From 52961804d19c413c09ff4e08c327647ffc3d0bea Mon Sep 17 00:00:00 2001 From: magic-akari Date: Mon, 3 Jan 2022 04:54:58 +0800 Subject: [PATCH] feat(es/codegen): Make the output for empty objects and empty statements pretty (#3171) --- .../tests/fixture/issue-1160/output/entry.ts | 9 +- .../fixture/issue-1232/cjs/output/index.js | 6 +- .../tests/fixture/issue-1278/output/index.ts | 3 +- .../tests/fixture/issue-1307/output/index.ts | 6 +- .../fixture/issue-1333/case2/output/index.js | 3 +- .../tests/fixture/issue-1345/output/index.ts | 3 +- .../fixture/issue-1362/case1/output/index.ts | 3 +- .../fixture/issue-1421/case1/output/index.ts | 3 +- .../fixture/issue-1449/case1/output/index.js | 3 +- .../fixture/issue-1456/case2/output/index.ts | 3 +- .../fixture/issue-1490/case1/output/index.js | 3 +- .../fixture/issue-1490/full/output/index.js | 6 +- .../fixture/issue-1505/case1/output/index.ts | 3 +- .../fixture/issue-1505/case2/output/index.ts | 3 +- .../fixture/issue-1505/case3/output/index.tsx | 3 +- .../fixture/issue-1505/case4/output/index.tsx | 3 +- .../fixture/issue-1505/case5/output/index.tsx | 3 +- .../issue-1505/tsx-default/output/index.ts | 3 +- .../fixture/issue-1515/case1/output/input.ts | 6 +- .../fixture/issue-1525/case1/output/index.tsx | 6 +- .../fixture/issue-1554/case1/output/index.js | 6 +- .../fixture/issue-1554/case2/output/index.js | 6 +- .../fixture/issue-1575/case1/output/index.js | 3 +- .../tests/fixture/issue-1600/output/index.js | 6 +- .../fixture/issue-1614/case1/output/index.ts | 6 +- .../fixture/issue-1660/case1/output/index.js | 3 +- .../fixture/issue-1660/case3/output/index.js | 3 +- .../fixture/issue-1660/es3/output/index.js | 3 +- .../fixture/issue-1660/es5/output/index.js | 3 +- .../fixture/issue-1682/case2/output/index.ts | 6 +- .../tests/fixture/issue-1687/output/input.tsx | 6 +- .../fixture/issue-1714/case1/output/index.js | 6 +- .../fixture/issue-1729/case1/output/index.ts | 3 +- .../issue-1734/case1-B/output/index.js | 6 +- .../issue-1734/case2-C/output/index.js | 6 +- .../issue-1734/case3-D/output/index.js | 6 +- .../issue-1859/case1-js/output/index.js | 9 +- .../issue-1859/case2-ts/output/index.ts | 9 +- .../fixture/issue-1859/case3/output/bar.ts | 3 +- .../fixture/issue-1859/case3/output/foo.ts | 3 +- .../fixture/issue-1859/case3/output/index.ts | 6 +- .../fixture/issue-1859/case3/output/lib.ts | 9 +- .../es5-after-other/output/index.js | 3 +- .../fixture/issue-1918/es5/output/index.js | 3 +- .../fixture/issue-1938/cjs/output/index.js | 6 +- .../fixture/issue-2022/no-opt/output/index.js | 3 +- .../fixture/issue-2027/case1/output/index.js | 3 +- .../tests/fixture/issue-2150/output/index.js | 3 +- .../fixture/issue-2164/es2015/output/index.js | 3 +- .../fixture/issue-2164/es2016/output/index.js | 3 +- .../fixture/issue-2164/es2018/output/index.js | 3 +- .../fixture/issue-2164/es5/output/index.js | 3 +- .../tests/fixture/issue-2214/output/index.tsx | 3 +- .../fixture/issue-2225/case1/output/index.js | 3 +- .../fixture/issue-2232/case1/output/index.js | 9 +- .../fixture/issue-2232/case2/output/index.ts | 9 +- .../tests/fixture/issue-2310/output/index.tsx | 3 +- .../fixture/issue-2352/1/output/index.js | 3 +- .../fixture/issue-2428/1/output/index.ts | 9 +- .../fixture/issue-2468/1/output/index.js | 3 +- .../fixture/issue-2531/1/output/index.js | 9 +- .../fixture/issue-2531/2/output/index.js | 9 +- .../fixture/issue-2539/1/output/index.js | 6 +- .../fixture/issue-2606/1/output/index.ts | 6 +- .../fixture/issue-2856/1/output/index.js | 6 +- .../tests/fixture/issue-2988/output/index.ts | 9 +- .../fixture/issue-3073/1/output/index.ts | 3 +- .../fixture/issue-3073/2/output/index.ts | 3 +- .../fixture/issue-846/case1/output/index.js | 9 +- .../module/ignore-dynamic/1/output/index.js | 6 +- .../new-target/output/class-extends-error.ts | 6 +- .../next.js/server/render/1/output/index.tsx | 48 +- .../shared/lib/router/1/output/index.ts | 12 +- .../next.js/slack-2/es5/output/index.js | 3 +- .../paths/ext/002/output/foo.ts/index.js | 3 +- .../pr-1524/comment-1/output/index.tsx | 3 +- .../pr-1579/checkingExtend/output/index.js | 6 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 3 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 3 +- ...sWithSameNameAndCommonRoot_es5.1.normal.js | 3 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 3 +- .../ArrowFunction4_es2015.1.normal.js | 3 +- .../ArrowFunction4_es5.1.normal.js | 3 +- ...tUsesClassTypeParameter_es2015.1.normal.js | 15 +- ...sesClassTypeParameter_es2015.2.minified.js | 3 +- ...ThatUsesClassTypeParameter_es5.1.normal.js | 15 +- ...atUsesClassTypeParameter_es5.2.minified.js | 9 +- ...icFunctionOfTheSameName_es2015.1.normal.js | 6 +- ...FunctionOfTheSameName_es2015.2.minified.js | 6 +- ...taticFunctionOfTheSameName_es5.1.normal.js | 6 +- ...ticFunctionOfTheSameName_es5.2.minified.js | 6 +- ...icFunctionOfTheSameName_es2015.1.normal.js | 6 +- ...FunctionOfTheSameName_es2015.2.minified.js | 6 +- ...taticFunctionOfTheSameName_es5.1.normal.js | 6 +- ...ticFunctionOfTheSameName_es5.2.minified.js | 6 +- ...singClassPrivateStatics_es2015.1.normal.js | 3 +- ...ngClassPrivateStatics_es2015.2.minified.js | 3 +- ...onUsingClassPrivateStatics_es5.1.normal.js | 3 +- ...UsingClassPrivateStatics_es5.2.minified.js | 3 +- ...dFunctionThatShareAName_es2015.1.normal.js | 9 +- ...unctionThatShareAName_es2015.2.minified.js | 9 +- ...rtedFunctionThatShareAName_es5.1.normal.js | 9 +- ...edFunctionThatShareAName_es5.2.minified.js | 9 +- ...dFunctionThatShareAName_es2015.1.normal.js | 9 +- ...unctionThatShareAName_es2015.2.minified.js | 3 +- ...rtedFunctionThatShareAName_es5.1.normal.js | 9 +- ...edFunctionThatShareAName_es5.2.minified.js | 3 +- ...portedVarThatShareAName_es2015.1.normal.js | 9 +- ...rtedVarThatShareAName_es2015.2.minified.js | 9 +- ...dExportedVarThatShareAName_es5.1.normal.js | 9 +- ...xportedVarThatShareAName_es5.2.minified.js | 9 +- ...portedVarThatShareAName_es2015.1.normal.js | 9 +- ...rtedVarThatShareAName_es2015.2.minified.js | 3 +- ...nExportedVarThatShareAName_es5.1.normal.js | 9 +- ...xportedVarThatShareAName_es5.2.minified.js | 3 +- ...ameNameAndCommonRootES6_es2015.1.normal.js | 18 +- ...eNameAndCommonRootES6_es2015.2.minified.js | 14 +- ...thSameNameAndCommonRootES6_es5.1.normal.js | 18 +- ...SameNameAndCommonRootES6_es5.2.minified.js | 16 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 18 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 14 +- ...eWithSameNameAndCommonRoot_es5.1.normal.js | 18 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 16 +- .../ES3For-ofTypeCheck1_es2015.1.normal.js | 3 +- .../ES3For-ofTypeCheck2_es2015.1.normal.js | 3 +- .../ES3For-ofTypeCheck4_es2015.1.normal.js | 3 +- .../ES3For-ofTypeCheck6_es2015.1.normal.js | 3 +- .../ES5For-of11_es2015.1.normal.js | 3 +- .../ES5For-of21_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck10_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck11_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck12_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck13_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck14_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck1_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck2_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck3_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck4_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck5_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck6_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck7_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck8_es2015.1.normal.js | 3 +- .../ES5For-ofTypeCheck9_es2015.1.normal.js | 3 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 6 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 4 +- ...eWithSameNameAndCommonRoot_es5.1.normal.js | 6 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 6 +- ...aceWithInaccessibleType_es2015.1.normal.js | 3 +- ...eWithInaccessibleType_es2015.2.minified.js | 3 +- ...erfaceWithInaccessibleType_es5.1.normal.js | 3 +- ...faceWithInaccessibleType_es5.2.minified.js | 3 +- ...stMemberTypeAnnotations_es2015.1.normal.js | 3 +- ...MemberTypeAnnotations_es2015.2.minified.js | 3 +- ...eListMemberTypeAnnotations_es5.1.normal.js | 6 +- ...istMemberTypeAnnotations_es5.2.minified.js | 6 +- ...nIndexerTypeAnnotations_es2015.1.normal.js | 3 +- ...ndexerTypeAnnotations_es2015.2.minified.js | 3 +- ...peInIndexerTypeAnnotations_es5.1.normal.js | 3 +- ...InIndexerTypeAnnotations_es5.2.minified.js | 3 +- ...TypeParameterConstraint_es2015.1.normal.js | 3 +- ...peParameterConstraint_es2015.2.minified.js | 3 +- ...eInTypeParameterConstraint_es5.1.normal.js | 6 +- ...nTypeParameterConstraint_es5.2.minified.js | 6 +- ...AndReturnTypeAnnotation_es2015.1.normal.js | 3 +- ...dReturnTypeAnnotation_es2015.2.minified.js | 3 +- ...terAndReturnTypeAnnotation_es5.1.normal.js | 3 +- ...rAndReturnTypeAnnotation_es5.2.minified.js | 3 +- ...ParameterTypeAnnotation_es2015.1.normal.js | 3 +- ...rameterTypeAnnotation_es2015.2.minified.js | 3 +- ...sInParameterTypeAnnotation_es5.1.normal.js | 3 +- ...nParameterTypeAnnotation_es5.2.minified.js | 3 +- ...sInReturnTypeAnnotation_es2015.1.normal.js | 3 +- ...nReturnTypeAnnotation_es2015.2.minified.js | 3 +- ...ypesInReturnTypeAnnotation_es5.1.normal.js | 3 +- ...esInReturnTypeAnnotation_es5.2.minified.js | 3 +- ...stMemberTypeAnnotations_es2015.1.normal.js | 3 +- ...MemberTypeAnnotations_es2015.2.minified.js | 3 +- ...eListMemberTypeAnnotations_es5.1.normal.js | 3 +- ...istMemberTypeAnnotations_es5.2.minified.js | 3 +- ...TypeParameterConstraint_es2015.1.normal.js | 3 +- ...peParameterConstraint_es2015.2.minified.js | 3 +- ...eInTypeParameterConstraint_es5.1.normal.js | 3 +- ...nTypeParameterConstraint_es5.2.minified.js | 3 +- ...pesOnItsExportedMembers_es2015.1.normal.js | 9 +- ...sOnItsExportedMembers_es2015.2.minified.js | 9 +- ...eTypesOnItsExportedMembers_es5.1.normal.js | 6 +- ...ypesOnItsExportedMembers_es5.2.minified.js | 6 +- ...InMemberTypeAnnotations_es2015.1.normal.js | 3 +- ...MemberTypeAnnotations_es2015.2.minified.js | 3 +- ...pesInMemberTypeAnnotations_es5.1.normal.js | 3 +- ...sInMemberTypeAnnotations_es5.2.minified.js | 3 +- ...edMemberTypeAnnotations_es2015.1.normal.js | 3 +- ...MemberTypeAnnotations_es2015.2.minified.js | 3 +- ...estedMemberTypeAnnotations_es5.1.normal.js | 3 +- ...tedMemberTypeAnnotations_es5.2.minified.js | 3 +- ...sibleTypeAsTypeArgument_es2015.1.normal.js | 3 +- ...bleTypeAsTypeArgument_es2015.2.minified.js | 3 +- ...cessibleTypeAsTypeArgument_es5.1.normal.js | 3 +- ...ssibleTypeAsTypeArgument_es5.2.minified.js | 3 +- ...bleTypeInTypeAnnotation_es2015.1.normal.js | 3 +- ...eTypeInTypeAnnotation_es2015.2.minified.js | 3 +- ...ssibleTypeInTypeAnnotation_es5.1.normal.js | 3 +- ...ibleTypeInTypeAnnotation_es5.2.minified.js | 3 +- ...bleTypeInTypeAnnotation_es2015.1.normal.js | 3 +- ...eTypeInTypeAnnotation_es2015.2.minified.js | 3 +- ...ssibleTypeInTypeAnnotation_es5.1.normal.js | 3 +- ...ibleTypeInTypeAnnotation_es5.2.minified.js | 3 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 15 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 13 +- ...eWithSameNameAndCommonRoot_es5.1.normal.js | 15 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 13 +- ...eAndDifferentCommonRoot_es2015.1.normal.js | 9 +- ...ndDifferentCommonRoot_es2015.2.minified.js | 7 +- ...NameAndDifferentCommonRoot_es5.1.normal.js | 9 +- ...meAndDifferentCommonRoot_es5.2.minified.js | 7 +- ...unctionDeclaration1_es6_es2015.1.normal.js | 3 +- .../FunctionDeclaration9_es6_es5.1.normal.js | 3 +- ...FunctionDeclaration9_es6_es5.2.minified.js | 3 +- ...FunctionExpression1_es6_es2015.1.normal.js | 3 +- ...FunctionExpression2_es6_es2015.1.normal.js | 3 +- ...ropertyAssignments1_es6_es2015.1.normal.js | 3 +- ...ropertyAssignments5_es6_es2015.1.normal.js | 3 +- ...onPropertyAssignments5_es6_es5.1.normal.js | 3 +- ...PropertyAssignments5_es6_es5.2.minified.js | 3 +- ...unctionDeclaration1_es6_es2015.1.normal.js | 3 +- ...unctionDeclaration2_es6_es2015.1.normal.js | 3 +- ...unctionDeclaration3_es6_es2015.1.normal.js | 3 +- ...unctionDeclaration7_es6_es2015.1.normal.js | 3 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 18 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 12 +- ...sWithSameNameAndCommonRoot_es5.1.normal.js | 18 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 14 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 6 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 6 +- ...mWithSameNameAndCommonRoot_es5.1.normal.js | 6 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 4 +- ...thSameNameAndCommonRoot_es2015.1.normal.js | 15 +- ...SameNameAndCommonRoot_es2015.2.minified.js | 13 +- ...nWithSameNameAndCommonRoot_es5.1.normal.js | 15 +- ...ithSameNameAndCommonRoot_es5.2.minified.js | 13 +- ...edAndNonExportedClasses_es2015.1.normal.js | 3 +- ...AndNonExportedClasses_es2015.2.minified.js | 3 +- ...ortedAndNonExportedClasses_es5.1.normal.js | 3 +- ...tedAndNonExportedClasses_es5.2.minified.js | 3 +- ...rtedAndNonExportedEnums_es2015.1.normal.js | 9 +- ...edAndNonExportedEnums_es2015.2.minified.js | 9 +- ...xportedAndNonExportedEnums_es5.1.normal.js | 9 +- ...ortedAndNonExportedEnums_es5.2.minified.js | 7 +- ...AndNonExportedFunctions_es2015.1.normal.js | 3 +- ...dNonExportedFunctions_es2015.2.minified.js | 3 +- ...tedAndNonExportedFunctions_es5.1.normal.js | 3 +- ...dAndNonExportedFunctions_es5.2.minified.js | 3 +- ...dNonExportedImportAlias_es2015.1.normal.js | 6 +- ...onExportedImportAlias_es2015.2.minified.js | 6 +- ...dAndNonExportedImportAlias_es5.1.normal.js | 6 +- ...ndNonExportedImportAlias_es5.2.minified.js | 6 +- ...AndNonExportedVariables_es2015.1.normal.js | 3 +- ...dNonExportedVariables_es2015.2.minified.js | 3 +- ...tedAndNonExportedVariables_es5.1.normal.js | 3 +- ...dAndNonExportedVariables_es5.2.minified.js | 3 +- .../Protected3_es2015.1.normal.js | 3 +- .../Protected5_es2015.1.normal.js | 3 +- .../tsc-references/Protected5_es5.1.normal.js | 3 +- .../Protected5_es5.2.minified.js | 3 +- ...tedClassesOfTheSameName_es2015.1.normal.js | 24 +- ...dClassesOfTheSameName_es2015.2.minified.js | 12 +- ...portedClassesOfTheSameName_es5.1.normal.js | 24 +- ...rtedClassesOfTheSameName_es5.2.minified.js | 20 +- ...dLocalVarsOfTheSameName_es2015.1.normal.js | 12 +- ...ocalVarsOfTheSameName_es2015.2.minified.js | 8 +- ...rtedLocalVarsOfTheSameName_es5.1.normal.js | 12 +- ...edLocalVarsOfTheSameName_es5.2.minified.js | 10 +- ...tedClassesOfTheSameName_es2015.1.normal.js | 24 +- ...dClassesOfTheSameName_es2015.2.minified.js | 20 +- ...portedClassesOfTheSameName_es5.1.normal.js | 24 +- ...rtedClassesOfTheSameName_es5.2.minified.js | 20 +- ...dLocalVarsOfTheSameName_es2015.1.normal.js | 12 +- ...ocalVarsOfTheSameName_es2015.2.minified.js | 10 +- ...rtedLocalVarsOfTheSameName_es5.1.normal.js | 12 +- ...edLocalVarsOfTheSameName_es5.2.minified.js | 10 +- ...tedModulesOfTheSameName_es2015.1.normal.js | 30 +- ...dModulesOfTheSameName_es2015.2.minified.js | 26 +- ...portedModulesOfTheSameName_es5.1.normal.js | 30 +- ...rtedModulesOfTheSameName_es5.2.minified.js | 26 +- ...eAndDifferentCommonRoot_es2015.1.normal.js | 18 +- ...ndDifferentCommonRoot_es2015.2.minified.js | 16 +- ...NameAndDifferentCommonRoot_es5.1.normal.js | 18 +- ...meAndDifferentCommonRoot_es5.2.minified.js | 16 +- ...meNameAndSameCommonRoot_es2015.1.normal.js | 12 +- ...NameAndSameCommonRoot_es2015.2.minified.js | 10 +- ...eSameNameAndSameCommonRoot_es5.1.normal.js | 12 +- ...ameNameAndSameCommonRoot_es5.2.minified.js | 10 +- .../TypeGuardWithEnumUnion_es2015.1.normal.js | 3 +- ...ypeGuardWithEnumUnion_es2015.2.minified.js | 3 +- .../TypeGuardWithEnumUnion_es5.1.normal.js | 3 +- .../TypeGuardWithEnumUnion_es5.2.minified.js | 3 +- .../abstractProperty_es5.1.normal.js | 3 +- .../abstractProperty_es5.2.minified.js | 3 +- .../accessorWithES3_es2015.1.normal.js | 6 +- .../accessorWithES3_es5.1.normal.js | 6 +- .../accessorWithES3_es5.2.minified.js | 3 +- .../accessorWithES5_es2015.1.normal.js | 6 +- .../accessorWithES5_es5.1.normal.js | 6 +- .../accessorWithES5_es5.2.minified.js | 3 +- ...dAccessibilityModifiers_es2015.1.normal.js | 12 +- ...chedAccessibilityModifiers_es5.1.normal.js | 12 +- ...edAccessibilityModifiers_es5.2.minified.js | 12 +- ...AreNotContextuallyTyped_es2015.1.normal.js | 3 +- ...orsAreNotContextuallyTyped_es5.1.normal.js | 3 +- ...sAreNotContextuallyTyped_es5.2.minified.js | 3 +- ...accessorsOverrideMethod_es2015.1.normal.js | 3 +- .../accessorsOverrideMethod_es5.1.normal.js | 6 +- .../accessorsOverrideMethod_es5.2.minified.js | 6 +- ...accessorsOverrideProperty2_es5.1.normal.js | 3 +- ...cessorsOverrideProperty2_es5.2.minified.js | 3 +- ...accessorsOverrideProperty3_es5.1.normal.js | 3 +- ...cessorsOverrideProperty3_es5.2.minified.js | 3 +- ...accessorsOverrideProperty4_es5.1.normal.js | 3 +- ...cessorsOverrideProperty4_es5.2.minified.js | 3 +- ...essorsOverrideProperty5_es2015.1.normal.js | 3 +- ...accessorsOverrideProperty5_es5.1.normal.js | 6 +- ...cessorsOverrideProperty5_es5.2.minified.js | 6 +- ...accessorsOverrideProperty6_es5.1.normal.js | 3 +- ...cessorsOverrideProperty6_es5.2.minified.js | 3 +- ...accessorsOverrideProperty7_es5.1.normal.js | 3 +- ...cessorsOverrideProperty7_es5.2.minified.js | 3 +- .../accessorsOverrideProperty_es5.1.normal.js | 3 +- ...ccessorsOverrideProperty_es5.2.minified.js | 3 +- ...atorWithAnyAndEveryType_es2015.1.normal.js | 12 +- ...orWithAnyAndEveryType_es2015.2.minified.js | 9 +- ...peratorWithAnyAndEveryType_es5.1.normal.js | 12 +- ...ratorWithAnyAndEveryType_es5.2.minified.js | 9 +- ...atorWithInvalidOperands_es2015.1.normal.js | 16 +- ...orWithInvalidOperands_es2015.2.minified.js | 9 +- ...peratorWithInvalidOperands_es5.1.normal.js | 16 +- ...ratorWithInvalidOperands_es5.2.minified.js | 9 +- ...ValueAndInvalidOperator_es2015.1.normal.js | 3 +- ...ullValueAndInvalidOperator_es5.1.normal.js | 3 +- ...llValueAndValidOperator_es2015.1.normal.js | 3 +- ...ValueAndValidOperator_es2015.2.minified.js | 3 +- ...hNullValueAndValidOperator_es5.1.normal.js | 3 +- ...ullValueAndValidOperator_es5.2.minified.js | 3 +- ...eratorWithNumberAndEnum_es2015.1.normal.js | 6 +- ...atorWithNumberAndEnum_es2015.2.minified.js | 4 +- ...nOperatorWithNumberAndEnum_es5.1.normal.js | 6 +- ...peratorWithNumberAndEnum_es5.2.minified.js | 4 +- ...rWithStringAndEveryType_es2015.1.normal.js | 3 +- ...ithStringAndEveryType_es2015.2.minified.js | 3 +- ...atorWithStringAndEveryType_es5.1.normal.js | 3 +- ...orWithStringAndEveryType_es5.2.minified.js | 3 +- ...eratorWithTypeParameter_es2015.1.normal.js | 6 +- ...atorWithTypeParameter_es2015.2.minified.js | 3 +- ...nOperatorWithTypeParameter_es5.1.normal.js | 6 +- ...peratorWithTypeParameter_es5.2.minified.js | 3 +- ...ValueAndInvalidOperands_es2015.1.normal.js | 3 +- ...nedValueAndInvalidOperands_es5.1.normal.js | 3 +- ...edValueAndValidOperator_es2015.1.normal.js | 3 +- ...ValueAndValidOperator_es2015.2.minified.js | 3 +- ...finedValueAndValidOperator_es5.1.normal.js | 3 +- ...nedValueAndValidOperator_es5.2.minified.js | 3 +- ...portAsPrimaryExpression_es2015.1.normal.js | 3 +- ...rtAsPrimaryExpression_es2015.2.minified.js | 3 +- ...dImportAsPrimaryExpression_es5.1.normal.js | 3 +- ...mportAsPrimaryExpression_es5.2.minified.js | 3 +- ...tNotAsPrimaryExpression_es2015.1.normal.js | 6 +- ...otAsPrimaryExpression_es2015.2.minified.js | 3 +- ...portNotAsPrimaryExpression_es5.1.normal.js | 6 +- ...rtNotAsPrimaryExpression_es5.2.minified.js | 3 +- ...InitializerDoesntNarrow_es2015.1.normal.js | 6 +- ...itializerDoesntNarrow_es2015.2.minified.js | 6 +- ...rtyInitializerDoesntNarrow_es5.1.normal.js | 6 +- ...yInitializerDoesntNarrow_es5.2.minified.js | 6 +- ...nymousDefaultExportsAmd_es2015.1.normal.js | 3 +- ...mousDefaultExportsAmd_es2015.2.minified.js | 3 +- ...anonymousDefaultExportsAmd_es5.1.normal.js | 3 +- ...onymousDefaultExportsAmd_es5.2.minified.js | 3 +- ...sDefaultExportsCommonjs_es2015.1.normal.js | 3 +- ...efaultExportsCommonjs_es2015.2.minified.js | 3 +- ...mousDefaultExportsCommonjs_es5.1.normal.js | 3 +- ...usDefaultExportsCommonjs_es5.2.minified.js | 3 +- ...ousDefaultExportsSystem_es2015.1.normal.js | 3 +- ...sDefaultExportsSystem_es2015.2.minified.js | 3 +- ...nymousDefaultExportsSystem_es5.1.normal.js | 3 +- ...mousDefaultExportsSystem_es5.2.minified.js | 3 +- ...nymousDefaultExportsUmd_es2015.1.normal.js | 3 +- ...mousDefaultExportsUmd_es2015.2.minified.js | 3 +- ...anonymousDefaultExportsUmd_es5.1.normal.js | 3 +- ...onymousDefaultExportsUmd_es5.2.minified.js | 3 +- ...ignabilityInInheritance_es2015.1.normal.js | 12 +- ...nabilityInInheritance_es2015.2.minified.js | 10 +- ...AssignabilityInInheritance_es5.1.normal.js | 12 +- ...signabilityInInheritance_es5.2.minified.js | 10 +- ...yAssignableToEveryType2_es2015.1.normal.js | 12 +- ...ssignableToEveryType2_es2015.2.minified.js | 10 +- .../anyAssignableToEveryType2_es5.1.normal.js | 12 +- ...nyAssignableToEveryType2_es5.2.minified.js | 10 +- ...nyAssignableToEveryType_es2015.1.normal.js | 3 +- ...AssignableToEveryType_es2015.2.minified.js | 3 +- .../anyAssignableToEveryType_es5.1.normal.js | 3 +- ...anyAssignableToEveryType_es5.2.minified.js | 3 +- .../apparentTypeSubtyping_es5.1.normal.js | 3 +- .../apparentTypeSubtyping_es5.2.minified.js | 3 +- .../apparentTypeSupertype_es5.1.normal.js | 3 +- .../apparentTypeSupertype_es5.2.minified.js | 3 +- ...ressionContextualTyping_es2015.1.normal.js | 9 +- ...ssionContextualTyping_es2015.2.minified.js | 6 +- ...ExpressionContextualTyping_es5.1.normal.js | 3 +- ...pressionContextualTyping_es5.2.minified.js | 3 +- ...icOperatorWithEnumUnion_es2015.1.normal.js | 6 +- ...OperatorWithEnumUnion_es2015.2.minified.js | 4 +- ...meticOperatorWithEnumUnion_es5.1.normal.js | 6 +- ...ticOperatorWithEnumUnion_es5.2.minified.js | 4 +- ...thmeticOperatorWithEnum_es2015.1.normal.js | 3 +- ...meticOperatorWithEnum_es2015.2.minified.js | 3 +- ...arithmeticOperatorWithEnum_es5.1.normal.js | 3 +- ...ithmeticOperatorWithEnum_es5.2.minified.js | 3 +- ...atorWithInvalidOperands_es2015.1.normal.js | 3 +- ...orWithInvalidOperands_es2015.2.minified.js | 3 +- ...peratorWithInvalidOperands_es5.1.normal.js | 3 +- ...ratorWithInvalidOperands_es5.2.minified.js | 3 +- ...ValueAndInvalidOperands_es2015.1.normal.js | 60 +- ...ullValueAndInvalidOperands_es5.1.normal.js | 60 +- ...llValueAndValidOperands_es2015.1.normal.js | 3 +- ...ValueAndValidOperands_es2015.2.minified.js | 3 +- ...hNullValueAndValidOperands_es5.1.normal.js | 3 +- ...ullValueAndValidOperands_es5.2.minified.js | 3 +- ...ValueAndInvalidOperands_es2015.1.normal.js | 60 +- ...nedValueAndInvalidOperands_es5.1.normal.js | 60 +- ...edValueAndValidOperands_es2015.1.normal.js | 3 +- ...ValueAndValidOperands_es2015.2.minified.js | 3 +- ...finedValueAndValidOperands_es5.1.normal.js | 3 +- ...nedValueAndValidOperands_es5.2.minified.js | 3 +- .../arrayLiteralInference_es2015.1.normal.js | 6 +- ...arrayLiteralInference_es2015.2.minified.js | 4 +- .../arrayLiteralInference_es5.1.normal.js | 6 +- .../arrayLiteralInference_es5.2.minified.js | 4 +- ...eralsWithRecursiveGenerics_es5.1.normal.js | 3 +- ...alsWithRecursiveGenerics_es5.2.minified.js | 3 +- .../arrayLiterals_es5.1.normal.js | 3 +- .../arrayLiterals_es5.2.minified.js | 3 +- .../arrayOfFunctionTypes3_es2015.1.normal.js | 3 +- .../arrayOfFunctionTypes3_es5.1.normal.js | 3 +- ...rrowFunctionExpressions_es2015.1.normal.js | 33 +- .../arrowFunctionExpressions_es5.1.normal.js | 3 +- ...arrowFunctionExpressions_es5.2.minified.js | 3 +- .../asOperator4_es2015.1.normal.js | 3 +- .../asOperator4_es2015.2.minified.js | 3 +- .../asOperator4_es5.1.normal.js | 3 +- .../asOperator4_es5.2.minified.js | 3 +- ...ntsParsingAsNamespace04_es2015.1.normal.js | 3 +- ...eventsParsingAsNamespace04_es5.1.normal.js | 3 +- ...ntsParsingAsNamespace05_es2015.1.normal.js | 6 +- ...sParsingAsNamespace05_es2015.2.minified.js | 4 +- ...eventsParsingAsNamespace05_es5.1.normal.js | 6 +- ...entsParsingAsNamespace05_es5.2.minified.js | 4 +- .../assignAnyToEveryType_es2015.1.normal.js | 6 +- .../assignAnyToEveryType_es2015.2.minified.js | 4 +- .../assignAnyToEveryType_es5.1.normal.js | 6 +- .../assignAnyToEveryType_es5.2.minified.js | 6 +- .../assignEveryTypeToAny_es2015.1.normal.js | 3 +- .../assignEveryTypeToAny_es2015.2.minified.js | 3 +- .../assignEveryTypeToAny_es5.1.normal.js | 3 +- .../assignEveryTypeToAny_es5.2.minified.js | 3 +- ...ignObjectToNonPrimitive_es2015.1.normal.js | 3 +- ...assignObjectToNonPrimitive_es5.1.normal.js | 3 +- ...opertyDeclarationESNext_es2015.1.normal.js | 3 +- ...oPropertyDeclarationESNext_es5.1.normal.js | 6 +- ...ropertyDeclarationESNext_es5.2.minified.js | 6 +- ...tCompatWithCallSignatures3_es5.1.normal.js | 3 +- ...ompatWithCallSignatures3_es5.2.minified.js | 3 +- ...mpatWithCallSignatures4_es2015.1.normal.js | 9 +- ...atWithCallSignatures4_es2015.2.minified.js | 9 +- ...tCompatWithCallSignatures4_es5.1.normal.js | 12 +- ...ompatWithCallSignatures4_es5.2.minified.js | 10 +- ...tCompatWithCallSignatures5_es5.1.normal.js | 3 +- ...ompatWithCallSignatures5_es5.2.minified.js | 3 +- ...tCompatWithCallSignatures6_es5.1.normal.js | 3 +- ...ompatWithCallSignatures6_es5.2.minified.js | 3 +- ...atWithConstructSignatures3_es5.1.normal.js | 3 +- ...WithConstructSignatures3_es5.2.minified.js | 3 +- ...ithConstructSignatures4_es2015.1.normal.js | 9 +- ...hConstructSignatures4_es2015.2.minified.js | 9 +- ...atWithConstructSignatures4_es5.1.normal.js | 12 +- ...WithConstructSignatures4_es5.2.minified.js | 10 +- ...atWithConstructSignatures5_es5.1.normal.js | 3 +- ...WithConstructSignatures5_es5.2.minified.js | 3 +- ...atWithConstructSignatures6_es5.1.normal.js | 3 +- ...WithConstructSignatures6_es5.2.minified.js | 3 +- ...tWithDiscriminatedUnion_es2015.1.normal.js | 42 +- ...ithDiscriminatedUnion_es2015.2.minified.js | 13 +- ...mpatWithDiscriminatedUnion_es5.1.normal.js | 42 +- ...atWithDiscriminatedUnion_es5.2.minified.js | 13 +- ...sWithOptionalParameters_es2015.1.normal.js | 9 +- ...uresWithOptionalParameters_es5.1.normal.js | 9 +- ...esWithOptionalParameters_es5.2.minified.js | 9 +- ...mpatWithNumericIndexer2_es2015.1.normal.js | 3 +- ...tCompatWithNumericIndexer2_es5.1.normal.js | 3 +- ...mpatWithNumericIndexer3_es2015.1.normal.js | 3 +- ...tCompatWithNumericIndexer3_es5.1.normal.js | 6 +- ...ompatWithNumericIndexer3_es5.2.minified.js | 6 +- ...ompatWithNumericIndexer_es2015.1.normal.js | 3 +- ...ntCompatWithNumericIndexer_es5.1.normal.js | 6 +- ...CompatWithNumericIndexer_es5.2.minified.js | 6 +- ...ompatWithObjectMembers4_es2015.1.normal.js | 6 +- ...patWithObjectMembers4_es2015.2.minified.js | 6 +- ...ntCompatWithObjectMembers4_es5.1.normal.js | 9 +- ...CompatWithObjectMembers4_es5.2.minified.js | 9 +- ...ectMembersAccessibility_es2015.1.normal.js | 6 +- ...tMembersAccessibility_es2015.2.minified.js | 6 +- ...ObjectMembersAccessibility_es5.1.normal.js | 6 +- ...jectMembersAccessibility_es5.2.minified.js | 6 +- ...jectMembersOptionality2_es2015.1.normal.js | 6 +- ...ctMembersOptionality2_es2015.2.minified.js | 6 +- ...hObjectMembersOptionality2_es5.1.normal.js | 9 +- ...bjectMembersOptionality2_es5.2.minified.js | 9 +- ...bjectMembersOptionality_es2015.1.normal.js | 6 +- ...ectMembersOptionality_es2015.2.minified.js | 6 +- ...thObjectMembersOptionality_es5.1.normal.js | 9 +- ...ObjectMembersOptionality_es5.2.minified.js | 9 +- ...mbersStringNumericNames_es2015.1.normal.js | 6 +- ...ersStringNumericNames_es2015.2.minified.js | 6 +- ...tMembersStringNumericNames_es5.1.normal.js | 6 +- ...embersStringNumericNames_es5.2.minified.js | 6 +- ...CompatWithObjectMembers_es2015.1.normal.js | 6 +- ...mpatWithObjectMembers_es2015.2.minified.js | 6 +- ...entCompatWithObjectMembers_es5.1.normal.js | 6 +- ...tCompatWithObjectMembers_es5.2.minified.js | 6 +- ...ompatWithStringIndexer2_es2015.1.normal.js | 3 +- ...patWithStringIndexer2_es2015.2.minified.js | 3 +- ...ntCompatWithStringIndexer2_es5.1.normal.js | 3 +- ...CompatWithStringIndexer2_es5.2.minified.js | 3 +- ...ompatWithStringIndexer3_es2015.1.normal.js | 3 +- ...ntCompatWithStringIndexer3_es5.1.normal.js | 3 +- ...CompatWithStringIndexer3_es5.2.minified.js | 3 +- ...CompatWithStringIndexer_es2015.1.normal.js | 3 +- ...mpatWithStringIndexer_es2015.2.minified.js | 3 +- ...entCompatWithStringIndexer_es5.1.normal.js | 6 +- ...tCompatWithStringIndexer_es5.2.minified.js | 6 +- ...arenthesizedIdentifiers_es2015.1.normal.js | 15 +- ...enthesizedIdentifiers_es2015.2.minified.js | 15 +- ...ToParenthesizedIdentifiers_es5.1.normal.js | 15 +- ...ParenthesizedIdentifiers_es5.2.minified.js | 15 +- .../assignmentToVoidZero2_es2015.1.normal.js | 3 +- ...assignmentToVoidZero2_es2015.2.minified.js | 3 +- .../assignmentToVoidZero2_es5.1.normal.js | 3 +- .../assignmentToVoidZero2_es5.2.minified.js | 3 +- .../assignments_es2015.1.normal.js | 6 +- .../assignments_es2015.2.minified.js | 3 +- .../assignments_es5.1.normal.js | 6 +- .../assignments_es5.2.minified.js | 3 +- ...syncAliasReturnType_es5_es2015.1.normal.js | 3 +- ...ncAliasReturnType_es5_es2015.2.minified.js | 3 +- ...syncAliasReturnType_es6_es2015.1.normal.js | 3 +- ...ncAliasReturnType_es6_es2015.2.minified.js | 3 +- ...rrowFunction10_es2017_es2015.2.minified.js | 3 +- ...ncArrowFunction10_es5_es2015.2.minified.js | 3 +- ...ncArrowFunction10_es6_es2015.2.minified.js | 3 +- .../asyncArrowFunction11_es5_es5.1.normal.js | 3 +- ...asyncArrowFunction11_es5_es5.2.minified.js | 3 +- ...ncArrowFunction1_es2017_es2015.1.normal.js | 3 +- ...ArrowFunction1_es2017_es2015.2.minified.js | 3 +- ...asyncArrowFunction1_es5_es2015.1.normal.js | 3 +- ...yncArrowFunction1_es5_es2015.2.minified.js | 3 +- ...asyncArrowFunction1_es6_es2015.1.normal.js | 3 +- ...yncArrowFunction1_es6_es2015.2.minified.js | 3 +- ...ncArrowFunction2_es2017_es2015.1.normal.js | 3 +- ...asyncArrowFunction2_es2017_es5.1.normal.js | 3 +- ...asyncArrowFunction2_es5_es2015.1.normal.js | 3 +- .../asyncArrowFunction2_es5_es5.1.normal.js | 3 +- ...asyncArrowFunction2_es6_es2015.1.normal.js | 3 +- .../asyncArrowFunction2_es6_es5.1.normal.js | 3 +- ...ncArrowFunction3_es2017_es2015.1.normal.js | 3 +- ...asyncArrowFunction3_es5_es2015.1.normal.js | 3 +- ...asyncArrowFunction3_es6_es2015.1.normal.js | 3 +- ...ncArrowFunction4_es2017_es2015.1.normal.js | 3 +- ...asyncArrowFunction4_es2017_es5.1.normal.js | 3 +- ...asyncArrowFunction4_es5_es2015.1.normal.js | 3 +- .../asyncArrowFunction4_es5_es5.1.normal.js | 3 +- ...asyncArrowFunction4_es6_es2015.1.normal.js | 3 +- .../asyncArrowFunction4_es6_es5.1.normal.js | 3 +- ...apturesArguments_es2017_es2015.1.normal.js | 3 +- ...onCapturesArguments_es2017_es5.1.normal.js | 3 +- ...CapturesArguments_es2017_es5.2.minified.js | 3 +- ...onCapturesArguments_es5_es2015.1.normal.js | 3 +- ...ctionCapturesArguments_es5_es5.1.normal.js | 3 +- ...ionCapturesArguments_es5_es5.2.minified.js | 3 +- ...onCapturesArguments_es6_es2015.1.normal.js | 3 +- ...ctionCapturesArguments_es6_es5.1.normal.js | 3 +- ...ionCapturesArguments_es6_es5.2.minified.js | 3 +- ...ncArrowFunction_allowJs_es2015.1.normal.js | 3 +- ...asyncArrowFunction_allowJs_es5.1.normal.js | 3 +- ...tIsolatedModules_es2017_es2015.1.normal.js | 60 +- ...solatedModules_es2017_es2015.2.minified.js | 23 +- ...waitIsolatedModules_es2017_es5.1.normal.js | 3 +- ...itIsolatedModules_es2017_es5.2.minified.js | 3 +- ...waitIsolatedModules_es5_es2015.1.normal.js | 60 +- ...itIsolatedModules_es5_es2015.2.minified.js | 23 +- ...ncAwaitIsolatedModules_es5_es5.1.normal.js | 3 +- ...AwaitIsolatedModules_es5_es5.2.minified.js | 3 +- ...waitIsolatedModules_es6_es2015.1.normal.js | 60 +- ...itIsolatedModules_es6_es2015.2.minified.js | 23 +- ...ncAwaitIsolatedModules_es6_es5.1.normal.js | 3 +- ...AwaitIsolatedModules_es6_es5.2.minified.js | 3 +- .../asyncAwait_es2017_es2015.1.normal.js | 60 +- .../asyncAwait_es2017_es2015.2.minified.js | 23 +- .../asyncAwait_es2017_es5.1.normal.js | 3 +- .../asyncAwait_es2017_es5.2.minified.js | 3 +- .../asyncAwait_es5_es2015.1.normal.js | 60 +- .../asyncAwait_es5_es2015.2.minified.js | 23 +- .../asyncAwait_es5_es5.1.normal.js | 3 +- .../asyncAwait_es5_es5.2.minified.js | 3 +- .../asyncAwait_es6_es2015.1.normal.js | 60 +- .../asyncAwait_es6_es2015.2.minified.js | 23 +- .../asyncAwait_es6_es5.1.normal.js | 3 +- .../asyncAwait_es6_es5.2.minified.js | 3 +- ...ionDeclaration11_es2017_es2015.1.normal.js | 3 +- ...nDeclaration11_es2017_es2015.2.minified.js | 3 +- ...nctionDeclaration11_es5_es2015.1.normal.js | 3 +- ...tionDeclaration11_es5_es2015.2.minified.js | 3 +- ...nctionDeclaration11_es6_es2015.1.normal.js | 3 +- ...tionDeclaration11_es6_es2015.2.minified.js | 3 +- ...nDeclaration13_es2017_es2015.2.minified.js | 3 +- ...tionDeclaration13_es5_es2015.2.minified.js | 3 +- ...tionDeclaration13_es6_es2015.2.minified.js | 3 +- ...nDeclaration14_es2017_es2015.2.minified.js | 3 +- ...tionDeclaration14_es5_es2015.2.minified.js | 3 +- ...tionDeclaration14_es6_es2015.2.minified.js | 3 +- ...tionDeclaration1_es2017_es2015.1.normal.js | 3 +- ...onDeclaration1_es2017_es2015.2.minified.js | 3 +- ...unctionDeclaration1_es5_es2015.1.normal.js | 3 +- ...ctionDeclaration1_es5_es2015.2.minified.js | 3 +- ...unctionDeclaration1_es6_es2015.1.normal.js | 3 +- ...ctionDeclaration1_es6_es2015.2.minified.js | 3 +- ...tionDeclaration2_es2017_es2015.1.normal.js | 3 +- ...unctionDeclaration2_es2017_es5.1.normal.js | 3 +- ...unctionDeclaration2_es5_es2015.1.normal.js | 3 +- ...ncFunctionDeclaration2_es5_es5.1.normal.js | 3 +- ...unctionDeclaration2_es6_es2015.1.normal.js | 3 +- ...ncFunctionDeclaration2_es6_es5.1.normal.js | 3 +- ...tionDeclaration3_es2017_es2015.1.normal.js | 3 +- ...unctionDeclaration3_es5_es2015.1.normal.js | 3 +- ...unctionDeclaration3_es6_es2015.1.normal.js | 3 +- ...tionDeclaration4_es2017_es2015.1.normal.js | 3 +- ...unctionDeclaration4_es2017_es5.1.normal.js | 3 +- ...unctionDeclaration4_es5_es2015.1.normal.js | 3 +- ...ncFunctionDeclaration4_es5_es5.1.normal.js | 3 +- ...unctionDeclaration4_es6_es2015.1.normal.js | 3 +- ...ncFunctionDeclaration4_es6_es5.1.normal.js | 3 +- ...unctionDeclaration8_es2017_es5.1.normal.js | 3 +- ...ctionDeclaration8_es2017_es5.2.minified.js | 3 +- ...ncFunctionDeclaration8_es5_es5.1.normal.js | 3 +- ...FunctionDeclaration8_es5_es5.2.minified.js | 3 +- ...ncFunctionDeclaration8_es6_es5.1.normal.js | 3 +- ...FunctionDeclaration8_es6_es5.2.minified.js | 3 +- ...onCapturesArguments_es5_es2015.1.normal.js | 3 +- ...ationCapturesArguments_es5_es5.1.normal.js | 3 +- ...ionCapturesArguments_es5_es5.2.minified.js | 3 +- .../asyncImportedPromise_es5_es5.1.normal.js | 6 +- ...asyncImportedPromise_es5_es5.2.minified.js | 6 +- .../asyncImportedPromise_es6_es5.1.normal.js | 6 +- ...asyncImportedPromise_es6_es5.2.minified.js | 6 +- ...odWithSuperConflict_es6_es2015.1.normal.js | 9 +- ...ethodWithSuperConflict_es6_es5.1.normal.js | 12 +- ...hodWithSuperConflict_es6_es5.2.minified.js | 12 +- ...cMethodWithSuper_es2017_es2015.1.normal.js | 9 +- ...syncMethodWithSuper_es2017_es5.1.normal.js | 12 +- ...ncMethodWithSuper_es2017_es5.2.minified.js | 12 +- ...syncMethodWithSuper_es5_es2015.1.normal.js | 9 +- .../asyncMethodWithSuper_es5_es5.1.normal.js | 12 +- ...asyncMethodWithSuper_es5_es5.2.minified.js | 12 +- ...syncMethodWithSuper_es6_es2015.1.normal.js | 21 +- .../asyncMethodWithSuper_es6_es5.1.normal.js | 24 +- ...asyncMethodWithSuper_es6_es5.2.minified.js | 24 +- .../asyncMultiFile_es5_es2015.1.normal.js | 6 +- .../asyncMultiFile_es5_es2015.2.minified.js | 3 +- .../asyncMultiFile_es5_es5.1.normal.js | 3 +- .../asyncMultiFile_es6_es2015.1.normal.js | 6 +- .../asyncMultiFile_es6_es2015.2.minified.js | 3 +- .../asyncMultiFile_es6_es5.1.normal.js | 3 +- ...yncWithVarShadowing_es6_es2015.1.normal.js | 39 +- ...cWithVarShadowing_es6_es2015.2.minified.js | 54 +- .../asyncWithVarShadowing_es6_es5.1.normal.js | 33 +- ...syncWithVarShadowing_es6_es5.2.minified.js | 26 +- ...entCompatIndexSignature_es2015.1.normal.js | 6 +- ...gnmentCompatIndexSignature_es5.1.normal.js | 6 +- ...ketAccessIndexSignature_es2015.1.normal.js | 6 +- ...tAccessIndexSignature_es2015.2.minified.js | 4 +- ...racketAccessIndexSignature_es5.1.normal.js | 6 +- ...cketAccessIndexSignature_es5.2.minified.js | 4 +- ...waitClassExpression_es2017_es5.1.normal.js | 3 +- ...itClassExpression_es2017_es5.2.minified.js | 3 +- .../awaitClassExpression_es5_es5.1.normal.js | 3 +- ...awaitClassExpression_es5_es5.2.minified.js | 3 +- .../awaitClassExpression_es6_es5.1.normal.js | 3 +- ...awaitClassExpression_es6_es5.2.minified.js | 3 +- ...eOfConditionalExpressions2_es5.1.normal.js | 3 +- ...fConditionalExpressions2_es5.2.minified.js | 3 +- ...fConditionalExpressions_es2015.1.normal.js | 15 +- ...peOfConditionalExpressions_es5.1.normal.js | 18 +- ...OfConditionalExpressions_es5.2.minified.js | 3 +- .../bestCommonTypeOfTuple2_es5.1.normal.js | 3 +- .../bestCommonTypeOfTuple2_es5.2.minified.js | 3 +- .../bestCommonTypeOfTuple_es2015.1.normal.js | 6 +- ...bestCommonTypeOfTuple_es2015.2.minified.js | 4 +- .../bestCommonTypeOfTuple_es5.1.normal.js | 6 +- .../bestCommonTypeOfTuple_es5.2.minified.js | 4 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 6 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 9 +- ...otOperatorWithAnyOtherType_es5.1.normal.js | 6 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 9 +- ...OperatorWithBooleanType_es2015.1.normal.js | 3 +- ...eratorWithBooleanType_es2015.2.minified.js | 3 +- ...NotOperatorWithBooleanType_es5.1.normal.js | 3 +- ...tOperatorWithBooleanType_es5.2.minified.js | 3 +- ...NotOperatorWithEnumType_es2015.1.normal.js | 3 +- ...tOperatorWithEnumType_es2015.2.minified.js | 3 +- ...iseNotOperatorWithEnumType_es5.1.normal.js | 3 +- ...eNotOperatorWithEnumType_es5.2.minified.js | 3 +- ...tOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...eNotOperatorWithNumberType_es5.1.normal.js | 3 +- ...otOperatorWithNumberType_es5.2.minified.js | 3 +- ...tOperatorWithStringType_es2015.1.normal.js | 3 +- ...peratorWithStringType_es2015.2.minified.js | 3 +- ...eNotOperatorWithStringType_es5.1.normal.js | 3 +- ...otOperatorWithStringType_es5.2.minified.js | 3 +- .../callChainWithSuper_es2015.1.normal.js | 3 +- .../callChainWithSuper_es5.1.normal.js | 6 +- .../callChainWithSuper_es5.2.minified.js | 6 +- ...lessConstructorFunction_es2015.1.normal.js | 3 +- ...rtylessConstructorFunction_es5.1.normal.js | 3 +- ...ssignabilityInInheritance2_es5.1.normal.js | 3 +- ...ignabilityInInheritance2_es5.2.minified.js | 3 +- ...gnabilityInInheritance3_es2015.1.normal.js | 3 +- ...ssignabilityInInheritance3_es5.1.normal.js | 6 +- ...ignabilityInInheritance3_es5.2.minified.js | 6 +- ...ssignabilityInInheritance4_es5.1.normal.js | 3 +- ...ignabilityInInheritance4_es5.2.minified.js | 3 +- ...ssignabilityInInheritance5_es5.1.normal.js | 3 +- ...ignabilityInInheritance5_es5.2.minified.js | 3 +- ...ssignabilityInInheritance6_es5.1.normal.js | 3 +- ...ignabilityInInheritance6_es5.2.minified.js | 3 +- ...ithoutAnnotationsOrBody_es2015.1.normal.js | 3 +- ...reWithoutAnnotationsOrBody_es5.1.normal.js | 3 +- ...TypeAnnotationInference_es2015.1.normal.js | 21 +- ...peAnnotationInference_es2015.2.minified.js | 20 +- ...urnTypeAnnotationInference_es5.1.normal.js | 18 +- ...nTypeAnnotationInference_es5.2.minified.js | 15 +- ...WithDuplicateParameters_es2015.1.normal.js | 48 +- ...resWithDuplicateParameters_es5.1.normal.js | 48 +- ...sWithDuplicateParameters_es5.2.minified.js | 9 +- ...WithOptionalParameters2_es2015.1.normal.js | 12 +- ...thOptionalParameters2_es2015.2.minified.js | 6 +- ...resWithOptionalParameters2_es5.1.normal.js | 12 +- ...sWithOptionalParameters2_es5.2.minified.js | 12 +- ...sWithOptionalParameters_es2015.1.normal.js | 21 +- ...ithOptionalParameters_es2015.2.minified.js | 16 +- ...uresWithOptionalParameters_es5.1.normal.js | 21 +- ...esWithOptionalParameters_es5.2.minified.js | 19 +- .../callWithMissingVoid_es2015.1.normal.js | 12 +- .../callWithMissingVoid_es2015.2.minified.js | 12 +- .../callWithMissingVoid_es5.1.normal.js | 9 +- .../callWithMissingVoid_es5.2.minified.js | 9 +- .../callWithSpreadES6_es2015.1.normal.js | 6 +- .../callWithSpreadES6_es2015.2.minified.js | 3 +- .../callWithSpreadES6_es5.1.normal.js | 3 +- .../callWithSpreadES6_es5.2.minified.js | 3 +- .../callWithSpread_es2015.1.normal.js | 6 +- .../callWithSpread_es2015.2.minified.js | 3 +- .../callWithSpread_es5.1.normal.js | 3 +- .../callWithSpread_es5.2.minified.js | 3 +- .../castingTuple_es2015.1.normal.js | 6 +- .../castingTuple_es2015.2.minified.js | 4 +- .../castingTuple_es5.1.normal.js | 9 +- .../castingTuple_es5.2.minified.js | 7 +- .../chained2_es2015.1.normal.js | 6 +- .../tsc-references/chained2_es5.1.normal.js | 6 +- .../tsc-references/chained_es2015.1.normal.js | 3 +- .../tsc-references/chained_es5.1.normal.js | 3 +- ...rtsObjectAssignProperty_es2015.1.normal.js | 6 +- ...sObjectAssignProperty_es2015.2.minified.js | 6 +- ...xportsObjectAssignProperty_es5.1.normal.js | 6 +- ...ortsObjectAssignProperty_es5.2.minified.js | 6 +- ...AssignPrototypeProperty_es2015.1.normal.js | 3 +- ...signPrototypeProperty_es2015.2.minified.js | 3 +- ...ectAssignPrototypeProperty_es5.1.normal.js | 3 +- ...tAssignPrototypeProperty_es5.2.minified.js | 3 +- ...JsdocOptionalParamOrder_es2015.1.normal.js | 3 +- ...eckJsdocOptionalParamOrder_es5.1.normal.js | 3 +- ...laredFunctionExpression_es2015.1.normal.js | 10 +- ...DeclaredFunctionExpression_es5.1.normal.js | 10 +- .../checkJsdocParamTag1_es2015.1.normal.js | 3 +- .../checkJsdocParamTag1_es2015.2.minified.js | 3 +- .../checkJsdocParamTag1_es5.1.normal.js | 3 +- .../checkJsdocParamTag1_es5.2.minified.js | 3 +- .../checkJsdocTypeTag1_es2015.1.normal.js | 6 +- .../checkJsdocTypeTag1_es5.1.normal.js | 6 +- .../checkJsdocTypeTag6_es2015.1.normal.js | 3 +- .../checkJsdocTypeTag6_es5.1.normal.js | 3 +- ...ocTypedefOnlySourceFile_es2015.1.normal.js | 3 +- ...TypedefOnlySourceFile_es2015.2.minified.js | 3 +- ...JsdocTypedefOnlySourceFile_es5.1.normal.js | 3 +- ...docTypedefOnlySourceFile_es5.2.minified.js | 3 +- ...JsxChildrenCanBeTupleTypex_es5.1.normal.js | 3 +- ...xChildrenCanBeTupleTypex_es5.2.minified.js | 3 +- ...kJsxChildrenProperty12x_es2015.1.normal.js | 6 +- ...sxChildrenProperty12x_es2015.2.minified.js | 3 +- ...heckJsxChildrenProperty12x_es5.1.normal.js | 9 +- ...ckJsxChildrenProperty12x_es5.2.minified.js | 6 +- ...kJsxChildrenProperty13x_es2015.1.normal.js | 3 +- ...sxChildrenProperty13x_es2015.2.minified.js | 3 +- ...heckJsxChildrenProperty13x_es5.1.normal.js | 6 +- ...ckJsxChildrenProperty13x_es5.2.minified.js | 6 +- ...heckJsxChildrenProperty14x_es5.1.normal.js | 3 +- ...ckJsxChildrenProperty14x_es5.2.minified.js | 3 +- ...checkJsxChildrenProperty3x_es5.1.normal.js | 3 +- ...eckJsxChildrenProperty3x_es5.2.minified.js | 3 +- ...checkJsxChildrenProperty4x_es5.1.normal.js | 3 +- ...eckJsxChildrenProperty4x_es5.2.minified.js | 3 +- ...checkJsxChildrenProperty5x_es5.1.normal.js | 3 +- ...eckJsxChildrenProperty5x_es5.2.minified.js | 3 +- ...checkJsxChildrenProperty6x_es5.1.normal.js | 3 +- ...eckJsxChildrenProperty6x_es5.2.minified.js | 3 +- ...checkJsxChildrenProperty7x_es5.1.normal.js | 3 +- ...eckJsxChildrenProperty7x_es5.2.minified.js | 3 +- ...checkJsxChildrenProperty8x_es5.1.normal.js | 3 +- ...eckJsxChildrenProperty8x_es5.2.minified.js | 3 +- ...ersectionElementPropsTypex_es5.1.normal.js | 3 +- ...sectionElementPropsTypex_es5.2.minified.js | 3 +- ...leSkipContextSensitiveBugx_es5.1.normal.js | 3 +- ...SkipContextSensitiveBugx_es5.2.minified.js | 3 +- ...eckObjectDefineProperty_es2015.1.normal.js | 9 +- ...kObjectDefineProperty_es2015.2.minified.js | 6 +- .../checkObjectDefineProperty_es5.1.normal.js | 9 +- ...heckObjectDefineProperty_es5.2.minified.js | 6 +- ...herObjectAssignProperty_es2015.1.normal.js | 3 +- ...rObjectAssignProperty_es2015.2.minified.js | 3 +- ...kOtherObjectAssignProperty_es5.1.normal.js | 3 +- ...therObjectAssignProperty_es5.2.minified.js | 3 +- ...cialPropertyAssignments_es2015.1.normal.js | 3 +- ...alPropertyAssignments_es2015.2.minified.js | 6 +- ...SpecialPropertyAssignments_es5.1.normal.js | 3 +- ...ecialPropertyAssignments_es5.2.minified.js | 6 +- .../circularImportAlias_es2015.1.normal.js | 6 +- .../circularImportAlias_es2015.2.minified.js | 4 +- .../circularImportAlias_es5.1.normal.js | 9 +- .../circularImportAlias_es5.2.minified.js | 9 +- ...ularIndexedAccessErrors_es2015.1.normal.js | 3 +- ...ircularIndexedAccessErrors_es5.1.normal.js | 3 +- ...leAssignmentDeclaration_es2015.1.normal.js | 6 +- ...AssignmentDeclaration_es2015.2.minified.js | 6 +- ...tipleAssignmentDeclaration_es5.1.normal.js | 6 +- ...pleAssignmentDeclaration_es5.2.minified.js | 6 +- .../circularReference_es2015.1.normal.js | 6 +- .../circularReference_es2015.2.minified.js | 6 +- .../circularReference_es5.1.normal.js | 6 +- .../circularReference_es5.2.minified.js | 6 +- ...ctConstructorAssignability_es5.1.normal.js | 3 +- ...ConstructorAssignability_es5.2.minified.js | 3 +- .../classAbstractExtends_es2015.1.normal.js | 6 +- .../classAbstractExtends_es5.1.normal.js | 9 +- .../classAbstractExtends_es5.2.minified.js | 9 +- ...assAbstractFactoryFunction_es5.1.normal.js | 3 +- ...sAbstractFactoryFunction_es5.2.minified.js | 3 +- .../classAbstractGeneric_es2015.1.normal.js | 6 +- .../classAbstractGeneric_es5.1.normal.js | 9 +- .../classAbstractGeneric_es5.2.minified.js | 9 +- ...ractImportInstantiation_es2015.1.normal.js | 3 +- ...ctImportInstantiation_es2015.2.minified.js | 3 +- ...bstractImportInstantiation_es5.1.normal.js | 3 +- ...tractImportInstantiation_es5.2.minified.js | 3 +- .../classAbstractInAModule_es2015.1.normal.js | 3 +- ...lassAbstractInAModule_es2015.2.minified.js | 3 +- .../classAbstractInAModule_es5.1.normal.js | 6 +- .../classAbstractInAModule_es5.2.minified.js | 6 +- .../classAbstractInheritance_es5.1.normal.js | 3 +- ...classAbstractInheritance_es5.2.minified.js | 3 +- ...assAbstractInstantiations1_es5.1.normal.js | 3 +- ...sAbstractInstantiations1_es5.2.minified.js | 3 +- .../classAbstractOverloads_es2015.1.normal.js | 3 +- .../classAbstractOverloads_es5.1.normal.js | 3 +- .../classAbstractOverloads_es5.2.minified.js | 3 +- ...actOverrideWithAbstract_es2015.1.normal.js | 12 +- ...stractOverrideWithAbstract_es5.1.normal.js | 15 +- ...ractOverrideWithAbstract_es5.2.minified.js | 15 +- .../classAbstractSuperCalls_es5.1.normal.js | 3 +- .../classAbstractSuperCalls_es5.2.minified.js | 3 +- ...stractUsingAbstractMethod1_es5.1.normal.js | 3 +- ...ractUsingAbstractMethod1_es5.2.minified.js | 3 +- ...ndInterfaceWithSameName_es2015.1.normal.js | 3 +- ...ssAndInterfaceWithSameName_es5.1.normal.js | 3 +- ...AndInterfaceWithSameName_es5.2.minified.js | 3 +- ...AndVariableWithSameName_es2015.1.normal.js | 3 +- ...assAndVariableWithSameName_es5.1.normal.js | 3 +- ...sAndVariableWithSameName_es5.2.minified.js | 3 +- ...tendConstructorFunction_es2015.1.normal.js | 3 +- ...ndConstructorFunction_es2015.2.minified.js | 3 +- ...nExtendConstructorFunction_es5.1.normal.js | 6 +- ...xtendConstructorFunction_es5.2.minified.js | 6 +- ...sConstructorAccessibility2_es5.1.normal.js | 3 +- ...onstructorAccessibility2_es5.2.minified.js | 3 +- ...nstructorAccessibility4_es2015.1.normal.js | 6 +- ...sConstructorAccessibility4_es5.1.normal.js | 3 +- ...onstructorAccessibility4_es5.2.minified.js | 3 +- ...nstructorAccessibility5_es2015.1.normal.js | 3 +- ...sConstructorAccessibility5_es5.1.normal.js | 3 +- ...onstructorAccessibility5_es5.2.minified.js | 3 +- ...onstructorAccessibility_es2015.1.normal.js | 3 +- ...structorAccessibility_es2015.2.minified.js | 3 +- ...ssConstructorAccessibility_es5.1.normal.js | 3 +- ...ConstructorAccessibility_es5.2.minified.js | 3 +- ...rOverloadsAccessibility_es2015.1.normal.js | 12 +- ...orParametersAccessibility2_es5.1.normal.js | 3 +- ...ParametersAccessibility2_es5.2.minified.js | 3 +- ...orParametersAccessibility3_es5.1.normal.js | 3 +- ...ParametersAccessibility3_es5.2.minified.js | 3 +- ...torParametersAccessibility_es5.1.normal.js | 3 +- ...rParametersAccessibility_es5.2.minified.js | 3 +- ...ssDoesNotDependOnBaseTypes_es5.1.normal.js | 3 +- ...DoesNotDependOnBaseTypes_es5.2.minified.js | 3 +- .../classExpression2_es5.1.normal.js | 3 +- .../classExpression2_es5.2.minified.js | 3 +- .../classExpression3_es5.1.normal.js | 3 +- .../classExpression3_es5.2.minified.js | 3 +- .../classExpressionES62_es5.1.normal.js | 3 +- .../classExpressionES62_es5.2.minified.js | 3 +- .../classExpressionES63_es5.1.normal.js | 3 +- .../classExpressionES63_es5.2.minified.js | 3 +- .../classExtendingBuiltinType_es5.1.normal.js | 6 +- ...lassExtendingBuiltinType_es5.2.minified.js | 6 +- ...lassExtendingClassLikeType_es5.1.normal.js | 3 +- ...ssExtendingClassLikeType_es5.2.minified.js | 3 +- .../classExtendingClass_es2015.1.normal.js | 12 +- .../classExtendingClass_es2015.2.minified.js | 12 +- .../classExtendingClass_es5.1.normal.js | 15 +- .../classExtendingClass_es5.2.minified.js | 15 +- ...assExtendingNonConstructor_es5.1.normal.js | 3 +- ...sExtendingNonConstructor_es5.2.minified.js | 3 +- .../classExtendingNull_es5.1.normal.js | 3 +- .../classExtendingNull_es5.2.minified.js | 3 +- ...xtendsItselfIndirectly2_es2015.1.normal.js | 15 +- ...endsItselfIndirectly2_es2015.2.minified.js | 15 +- ...ssExtendsItselfIndirectly2_es5.1.normal.js | 18 +- ...ExtendsItselfIndirectly2_es5.2.minified.js | 18 +- ...ssExtendsItselfIndirectly3_es5.1.normal.js | 3 +- ...ExtendsItselfIndirectly3_es5.2.minified.js | 3 +- ...assExtendsItselfIndirectly_es5.1.normal.js | 3 +- ...sExtendsItselfIndirectly_es5.2.minified.js | 3 +- .../classExtendsItself_es5.1.normal.js | 3 +- .../classExtendsItself_es5.2.minified.js | 3 +- ...owedConstructorFunction_es2015.1.normal.js | 3 +- ...hadowedConstructorFunction_es5.1.normal.js | 6 +- ...dowedConstructorFunction_es5.2.minified.js | 6 +- ...alidConstructorFunction_es2015.1.normal.js | 3 +- ...idConstructorFunction_es2015.2.minified.js | 3 +- ...dsValidConstructorFunction_es5.1.normal.js | 6 +- ...ValidConstructorFunction_es5.2.minified.js | 6 +- .../classIsSubtypeOfBaseType_es5.1.normal.js | 3 +- ...classIsSubtypeOfBaseType_es5.2.minified.js | 3 +- .../classPropertyAsPrivate_es2015.1.normal.js | 12 +- ...lassPropertyAsPrivate_es2015.2.minified.js | 12 +- .../classPropertyAsPrivate_es5.1.normal.js | 12 +- .../classPropertyAsPrivate_es5.2.minified.js | 12 +- ...lassPropertyAsProtected_es2015.1.normal.js | 12 +- ...ssPropertyAsProtected_es2015.2.minified.js | 12 +- .../classPropertyAsProtected_es5.1.normal.js | 12 +- ...classPropertyAsProtected_es5.2.minified.js | 12 +- ...opertyIsPublicByDefault_es2015.1.normal.js | 12 +- ...ertyIsPublicByDefault_es2015.2.minified.js | 12 +- ...sPropertyIsPublicByDefault_es5.1.normal.js | 12 +- ...ropertyIsPublicByDefault_es5.2.minified.js | 12 +- ...seClassButNoConstructor_es2015.1.normal.js | 6 +- ...ClassButNoConstructor_es2015.2.minified.js | 6 +- ...hBaseClassButNoConstructor_es5.1.normal.js | 3 +- ...aseClassButNoConstructor_es5.2.minified.js | 3 +- .../classWithConstructors_es2015.1.normal.js | 18 +- ...classWithConstructors_es2015.2.minified.js | 18 +- .../classWithConstructors_es5.1.normal.js | 9 +- .../classWithConstructors_es5.2.minified.js | 9 +- .../classWithEmptyBody_es2015.1.normal.js | 6 +- .../classWithEmptyBody_es5.1.normal.js | 6 +- ...sEquivalentToInterface2_es2015.1.normal.js | 3 +- ...bersEquivalentToInterface2_es5.1.normal.js | 3 +- ...rsEquivalentToInterface2_es5.2.minified.js | 3 +- ...rsEquivalentToInterface_es2015.1.normal.js | 3 +- ...mbersEquivalentToInterface_es5.1.normal.js | 3 +- ...ersEquivalentToInterface_es5.2.minified.js | 3 +- ...ssWithOptionalParameter_es2015.1.normal.js | 6 +- ...classWithOptionalParameter_es5.1.normal.js | 6 +- ...assWithOptionalParameter_es5.2.minified.js | 6 +- ...classWithProtectedProperty_es5.1.normal.js | 3 +- ...assWithProtectedProperty_es5.2.minified.js | 3 +- ...nParameterBindingPattern.2_es5.1.normal.js | 3 +- ...arameterBindingPattern.2_es5.2.minified.js | 3 +- ...nParameterBindingPattern.3_es5.1.normal.js | 3 +- ...arameterBindingPattern.3_es5.2.minified.js | 3 +- ...ParameterBindingPattern_es2015.1.normal.js | 3 +- ...ldInParameterInitializer.2_es5.1.normal.js | 3 +- ...InParameterInitializer.2_es5.2.minified.js | 3 +- ...ldInParameterInitializer.3_es5.1.normal.js | 3 +- ...InParameterInitializer.3_es5.2.minified.js | 3 +- ...dInParameterInitializer_es2015.1.normal.js | 3 +- .../classWithStaticMembers_es2015.1.normal.js | 3 +- ...lassWithStaticMembers_es2015.2.minified.js | 3 +- .../classWithStaticMembers_es5.1.normal.js | 6 +- .../classWithStaticMembers_es5.2.minified.js | 6 +- ...oConstructorDefinitions_es2015.1.normal.js | 6 +- ...atorOtherValidOperation_es2015.1.normal.js | 3 +- ...peratorOtherValidOperation_es5.1.normal.js | 3 +- ...SecondOperandObjectType_es2015.1.normal.js | 6 +- ...ithSecondOperandObjectType_es5.1.normal.js | 6 +- ...ExportedClassExpression_es2015.1.normal.js | 3 +- ...portedClassExpression_es2015.2.minified.js | 3 +- ...ortExportedClassExpression_es5.1.normal.js | 3 +- ...tExportedClassExpression_es5.2.minified.js | 3 +- ...estedClassTypeReference_es2015.1.normal.js | 3 +- ...tedClassTypeReference_es2015.2.minified.js | 3 +- ...rtNestedClassTypeReference_es5.1.normal.js | 3 +- ...NestedClassTypeReference_es5.2.minified.js | 3 +- ...tNotAsPrimaryExpression_es2015.1.normal.js | 6 +- ...otAsPrimaryExpression_es2015.2.minified.js | 3 +- ...portNotAsPrimaryExpression_es5.1.normal.js | 6 +- ...rtNotAsPrimaryExpression_es5.2.minified.js | 3 +- ...eratorWithIdenticalObjects_es5.1.normal.js | 3 +- ...atorWithIdenticalObjects_es5.2.minified.js | 3 +- ...hIdenticalPrimitiveType_es2015.1.normal.js | 3 +- ...denticalPrimitiveType_es2015.2.minified.js | 3 +- ...WithIdenticalPrimitiveType_es5.1.normal.js | 3 +- ...thIdenticalPrimitiveType_es5.2.minified.js | 3 +- ...shipObjectsOnCallSignature_es5.1.normal.js | 3 +- ...ipObjectsOnCallSignature_es5.2.minified.js | 3 +- ...ectsOnConstructorSignature_es5.1.normal.js | 3 +- ...tsOnConstructorSignature_es5.2.minified.js | 3 +- ...hipObjectsOnIndexSignature_es5.1.normal.js | 3 +- ...pObjectsOnIndexSignature_es5.2.minified.js | 3 +- ...nInstantiatedCallSignature_es5.1.normal.js | 3 +- ...nstantiatedCallSignature_es5.2.minified.js | 3 +- ...tiatedConstructorSignature_es5.1.normal.js | 3 +- ...atedConstructorSignature_es5.2.minified.js | 3 +- ...lationshipPrimitiveType_es2015.1.normal.js | 3 +- ...tionshipPrimitiveType_es2015.2.minified.js | 3 +- ...oRelationshipPrimitiveType_es5.1.normal.js | 3 +- ...elationshipPrimitiveType_es5.2.minified.js | 3 +- ...lationshipTypeParameter_es2015.1.normal.js | 3 +- ...tionshipTypeParameter_es2015.2.minified.js | 3 +- ...oRelationshipTypeParameter_es5.1.normal.js | 3 +- ...elationshipTypeParameter_es5.2.minified.js | 3 +- ...atorWithOneOperandIsAny_es2015.1.normal.js | 3 +- ...orWithOneOperandIsAny_es2015.2.minified.js | 3 +- ...peratorWithOneOperandIsAny_es5.1.normal.js | 3 +- ...ratorWithOneOperandIsAny_es5.2.minified.js | 3 +- ...torWithOneOperandIsNull_es2015.1.normal.js | 3 +- ...rWithOneOperandIsNull_es2015.2.minified.js | 3 +- ...eratorWithOneOperandIsNull_es5.1.normal.js | 3 +- ...atorWithOneOperandIsNull_es5.2.minified.js | 3 +- ...thOneOperandIsUndefined_es2015.1.normal.js | 3 +- ...OneOperandIsUndefined_es2015.2.minified.js | 3 +- ...rWithOneOperandIsUndefined_es5.1.normal.js | 3 +- ...ithOneOperandIsUndefined_es5.2.minified.js | 3 +- ...ithSubtypeEnumAndNumber_es2015.1.normal.js | 3 +- ...hSubtypeEnumAndNumber_es2015.2.minified.js | 3 +- ...orWithSubtypeEnumAndNumber_es5.1.normal.js | 3 +- ...WithSubtypeEnumAndNumber_es5.2.minified.js | 3 +- ...btypeObjectOnCallSignature_es5.1.normal.js | 3 +- ...ypeObjectOnCallSignature_es5.2.minified.js | 3 +- ...jectOnConstructorSignature_es5.1.normal.js | 3 +- ...ctOnConstructorSignature_es5.2.minified.js | 3 +- ...typeObjectOnIndexSignature_es5.1.normal.js | 3 +- ...peObjectOnIndexSignature_es5.2.minified.js | 3 +- ...nInstantiatedCallSignature_es5.1.normal.js | 3 +- ...nstantiatedCallSignature_es5.2.minified.js | 3 +- ...tiatedConstructorSignature_es5.1.normal.js | 3 +- ...atedConstructorSignature_es5.2.minified.js | 3 +- ...ithSubtypeObjectOnProperty_es5.1.normal.js | 3 +- ...hSubtypeObjectOnProperty_es5.2.minified.js | 3 +- ...ignmentLHSCanBeAssigned_es2015.1.normal.js | 9 +- ...nmentLHSCanBeAssigned_es2015.2.minified.js | 5 +- ...AssignmentLHSCanBeAssigned_es5.1.normal.js | 9 +- ...signmentLHSCanBeAssigned_es5.2.minified.js | 5 +- ...mentLHSCannotBeAssigned_es2015.1.normal.js | 3 +- ...ntLHSCannotBeAssigned_es2015.2.minified.js | 3 +- ...ignmentLHSCannotBeAssigned_es5.1.normal.js | 3 +- ...nmentLHSCannotBeAssigned_es5.2.minified.js | 3 +- ...mentWithInvalidOperands_es2015.1.normal.js | 18 +- ...ntWithInvalidOperands_es2015.2.minified.js | 8 +- ...ignmentWithInvalidOperands_es5.1.normal.js | 18 +- ...nmentWithInvalidOperands_es5.2.minified.js | 8 +- ...ignmentLHSCanBeAssigned_es2015.1.normal.js | 3 +- ...nmentLHSCanBeAssigned_es2015.2.minified.js | 3 +- ...AssignmentLHSCanBeAssigned_es5.1.normal.js | 3 +- ...signmentLHSCanBeAssigned_es5.2.minified.js | 3 +- ...mentWithInvalidOperands_es2015.1.normal.js | 21 +- ...ntWithInvalidOperands_es2015.2.minified.js | 9 +- ...ignmentWithInvalidOperands_es5.1.normal.js | 21 +- ...nmentWithInvalidOperands_es5.2.minified.js | 9 +- ...gnmentLHSCanBeAssigned1_es2015.1.normal.js | 3 +- ...mentLHSCanBeAssigned1_es2015.2.minified.js | 3 +- ...ssignmentLHSCanBeAssigned1_es5.1.normal.js | 3 +- ...ignmentLHSCanBeAssigned1_es5.2.minified.js | 3 +- ...mentLHSCannotBeAssigned_es2015.1.normal.js | 21 +- ...ntLHSCannotBeAssigned_es2015.2.minified.js | 9 +- ...ignmentLHSCannotBeAssigned_es5.1.normal.js | 21 +- ...nmentLHSCannotBeAssigned_es5.2.minified.js | 9 +- ...utedPropertyNames10_ES5_es2015.1.normal.js | 33 +- ...omputedPropertyNames10_ES5_es5.1.normal.js | 14 +- ...putedPropertyNames10_ES5_es5.2.minified.js | 14 +- ...utedPropertyNames10_ES6_es2015.1.normal.js | 33 +- ...omputedPropertyNames10_ES6_es5.1.normal.js | 14 +- ...putedPropertyNames10_ES6_es5.2.minified.js | 14 +- ...utedPropertyNames11_ES5_es2015.1.normal.js | 15 +- ...omputedPropertyNames11_ES5_es5.1.normal.js | 32 +- ...putedPropertyNames11_ES5_es5.2.minified.js | 32 +- ...utedPropertyNames11_ES6_es2015.1.normal.js | 15 +- ...omputedPropertyNames11_ES6_es5.1.normal.js | 32 +- ...putedPropertyNames11_ES6_es5.2.minified.js | 32 +- ...utedPropertyNames13_ES5_es2015.1.normal.js | 33 +- ...omputedPropertyNames13_ES5_es5.1.normal.js | 33 +- ...putedPropertyNames13_ES5_es5.2.minified.js | 33 +- ...utedPropertyNames13_ES6_es2015.1.normal.js | 33 +- ...omputedPropertyNames13_ES6_es5.1.normal.js | 33 +- ...putedPropertyNames13_ES6_es5.2.minified.js | 33 +- ...utedPropertyNames14_ES5_es2015.1.normal.js | 21 +- ...omputedPropertyNames14_ES5_es5.1.normal.js | 21 +- ...putedPropertyNames14_ES5_es5.2.minified.js | 21 +- ...utedPropertyNames14_ES6_es2015.1.normal.js | 21 +- ...omputedPropertyNames14_ES6_es5.1.normal.js | 21 +- ...putedPropertyNames14_ES6_es5.2.minified.js | 21 +- ...utedPropertyNames15_ES5_es2015.1.normal.js | 9 +- ...omputedPropertyNames15_ES5_es5.1.normal.js | 9 +- ...putedPropertyNames15_ES5_es5.2.minified.js | 9 +- ...utedPropertyNames15_ES6_es2015.1.normal.js | 9 +- ...omputedPropertyNames15_ES6_es5.1.normal.js | 9 +- ...putedPropertyNames15_ES6_es5.2.minified.js | 9 +- ...utedPropertyNames16_ES5_es2015.1.normal.js | 15 +- ...omputedPropertyNames16_ES5_es5.1.normal.js | 15 +- ...putedPropertyNames16_ES5_es5.2.minified.js | 15 +- ...utedPropertyNames16_ES6_es2015.1.normal.js | 15 +- ...omputedPropertyNames16_ES6_es5.1.normal.js | 15 +- ...putedPropertyNames16_ES6_es5.2.minified.js | 15 +- ...utedPropertyNames17_ES5_es2015.1.normal.js | 12 +- ...omputedPropertyNames17_ES5_es5.1.normal.js | 12 +- ...putedPropertyNames17_ES5_es5.2.minified.js | 12 +- ...utedPropertyNames17_ES6_es2015.1.normal.js | 12 +- ...omputedPropertyNames17_ES6_es5.1.normal.js | 12 +- ...putedPropertyNames17_ES6_es5.2.minified.js | 12 +- ...omputedPropertyNames18_ES5_es5.1.normal.js | 3 +- ...omputedPropertyNames18_ES6_es5.1.normal.js | 3 +- ...utedPropertyNames19_ES5_es2015.1.normal.js | 3 +- ...edPropertyNames19_ES5_es2015.2.minified.js | 3 +- ...omputedPropertyNames19_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames19_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames19_ES6_es2015.1.normal.js | 3 +- ...edPropertyNames19_ES6_es2015.2.minified.js | 3 +- ...omputedPropertyNames19_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames19_ES6_es5.2.minified.js | 6 +- ...putedPropertyNames1_ES5_es2015.1.normal.js | 3 +- ...computedPropertyNames1_ES5_es5.1.normal.js | 13 +- ...mputedPropertyNames1_ES5_es5.2.minified.js | 11 +- ...putedPropertyNames1_ES6_es2015.1.normal.js | 3 +- ...computedPropertyNames1_ES6_es5.1.normal.js | 13 +- ...mputedPropertyNames1_ES6_es5.2.minified.js | 11 +- ...omputedPropertyNames20_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames20_ES5_es5.2.minified.js | 3 +- ...omputedPropertyNames20_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames20_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames21_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames21_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames21_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames21_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames21_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames21_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames22_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames22_ES5_es5.1.normal.js | 4 +- ...putedPropertyNames22_ES5_es5.2.minified.js | 4 +- ...utedPropertyNames22_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames22_ES6_es5.1.normal.js | 4 +- ...putedPropertyNames22_ES6_es5.2.minified.js | 4 +- ...utedPropertyNames23_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames23_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames23_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames23_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames23_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames23_ES6_es5.2.minified.js | 6 +- ...utedPropertyNames24_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames24_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames24_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames24_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames24_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames24_ES6_es5.2.minified.js | 6 +- ...utedPropertyNames25_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames25_ES5_es5.1.normal.js | 7 +- ...putedPropertyNames25_ES5_es5.2.minified.js | 7 +- ...utedPropertyNames25_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames25_ES6_es5.1.normal.js | 7 +- ...putedPropertyNames25_ES6_es5.2.minified.js | 7 +- ...utedPropertyNames26_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames26_ES5_es5.1.normal.js | 9 +- ...putedPropertyNames26_ES5_es5.2.minified.js | 9 +- ...utedPropertyNames26_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames26_ES6_es5.1.normal.js | 9 +- ...putedPropertyNames26_ES6_es5.2.minified.js | 9 +- ...utedPropertyNames27_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames27_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames27_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames27_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames27_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames27_ES6_es5.2.minified.js | 6 +- ...utedPropertyNames28_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames28_ES5_es5.1.normal.js | 7 +- ...putedPropertyNames28_ES5_es5.2.minified.js | 7 +- ...utedPropertyNames28_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames28_ES6_es5.1.normal.js | 7 +- ...putedPropertyNames28_ES6_es5.2.minified.js | 7 +- ...utedPropertyNames29_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames29_ES5_es5.1.normal.js | 4 +- ...utedPropertyNames29_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames29_ES6_es5.1.normal.js | 4 +- ...putedPropertyNames2_ES5_es2015.1.normal.js | 18 +- ...computedPropertyNames2_ES5_es5.1.normal.js | 18 +- ...mputedPropertyNames2_ES5_es5.2.minified.js | 18 +- ...putedPropertyNames2_ES6_es2015.1.normal.js | 18 +- ...computedPropertyNames2_ES6_es5.1.normal.js | 18 +- ...mputedPropertyNames2_ES6_es5.2.minified.js | 18 +- ...utedPropertyNames30_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames30_ES5_es5.1.normal.js | 7 +- ...putedPropertyNames30_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames30_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames30_ES6_es5.1.normal.js | 7 +- ...putedPropertyNames30_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames31_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames31_ES5_es5.1.normal.js | 7 +- ...putedPropertyNames31_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames31_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames31_ES6_es5.1.normal.js | 7 +- ...putedPropertyNames31_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames32_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames32_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames32_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames32_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames32_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames32_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames33_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames33_ES5_es5.1.normal.js | 4 +- ...putedPropertyNames33_ES5_es5.2.minified.js | 4 +- ...utedPropertyNames33_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames33_ES6_es5.1.normal.js | 4 +- ...putedPropertyNames33_ES6_es5.2.minified.js | 4 +- ...utedPropertyNames34_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames34_ES5_es5.1.normal.js | 4 +- ...putedPropertyNames34_ES5_es5.2.minified.js | 4 +- ...utedPropertyNames34_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames34_ES6_es5.1.normal.js | 4 +- ...putedPropertyNames34_ES6_es5.2.minified.js | 4 +- ...utedPropertyNames36_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames36_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames36_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames36_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames36_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames36_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames37_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames37_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames37_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames37_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames37_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames37_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames38_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames38_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames38_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames38_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames38_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames38_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames39_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames39_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames39_ES5_es5.2.minified.js | 3 +- ...utedPropertyNames39_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames39_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames39_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames43_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames43_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames43_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames43_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames43_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames43_ES6_es5.2.minified.js | 6 +- ...utedPropertyNames44_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames44_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames44_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames44_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames44_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames44_ES6_es5.2.minified.js | 6 +- ...utedPropertyNames45_ES5_es2015.1.normal.js | 3 +- ...omputedPropertyNames45_ES5_es5.1.normal.js | 6 +- ...putedPropertyNames45_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames45_ES6_es2015.1.normal.js | 3 +- ...omputedPropertyNames45_ES6_es5.1.normal.js | 6 +- ...putedPropertyNames45_ES6_es5.2.minified.js | 6 +- ...omputedPropertyNames46_ES5_es5.1.normal.js | 3 +- ...putedPropertyNames46_ES5_es5.2.minified.js | 3 +- ...omputedPropertyNames46_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames46_ES6_es5.2.minified.js | 3 +- ...utedPropertyNames47_ES5_es2015.1.normal.js | 6 +- ...edPropertyNames47_ES5_es2015.2.minified.js | 4 +- ...omputedPropertyNames47_ES5_es5.1.normal.js | 9 +- ...putedPropertyNames47_ES5_es5.2.minified.js | 5 +- ...utedPropertyNames47_ES6_es2015.1.normal.js | 6 +- ...edPropertyNames47_ES6_es2015.2.minified.js | 4 +- ...omputedPropertyNames47_ES6_es5.1.normal.js | 9 +- ...putedPropertyNames47_ES6_es5.2.minified.js | 5 +- ...utedPropertyNames48_ES5_es2015.1.normal.js | 3 +- ...edPropertyNames48_ES5_es2015.2.minified.js | 3 +- ...omputedPropertyNames48_ES5_es5.1.normal.js | 12 +- ...putedPropertyNames48_ES5_es5.2.minified.js | 6 +- ...utedPropertyNames48_ES6_es2015.1.normal.js | 3 +- ...edPropertyNames48_ES6_es2015.2.minified.js | 3 +- ...omputedPropertyNames48_ES6_es5.1.normal.js | 12 +- ...putedPropertyNames48_ES6_es5.2.minified.js | 6 +- ...computedPropertyNames4_ES5_es5.1.normal.js | 3 +- ...mputedPropertyNames4_ES5_es5.2.minified.js | 3 +- ...computedPropertyNames4_ES6_es5.1.normal.js | 3 +- ...mputedPropertyNames4_ES6_es5.2.minified.js | 3 +- ...omputedPropertyNames51_ES5_es5.1.normal.js | 3 +- ...omputedPropertyNames51_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames5_ES5_es2015.1.normal.js | 3 +- ...computedPropertyNames5_ES5_es5.1.normal.js | 4 +- ...mputedPropertyNames5_ES5_es5.2.minified.js | 4 +- ...putedPropertyNames5_ES6_es2015.1.normal.js | 3 +- ...computedPropertyNames5_ES6_es5.1.normal.js | 4 +- ...mputedPropertyNames5_ES6_es5.2.minified.js | 4 +- ...computedPropertyNames6_ES5_es5.1.normal.js | 3 +- ...mputedPropertyNames6_ES5_es5.2.minified.js | 3 +- ...computedPropertyNames6_ES6_es5.1.normal.js | 3 +- ...mputedPropertyNames6_ES6_es5.2.minified.js | 3 +- ...putedPropertyNames7_ES5_es2015.1.normal.js | 3 +- ...tedPropertyNames7_ES5_es2015.2.minified.js | 3 +- ...computedPropertyNames7_ES5_es5.1.normal.js | 6 +- ...mputedPropertyNames7_ES5_es5.2.minified.js | 4 +- ...putedPropertyNames7_ES6_es2015.1.normal.js | 3 +- ...tedPropertyNames7_ES6_es2015.2.minified.js | 3 +- ...computedPropertyNames7_ES6_es5.1.normal.js | 6 +- ...mputedPropertyNames7_ES6_es5.2.minified.js | 4 +- ...computedPropertyNames8_ES5_es5.1.normal.js | 3 +- ...computedPropertyNames8_ES6_es5.1.normal.js | 3 +- ...putedPropertyNames9_ES5_es2015.1.normal.js | 3 +- ...tedPropertyNames9_ES5_es2015.2.minified.js | 3 +- ...computedPropertyNames9_ES5_es5.1.normal.js | 6 +- ...mputedPropertyNames9_ES5_es5.2.minified.js | 6 +- ...putedPropertyNames9_ES6_es2015.1.normal.js | 3 +- ...tedPropertyNames9_ES6_es2015.2.minified.js | 3 +- ...computedPropertyNames9_ES6_es5.1.normal.js | 6 +- ...mputedPropertyNames9_ES6_es5.2.minified.js | 6 +- ...yNamesContextualType10_ES5_es5.1.normal.js | 3 +- ...amesContextualType10_ES5_es5.2.minified.js | 3 +- ...yNamesContextualType10_ES6_es5.1.normal.js | 3 +- ...amesContextualType10_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType1_ES5_es5.1.normal.js | 3 +- ...NamesContextualType1_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType1_ES6_es5.1.normal.js | 3 +- ...NamesContextualType1_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType2_ES5_es5.1.normal.js | 3 +- ...NamesContextualType2_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType2_ES6_es5.1.normal.js | 3 +- ...NamesContextualType2_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType3_ES5_es5.1.normal.js | 3 +- ...NamesContextualType3_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType3_ES6_es5.1.normal.js | 3 +- ...NamesContextualType3_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType4_ES5_es5.1.normal.js | 3 +- ...NamesContextualType4_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType4_ES6_es5.1.normal.js | 3 +- ...NamesContextualType4_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType5_ES5_es5.1.normal.js | 3 +- ...NamesContextualType5_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType5_ES6_es5.1.normal.js | 3 +- ...NamesContextualType5_ES6_es5.2.minified.js | 3 +- ...amesContextualType6_ES5_es2015.1.normal.js | 3 +- ...esContextualType6_ES5_es2015.2.minified.js | 3 +- ...tyNamesContextualType6_ES5_es5.1.normal.js | 3 +- ...NamesContextualType6_ES5_es5.2.minified.js | 3 +- ...amesContextualType6_ES6_es2015.1.normal.js | 3 +- ...esContextualType6_ES6_es2015.2.minified.js | 3 +- ...tyNamesContextualType6_ES6_es5.1.normal.js | 3 +- ...NamesContextualType6_ES6_es5.2.minified.js | 3 +- ...amesContextualType7_ES5_es2015.1.normal.js | 3 +- ...esContextualType7_ES5_es2015.2.minified.js | 3 +- ...tyNamesContextualType7_ES5_es5.1.normal.js | 3 +- ...NamesContextualType7_ES5_es5.2.minified.js | 3 +- ...amesContextualType7_ES6_es2015.1.normal.js | 3 +- ...esContextualType7_ES6_es2015.2.minified.js | 3 +- ...tyNamesContextualType7_ES6_es5.1.normal.js | 3 +- ...NamesContextualType7_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType8_ES5_es5.1.normal.js | 3 +- ...NamesContextualType8_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType8_ES6_es5.1.normal.js | 3 +- ...NamesContextualType8_ES6_es5.2.minified.js | 3 +- ...tyNamesContextualType9_ES5_es5.1.normal.js | 3 +- ...NamesContextualType9_ES5_es5.2.minified.js | 3 +- ...tyNamesContextualType9_ES6_es5.1.normal.js | 3 +- ...NamesContextualType9_ES6_es5.2.minified.js | 3 +- ...mesDeclarationEmit1_ES5_es2015.1.normal.js | 6 +- ...yNamesDeclarationEmit1_ES5_es5.1.normal.js | 6 +- ...amesDeclarationEmit1_ES5_es5.2.minified.js | 6 +- ...mesDeclarationEmit1_ES6_es2015.1.normal.js | 6 +- ...yNamesDeclarationEmit1_ES6_es5.1.normal.js | 6 +- ...amesDeclarationEmit1_ES6_es5.2.minified.js | 6 +- ...mesDeclarationEmit2_ES5_es2015.1.normal.js | 6 +- ...yNamesDeclarationEmit2_ES5_es5.1.normal.js | 6 +- ...amesDeclarationEmit2_ES5_es5.2.minified.js | 6 +- ...mesDeclarationEmit2_ES6_es2015.1.normal.js | 6 +- ...yNamesDeclarationEmit2_ES6_es5.1.normal.js | 6 +- ...amesDeclarationEmit2_ES6_es5.2.minified.js | 6 +- ...mesDeclarationEmit5_ES5_es2015.1.normal.js | 6 +- ...yNamesDeclarationEmit5_ES5_es5.1.normal.js | 12 +- ...amesDeclarationEmit5_ES5_es5.2.minified.js | 12 +- ...mesDeclarationEmit5_ES6_es2015.1.normal.js | 6 +- ...yNamesDeclarationEmit5_ES6_es5.1.normal.js | 12 +- ...amesDeclarationEmit5_ES6_es5.2.minified.js | 12 +- ...mesDeclarationEmit6_ES5_es2015.1.normal.js | 12 +- ...yNamesDeclarationEmit6_ES5_es5.1.normal.js | 7 +- ...amesDeclarationEmit6_ES5_es5.2.minified.js | 7 +- ...mesDeclarationEmit6_ES6_es2015.1.normal.js | 12 +- ...yNamesDeclarationEmit6_ES6_es5.1.normal.js | 7 +- ...amesDeclarationEmit6_ES6_es5.2.minified.js | 7 +- ...pertyNamesSourceMap1_ES5_es5.2.minified.js | 3 +- ...pertyNamesSourceMap1_ES6_es5.2.minified.js | 3 +- ...ropertyNamesSourceMap2_ES5_es5.1.normal.js | 9 +- ...pertyNamesSourceMap2_ES5_es5.2.minified.js | 8 +- ...ropertyNamesSourceMap2_ES6_es5.1.normal.js | 9 +- ...pertyNamesSourceMap2_ES6_es5.2.minified.js | 8 +- ...NamesWithStaticProperty_es2015.1.normal.js | 3 +- ...mesWithStaticProperty_es2015.2.minified.js | 6 +- ...rtyNamesWithStaticProperty_es5.1.normal.js | 3 +- ...yNamesWithStaticProperty_es5.2.minified.js | 6 +- ...peratorWithIdenticalBCT_es2015.1.normal.js | 12 +- ...alOperatorWithIdenticalBCT_es5.1.normal.js | 15 +- ...OperatorWithIdenticalBCT_es5.2.minified.js | 3 +- ...peratorWithoutIdenticalBCT_es5.1.normal.js | 3 +- ...ratorWithoutIdenticalBCT_es5.2.minified.js | 3 +- .../conditionalTypes1_es2015.1.normal.js | 3 +- .../conditionalTypes1_es5.1.normal.js | 3 +- .../conditionalTypes2_es5.2.minified.js | 9 +- ...sfactionWithEmptyObject_es2015.1.normal.js | 30 +- ...actionWithEmptyObject_es2015.2.minified.js | 18 +- ...atisfactionWithEmptyObject_es5.1.normal.js | 30 +- ...isfactionWithEmptyObject_es5.2.minified.js | 18 +- ...ssignabilityInInheritance2_es5.1.normal.js | 3 +- ...ignabilityInInheritance2_es5.2.minified.js | 3 +- ...gnabilityInInheritance3_es2015.1.normal.js | 3 +- ...ssignabilityInInheritance3_es5.1.normal.js | 6 +- ...ignabilityInInheritance3_es5.2.minified.js | 6 +- ...ssignabilityInInheritance4_es5.1.normal.js | 3 +- ...ignabilityInInheritance4_es5.2.minified.js | 3 +- ...ssignabilityInInheritance5_es5.1.normal.js | 3 +- ...ignabilityInInheritance5_es5.2.minified.js | 3 +- ...ssignabilityInInheritance6_es5.1.normal.js | 3 +- ...ignabilityInInheritance6_es5.2.minified.js | 3 +- ...ignabilityInInheritance_es2015.1.normal.js | 3 +- ...nabilityInInheritance_es2015.2.minified.js | 3 +- ...AssignabilityInInheritance_es5.1.normal.js | 3 +- ...signabilityInInheritance_es5.2.minified.js | 3 +- ...sWithIdenticalOverloads_es2015.1.normal.js | 6 +- ...ithIdenticalOverloads_es2015.2.minified.js | 6 +- ...ignaturesWithOverloads2_es2015.1.normal.js | 12 +- ...naturesWithOverloads2_es2015.2.minified.js | 12 +- ...ctSignaturesWithOverloads2_es5.1.normal.js | 6 +- ...SignaturesWithOverloads2_es5.2.minified.js | 6 +- ...tDifferOnlyByReturnType_es2015.1.normal.js | 6 +- ...SignaturesWithOverloads_es2015.1.normal.js | 6 +- ...gnaturesWithOverloads_es2015.2.minified.js | 6 +- ...ltValuesReferencingThis_es2015.1.normal.js | 6 +- ...IsAssignableToBaseType2_es2015.1.normal.js | 3 +- ...ypeIsAssignableToBaseType2_es5.1.normal.js | 3 +- ...eIsAssignableToBaseType2_es5.2.minified.js | 3 +- ...TypeIsAssignableToBaseType_es5.1.normal.js | 3 +- ...peIsAssignableToBaseType_es5.2.minified.js | 3 +- .../constructorFunctions_es2015.1.normal.js | 6 +- .../constructorFunctions_es2015.2.minified.js | 6 +- .../constructorFunctions_es5.1.normal.js | 6 +- .../constructorFunctions_es5.2.minified.js | 6 +- ...torHasPrototypeProperty_es2015.1.normal.js | 6 +- ...rHasPrototypeProperty_es2015.2.minified.js | 6 +- ...ructorHasPrototypeProperty_es5.1.normal.js | 9 +- ...ctorHasPrototypeProperty_es5.2.minified.js | 9 +- ...sWithOptionalParameters_es2015.1.normal.js | 6 +- ...torParameterProperties2_es2015.1.normal.js | 3 +- ...orTagOnClassConstructor_es2015.1.normal.js | 3 +- ...TagOnClassConstructor_es2015.2.minified.js | 3 +- ...contextualTypeFromJSDoc_es2015.1.normal.js | 3 +- .../contextualTypeFromJSDoc_es5.1.normal.js | 3 +- .../contextualTypeFromJSDoc_es5.2.minified.js | 3 +- ...contextualTypeWithTuple_es2015.1.normal.js | 3 +- .../contextualTypeWithTuple_es5.1.normal.js | 3 +- ...lTypedSpecialAssignment_es2015.1.normal.js | 33 +- ...ypedSpecialAssignment_es2015.2.minified.js | 33 +- ...tualTypedSpecialAssignment_es5.1.normal.js | 33 +- ...alTypedSpecialAssignment_es5.2.minified.js | 33 +- ...dingInitializerNegative_es2015.1.normal.js | 18 +- ...TypedBindingInitializer_es2015.1.normal.js | 18 +- ...extuallyTypedIifeStrict_es2015.1.normal.js | 15 +- ...ontextuallyTypedIifeStrict_es5.1.normal.js | 15 +- .../contextuallyTypedIife_es2015.1.normal.js | 15 +- .../contextuallyTypedIife_es5.1.normal.js | 15 +- ...eralsInJsxAttributes02x_es2015.1.normal.js | 12 +- ...alsInJsxAttributes02x_es2015.2.minified.js | 18 +- ...LiteralsInJsxAttributes02x_es5.1.normal.js | 12 +- ...teralsInJsxAttributes02x_es5.2.minified.js | 18 +- ...MarkAliasAsReferences1x_es2015.1.normal.js | 3 +- ...rkAliasAsReferences1x_es2015.2.minified.js | 3 +- ...tlyMarkAliasAsReferences1x_es5.1.normal.js | 3 +- ...yMarkAliasAsReferences1x_es5.2.minified.js | 3 +- ...MarkAliasAsReferences2x_es2015.1.normal.js | 3 +- ...rkAliasAsReferences2x_es2015.2.minified.js | 3 +- ...tlyMarkAliasAsReferences2x_es5.1.normal.js | 3 +- ...yMarkAliasAsReferences2x_es5.2.minified.js | 3 +- ...MarkAliasAsReferences3x_es2015.1.normal.js | 3 +- ...rkAliasAsReferences3x_es2015.2.minified.js | 3 +- ...tlyMarkAliasAsReferences3x_es5.1.normal.js | 3 +- ...yMarkAliasAsReferences3x_es5.2.minified.js | 3 +- ...MarkAliasAsReferences4x_es2015.1.normal.js | 3 +- ...rkAliasAsReferences4x_es2015.2.minified.js | 3 +- ...tlyMarkAliasAsReferences4x_es5.1.normal.js | 3 +- ...yMarkAliasAsReferences4x_es5.2.minified.js | 3 +- ...rationEmitThisPredicates01_es5.1.normal.js | 3 +- ...tionEmitThisPredicates01_es5.2.minified.js | 3 +- ...redicatesWithPrivateName01_es5.1.normal.js | 3 +- ...dicatesWithPrivateName01_es5.2.minified.js | 3 +- .../declarationFiles_es2015.1.normal.js | 3 +- .../declarationFiles_es5.2.minified.js | 3 +- ...larationsAndAssignments_es2015.1.normal.js | 15 +- ...rationsAndAssignments_es2015.2.minified.js | 12 +- ...declarationsAndAssignments_es5.1.normal.js | 12 +- ...clarationsAndAssignments_es5.2.minified.js | 4 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 3 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 3 +- ...ntOperatorWithAnyOtherType_es5.1.normal.js | 3 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 3 +- ...umTypeInvalidOperations_es2015.1.normal.js | 7 +- ...TypeInvalidOperations_es2015.2.minified.js | 3 +- ...hEnumTypeInvalidOperations_es5.1.normal.js | 7 +- ...numTypeInvalidOperations_es5.2.minified.js | 3 +- ...entOperatorWithEnumType_es2015.1.normal.js | 3 +- ...tOperatorWithEnumType_es2015.2.minified.js | 3 +- ...rementOperatorWithEnumType_es5.1.normal.js | 3 +- ...mentOperatorWithEnumType_es5.2.minified.js | 3 +- ...tOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...mentOperatorWithNumberType_es5.1.normal.js | 3 +- ...ntOperatorWithNumberType_es5.2.minified.js | 3 +- ...portInAwaitExpression01_es2015.1.normal.js | 3 +- ...rtInAwaitExpression01_es2015.2.minified.js | 3 +- ...tExportInAwaitExpression01_es5.1.normal.js | 3 +- ...xportInAwaitExpression01_es5.2.minified.js | 3 +- ...portInAwaitExpression02_es2015.1.normal.js | 3 +- ...rtInAwaitExpression02_es2015.2.minified.js | 3 +- ...tExportInAwaitExpression02_es5.1.normal.js | 3 +- ...xportInAwaitExpression02_es5.2.minified.js | 3 +- ...ltExportWithOverloads01_es2015.1.normal.js | 3 +- ...ExportWithOverloads01_es2015.2.minified.js | 3 +- ...ultExportsCannotMerge01_es2015.1.normal.js | 3 +- ...tExportsCannotMerge01_es2015.2.minified.js | 3 +- ...efaultExportsCannotMerge01_es5.1.normal.js | 3 +- ...aultExportsCannotMerge01_es5.2.minified.js | 3 +- ...ultExportsCannotMerge04_es2015.1.normal.js | 6 +- ...tExportsCannotMerge04_es2015.2.minified.js | 6 +- ...efaultExportsCannotMerge04_es5.1.normal.js | 6 +- ...aultExportsCannotMerge04_es5.2.minified.js | 6 +- ...ltExportsGetExportedAmd_es2015.1.normal.js | 3 +- ...ExportsGetExportedAmd_es2015.2.minified.js | 3 +- ...faultExportsGetExportedAmd_es5.1.normal.js | 3 +- ...ultExportsGetExportedAmd_es5.2.minified.js | 3 +- ...ortsGetExportedCommonjs_es2015.1.normal.js | 3 +- ...tsGetExportedCommonjs_es2015.2.minified.js | 3 +- ...ExportsGetExportedCommonjs_es5.1.normal.js | 3 +- ...portsGetExportedCommonjs_es5.2.minified.js | 3 +- ...xportsGetExportedSystem_es2015.1.normal.js | 3 +- ...ortsGetExportedSystem_es2015.2.minified.js | 3 +- ...ltExportsGetExportedSystem_es5.1.normal.js | 3 +- ...ExportsGetExportedSystem_es5.2.minified.js | 3 +- ...ltExportsGetExportedUmd_es2015.1.normal.js | 3 +- ...ExportsGetExportedUmd_es2015.2.minified.js | 3 +- ...faultExportsGetExportedUmd_es5.1.normal.js | 3 +- ...ultExportsGetExportedUmd_es5.2.minified.js | 3 +- ...ignedClassWithPrototype_es2015.1.normal.js | 9 +- ...nedClassWithPrototype_es2015.2.minified.js | 9 +- ...AssignedClassWithPrototype_es5.1.normal.js | 9 +- ...signedClassWithPrototype_es5.2.minified.js | 9 +- .../defineProperty_es2015.1.normal.js | 3 +- .../defineProperty_es5.1.normal.js | 6 +- .../defineProperty_es5.2.minified.js | 6 +- ...tructorWithoutSuperCall_es2015.1.normal.js | 3 +- ...onstructorWithoutSuperCall_es5.1.normal.js | 3 +- ...structorWithoutSuperCall_es5.2.minified.js | 3 +- ...rridesBaseClassAccessor_es2015.1.normal.js | 3 +- ...OverridesBaseClassAccessor_es5.1.normal.js | 6 +- ...erridesBaseClassAccessor_es5.2.minified.js | 6 +- ...ncludesInheritedMembers_es2015.1.normal.js | 15 +- ...ludesInheritedMembers_es2015.2.minified.js | 15 +- ...ssIncludesInheritedMembers_es5.1.normal.js | 15 +- ...IncludesInheritedMembers_es5.2.minified.js | 15 +- ...ithAssignmentCompatibility_es5.1.normal.js | 3 +- ...hAssignmentCompatibility_es5.2.minified.js | 3 +- ...ivedClassOverridesPrivates_es5.1.normal.js | 3 +- ...edClassOverridesPrivates_es5.2.minified.js | 3 +- ...rridesProtectedMembers2_es2015.1.normal.js | 27 +- ...idesProtectedMembers2_es2015.2.minified.js | 27 +- ...OverridesProtectedMembers2_es5.1.normal.js | 27 +- ...erridesProtectedMembers2_es5.2.minified.js | 27 +- ...rridesProtectedMembers3_es2015.1.normal.js | 27 +- ...OverridesProtectedMembers3_es5.1.normal.js | 27 +- ...erridesProtectedMembers3_es5.2.minified.js | 27 +- ...OverridesProtectedMembers4_es5.1.normal.js | 3 +- ...erridesProtectedMembers4_es5.2.minified.js | 3 +- ...erridesProtectedMembers_es2015.1.normal.js | 27 +- ...sOverridesProtectedMembers_es5.1.normal.js | 27 +- ...verridesProtectedMembers_es5.2.minified.js | 27 +- ...sOverridesPublicMembers_es2015.1.normal.js | 27 +- ...verridesPublicMembers_es2015.2.minified.js | 27 +- ...lassOverridesPublicMembers_es5.1.normal.js | 27 +- ...ssOverridesPublicMembers_es5.2.minified.js | 27 +- ...assOverridesWithoutSubtype_es5.1.normal.js | 3 +- ...sOverridesWithoutSubtype_es5.2.minified.js | 3 +- ...rivedClassTransitivity2_es2015.1.normal.js | 9 +- .../derivedClassTransitivity2_es5.1.normal.js | 12 +- ...erivedClassTransitivity2_es5.2.minified.js | 12 +- ...rivedClassTransitivity3_es2015.1.normal.js | 9 +- .../derivedClassTransitivity3_es5.1.normal.js | 12 +- ...erivedClassTransitivity3_es5.2.minified.js | 12 +- ...rivedClassTransitivity4_es2015.1.normal.js | 9 +- .../derivedClassTransitivity4_es5.1.normal.js | 12 +- ...erivedClassTransitivity4_es5.2.minified.js | 12 +- ...erivedClassTransitivity_es2015.1.normal.js | 9 +- .../derivedClassTransitivity_es5.1.normal.js | 12 +- ...derivedClassTransitivity_es5.2.minified.js | 12 +- .../derivedClassWithAny_es5.1.normal.js | 3 +- .../derivedClassWithAny_es5.2.minified.js | 3 +- ...dowingProtectedInstance_es2015.1.normal.js | 6 +- ...ShadowingProtectedInstance_es5.1.normal.js | 9 +- ...adowingProtectedInstance_es5.2.minified.js | 9 +- ...ShadowingPublicInstance_es2015.1.normal.js | 6 +- ...adowingPublicInstance_es2015.2.minified.js | 6 +- ...nceShadowingPublicInstance_es5.1.normal.js | 9 +- ...eShadowingPublicInstance_es5.2.minified.js | 9 +- ...hadowingProtectedStatic_es2015.1.normal.js | 6 +- ...icShadowingProtectedStatic_es5.1.normal.js | 9 +- ...ShadowingProtectedStatic_es5.2.minified.js | 9 +- ...icShadowingPublicStatic_es2015.1.normal.js | 6 +- ...ShadowingPublicStatic_es2015.2.minified.js | 6 +- ...taticShadowingPublicStatic_es5.1.normal.js | 9 +- ...ticShadowingPublicStatic_es5.2.minified.js | 9 +- ...ithoutExplicitConstructor2_es5.1.normal.js | 3 +- ...houtExplicitConstructor2_es5.2.minified.js | 3 +- ...ithoutExplicitConstructor3_es5.1.normal.js | 3 +- ...houtExplicitConstructor3_es5.2.minified.js | 3 +- ...WithoutExplicitConstructor_es5.1.normal.js | 3 +- ...thoutExplicitConstructor_es5.2.minified.js | 3 +- ...derivedGenericClassWithAny_es5.1.normal.js | 3 +- ...rivedGenericClassWithAny_es5.2.minified.js | 3 +- ...CallViaSuperPropertyAccess_es5.1.normal.js | 3 +- ...llViaSuperPropertyAccess_es5.2.minified.js | 3 +- ...oesNotRequireExtendsClause_es5.1.normal.js | 3 +- ...sNotRequireExtendsClause_es5.2.minified.js | 3 +- ...ngPatternAndAssignment3_es2015.1.normal.js | 9 +- ...uringAssignabilityCheck_es2015.1.normal.js | 9 +- ...ingAssignabilityCheck_es2015.2.minified.js | 9 +- ...ucturingAssignabilityCheck_es5.1.normal.js | 9 +- ...turingAssignabilityCheck_es5.2.minified.js | 9 +- .../destructuringCatch_es2015.1.normal.js | 4 +- .../destructuringCatch_es2015.2.minified.js | 13 +- .../destructuringCatch_es5.1.normal.js | 3 +- .../destructuringCatch_es5.2.minified.js | 6 +- ...estructuringControlFlow_es2015.1.normal.js | 3 +- .../destructuringControlFlow_es5.1.normal.js | 3 +- ...ucturingEvaluationOrder_es2015.1.normal.js | 18 +- ...turingEvaluationOrder_es2015.2.minified.js | 18 +- ...structuringEvaluationOrder_es5.1.normal.js | 18 +- ...ructuringEvaluationOrder_es5.2.minified.js | 18 +- ...PatternWithNestedSpread_es2015.1.normal.js | 9 +- ...tternWithNestedSpread_es2015.2.minified.js | 9 +- ...entPatternWithNestedSpread_es5.1.normal.js | 9 +- ...tPatternWithNestedSpread_es5.2.minified.js | 9 +- ...atternAndAssignment1ES5_es2015.1.normal.js | 3 +- ...ternAndAssignment1ES5_es2015.2.minified.js | 3 +- ...ngPatternAndAssignment1ES5_es5.1.normal.js | 3 +- ...PatternAndAssignment1ES5_es5.2.minified.js | 3 +- ...atternAndAssignment1ES6_es2015.1.normal.js | 3 +- ...ternAndAssignment1ES6_es2015.2.minified.js | 3 +- ...ngPatternAndAssignment1ES6_es5.1.normal.js | 3 +- ...PatternAndAssignment1ES6_es5.2.minified.js | 3 +- ...ngPatternAndAssignment4_es2015.1.normal.js | 3 +- ...PatternAndAssignment4_es2015.2.minified.js | 3 +- ...ndingPatternAndAssignment4_es5.1.normal.js | 3 +- ...ingPatternAndAssignment4_es5.2.minified.js | 3 +- ...ngPatternAndAssignment5_es2015.1.normal.js | 12 +- ...ndingPatternAndAssignment5_es5.1.normal.js | 12 +- ...ndingPatternAndAssignment6_es5.1.normal.js | 3 +- ...ingPatternAndAssignment6_es5.2.minified.js | 3 +- ...ngPatternAndAssignment7_es2015.1.normal.js | 3 +- ...PatternAndAssignment7_es2015.2.minified.js | 3 +- ...ndingPatternAndAssignment7_es5.1.normal.js | 6 +- ...ingPatternAndAssignment7_es5.2.minified.js | 6 +- ...ndingPatternAndAssignment8_es5.1.normal.js | 3 +- ...ingPatternAndAssignment8_es5.2.minified.js | 3 +- ...arameterDeclaration1ES5_es2015.1.normal.js | 96 +- ...ameterDeclaration1ES5_es2015.2.minified.js | 24 +- ...ngParameterDeclaration1ES5_es5.1.normal.js | 18 +- ...ParameterDeclaration1ES5_es5.2.minified.js | 12 +- ...Declaration1ES5iterable_es2015.1.normal.js | 96 +- ...claration1ES5iterable_es2015.2.minified.js | 24 +- ...terDeclaration1ES5iterable_es5.1.normal.js | 18 +- ...rDeclaration1ES5iterable_es5.2.minified.js | 12 +- ...arameterDeclaration1ES6_es2015.1.normal.js | 93 +- ...ameterDeclaration1ES6_es2015.2.minified.js | 24 +- ...ngParameterDeclaration1ES6_es5.1.normal.js | 15 +- ...ParameterDeclaration1ES6_es5.2.minified.js | 12 +- ...arameterDeclaration3ES5_es2015.1.normal.js | 36 +- ...ameterDeclaration3ES5_es2015.2.minified.js | 13 +- ...ngParameterDeclaration3ES5_es5.1.normal.js | 6 +- ...ParameterDeclaration3ES5_es5.2.minified.js | 4 +- ...Declaration3ES5iterable_es2015.1.normal.js | 36 +- ...claration3ES5iterable_es2015.2.minified.js | 13 +- ...terDeclaration3ES5iterable_es5.1.normal.js | 6 +- ...rDeclaration3ES5iterable_es5.2.minified.js | 4 +- ...arameterDeclaration3ES6_es2015.1.normal.js | 36 +- ...ameterDeclaration3ES6_es2015.2.minified.js | 13 +- ...ngParameterDeclaration3ES6_es5.1.normal.js | 6 +- ...ParameterDeclaration3ES6_es5.2.minified.js | 4 +- ...ngParameterDeclaration5_es2015.1.normal.js | 33 +- ...ParameterDeclaration5_es2015.2.minified.js | 30 +- ...uringParameterDeclaration5_es5.1.normal.js | 15 +- ...ingParameterDeclaration5_es5.2.minified.js | 15 +- ...arameterDeclaration7ES5_es2015.1.normal.js | 12 +- ...Declaration7ES5iterable_es2015.1.normal.js | 12 +- ...ngParameterDeclaration8_es2015.1.normal.js | 3 +- ...ParameterDeclaration8_es2015.2.minified.js | 6 +- ...uringParameterDeclaration8_es5.1.normal.js | 3 +- ...ingParameterDeclaration8_es5.2.minified.js | 3 +- .../destructuringSpread_es2015.1.normal.js | 15 +- .../destructuringSpread_es2015.2.minified.js | 15 +- .../destructuringSpread_es5.1.normal.js | 15 +- .../destructuringSpread_es5.2.minified.js | 15 +- ...ithLiteralInitializers2_es2015.1.normal.js | 60 +- ...WithLiteralInitializers_es2015.1.normal.js | 49 +- ...thLiteralInitializers_es2015.2.minified.js | 40 +- ...ingWithLiteralInitializers_es5.1.normal.js | 15 +- ...gWithLiteralInitializers_es5.2.minified.js | 15 +- .../doWhileBreakStatements_es2015.1.normal.js | 3 +- .../doWhileBreakStatements_es5.1.normal.js | 3 +- ...WhileContinueStatements_es2015.1.normal.js | 3 +- .../doWhileContinueStatements_es5.1.normal.js | 3 +- ...licateExportAssignments_es2015.1.normal.js | 6 +- ...cateExportAssignments_es2015.2.minified.js | 6 +- ...duplicateExportAssignments_es5.1.normal.js | 6 +- ...plicateExportAssignments_es5.2.minified.js | 6 +- ...rtiesInTypeAssertions01_es2015.1.normal.js | 3 +- ...opertiesInTypeAssertions01_es5.1.normal.js | 3 +- ...rtiesInTypeAssertions02_es2015.1.normal.js | 3 +- ...opertiesInTypeAssertions02_es5.1.normal.js | 3 +- .../duplicatePropertyNames_es2015.1.normal.js | 18 +- .../duplicatePropertyNames_es5.1.normal.js | 13 +- .../duplicatePropertyNames_es5.2.minified.js | 11 +- ...duplicateStringIndexers_es2015.1.normal.js | 3 +- .../duplicateStringIndexers_es5.1.normal.js | 3 +- .../duplicateStringIndexers_es5.2.minified.js | 3 +- ...mitArrowFunctionAsIsES6_es2015.1.normal.js | 9 +- .../emitArrowFunctionAsIsES6_es5.1.normal.js | 9 +- .../emitArrowFunctionAsIs_es2015.1.normal.js | 9 +- .../emitArrowFunctionAsIs_es5.1.normal.js | 9 +- .../emitArrowFunctionES6_es2015.1.normal.js | 45 +- .../emitArrowFunctionES6_es2015.2.minified.js | 6 +- .../emitArrowFunctionES6_es5.1.normal.js | 9 +- .../emitArrowFunctionES6_es5.2.minified.js | 3 +- ...unctionThisCapturingES6_es2015.1.normal.js | 3 +- ...owFunctionThisCapturingES6_es5.1.normal.js | 3 +- ...owFunctionThisCapturing_es2015.1.normal.js | 3 +- ...ArrowFunctionThisCapturing_es5.1.normal.js | 3 +- ...henUsingArguments01_ES6_es2015.1.normal.js | 3 +- ...onWhenUsingArguments01_ES6_es5.1.normal.js | 3 +- ...ionWhenUsingArguments01_es2015.1.normal.js | 3 +- ...nctionWhenUsingArguments01_es5.1.normal.js | 3 +- .../emitArrowFunction_es2015.1.normal.js | 15 +- .../emitArrowFunction_es2015.2.minified.js | 3 +- .../emitArrowFunction_es5.1.normal.js | 9 +- .../emitArrowFunction_es5.2.minified.js | 3 +- ...itArrowFunctionsAsIsES6_es2015.1.normal.js | 9 +- .../emitArrowFunctionsAsIsES6_es5.1.normal.js | 9 +- .../emitArrowFunctionsAsIs_es2015.1.normal.js | 9 +- .../emitArrowFunctionsAsIs_es5.1.normal.js | 9 +- ...eclarationOverloadInES6_es2015.1.normal.js | 6 +- ...ionWithConstructorInES6_es2015.1.normal.js | 6 +- ...rationWithConstructorInES6_es5.1.normal.js | 3 +- ...tionWithConstructorInES6_es5.2.minified.js | 3 +- ...ionAndTypeArgumentInES6_es2015.1.normal.js | 3 +- ...ensionAndTypeArgumentInES6_es5.1.normal.js | 3 +- ...sionAndTypeArgumentInES6_es5.2.minified.js | 3 +- ...ationWithExtensionInES6_es2015.1.normal.js | 6 +- ...larationWithExtensionInES6_es5.1.normal.js | 6 +- ...rationWithExtensionInES6_es5.2.minified.js | 6 +- ...onWithGetterSetterInES6_es2015.1.normal.js | 15 +- ...ationWithGetterSetterInES6_es5.1.normal.js | 15 +- ...ionWithGetterSetterInES6_es5.2.minified.js | 15 +- ...iteralPropertyNameInES6_es2015.1.normal.js | 12 +- ...eralPropertyNameInES6_es2015.2.minified.js | 12 +- ...thLiteralPropertyNameInES6_es5.1.normal.js | 12 +- ...LiteralPropertyNameInES6_es5.2.minified.js | 12 +- ...larationWithMethodInES6_es2015.1.normal.js | 18 +- ...DeclarationWithMethodInES6_es5.1.normal.js | 18 +- ...clarationWithMethodInES6_es5.2.minified.js | 18 +- ...rtyAccessInHeritageClause1_es5.1.normal.js | 3 +- ...yAccessInHeritageClause1_es5.2.minified.js | 3 +- ...ithPropertyAssignmentInES6_es5.1.normal.js | 3 +- ...hPropertyAssignmentInES6_es5.2.minified.js | 3 +- ...onWithSuperMethodCall01_es2015.1.normal.js | 3 +- ...ationWithSuperMethodCall01_es5.1.normal.js | 6 +- ...ionWithSuperMethodCall01_es5.2.minified.js | 9 +- ...ionWithThisKeywordInES6_es2015.1.normal.js | 3 +- ...nWithThisKeywordInES6_es2015.2.minified.js | 3 +- ...rationWithThisKeywordInES6_es5.1.normal.js | 3 +- ...tionWithThisKeywordInES6_es5.2.minified.js | 3 +- ...ltParametersFunctionES6_es2015.1.normal.js | 12 +- ...rsFunctionExpressionES6_es2015.1.normal.js | 21 +- ...etersFunctionExpression_es2015.1.normal.js | 21 +- ...tersFunctionPropertyES6_es2015.1.normal.js | 12 +- ...ametersFunctionProperty_es2015.1.normal.js | 12 +- ...faultParametersFunction_es2015.1.normal.js | 12 +- ...aultParametersMethodES6_es2015.1.normal.js | 21 +- ...DefaultParametersMethod_es2015.1.normal.js | 21 +- ...stParametersFunctionES6_es2015.1.normal.js | 6 +- ...rsFunctionExpressionES6_es2015.1.normal.js | 12 +- ...etersFunctionExpression_es2015.1.normal.js | 12 +- ...tersFunctionPropertyES6_es2015.1.normal.js | 3 +- ...ametersFunctionProperty_es2015.1.normal.js | 3 +- ...tRestParametersFunction_es2015.1.normal.js | 6 +- ...RestParametersMethodES6_es2015.1.normal.js | 18 +- ...mitRestParametersMethod_es2015.1.normal.js | 18 +- ...eSuperCallWithDefineFields_es5.1.normal.js | 3 +- ...uperCallWithDefineFields_es5.2.minified.js | 3 +- ...tStatementsBeforeSuperCall_es5.1.normal.js | 3 +- ...tatementsBeforeSuperCall_es5.2.minified.js | 3 +- ...ors.classMethods.es2015_es2015.1.normal.js | 9 +- ...rators.classMethods.es2015_es5.1.normal.js | 9 +- ...tors.classMethods.es2015_es5.2.minified.js | 9 +- ...ors.classMethods.es2018_es2015.1.normal.js | 9 +- ...rators.classMethods.es2018_es5.1.normal.js | 9 +- ...tors.classMethods.es2018_es5.2.minified.js | 9 +- ...rators.classMethods.es5_es2015.1.normal.js | 9 +- ...enerators.classMethods.es5_es5.1.normal.js | 9 +- ...erators.classMethods.es5_es5.2.minified.js | 9 +- ...tionDeclarations.es2015_es2015.1.normal.js | 3 +- ...onDeclarations.es2015_es2015.2.minified.js | 3 +- ...tionDeclarations.es2018_es2015.1.normal.js | 3 +- ...onDeclarations.es2018_es2015.2.minified.js | 3 +- ...unctionDeclarations.es5_es2015.1.normal.js | 3 +- ...ctionDeclarations.es5_es2015.2.minified.js | 3 +- ...ctionExpressions.es2015_es2015.1.normal.js | 3 +- ...ionExpressions.es2015_es2015.2.minified.js | 3 +- ...ctionExpressions.es2018_es2015.1.normal.js | 3 +- ...ionExpressions.es2018_es2015.2.minified.js | 3 +- ...functionExpressions.es5_es2015.1.normal.js | 3 +- ...nctionExpressions.es5_es2015.2.minified.js | 3 +- ...ctLiteralMethods.es2015_es2015.1.normal.js | 3 +- ...ctLiteralMethods.es2018_es2015.1.normal.js | 3 +- ...bjectLiteralMethods.es5_es2015.1.normal.js | 3 +- ...r.noCatchBinding.es2019_es2015.1.normal.js | 16 +- ...tter.noCatchBinding.es2019_es5.1.normal.js | 16 +- ...onBindingPatterns01_ES5_es2015.1.normal.js | 23 +- ...BindingPatterns01_ES5_es2015.2.minified.js | 4 +- ...ationBindingPatterns01_ES5_es5.1.normal.js | 5 +- ...ionBindingPatterns01_ES5_es5.2.minified.js | 4 +- ...gPatterns01_ES5iterable_es2015.1.normal.js | 23 +- ...atterns01_ES5iterable_es2015.2.minified.js | 4 +- ...dingPatterns01_ES5iterable_es5.1.normal.js | 5 +- ...ngPatterns01_ES5iterable_es5.2.minified.js | 4 +- ...onBindingPatterns01_ES6_es2015.1.normal.js | 23 +- ...BindingPatterns01_ES6_es2015.2.minified.js | 4 +- ...ationBindingPatterns01_ES6_es5.1.normal.js | 5 +- ...ionBindingPatterns01_ES6_es5.2.minified.js | 4 +- ...ignabilityInInheritance_es2015.1.normal.js | 15 +- ...nabilityInInheritance_es2015.2.minified.js | 11 +- ...AssignabilityInInheritance_es5.1.normal.js | 15 +- ...signabilityInInheritance_es5.2.minified.js | 13 +- .../enumAssignability_es2015.1.normal.js | 9 +- .../enumAssignability_es2015.2.minified.js | 4 +- .../enumAssignability_es5.1.normal.js | 9 +- .../enumAssignability_es5.2.minified.js | 7 +- ...typeOfAnythingButNumber_es2015.1.normal.js | 15 +- ...peOfAnythingButNumber_es2015.2.minified.js | 11 +- ...SubtypeOfAnythingButNumber_es5.1.normal.js | 15 +- ...btypeOfAnythingButNumber_es5.2.minified.js | 13 +- .../enumLiteralTypes1_es2015.1.normal.js | 3 +- .../enumLiteralTypes1_es2015.2.minified.js | 3 +- .../enumLiteralTypes1_es5.1.normal.js | 3 +- .../enumLiteralTypes1_es5.2.minified.js | 3 +- .../enumLiteralTypes2_es2015.1.normal.js | 3 +- .../enumLiteralTypes2_es2015.2.minified.js | 3 +- .../enumLiteralTypes2_es5.1.normal.js | 3 +- .../enumLiteralTypes2_es5.2.minified.js | 3 +- .../enumLiteralTypes3_es2015.1.normal.js | 3 +- .../enumLiteralTypes3_es2015.2.minified.js | 3 +- .../enumLiteralTypes3_es5.1.normal.js | 3 +- .../enumLiteralTypes3_es5.2.minified.js | 3 +- .../enumMergeWithExpando_es2015.1.normal.js | 3 +- .../enumMergeWithExpando_es2015.2.minified.js | 3 +- .../enumMergeWithExpando_es5.1.normal.js | 3 +- .../enumMergeWithExpando_es5.2.minified.js | 3 +- .../enumTagOnExports2_es2015.1.normal.js | 3 +- .../enumTagOnExports2_es2015.2.minified.js | 3 +- .../enumTagOnExports2_es5.1.normal.js | 3 +- .../enumTagOnExports2_es5.2.minified.js | 3 +- .../enumTagOnExports_es2015.1.normal.js | 6 +- .../enumTagOnExports_es2015.2.minified.js | 4 +- .../enumTagOnExports_es5.1.normal.js | 6 +- .../enumTagOnExports_es5.2.minified.js | 4 +- ...numTagUseBeforeDefCrash_es2015.1.normal.js | 3 +- .../enumTagUseBeforeDefCrash_es5.1.normal.js | 3 +- .../equalityStrictNulls_es2015.1.normal.js | 84 +- .../equalityStrictNulls_es5.1.normal.js | 84 +- ...WithIntersectionTypes01_es2015.1.normal.js | 6 +- ...ityWithIntersectionTypes01_es5.1.normal.js | 6 +- ...qualityWithUnionTypes01_es2015.1.normal.js | 6 +- .../equalityWithUnionTypes01_es5.1.normal.js | 6 +- ...rrorSuperPropertyAccess_es2015.1.normal.js | 12 +- ...orSuperPropertyAccess_es2015.2.minified.js | 12 +- .../errorSuperPropertyAccess_es5.1.normal.js | 15 +- ...errorSuperPropertyAccess_es5.2.minified.js | 18 +- ...ulekindWithES2015Target_es2015.1.normal.js | 3 +- ...ekindWithES2015Target_es2015.2.minified.js | 3 +- ...dulekindWithES5Target12_es2015.1.normal.js | 24 +- ...lekindWithES5Target12_es2015.2.minified.js | 14 +- ...6modulekindWithES5Target12_es5.1.normal.js | 24 +- ...odulekindWithES5Target12_es5.2.minified.js | 14 +- ...odulekindWithES5Target2_es2015.1.normal.js | 3 +- ...ulekindWithES5Target2_es2015.2.minified.js | 3 +- ...s6modulekindWithES5Target2_es5.1.normal.js | 3 +- ...modulekindWithES5Target2_es5.2.minified.js | 3 +- ...odulekindWithES5Target5_es2015.1.normal.js | 6 +- ...ulekindWithES5Target5_es2015.2.minified.js | 4 +- ...s6modulekindWithES5Target5_es5.1.normal.js | 6 +- ...modulekindWithES5Target5_es5.2.minified.js | 4 +- ...odulekindWithES5Target6_es2015.1.normal.js | 9 +- ...ulekindWithES5Target6_es2015.2.minified.js | 9 +- ...odulekindWithES5Target7_es2015.1.normal.js | 3 +- ...s6modulekindWithES5Target7_es5.1.normal.js | 3 +- .../es6modulekind_es2015.1.normal.js | 3 +- .../es6modulekind_es2015.2.minified.js | 3 +- ...ulekindWithES2015Target_es2015.1.normal.js | 3 +- ...ekindWithES2015Target_es2015.2.minified.js | 3 +- ...dulekindWithES5Target12_es2015.1.normal.js | 24 +- ...lekindWithES5Target12_es2015.2.minified.js | 14 +- ...tmodulekindWithES5Target12_es5.1.normal.js | 24 +- ...odulekindWithES5Target12_es5.2.minified.js | 14 +- ...odulekindWithES5Target2_es2015.1.normal.js | 3 +- ...ulekindWithES5Target2_es2015.2.minified.js | 3 +- ...xtmodulekindWithES5Target2_es5.1.normal.js | 3 +- ...modulekindWithES5Target2_es5.2.minified.js | 3 +- ...odulekindWithES5Target5_es2015.1.normal.js | 6 +- ...ulekindWithES5Target5_es2015.2.minified.js | 4 +- ...xtmodulekindWithES5Target5_es5.1.normal.js | 6 +- ...modulekindWithES5Target5_es5.2.minified.js | 4 +- ...odulekindWithES5Target6_es2015.1.normal.js | 9 +- ...ulekindWithES5Target6_es2015.2.minified.js | 9 +- ...odulekindWithES5Target7_es2015.1.normal.js | 3 +- ...xtmodulekindWithES5Target7_es5.1.normal.js | 3 +- .../esnextmodulekind_es2015.1.normal.js | 3 +- .../esnextmodulekind_es2015.2.minified.js | 3 +- ...veryTypeAssignableToAny_es2015.1.normal.js | 3 +- ...ryTypeAssignableToAny_es2015.2.minified.js | 3 +- .../everyTypeAssignableToAny_es5.1.normal.js | 3 +- ...everyTypeAssignableToAny_es5.2.minified.js | 3 +- ...nnotationAndInitializer_es2015.1.normal.js | 3 +- ...otationAndInitializer_es2015.2.minified.js | 3 +- ...thAnnotationAndInitializer_es5.1.normal.js | 3 +- ...AnnotationAndInitializer_es5.2.minified.js | 3 +- ...onAndInvalidInitializer_es2015.1.normal.js | 6 +- ...AndInvalidInitializer_es2015.2.minified.js | 6 +- ...ationAndInvalidInitializer_es5.1.normal.js | 6 +- ...ionAndInvalidInitializer_es5.2.minified.js | 6 +- ...veryTypeWithInitializer_es2015.1.normal.js | 3 +- ...ryTypeWithInitializer_es2015.2.minified.js | 3 +- .../everyTypeWithInitializer_es5.1.normal.js | 3 +- ...everyTypeWithInitializer_es5.2.minified.js | 3 +- .../expandoOnAlias_es2015.1.normal.js | 6 +- .../expandoOnAlias_es2015.2.minified.js | 4 +- .../expandoOnAlias_es5.1.normal.js | 6 +- .../expandoOnAlias_es5.2.minified.js | 4 +- ...onOperatorWithEnumUnion_es2015.1.normal.js | 6 +- ...OperatorWithEnumUnion_es2015.2.minified.js | 4 +- ...ationOperatorWithEnumUnion_es5.1.normal.js | 6 +- ...ionOperatorWithEnumUnion_es5.2.minified.js | 4 +- ...tiationOperatorWithEnum_es2015.1.normal.js | 3 +- ...ationOperatorWithEnum_es2015.2.minified.js | 3 +- ...nentiationOperatorWithEnum_es5.1.normal.js | 3 +- ...ntiationOperatorWithEnum_es5.2.minified.js | 3 +- ...atorWithInvalidOperands_es2015.1.normal.js | 3 +- ...orWithInvalidOperands_es2015.2.minified.js | 3 +- ...peratorWithInvalidOperands_es5.1.normal.js | 3 +- ...ratorWithInvalidOperands_es5.2.minified.js | 3 +- ...ValueAndInvalidOperands_es2015.1.normal.js | 6 +- ...ullValueAndInvalidOperands_es5.1.normal.js | 6 +- ...llValueAndValidOperands_es2015.1.normal.js | 3 +- ...ValueAndValidOperands_es2015.2.minified.js | 3 +- ...hNullValueAndValidOperands_es5.1.normal.js | 3 +- ...ullValueAndValidOperands_es5.2.minified.js | 3 +- ...ValueAndInvalidOperands_es2015.1.normal.js | 6 +- ...nedValueAndInvalidOperands_es5.1.normal.js | 6 +- ...edValueAndValidOperands_es2015.1.normal.js | 3 +- ...ValueAndValidOperands_es2015.2.minified.js | 3 +- ...finedValueAndValidOperands_es5.1.normal.js | 3 +- ...nedValueAndValidOperands_es5.2.minified.js | 3 +- ...exportAndImport-es3-amd_es2015.1.normal.js | 3 +- ...portAndImport-es3-amd_es2015.2.minified.js | 3 +- .../exportAndImport-es3-amd_es5.1.normal.js | 3 +- .../exportAndImport-es3-amd_es5.2.minified.js | 3 +- .../exportAndImport-es3_es2015.1.normal.js | 3 +- .../exportAndImport-es3_es2015.2.minified.js | 3 +- .../exportAndImport-es3_es5.1.normal.js | 3 +- .../exportAndImport-es3_es5.2.minified.js | 3 +- ...exportAndImport-es5-amd_es2015.1.normal.js | 3 +- ...portAndImport-es5-amd_es2015.2.minified.js | 3 +- .../exportAndImport-es5-amd_es5.1.normal.js | 3 +- .../exportAndImport-es5-amd_es5.2.minified.js | 3 +- .../exportAndImport-es5_es2015.1.normal.js | 3 +- .../exportAndImport-es5_es2015.2.minified.js | 3 +- .../exportAndImport-es5_es5.1.normal.js | 3 +- .../exportAndImport-es5_es5.2.minified.js | 3 +- ...espace_exportAssignment_es2015.1.normal.js | 3 +- ...pace_exportAssignment_es2015.2.minified.js | 3 +- ...Namespace_exportAssignment_es5.1.normal.js | 3 +- ...mespace_exportAssignment_es5.2.minified.js | 3 +- ...ssignmentAndDeclaration_es2015.1.normal.js | 3 +- ...ignmentAndDeclaration_es2015.2.minified.js | 3 +- ...rtAssignmentAndDeclaration_es5.1.normal.js | 3 +- ...AssignmentAndDeclaration_es5.2.minified.js | 3 +- ...signmentCircularModules_es2015.1.normal.js | 9 +- ...gnmentCircularModules_es2015.2.minified.js | 9 +- ...tAssignmentCircularModules_es5.1.normal.js | 9 +- ...ssignmentCircularModules_es5.2.minified.js | 9 +- ...tConstrainedGenericType_es2015.1.normal.js | 3 +- ...onstrainedGenericType_es2015.2.minified.js | 3 +- ...signmentMergedInterface_es2015.1.normal.js | 3 +- ...tAssignmentMergedInterface_es5.1.normal.js | 3 +- ...tAssignmentMergedModule_es2015.1.normal.js | 9 +- ...ssignmentMergedModule_es2015.2.minified.js | 9 +- ...portAssignmentMergedModule_es5.1.normal.js | 9 +- ...rtAssignmentMergedModule_es5.2.minified.js | 9 +- ...signmentTopLevelClodule_es2015.1.normal.js | 3 +- ...gnmentTopLevelClodule_es2015.2.minified.js | 3 +- ...tAssignmentTopLevelClodule_es5.1.normal.js | 3 +- ...ssignmentTopLevelClodule_es5.2.minified.js | 3 +- ...ignmentTopLevelEnumdule_es2015.1.normal.js | 6 +- ...nmentTopLevelEnumdule_es2015.2.minified.js | 4 +- ...AssignmentTopLevelEnumdule_es5.1.normal.js | 6 +- ...signmentTopLevelEnumdule_es5.2.minified.js | 4 +- ...signmentTopLevelFundule_es2015.1.normal.js | 3 +- ...gnmentTopLevelFundule_es2015.2.minified.js | 3 +- ...tAssignmentTopLevelFundule_es5.1.normal.js | 3 +- ...ssignmentTopLevelFundule_es5.2.minified.js | 3 +- ...nmentTopLevelIdentifier_es2015.1.normal.js | 6 +- ...entTopLevelIdentifier_es2015.2.minified.js | 3 +- ...signmentTopLevelIdentifier_es5.1.normal.js | 6 +- ...gnmentTopLevelIdentifier_es5.2.minified.js | 3 +- .../exportCodeGen_es2015.1.normal.js | 36 +- .../exportCodeGen_es2015.2.minified.js | 20 +- .../exportCodeGen_es5.1.normal.js | 36 +- .../exportCodeGen_es5.2.minified.js | 20 +- ...exportDeclaration_value_es2015.1.normal.js | 6 +- ...portDeclaration_value_es2015.2.minified.js | 3 +- .../exportDeclaration_value_es5.1.normal.js | 6 +- .../exportDeclaration_value_es5.2.minified.js | 3 +- .../exportImportAlias_es2015.1.normal.js | 24 +- .../exportImportAlias_es2015.2.minified.js | 24 +- .../exportImportAlias_es5.1.normal.js | 24 +- .../exportImportAlias_es5.2.minified.js | 22 +- ...exportNestedNamespaces2_es2015.1.normal.js | 3 +- ...portNestedNamespaces2_es2015.2.minified.js | 3 +- .../exportNestedNamespaces2_es5.1.normal.js | 3 +- .../exportNestedNamespaces2_es5.2.minified.js | 3 +- .../exportNestedNamespaces_es2015.1.normal.js | 3 +- ...xportNestedNamespaces_es2015.2.minified.js | 3 +- .../exportNestedNamespaces_es5.1.normal.js | 3 +- .../exportNestedNamespaces_es5.2.minified.js | 3 +- .../exportStar-amd_es2015.1.normal.js | 3 +- .../exportStar-amd_es2015.2.minified.js | 3 +- .../exportStar-amd_es5.1.normal.js | 3 +- .../exportStar-amd_es5.2.minified.js | 3 +- .../exportStar_es2015.1.normal.js | 3 +- .../exportStar_es2015.2.minified.js | 3 +- .../tsc-references/exportStar_es5.1.normal.js | 3 +- .../exportStar_es5.2.minified.js | 3 +- .../exportedAliasedEnumTag_es2015.1.normal.js | 3 +- ...xportedAliasedEnumTag_es2015.2.minified.js | 3 +- .../exportedAliasedEnumTag_es5.1.normal.js | 3 +- .../exportedAliasedEnumTag_es5.2.minified.js | 3 +- .../exportsAndImports1-amd_es2015.1.normal.js | 12 +- ...xportsAndImports1-amd_es2015.2.minified.js | 10 +- .../exportsAndImports1-amd_es5.1.normal.js | 12 +- .../exportsAndImports1-amd_es5.2.minified.js | 10 +- .../exportsAndImports1-es6_es2015.1.normal.js | 12 +- ...xportsAndImports1-es6_es2015.2.minified.js | 10 +- .../exportsAndImports1-es6_es5.1.normal.js | 12 +- .../exportsAndImports1-es6_es5.2.minified.js | 10 +- .../exportsAndImports1_es2015.1.normal.js | 12 +- .../exportsAndImports1_es2015.2.minified.js | 10 +- .../exportsAndImports1_es5.1.normal.js | 12 +- .../exportsAndImports1_es5.2.minified.js | 10 +- .../exportsAndImports3-amd_es2015.1.normal.js | 12 +- ...xportsAndImports3-amd_es2015.2.minified.js | 10 +- .../exportsAndImports3-amd_es5.1.normal.js | 12 +- .../exportsAndImports3-amd_es5.2.minified.js | 10 +- .../exportsAndImports3-es6_es2015.1.normal.js | 12 +- ...xportsAndImports3-es6_es2015.2.minified.js | 10 +- .../exportsAndImports3-es6_es5.1.normal.js | 12 +- .../exportsAndImports3-es6_es5.2.minified.js | 10 +- .../exportsAndImports3_es2015.1.normal.js | 12 +- .../exportsAndImports3_es2015.2.minified.js | 10 +- .../exportsAndImports3_es5.1.normal.js | 12 +- .../exportsAndImports3_es5.2.minified.js | 10 +- ...ImportsWithUnderscores2_es2015.1.normal.js | 3 +- ...portsWithUnderscores2_es2015.2.minified.js | 3 +- ...AndImportsWithUnderscores2_es5.1.normal.js | 3 +- ...dImportsWithUnderscores2_es5.2.minified.js | 3 +- ...dClassExpressionFromModule_es5.1.normal.js | 3 +- ...lassExpressionFromModule_es5.2.minified.js | 3 +- .../extendsTag1_es5.1.normal.js | 6 +- .../extendsTag1_es5.2.minified.js | 6 +- .../extendsTag2_es2015.1.normal.js | 3 +- .../extendsTag2_es5.1.normal.js | 3 +- .../extendsTag2_es5.2.minified.js | 3 +- .../extendsTag3_es2015.1.normal.js | 3 +- .../extendsTag3_es5.1.normal.js | 3 +- .../extendsTag3_es5.2.minified.js | 3 +- .../extendsTag4_es2015.1.normal.js | 3 +- .../extendsTagEmit_es5.1.normal.js | 3 +- .../extendsTagEmit_es5.2.minified.js | 3 +- .../filterNamespace_import_es2015.1.normal.js | 6 +- ...ilterNamespace_import_es2015.2.minified.js | 6 +- .../filterNamespace_import_es5.1.normal.js | 6 +- .../filterNamespace_import_es5.2.minified.js | 6 +- .../fluentClasses_es5.1.normal.js | 3 +- .../fluentClasses_es5.2.minified.js | 3 +- ...inStatementsArrayErrors_es2015.1.normal.js | 9 +- ...or-inStatementsArrayErrors_es5.1.normal.js | 9 +- ...tatementsDestructuring2_es2015.1.normal.js | 3 +- ...StatementsDestructuring_es2015.1.normal.js | 3 +- .../for-inStatements_es2015.1.normal.js | 108 +- .../for-inStatements_es2015.2.minified.js | 18 +- .../for-inStatements_es5.1.normal.js | 111 +- .../for-inStatements_es5.2.minified.js | 21 +- .../for-of10_es2015.1.normal.js | 3 +- .../for-of11_es2015.1.normal.js | 3 +- .../for-of12_es2015.1.normal.js | 3 +- .../for-of13_es2015.1.normal.js | 3 +- .../for-of14_es2015.1.normal.js | 3 +- .../for-of15_es2015.1.normal.js | 3 +- .../for-of16_es2015.1.normal.js | 3 +- .../for-of17_es2015.1.normal.js | 3 +- .../for-of18_es2015.1.normal.js | 3 +- .../tsc-references/for-of1_es2015.1.normal.js | 3 +- .../for-of22_es2015.1.normal.js | 3 +- .../for-of24_es2015.1.normal.js | 3 +- .../for-of25_es2015.1.normal.js | 3 +- .../for-of26_es2015.1.normal.js | 3 +- .../for-of27_es2015.1.normal.js | 3 +- .../for-of28_es2015.1.normal.js | 3 +- .../for-of29_es2015.1.normal.js | 3 +- .../for-of30_es2015.1.normal.js | 3 +- .../for-of31_es2015.1.normal.js | 3 +- .../for-of32_es2015.1.normal.js | 3 +- .../for-of33_es2015.1.normal.js | 3 +- .../for-of34_es2015.1.normal.js | 3 +- .../for-of35_es2015.1.normal.js | 3 +- .../for-of47_es2015.1.normal.js | 3 +- .../for-of47_es2015.2.minified.js | 3 +- .../tsc-references/for-of47_es5.1.normal.js | 3 +- .../tsc-references/for-of47_es5.2.minified.js | 3 +- .../for-of48_es2015.1.normal.js | 3 +- .../for-of48_es2015.2.minified.js | 3 +- .../tsc-references/for-of48_es5.1.normal.js | 3 +- .../tsc-references/for-of48_es5.2.minified.js | 3 +- .../for-of51_es2015.1.normal.js | 3 +- .../for-of52_es2015.1.normal.js | 3 +- .../for-of56_es2015.1.normal.js | 3 +- .../for-of57_es2015.1.normal.js | 3 +- .../tsc-references/for-of7_es2015.1.normal.js | 3 +- .../tsc-references/for-of8_es2015.1.normal.js | 3 +- .../tsc-references/for-of9_es2015.1.normal.js | 6 +- .../forBreakStatements_es2015.1.normal.js | 3 +- .../forBreakStatements_es5.1.normal.js | 3 +- .../forContinueStatements_es2015.1.normal.js | 3 +- .../forContinueStatements_es5.1.normal.js | 3 +- .../forInBreakStatements_es2015.1.normal.js | 32 +- .../forInBreakStatements_es2015.2.minified.js | 25 +- .../forInBreakStatements_es5.1.normal.js | 32 +- .../forInBreakStatements_es5.2.minified.js | 25 +- ...forInContinueStatements_es2015.1.normal.js | 32 +- ...rInContinueStatements_es2015.2.minified.js | 25 +- .../forInContinueStatements_es5.1.normal.js | 32 +- .../forInContinueStatements_es5.2.minified.js | 25 +- ...entsMultipleInvalidDecl_es2015.1.normal.js | 57 +- ...tsMultipleInvalidDecl_es2015.2.minified.js | 3 +- ...tementsMultipleInvalidDecl_es5.1.normal.js | 60 +- ...mentsMultipleInvalidDecl_es5.2.minified.js | 6 +- ...ementsMultipleValidDecl_es2015.1.normal.js | 69 +- ...tatementsMultipleValidDecl_es5.1.normal.js | 69 +- .../forStatements_es2015.1.normal.js | 57 +- .../forStatements_es2015.2.minified.js | 3 +- .../forStatements_es5.1.normal.js | 57 +- .../forStatements_es5.2.minified.js | 3 +- .../forgottenNew_es2015.1.normal.js | 3 +- .../forgottenNew_es2015.2.minified.js | 3 +- .../forgottenNew_es5.1.normal.js | 3 +- .../forgottenNew_es5.2.minified.js | 3 +- ...ConstraintSatisfaction2_es2015.1.normal.js | 6 +- ...nstraintSatisfaction2_es2015.2.minified.js | 4 +- ...ionConstraintSatisfaction2_es5.1.normal.js | 6 +- ...nConstraintSatisfaction2_es5.2.minified.js | 4 +- ...essionContextualTyping1_es2015.1.normal.js | 15 +- ...sionContextualTyping1_es2015.2.minified.js | 3 +- ...xpressionContextualTyping1_es5.1.normal.js | 15 +- ...ressionContextualTyping1_es5.2.minified.js | 6 +- ...ionImplementationErrors_es2015.1.normal.js | 6 +- ...nctionImplementationErrors_es5.1.normal.js | 6 +- ...tionImplementationErrors_es5.2.minified.js | 3 +- ...functionImplementations_es2015.1.normal.js | 3 +- .../functionImplementations_es5.1.normal.js | 6 +- .../functionImplementations_es5.2.minified.js | 3 +- ...ionLiteralForOverloads2_es2015.1.normal.js | 6 +- .../functionNameConflicts_es2015.1.normal.js | 21 +- .../functionNameConflicts_es5.1.normal.js | 21 +- ...ltipleReturnStatements2_es2015.1.normal.js | 12 +- ...hMultipleReturnStatements2_es5.1.normal.js | 12 +- ...ultipleReturnStatements_es2015.1.normal.js | 3 +- ...thMultipleReturnStatements_es5.1.normal.js | 3 +- ...neratedContextualTyping_es2015.1.normal.js | 216 ++-- ...ratedContextualTyping_es2015.2.minified.js | 36 +- .../generatedContextualTyping_es5.1.normal.js | 147 +-- ...eneratedContextualTyping_es5.2.minified.js | 60 +- .../generatorAssignability_es5.1.normal.js | 3 +- .../generatorAssignability_es5.2.minified.js | 3 +- .../generatorImplicitAny_es2015.1.normal.js | 3 +- ...eratorInAmbientContext5_es2015.1.normal.js | 3 +- ...eratorInAmbientContext6_es2015.1.normal.js | 6 +- ...atorInAmbientContext6_es2015.2.minified.js | 4 +- ...generatorInAmbientContext6_es5.1.normal.js | 3 +- ...neratorInAmbientContext6_es5.2.minified.js | 3 +- .../generatorOverloads4_es2015.1.normal.js | 3 +- .../generatorOverloads5_es2015.1.normal.js | 6 +- .../generatorOverloads5_es5.1.normal.js | 3 +- .../generatorOverloads5_es5.2.minified.js | 3 +- ...nTypeInferenceNonStrict_es2015.1.normal.js | 3 +- ...atorReturnTypeInference_es2015.1.normal.js | 3 +- .../generatorTypeCheck17_es5.1.normal.js | 3 +- .../generatorTypeCheck17_es5.2.minified.js | 3 +- .../generatorTypeCheck19_es5.1.normal.js | 3 +- .../generatorTypeCheck19_es5.2.minified.js | 3 +- .../generatorTypeCheck1_es2015.1.normal.js | 3 +- .../generatorTypeCheck21_es5.1.normal.js | 3 +- .../generatorTypeCheck21_es5.2.minified.js | 3 +- .../generatorTypeCheck22_es5.1.normal.js | 3 +- .../generatorTypeCheck22_es5.2.minified.js | 3 +- .../generatorTypeCheck23_es5.1.normal.js | 3 +- .../generatorTypeCheck23_es5.2.minified.js | 3 +- .../generatorTypeCheck24_es5.1.normal.js | 3 +- .../generatorTypeCheck24_es5.2.minified.js | 3 +- .../generatorTypeCheck25_es5.1.normal.js | 3 +- .../generatorTypeCheck25_es5.2.minified.js | 3 +- .../generatorTypeCheck28_es5.1.normal.js | 3 +- .../generatorTypeCheck28_es5.2.minified.js | 3 +- .../generatorTypeCheck2_es2015.1.normal.js | 3 +- .../generatorTypeCheck3_es2015.1.normal.js | 3 +- .../generatorTypeCheck40_es5.1.normal.js | 3 +- .../generatorTypeCheck40_es5.2.minified.js | 3 +- .../generatorTypeCheck41_es5.1.normal.js | 3 +- .../generatorTypeCheck41_es5.2.minified.js | 3 +- .../generatorTypeCheck42_es2015.1.normal.js | 3 +- .../generatorTypeCheck42_es5.1.normal.js | 6 +- .../generatorTypeCheck42_es5.2.minified.js | 6 +- .../generatorTypeCheck43_es2015.1.normal.js | 3 +- .../generatorTypeCheck43_es5.1.normal.js | 3 +- .../generatorTypeCheck43_es5.2.minified.js | 3 +- .../generatorTypeCheck44_es5.1.normal.js | 9 +- .../generatorTypeCheck44_es5.2.minified.js | 7 +- .../generatorTypeCheck45_es5.2.minified.js | 3 +- .../generatorTypeCheck46_es5.1.normal.js | 3 +- .../generatorTypeCheck46_es5.2.minified.js | 6 +- .../generatorTypeCheck47_es2015.1.normal.js | 3 +- .../generatorTypeCheck4_es2015.1.normal.js | 3 +- .../generatorTypeCheck55_es5.1.normal.js | 3 +- .../generatorTypeCheck55_es5.2.minified.js | 3 +- .../generatorTypeCheck5_es2015.1.normal.js | 3 +- .../generatorTypeCheck60_es5.1.normal.js | 3 +- .../generatorTypeCheck60_es5.2.minified.js | 3 +- .../generatorTypeCheck63_es2015.1.normal.js | 3 +- .../generatorTypeCheck63_es2015.2.minified.js | 3 +- .../generatorTypeCheck6_es2015.1.normal.js | 3 +- .../generatorTypeCheck7_es2015.1.normal.js | 3 +- .../generatorTypeCheck8_es2015.1.normal.js | 3 +- .../generatorTypeCheck9_es2015.1.normal.js | 3 +- ...WithOverloadedArguments_es2015.1.normal.js | 18 +- ...thOverloadedArguments_es2015.2.minified.js | 8 +- ...hodWithOverloadedArguments_es5.1.normal.js | 18 +- ...dWithOverloadedArguments_es5.2.minified.js | 8 +- ...TypeArgumentInference_es2015.2.minified.js | 9 +- ...allTypeArgumentInference_es5.2.minified.js | 9 +- ...ypeArgumentInference2_es2015.2.minified.js | 3 +- ...tsTypeArgumentInference2_es5.2.minified.js | 3 +- ...TypeArgumentInference_es2015.2.minified.js | 9 +- ...aintsTypeArgumentInference_es5.1.normal.js | 3 +- ...ntsTypeArgumentInference_es5.2.minified.js | 12 +- ...nctionTypedArguments3_es2015.2.minified.js | 3 +- ...hFunctionTypedArguments3_es5.2.minified.js | 3 +- ...nctionTypedArguments4_es2015.2.minified.js | 3 +- ...hFunctionTypedArguments4_es5.2.minified.js | 3 +- ...ericSignatureArguments2_es2015.1.normal.js | 18 +- ...icSignatureArguments2_es2015.2.minified.js | 20 +- ...GenericSignatureArguments2_es5.1.normal.js | 18 +- ...nericSignatureArguments2_es5.2.minified.js | 22 +- ...ericSignatureArguments3_es2015.1.normal.js | 6 +- ...icSignatureArguments3_es2015.2.minified.js | 10 +- ...GenericSignatureArguments3_es5.1.normal.js | 6 +- ...nericSignatureArguments3_es5.2.minified.js | 10 +- ...ricSignatureArguments_es2015.2.minified.js | 3 +- ...enericSignatureArguments_es5.2.minified.js | 3 +- ...hNonSymmetricSubtypes_es2015.2.minified.js | 3 +- ...WithNonSymmetricSubtypes_es5.2.minified.js | 3 +- ...ricCallWithObjectTypeArgs2_es5.1.normal.js | 3 +- ...cCallWithObjectTypeArgs2_es5.2.minified.js | 3 +- ...peArgsAndConstraints2_es2015.2.minified.js | 3 +- ...ectTypeArgsAndConstraints2_es5.1.normal.js | 3 +- ...tTypeArgsAndConstraints2_es5.2.minified.js | 6 +- ...peArgsAndConstraints3_es2015.2.minified.js | 3 +- ...ectTypeArgsAndConstraints3_es5.1.normal.js | 3 +- ...tTypeArgsAndConstraints3_es5.2.minified.js | 6 +- ...TypeArgsAndConstraints4_es2015.1.normal.js | 17 +- ...peArgsAndConstraints4_es2015.2.minified.js | 9 +- ...ectTypeArgsAndConstraints4_es5.1.normal.js | 17 +- ...tTypeArgsAndConstraints4_es5.2.minified.js | 9 +- ...TypeArgsAndConstraints5_es2015.1.normal.js | 3 +- ...peArgsAndConstraints5_es2015.2.minified.js | 3 +- ...ectTypeArgsAndConstraints5_es5.1.normal.js | 3 +- ...tTypeArgsAndConstraints5_es5.2.minified.js | 3 +- ...ypeArgsAndConstraints_es2015.2.minified.js | 6 +- ...ctTypeArgsAndConstraints_es5.2.minified.js | 6 +- ...TypeArgsAndInitializers_es2015.1.normal.js | 15 +- ...allWithObjectTypeArgs_es2015.2.minified.js | 3 +- ...icCallWithObjectTypeArgs_es5.2.minified.js | 3 +- ...structorTypedArguments2_es2015.1.normal.js | 6 +- ...ructorTypedArguments2_es2015.2.minified.js | 3 +- ...ConstructorTypedArguments2_es5.1.normal.js | 6 +- ...nstructorTypedArguments2_es5.2.minified.js | 3 +- ...nstructorTypedArguments_es2015.1.normal.js | 6 +- ...tructorTypedArguments_es2015.2.minified.js | 6 +- ...dConstructorTypedArguments_es5.1.normal.js | 6 +- ...onstructorTypedArguments_es5.2.minified.js | 6 +- ...FunctionTypedArguments2_es2015.1.normal.js | 6 +- ...nctionTypedArguments2_es2015.2.minified.js | 14 +- ...dedFunctionTypedArguments2_es5.1.normal.js | 6 +- ...dFunctionTypedArguments2_es5.2.minified.js | 14 +- ...dFunctionTypedArguments_es2015.1.normal.js | 6 +- ...unctionTypedArguments_es2015.2.minified.js | 6 +- ...adedFunctionTypedArguments_es5.1.normal.js | 6 +- ...edFunctionTypedArguments_es5.2.minified.js | 6 +- ...enericCallWithTupleType_es2015.1.normal.js | 15 +- ...ericCallWithTupleType_es2015.2.minified.js | 15 +- .../genericCallWithTupleType_es5.1.normal.js | 15 +- ...genericCallWithTupleType_es5.2.minified.js | 15 +- ...cClassExpressionInFunction_es5.1.normal.js | 3 +- ...lassExpressionInFunction_es5.2.minified.js | 3 +- ...ionTypedMemberArguments_es2015.1.normal.js | 6 +- ...nTypedMemberArguments_es2015.2.minified.js | 6 +- ...nctionTypedMemberArguments_es5.1.normal.js | 6 +- ...tionTypedMemberArguments_es5.2.minified.js | 6 +- ...tTypeArgsAndConstraints_es2015.1.normal.js | 6 +- ...ypeArgsAndConstraints_es2015.2.minified.js | 6 +- ...jectTypeArgsAndConstraints_es5.1.normal.js | 6 +- ...ctTypeArgsAndConstraints_es5.2.minified.js | 12 +- .../genericObjectRest_es2015.1.normal.js | 12 +- .../genericObjectRest_es5.1.normal.js | 12 +- .../tsc-references/generic_es2015.1.normal.js | 3 +- .../tsc-references/generic_es5.1.normal.js | 3 +- ...ccessorContextualTyping_es2015.1.normal.js | 12 +- ...etAccessorContextualTyping_es5.1.normal.js | 12 +- ...AccessorContextualTyping_es5.2.minified.js | 12 +- ...erogeneousArrayLiterals_es2015.1.normal.js | 12 +- ...heterogeneousArrayLiterals_es5.1.normal.js | 15 +- ...terogeneousArrayLiterals_es5.2.minified.js | 3 +- .../ifDoWhileStatements_es2015.1.normal.js | 255 ++--- .../ifDoWhileStatements_es2015.2.minified.js | 9 +- .../ifDoWhileStatements_es5.1.normal.js | 258 ++--- .../ifDoWhileStatements_es5.2.minified.js | 12 +- ...ndingClassWithPrivates2_es2015.1.normal.js | 6 +- ...ingClassWithPrivates2_es2015.2.minified.js | 3 +- ...xtendingClassWithPrivates2_es5.1.normal.js | 9 +- ...endingClassWithPrivates2_es5.2.minified.js | 9 +- ...tendingClassWithProtecteds_es5.1.normal.js | 3 +- ...ndingClassWithProtecteds_es5.2.minified.js | 3 +- .../importAliasIdentifiers_es2015.1.normal.js | 9 +- ...mportAliasIdentifiers_es2015.2.minified.js | 3 +- .../importAliasIdentifiers_es5.1.normal.js | 9 +- .../importAliasIdentifiers_es5.2.minified.js | 3 +- ...importNonExternalModule_es2015.1.normal.js | 6 +- ...portNonExternalModule_es2015.2.minified.js | 3 +- .../importNonExternalModule_es5.1.normal.js | 6 +- .../importNonExternalModule_es5.2.minified.js | 3 +- ...ortStatementsInterfaces_es2015.1.normal.js | 9 +- ...tStatementsInterfaces_es2015.2.minified.js | 3 +- ...importStatementsInterfaces_es5.1.normal.js | 9 +- ...portStatementsInterfaces_es5.2.minified.js | 3 +- .../importStatements_es2015.1.normal.js | 12 +- .../importStatements_es2015.2.minified.js | 7 +- .../importStatements_es5.1.normal.js | 12 +- .../importStatements_es5.2.minified.js | 7 +- .../importTypeAmbient_es2015.1.normal.js | 3 +- .../importTypeGenericTypes_es2015.1.normal.js | 6 +- ...mportTypeGenericTypes_es2015.2.minified.js | 6 +- .../importTypeLocalMissing_es2015.1.normal.js | 6 +- ...mportTypeLocalMissing_es2015.2.minified.js | 6 +- .../importTypeLocal_es2015.1.normal.js | 6 +- .../importTypeLocal_es2015.2.minified.js | 6 +- ...tsNotUsedAsValues_error_es2015.1.normal.js | 9 +- ...NotUsedAsValues_error_es2015.2.minified.js | 9 +- ...portsNotUsedAsValues_error_es5.1.normal.js | 9 +- ...rtsNotUsedAsValues_error_es5.2.minified.js | 9 +- ...atorWithInvalidOperands_es2015.1.normal.js | 9 +- ...orWithInvalidOperands_es2015.2.minified.js | 3 +- ...peratorWithInvalidOperands_es5.1.normal.js | 9 +- ...ratorWithInvalidOperands_es5.2.minified.js | 3 +- ...eratorWithValidOperands_es2015.1.normal.js | 3 +- ...nOperatorWithValidOperands_es5.1.normal.js | 3 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 3 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 3 +- ...ntOperatorWithAnyOtherType_es5.1.normal.js | 3 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 3 +- ...umTypeInvalidOperations_es2015.1.normal.js | 7 +- ...TypeInvalidOperations_es2015.2.minified.js | 3 +- ...hEnumTypeInvalidOperations_es5.1.normal.js | 7 +- ...numTypeInvalidOperations_es5.2.minified.js | 3 +- ...entOperatorWithEnumType_es2015.1.normal.js | 3 +- ...tOperatorWithEnumType_es2015.2.minified.js | 3 +- ...rementOperatorWithEnumType_es5.1.normal.js | 3 +- ...mentOperatorWithEnumType_es5.2.minified.js | 3 +- ...tOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...mentOperatorWithNumberType_es5.1.normal.js | 3 +- ...ntOperatorWithNumberType_es5.2.minified.js | 3 +- ...assMembersFromAssignments3_es5.1.normal.js | 3 +- ...sMembersFromAssignments3_es5.2.minified.js | 3 +- ...assMembersFromAssignments4_es5.1.normal.js | 3 +- ...sMembersFromAssignments4_es5.2.minified.js | 3 +- ...assMembersFromAssignments5_es5.1.normal.js | 3 +- ...sMembersFromAssignments5_es5.2.minified.js | 3 +- ...MembersFromAssignments8_es2015.1.normal.js | 3 +- ...mbersFromAssignments8_es2015.2.minified.js | 3 +- ...assMembersFromAssignments8_es5.1.normal.js | 3 +- ...sMembersFromAssignments8_es5.2.minified.js | 3 +- ...cMembersFromAssignments_es2015.1.normal.js | 12 +- ...embersFromAssignments_es2015.2.minified.js | 12 +- ...aticMembersFromAssignments_es5.1.normal.js | 12 +- ...icMembersFromAssignments_es5.2.minified.js | 12 +- ...AssignsToClassPrototype_es2015.1.normal.js | 6 +- ...signsToClassPrototype_es2015.2.minified.js | 6 +- ...berAssignsToClassPrototype_es5.1.normal.js | 6 +- ...rAssignsToClassPrototype_es5.2.minified.js | 6 +- ...sInheritedIntoClassType_es2015.1.normal.js | 12 +- ...nheritedIntoClassType_es2015.2.minified.js | 12 +- ...tiesInheritedIntoClassType_es5.1.normal.js | 15 +- ...esInheritedIntoClassType_es5.2.minified.js | 15 +- ...ancePropertyInClassType_es2015.1.normal.js | 12 +- ...cePropertyInClassType_es2015.2.minified.js | 12 +- ...nstancePropertyInClassType_es5.1.normal.js | 12 +- ...tancePropertyInClassType_es5.2.minified.js | 12 +- ...atorWithInvalidOperands_es2015.1.normal.js | 6 +- ...peratorWithInvalidOperands_es5.1.normal.js | 6 +- ...ratorWithInvalidOperands_es5.2.minified.js | 6 +- ...icTypeWithTypeArguments_es2015.1.normal.js | 3 +- ...TypeWithTypeArguments_es2015.2.minified.js | 3 +- ...nericTypeWithTypeArguments_es5.1.normal.js | 3 +- ...ricTypeWithTypeArguments_es5.2.minified.js | 3 +- .../instantiatedModule_es2015.1.normal.js | 12 +- .../instantiatedModule_es2015.2.minified.js | 12 +- .../instantiatedModule_es5.1.normal.js | 12 +- .../instantiatedModule_es5.2.minified.js | 12 +- ...interfaceExtendingClass_es2015.1.normal.js | 3 +- .../interfaceExtendingClass_es5.1.normal.js | 3 +- .../interfaceExtendingClass_es5.2.minified.js | 3 +- ...bjectIntersectionErrors_es2015.1.normal.js | 3 +- ...ectIntersectionErrors_es2015.2.minified.js | 3 +- ...dsObjectIntersectionErrors_es5.1.normal.js | 6 +- ...ObjectIntersectionErrors_es5.2.minified.js | 6 +- ...tendsObjectIntersection_es2015.1.normal.js | 3 +- ...ndsObjectIntersection_es2015.2.minified.js | 3 +- ...eExtendsObjectIntersection_es5.1.normal.js | 6 +- ...xtendsObjectIntersection_es5.2.minified.js | 6 +- ...WithPropertyOfEveryType_es2015.1.normal.js | 18 +- ...thPropertyOfEveryType_es2015.2.minified.js | 4 +- ...aceWithPropertyOfEveryType_es5.1.normal.js | 18 +- ...eWithPropertyOfEveryType_es5.2.minified.js | 4 +- ...hatIsPrivateInBaseType2_es2015.1.normal.js | 6 +- ...tyThatIsPrivateInBaseType2_es5.1.normal.js | 6 +- ...ThatIsPrivateInBaseType2_es5.2.minified.js | 6 +- ...ctionOfUnionOfUnitTypes_es2015.1.normal.js | 3 +- ...ionOfUnionOfUnitTypes_es2015.2.minified.js | 3 +- ...rsectionOfUnionOfUnitTypes_es5.1.normal.js | 3 +- ...ectionOfUnionOfUnitTypes_es5.2.minified.js | 3 +- ...rsectionReductionStrict_es2015.1.normal.js | 8 +- ...ntersectionReductionStrict_es5.1.normal.js | 8 +- .../intersectionReduction_es2015.1.normal.js | 8 +- .../intersectionReduction_es5.1.normal.js | 8 +- ...sectionsAndEmptyObjects_es2015.1.normal.js | 9 +- ...ctionsAndEmptyObjects_es2015.2.minified.js | 7 +- ...tersectionsAndEmptyObjects_es5.1.normal.js | 9 +- ...rsectionsAndEmptyObjects_es5.2.minified.js | 7 +- ...nvalidAssignmentsToVoid_es2015.1.normal.js | 6 +- ...alidAssignmentsToVoid_es2015.2.minified.js | 6 +- .../invalidAssignmentsToVoid_es5.1.normal.js | 6 +- ...invalidAssignmentsToVoid_es5.2.minified.js | 6 +- ...validBooleanAssignments_es2015.1.normal.js | 6 +- ...lidBooleanAssignments_es2015.2.minified.js | 4 +- .../invalidBooleanAssignments_es5.1.normal.js | 6 +- ...nvalidBooleanAssignments_es5.2.minified.js | 6 +- .../invalidEnumAssignments_es2015.1.normal.js | 9 +- ...nvalidEnumAssignments_es2015.2.minified.js | 4 +- .../invalidEnumAssignments_es5.1.normal.js | 9 +- .../invalidEnumAssignments_es5.2.minified.js | 4 +- ...dImportAliasIdentifiers_es2015.1.normal.js | 3 +- ...mportAliasIdentifiers_es2015.2.minified.js | 3 +- ...alidImportAliasIdentifiers_es5.1.normal.js | 3 +- ...idImportAliasIdentifiers_es5.2.minified.js | 3 +- ...validInstantiatedModule_es2015.1.normal.js | 6 +- ...lidInstantiatedModule_es2015.2.minified.js | 4 +- .../invalidInstantiatedModule_es5.1.normal.js | 6 +- ...nvalidInstantiatedModule_es5.2.minified.js | 4 +- ...pleVariableDeclarations_es2015.1.normal.js | 3 +- ...eVariableDeclarations_es2015.2.minified.js | 3 +- ...ltipleVariableDeclarations_es5.1.normal.js | 6 +- ...ipleVariableDeclarations_es5.2.minified.js | 6 +- .../invalidNestedModules_es2015.1.normal.js | 27 +- .../invalidNestedModules_es2015.2.minified.js | 19 +- .../invalidNestedModules_es5.1.normal.js | 27 +- .../invalidNestedModules_es5.2.minified.js | 25 +- ...nvalidNumberAssignments_es2015.1.normal.js | 3 +- ...alidNumberAssignments_es2015.2.minified.js | 3 +- .../invalidNumberAssignments_es5.1.normal.js | 3 +- ...invalidNumberAssignments_es5.2.minified.js | 3 +- ...invalidReturnStatements_es2015.1.normal.js | 18 +- .../invalidReturnStatements_es5.1.normal.js | 21 +- .../invalidReturnStatements_es5.2.minified.js | 6 +- ...nvalidStringAssignments_es2015.1.normal.js | 6 +- ...alidStringAssignments_es2015.2.minified.js | 4 +- .../invalidStringAssignments_es5.1.normal.js | 6 +- ...invalidStringAssignments_es5.2.minified.js | 4 +- ...lidUndefinedAssignments_es2015.1.normal.js | 9 +- ...dUndefinedAssignments_es2015.2.minified.js | 4 +- ...nvalidUndefinedAssignments_es5.1.normal.js | 9 +- ...alidUndefinedAssignments_es5.2.minified.js | 6 +- .../invalidUndefinedValues_es2015.1.normal.js | 9 +- ...nvalidUndefinedValues_es2015.2.minified.js | 9 +- .../invalidUndefinedValues_es5.1.normal.js | 9 +- .../invalidUndefinedValues_es5.2.minified.js | 9 +- .../invalidVoidAssignments_es2015.1.normal.js | 9 +- ...nvalidVoidAssignments_es2015.2.minified.js | 7 +- .../invalidVoidAssignments_es5.1.normal.js | 9 +- .../invalidVoidAssignments_es5.2.minified.js | 7 +- .../invalidVoidValues_es2015.1.normal.js | 9 +- .../invalidVoidValues_es2015.2.minified.js | 9 +- .../invalidVoidValues_es5.1.normal.js | 9 +- .../invalidVoidValues_es5.2.minified.js | 9 +- ...phicMappedTypeInference_es2015.1.normal.js | 12 +- ...icMappedTypeInference_es2015.2.minified.js | 6 +- ...morphicMappedTypeInference_es5.1.normal.js | 12 +- ...rphicMappedTypeInference_es5.2.minified.js | 6 +- .../iterableArrayPattern10_es2015.1.normal.js | 3 +- ...terableArrayPattern10_es2015.2.minified.js | 3 +- .../iterableArrayPattern10_es5.1.normal.js | 3 +- .../iterableArrayPattern10_es5.2.minified.js | 3 +- .../iterableArrayPattern11_es2015.1.normal.js | 3 +- ...terableArrayPattern11_es2015.2.minified.js | 3 +- .../iterableArrayPattern11_es5.1.normal.js | 3 +- .../iterableArrayPattern11_es5.2.minified.js | 3 +- .../iterableArrayPattern12_es2015.1.normal.js | 3 +- ...terableArrayPattern12_es2015.2.minified.js | 3 +- .../iterableArrayPattern12_es5.1.normal.js | 3 +- .../iterableArrayPattern12_es5.2.minified.js | 3 +- .../iterableArrayPattern13_es2015.1.normal.js | 3 +- ...terableArrayPattern13_es2015.2.minified.js | 3 +- .../iterableArrayPattern13_es5.1.normal.js | 3 +- .../iterableArrayPattern13_es5.2.minified.js | 3 +- .../iterableArrayPattern14_es2015.1.normal.js | 3 +- ...terableArrayPattern14_es2015.2.minified.js | 3 +- .../iterableArrayPattern14_es5.1.normal.js | 3 +- .../iterableArrayPattern14_es5.2.minified.js | 3 +- .../iterableArrayPattern15_es2015.1.normal.js | 3 +- ...terableArrayPattern15_es2015.2.minified.js | 3 +- .../iterableArrayPattern15_es5.1.normal.js | 3 +- .../iterableArrayPattern15_es5.2.minified.js | 3 +- .../iterableArrayPattern16_es2015.1.normal.js | 3 +- ...terableArrayPattern16_es2015.2.minified.js | 3 +- .../iterableArrayPattern16_es5.1.normal.js | 3 +- .../iterableArrayPattern16_es5.2.minified.js | 3 +- .../iterableArrayPattern17_es2015.1.normal.js | 3 +- ...terableArrayPattern17_es2015.2.minified.js | 3 +- .../iterableArrayPattern17_es5.1.normal.js | 3 +- .../iterableArrayPattern17_es5.2.minified.js | 3 +- .../iterableArrayPattern18_es2015.1.normal.js | 3 +- ...terableArrayPattern18_es2015.2.minified.js | 3 +- .../iterableArrayPattern18_es5.1.normal.js | 3 +- .../iterableArrayPattern18_es5.2.minified.js | 3 +- .../iterableArrayPattern19_es2015.1.normal.js | 3 +- ...terableArrayPattern19_es2015.2.minified.js | 3 +- .../iterableArrayPattern19_es5.1.normal.js | 3 +- .../iterableArrayPattern19_es5.2.minified.js | 3 +- .../iterableArrayPattern20_es2015.1.normal.js | 3 +- ...terableArrayPattern20_es2015.2.minified.js | 3 +- .../iterableArrayPattern20_es5.1.normal.js | 3 +- .../iterableArrayPattern20_es5.2.minified.js | 3 +- .../iterableArrayPattern25_es2015.1.normal.js | 3 +- ...terableArrayPattern25_es2015.2.minified.js | 3 +- .../iterableArrayPattern26_es2015.1.normal.js | 3 +- ...terableArrayPattern26_es2015.2.minified.js | 3 +- .../iterableArrayPattern27_es2015.1.normal.js | 3 +- ...terableArrayPattern27_es2015.2.minified.js | 3 +- .../iterableArrayPattern28_es2015.1.normal.js | 3 +- ...terableArrayPattern28_es2015.2.minified.js | 3 +- .../iterableArrayPattern29_es2015.1.normal.js | 3 +- ...terableArrayPattern29_es2015.2.minified.js | 3 +- .../iterableArrayPattern3_es5.1.normal.js | 3 +- .../iterableArrayPattern3_es5.2.minified.js | 3 +- .../iterableArrayPattern4_es5.1.normal.js | 3 +- .../iterableArrayPattern4_es5.2.minified.js | 3 +- .../iterableArrayPattern5_es5.1.normal.js | 3 +- .../iterableArrayPattern5_es5.2.minified.js | 3 +- .../iterableArrayPattern6_es5.1.normal.js | 3 +- .../iterableArrayPattern6_es5.2.minified.js | 3 +- .../iterableArrayPattern7_es5.1.normal.js | 3 +- .../iterableArrayPattern7_es5.2.minified.js | 3 +- .../iterableArrayPattern8_es5.1.normal.js | 3 +- .../iterableArrayPattern8_es5.2.minified.js | 3 +- .../iterableArrayPattern9_es2015.1.normal.js | 3 +- .../iterableArrayPattern9_es5.1.normal.js | 3 +- .../iterableArrayPattern9_es5.2.minified.js | 3 +- .../iteratorSpreadInCall12_es2015.1.normal.js | 3 +- ...teratorSpreadInCall12_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall12_es5.1.normal.js | 3 +- .../iteratorSpreadInCall12_es5.2.minified.js | 3 +- .../iteratorSpreadInCall2_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall2_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall2_es5.1.normal.js | 3 +- .../iteratorSpreadInCall2_es5.2.minified.js | 3 +- .../iteratorSpreadInCall3_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall3_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall4_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall4_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall5_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall5_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall6_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall6_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall8_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall8_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall8_es5.1.normal.js | 3 +- .../iteratorSpreadInCall8_es5.2.minified.js | 3 +- .../iteratorSpreadInCall9_es2015.1.normal.js | 3 +- ...iteratorSpreadInCall9_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall9_es5.1.normal.js | 3 +- .../iteratorSpreadInCall9_es5.2.minified.js | 3 +- .../iteratorSpreadInCall_es2015.1.normal.js | 3 +- .../iteratorSpreadInCall_es2015.2.minified.js | 3 +- .../iteratorSpreadInCall_es5.1.normal.js | 3 +- .../iteratorSpreadInCall_es5.2.minified.js | 3 +- ...ntainerMergeJsContainer_es2015.1.normal.js | 9 +- ...ainerMergeJsContainer_es2015.2.minified.js | 7 +- ...sContainerMergeJsContainer_es5.1.normal.js | 9 +- ...ontainerMergeJsContainer_es5.2.minified.js | 7 +- ...inerMergeTsDeclaration2_es2015.1.normal.js | 3 +- ...erMergeTsDeclaration2_es2015.2.minified.js | 3 +- ...ntainerMergeTsDeclaration2_es5.1.normal.js | 3 +- ...ainerMergeTsDeclaration2_es5.2.minified.js | 3 +- ...inerMergeTsDeclaration3_es2015.1.normal.js | 6 +- ...erMergeTsDeclaration3_es2015.2.minified.js | 6 +- ...ntainerMergeTsDeclaration3_es5.1.normal.js | 6 +- ...ainerMergeTsDeclaration3_es5.2.minified.js | 4 +- ...ainerMergeTsDeclaration_es2015.1.normal.js | 6 +- ...nerMergeTsDeclaration_es2015.2.minified.js | 6 +- ...ontainerMergeTsDeclaration_es5.1.normal.js | 6 +- ...tainerMergeTsDeclaration_es5.2.minified.js | 6 +- ...clarationsClassAccessor_es2015.1.normal.js | 6 +- ...arationsClassAccessor_es2015.2.minified.js | 9 +- ...sDeclarationsClassAccessor_es5.1.normal.js | 3 +- ...eclarationsClassAccessor_es5.2.minified.js | 6 +- ...ionsClassExtendsVisibility_es5.1.normal.js | 3 +- ...nsClassExtendsVisibility_es5.2.minified.js | 3 +- ...tionsClassLikeHeuristic_es2015.1.normal.js | 6 +- ...onsClassLikeHeuristic_es2015.2.minified.js | 4 +- ...arationsClassLikeHeuristic_es5.1.normal.js | 6 +- ...ationsClassLikeHeuristic_es5.2.minified.js | 4 +- ...taticMethodAugmentation_es2015.1.normal.js | 3 +- ...ticMethodAugmentation_es2015.2.minified.js | 3 +- ...ssStaticMethodAugmentation_es5.1.normal.js | 3 +- ...StaticMethodAugmentation_es5.2.minified.js | 3 +- ...DeclarationsClassStatic_es2015.1.normal.js | 6 +- ...clarationsClassStatic_es2015.2.minified.js | 6 +- .../jsDeclarationsClassStatic_es5.1.normal.js | 6 +- ...sDeclarationsClassStatic_es5.2.minified.js | 6 +- .../jsDeclarationsClassesErr_es5.1.normal.js | 3 +- ...jsDeclarationsClassesErr_es5.2.minified.js | 3 +- .../jsDeclarationsClasses_es2015.1.normal.js | 24 +- ...jsDeclarationsClasses_es2015.2.minified.js | 24 +- .../jsDeclarationsClasses_es5.1.normal.js | 21 +- .../jsDeclarationsClasses_es5.2.minified.js | 21 +- ...sDeclarationsComputedNames_es5.1.normal.js | 6 +- ...eclarationsComputedNames_es5.2.minified.js | 6 +- ...larationsCrossfileMerge_es2015.1.normal.js | 3 +- ...rationsCrossfileMerge_es2015.2.minified.js | 3 +- ...DeclarationsCrossfileMerge_es5.1.normal.js | 3 +- ...clarationsCrossfileMerge_es5.2.minified.js | 3 +- .../jsDeclarationsDefault_es2015.1.normal.js | 3 +- ...jsDeclarationsDefault_es2015.2.minified.js | 3 +- .../jsDeclarationsDefault_es5.1.normal.js | 6 +- .../jsDeclarationsDefault_es5.2.minified.js | 6 +- .../jsDeclarationsEnums_es2015.1.normal.js | 41 +- .../jsDeclarationsEnums_es2015.2.minified.js | 11 +- .../jsDeclarationsEnums_es5.1.normal.js | 41 +- .../jsDeclarationsEnums_es5.2.minified.js | 11 +- ...structorFunctionWithSub_es2015.1.normal.js | 3 +- ...ructorFunctionWithSub_es2015.2.minified.js | 3 +- ...ConstructorFunctionWithSub_es5.1.normal.js | 3 +- ...nstructorFunctionWithSub_es5.2.minified.js | 3 +- ...gnedConstructorFunction_es2015.1.normal.js | 3 +- ...edConstructorFunction_es2015.2.minified.js | 3 +- ...ssignedConstructorFunction_es5.1.normal.js | 3 +- ...ignedConstructorFunction_es5.2.minified.js | 3 +- ...xportDefinePropertyEmit_es2015.1.normal.js | 12 +- ...ortDefinePropertyEmit_es2015.2.minified.js | 12 +- ...nsExportDefinePropertyEmit_es5.1.normal.js | 12 +- ...ExportDefinePropertyEmit_es5.2.minified.js | 12 +- ...DeclarationsExportForms_es2015.1.normal.js | 3 +- ...clarationsExportForms_es2015.2.minified.js | 3 +- .../jsDeclarationsExportForms_es5.1.normal.js | 3 +- ...sDeclarationsExportForms_es5.2.minified.js | 3 +- ...ationsExportedClassAliases_es5.1.normal.js | 6 +- ...ionsExportedClassAliases_es5.2.minified.js | 6 +- ...clarationsFunctionJSDoc_es2015.1.normal.js | 6 +- ...arationsFunctionJSDoc_es2015.2.minified.js | 6 +- ...sDeclarationsFunctionJSDoc_es5.1.normal.js | 6 +- ...eclarationsFunctionJSDoc_es5.2.minified.js | 6 +- ...onKeywordPropExhaustive_es2015.1.normal.js | 3 +- ...KeywordPropExhaustive_es2015.2.minified.js | 3 +- ...ctionKeywordPropExhaustive_es5.1.normal.js | 3 +- ...ionKeywordPropExhaustive_es5.2.minified.js | 3 +- ...ionsFunctionKeywordProp_es2015.1.normal.js | 9 +- ...nsFunctionKeywordProp_es2015.2.minified.js | 9 +- ...rationsFunctionKeywordProp_es5.1.normal.js | 9 +- ...tionsFunctionKeywordProp_es5.2.minified.js | 9 +- ...FunctionPrototypeStatic_es2015.1.normal.js | 9 +- ...nctionPrototypeStatic_es2015.2.minified.js | 7 +- ...onsFunctionPrototypeStatic_es5.1.normal.js | 9 +- ...sFunctionPrototypeStatic_es5.2.minified.js | 7 +- ...thDefaultAssignedMember_es2015.1.normal.js | 3 +- ...DefaultAssignedMember_es2015.2.minified.js | 3 +- ...nWithDefaultAssignedMember_es5.1.normal.js | 3 +- ...ithDefaultAssignedMember_es5.2.minified.js | 3 +- ...eclarationsFunctionsCjs_es2015.1.normal.js | 15 +- ...larationsFunctionsCjs_es2015.2.minified.js | 9 +- ...jsDeclarationsFunctionsCjs_es5.1.normal.js | 15 +- ...DeclarationsFunctionsCjs_es5.2.minified.js | 9 +- ...jsDeclarationsFunctions_es2015.1.normal.js | 15 +- ...DeclarationsFunctions_es2015.2.minified.js | 15 +- .../jsDeclarationsFunctions_es5.1.normal.js | 15 +- .../jsDeclarationsFunctions_es5.2.minified.js | 15 +- ...eclarationsGetterSetter_es2015.1.normal.js | 12 +- ...larationsGetterSetter_es2015.2.minified.js | 12 +- ...jsDeclarationsGetterSetter_es5.1.normal.js | 12 +- ...DeclarationsGetterSetter_es5.2.minified.js | 12 +- ...sedWithinNamespaceCjs_es2015.2.minified.js | 6 +- ...xposedWithinNamespaceCjs_es5.2.minified.js | 6 +- ...arationsMissingGenerics_es2015.1.normal.js | 6 +- ...eclarationsMissingGenerics_es5.1.normal.js | 6 +- ...nsMissingTypeParameters_es2015.1.normal.js | 3 +- ...tionsMissingTypeParameters_es5.1.normal.js | 3 +- ...eclarationsNestedParams_es2015.1.normal.js | 6 +- ...gReusesInputNodeInEmit1_es2015.1.normal.js | 3 +- ...eusesInputNodeInEmit1_es2015.2.minified.js | 3 +- ...gReusesInputNodeInEmit2_es2015.1.normal.js | 3 +- ...eusesInputNodeInEmit2_es2015.2.minified.js | 3 +- ...ThisTypeInJSDocFunction_es2015.1.normal.js | 3 +- ...isTypeInJSDocFunction_es2015.2.minified.js | 3 +- ...ithThisTypeInJSDocFunction_es5.1.normal.js | 3 +- ...hThisTypeInJSDocFunction_es5.2.minified.js | 3 +- ...itNoArgumentConstructor_es2015.1.normal.js | 3 +- ...NoArgumentConstructor_es2015.2.minified.js | 3 +- ...licitNoArgumentConstructor_es5.1.normal.js | 3 +- ...citNoArgumentConstructor_es5.2.minified.js | 3 +- ...jsDeclarationsThisTypes_es2015.1.normal.js | 3 +- ...DeclarationsThisTypes_es2015.2.minified.js | 3 +- .../jsDeclarationsThisTypes_es5.1.normal.js | 6 +- .../jsDeclarationsThisTypes_es5.2.minified.js | 6 +- ...arationsTypeReferences3_es2015.1.normal.js | 3 +- ...ationsTypeReferences3_es2015.2.minified.js | 3 +- ...eclarationsTypeReferences3_es5.1.normal.js | 3 +- ...larationsTypeReferences3_es5.2.minified.js | 3 +- ...arationsTypeReferences4_es2015.1.normal.js | 6 +- ...ationsTypeReferences4_es2015.2.minified.js | 4 +- ...eclarationsTypeReferences4_es5.1.normal.js | 6 +- ...larationsTypeReferences4_es5.2.minified.js | 4 +- ...nsTypedefAndImportTypes_es2015.1.normal.js | 3 +- ...TypedefAndImportTypes_es2015.2.minified.js | 3 +- ...tionsTypedefAndImportTypes_es5.1.normal.js | 3 +- ...onsTypedefAndImportTypes_es5.2.minified.js | 3 +- ...ertyAndExportAssignment_es2015.1.normal.js | 6 +- ...tyAndExportAssignment_es2015.2.minified.js | 6 +- ...ropertyAndExportAssignment_es5.1.normal.js | 3 +- ...pertyAndExportAssignment_es5.2.minified.js | 3 +- ...bjectsMarkedAsOpenEnded_es2015.1.normal.js | 18 +- ...ectsMarkedAsOpenEnded_es2015.2.minified.js | 16 +- ...jsObjectsMarkedAsOpenEnded_es5.1.normal.js | 18 +- ...ObjectsMarkedAsOpenEnded_es5.2.minified.js | 16 +- ...formCustomImportPragmax_es2015.1.normal.js | 6 +- ...rmCustomImportPragmax_es2015.2.minified.js | 6 +- ...ansformCustomImportPragmax_es5.1.normal.js | 6 +- ...sformCustomImportPragmax_es5.2.minified.js | 6 +- ...PropCustomImportPragmax_es2015.1.normal.js | 15 +- ...opCustomImportPragmax_es2015.2.minified.js | 15 +- ...KeyPropCustomImportPragmax_es5.1.normal.js | 15 +- ...yPropCustomImportPragmax_es5.2.minified.js | 15 +- ...ormKeyPropCustomImportx_es2015.1.normal.js | 3 +- ...mKeyPropCustomImportx_es2015.2.minified.js | 3 +- ...nsformKeyPropCustomImportx_es5.1.normal.js | 3 +- ...formKeyPropCustomImportx_es5.2.minified.js | 3 +- ...sxsCjsTransformKeyPropx_es2015.1.normal.js | 3 +- ...sCjsTransformKeyPropx_es2015.2.minified.js | 3 +- ...sxJsxsCjsTransformKeyPropx_es5.1.normal.js | 3 +- ...JsxsCjsTransformKeyPropx_es5.2.minified.js | 3 +- .../jsxReactTestSuitex_es2015.1.normal.js | 15 +- .../jsxReactTestSuitex_es2015.2.minified.js | 13 +- .../jsxReactTestSuitex_es5.1.normal.js | 15 +- .../jsxReactTestSuitex_es5.2.minified.js | 13 +- ...rwritesAttributeStrictx_es2015.1.normal.js | 3 +- ...ritesAttributeStrictx_es2015.2.minified.js | 3 +- ...OverwritesAttributeStrictx_es5.1.normal.js | 3 +- ...erwritesAttributeStrictx_es5.2.minified.js | 3 +- .../keyofAndIndexedAccess_es2015.1.normal.js | 24 +- ...keyofAndIndexedAccess_es2015.2.minified.js | 14 +- .../keyofAndIndexedAccess_es5.1.normal.js | 27 +- .../keyofAndIndexedAccess_es5.2.minified.js | 22 +- ...mentDeclarationSupport4_es2015.1.normal.js | 3 +- ...ntDeclarationSupport4_es2015.2.minified.js | 3 +- ...ignmentDeclarationSupport4_es5.1.normal.js | 3 +- ...nmentDeclarationSupport4_es5.2.minified.js | 3 +- ...mentDeclarationSupport5_es2015.1.normal.js | 3 +- ...ntDeclarationSupport5_es2015.2.minified.js | 3 +- ...ignmentDeclarationSupport5_es5.1.normal.js | 6 +- ...nmentDeclarationSupport5_es5.2.minified.js | 6 +- ...mentDeclarationSupport6_es2015.1.normal.js | 3 +- ...ntDeclarationSupport6_es2015.2.minified.js | 3 +- ...ignmentDeclarationSupport6_es5.1.normal.js | 3 +- ...nmentDeclarationSupport6_es5.2.minified.js | 3 +- ...mentDeclarationSupport7_es2015.1.normal.js | 3 +- ...ntDeclarationSupport7_es2015.2.minified.js | 3 +- ...ignmentDeclarationSupport7_es5.1.normal.js | 3 +- ...nmentDeclarationSupport7_es5.2.minified.js | 3 +- .../library-reference-6_es2015.1.normal.js | 3 +- .../library-reference-6_es5.1.normal.js | 3 +- .../literalTypeWidening_es2015.1.normal.js | 18 +- .../literalTypeWidening_es2015.2.minified.js | 6 +- .../literalTypeWidening_es5.1.normal.js | 18 +- .../literalTypeWidening_es5.2.minified.js | 6 +- .../literalTypes2_es2015.1.normal.js | 3 +- .../literalTypes2_es2015.2.minified.js | 3 +- .../literalTypes2_es5.1.normal.js | 3 +- .../literalTypes2_es5.2.minified.js | 3 +- ...alTypesAndDestructuring_es2015.1.normal.js | 3 +- ...TypesAndDestructuring_es2015.2.minified.js | 3 +- ...teralTypesAndDestructuring_es5.1.normal.js | 3 +- ...ralTypesAndDestructuring_es5.2.minified.js | 3 +- .../localTypes1_es2015.1.normal.js | 24 +- .../localTypes1_es5.1.normal.js | 27 +- .../localTypes1_es5.2.minified.js | 9 +- .../logicalAssignment10_es2015.1.normal.js | 3 +- .../logicalAssignment10_es2015.2.minified.js | 3 +- .../logicalAssignment10_es5.1.normal.js | 3 +- .../logicalAssignment10_es5.2.minified.js | 3 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 6 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 9 +- ...otOperatorWithAnyOtherType_es5.1.normal.js | 6 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 9 +- ...OperatorWithBooleanType_es2015.1.normal.js | 3 +- ...eratorWithBooleanType_es2015.2.minified.js | 3 +- ...NotOperatorWithBooleanType_es5.1.normal.js | 3 +- ...tOperatorWithBooleanType_es5.2.minified.js | 3 +- ...NotOperatorWithEnumType_es2015.1.normal.js | 7 +- ...tOperatorWithEnumType_es2015.2.minified.js | 3 +- ...calNotOperatorWithEnumType_es5.1.normal.js | 7 +- ...lNotOperatorWithEnumType_es5.2.minified.js | 3 +- ...tOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...lNotOperatorWithNumberType_es5.1.normal.js | 3 +- ...otOperatorWithNumberType_es5.2.minified.js | 3 +- ...tOperatorWithStringType_es2015.1.normal.js | 3 +- ...peratorWithStringType_es2015.2.minified.js | 3 +- ...lNotOperatorWithStringType_es5.1.normal.js | 3 +- ...otOperatorWithStringType_es5.2.minified.js | 3 +- .../mappedTypeConstraints_es2015.1.normal.js | 9 +- .../mappedTypeConstraints_es5.1.normal.js | 9 +- .../mappedTypeErrors_es2015.1.normal.js | 6 +- .../mappedTypeErrors_es2015.2.minified.js | 6 +- .../mappedTypeErrors_es5.1.normal.js | 6 +- .../mappedTypeErrors_es5.2.minified.js | 6 +- ...erlappingStringEnumKeys_es2015.1.normal.js | 6 +- ...lappingStringEnumKeys_es2015.2.minified.js | 4 +- ...eOverlappingStringEnumKeys_es5.1.normal.js | 6 +- ...verlappingStringEnumKeys_es5.2.minified.js | 4 +- .../mappedTypes2_es2015.1.normal.js | 3 +- .../mappedTypes2_es5.1.normal.js | 3 +- .../mappedTypes4_es2015.1.normal.js | 3 +- .../mappedTypes4_es5.1.normal.js | 3 +- .../mappedTypes6_es2015.1.normal.js | 12 +- .../mappedTypes6_es5.1.normal.js | 12 +- .../mappedTypesAndObjects_es2015.1.normal.js | 6 +- .../mappedTypesAndObjects_es5.1.normal.js | 6 +- .../mappedTypesAndObjects_es5.2.minified.js | 3 +- ...onsWithPrivateOverloads_es2015.1.normal.js | 24 +- ...sWithPrivateOverloads_es2015.2.minified.js | 24 +- ...ctionsWithPrivateOverloads_es5.1.normal.js | 24 +- ...ionsWithPrivateOverloads_es5.2.minified.js | 24 +- ...ionsWithPublicOverloads_es2015.1.normal.js | 24 +- ...nctionsWithPublicOverloads_es5.1.normal.js | 24 +- ...tionsWithPublicOverloads_es5.2.minified.js | 24 +- ...hPublicPrivateOverloads_es2015.1.normal.js | 36 +- ...WithPublicPrivateOverloads_es5.1.normal.js | 36 +- ...thPublicPrivateOverloads_es5.2.minified.js | 36 +- .../mergeThreeInterfaces2_es2015.1.normal.js | 24 +- ...mergeThreeInterfaces2_es2015.2.minified.js | 24 +- .../mergeThreeInterfaces2_es5.1.normal.js | 24 +- .../mergeThreeInterfaces2_es5.2.minified.js | 24 +- .../mergeThreeInterfaces_es2015.1.normal.js | 3 +- .../mergeThreeInterfaces_es2015.2.minified.js | 3 +- .../mergeThreeInterfaces_es5.1.normal.js | 3 +- .../mergeThreeInterfaces_es5.2.minified.js | 3 +- .../mergeTwoInterfaces2_es2015.1.normal.js | 18 +- .../mergeTwoInterfaces2_es2015.2.minified.js | 18 +- .../mergeTwoInterfaces2_es5.1.normal.js | 18 +- .../mergeTwoInterfaces2_es5.2.minified.js | 18 +- .../mergeTwoInterfaces_es2015.1.normal.js | 3 +- .../mergeTwoInterfaces_es2015.2.minified.js | 3 +- .../mergeTwoInterfaces_es5.1.normal.js | 3 +- .../mergeTwoInterfaces_es5.2.minified.js | 3 +- ...InheritedClassInterface_es2015.1.normal.js | 9 +- ...gedInheritedClassInterface_es5.1.normal.js | 12 +- ...dInheritedClassInterface_es5.2.minified.js | 12 +- ...MembersSatisfyAbstractBase_es5.1.normal.js | 3 +- ...mbersSatisfyAbstractBase_es5.2.minified.js | 3 +- ...acesWithInheritedPrivates2_es5.1.normal.js | 3 +- ...esWithInheritedPrivates2_es5.2.minified.js | 3 +- ...sWithInheritedPrivates3_es2015.1.normal.js | 3 +- ...acesWithInheritedPrivates3_es5.1.normal.js | 6 +- ...esWithInheritedPrivates3_es5.2.minified.js | 6 +- ...facesWithMultipleBases2_es2015.1.normal.js | 3 +- ...terfacesWithMultipleBases2_es5.1.normal.js | 3 +- ...rfacesWithMultipleBases2_es5.2.minified.js | 3 +- ...rfacesWithMultipleBases_es2015.1.normal.js | 3 +- ...nterfacesWithMultipleBases_es5.1.normal.js | 3 +- ...erfacesWithMultipleBases_es5.2.minified.js | 3 +- .../methodsReturningThis_es2015.1.normal.js | 3 +- .../methodsReturningThis_es2015.2.minified.js | 3 +- .../methodsReturningThis_es5.1.normal.js | 3 +- .../methodsReturningThis_es5.2.minified.js | 3 +- ...singAndExcessProperties_es2015.1.normal.js | 24 +- ...missingAndExcessProperties_es5.1.normal.js | 24 +- ...ssAssignmentDeclaration_es2015.1.normal.js | 3 +- ...AssignmentDeclaration_es2015.2.minified.js | 3 +- ...ccessAssignmentDeclaration_es5.1.normal.js | 3 +- ...essAssignmentDeclaration_es5.2.minified.js | 3 +- .../mixinAbstractClasses.2_es2015.1.normal.js | 3 +- ...ixinAbstractClasses.2_es2015.2.minified.js | 3 +- .../mixinAbstractClasses.2_es5.1.normal.js | 6 +- .../mixinAbstractClasses.2_es5.2.minified.js | 6 +- ...ssesReturnTypeInference_es2015.1.normal.js | 9 +- ...esReturnTypeInference_es2015.2.minified.js | 9 +- ...ClassesReturnTypeInference_es5.1.normal.js | 12 +- ...assesReturnTypeInference_es5.2.minified.js | 12 +- .../mixinAbstractClasses_es2015.1.normal.js | 9 +- .../mixinAbstractClasses_es2015.2.minified.js | 9 +- .../mixinAbstractClasses_es5.1.normal.js | 12 +- .../mixinAbstractClasses_es5.2.minified.js | 12 +- ...arationMemberInFunction_es2015.1.normal.js | 6 +- ...eclarationMemberInFunction_es5.1.normal.js | 6 +- ...ressionMemberInFunction_es2015.1.normal.js | 3 +- ...ExpressionMemberInFunction_es5.1.normal.js | 3 +- .../moduleExportAlias5_es2015.1.normal.js | 3 +- .../moduleExportAlias5_es2015.2.minified.js | 3 +- .../moduleExportAlias5_es5.1.normal.js | 3 +- .../moduleExportAlias5_es5.2.minified.js | 3 +- ...ElementAccessExpression_es2015.1.normal.js | 3 +- ...ementAccessExpression_es2015.2.minified.js | 3 +- ...iasElementAccessExpression_es5.1.normal.js | 3 +- ...sElementAccessExpression_es5.2.minified.js | 3 +- ...duleExportAliasImported_es2015.1.normal.js | 3 +- ...leExportAliasImported_es2015.2.minified.js | 3 +- .../moduleExportAliasImported_es5.1.normal.js | 3 +- ...oduleExportAliasImported_es5.2.minified.js | 3 +- .../moduleExportAlias_es2015.1.normal.js | 90 +- .../moduleExportAlias_es2015.2.minified.js | 32 +- .../moduleExportAlias_es5.1.normal.js | 90 +- .../moduleExportAlias_es5.2.minified.js | 32 +- ...moduleExportAssignment2_es2015.1.normal.js | 3 +- ...duleExportAssignment2_es2015.2.minified.js | 3 +- .../moduleExportAssignment2_es5.1.normal.js | 3 +- .../moduleExportAssignment2_es5.2.minified.js | 3 +- ...moduleExportAssignment3_es2015.1.normal.js | 3 +- ...duleExportAssignment3_es2015.2.minified.js | 3 +- .../moduleExportAssignment3_es5.1.normal.js | 3 +- .../moduleExportAssignment3_es5.2.minified.js | 3 +- ...moduleExportAssignment5_es2015.1.normal.js | 6 +- ...duleExportAssignment5_es2015.2.minified.js | 6 +- .../moduleExportAssignment5_es5.1.normal.js | 3 +- .../moduleExportAssignment5_es5.2.minified.js | 3 +- .../moduleExportAssignment_es2015.1.normal.js | 3 +- ...oduleExportAssignment_es2015.2.minified.js | 3 +- .../moduleExportAssignment_es5.1.normal.js | 3 +- .../moduleExportAssignment_es5.2.minified.js | 3 +- ...uleExportDuplicateAlias_es2015.1.normal.js | 3 +- ...eExportDuplicateAlias_es2015.2.minified.js | 3 +- ...moduleExportDuplicateAlias_es5.1.normal.js | 3 +- ...duleExportDuplicateAlias_es5.2.minified.js | 3 +- ...eExportNestedNamespaces_es2015.1.normal.js | 3 +- ...xportNestedNamespaces_es2015.2.minified.js | 3 +- ...duleExportNestedNamespaces_es5.1.normal.js | 3 +- ...leExportNestedNamespaces_es5.2.minified.js | 3 +- ...opertyAssignmentDefault_es2015.1.normal.js | 3 +- ...ertyAssignmentDefault_es2015.2.minified.js | 3 +- ...tPropertyAssignmentDefault_es5.1.normal.js | 3 +- ...ropertyAssignmentDefault_es5.2.minified.js | 3 +- ...portPropertyAssignment2_es2015.1.normal.js | 3 +- ...rtPropertyAssignment2_es2015.2.minified.js | 3 +- ...hExportPropertyAssignment2_es5.1.normal.js | 3 +- ...xportPropertyAssignment2_es5.2.minified.js | 3 +- ...xportPropertyAssignment_es2015.1.normal.js | 6 +- ...ortPropertyAssignment_es2015.2.minified.js | 4 +- ...thExportPropertyAssignment_es5.1.normal.js | 6 +- ...ExportPropertyAssignment_es5.2.minified.js | 4 +- ...ElementAccessAssignment_es2015.1.normal.js | 3 +- ...ementAccessAssignment_es2015.2.minified.js | 3 +- ...rtsElementAccessAssignment_es5.1.normal.js | 3 +- ...sElementAccessAssignment_es5.2.minified.js | 3 +- ...thStatementsOfEveryKind_es2015.1.normal.js | 18 +- ...StatementsOfEveryKind_es2015.2.minified.js | 12 +- ...eWithStatementsOfEveryKind_es5.1.normal.js | 21 +- ...ithStatementsOfEveryKind_es5.2.minified.js | 21 +- .../multipleDeclarations_es2015.1.normal.js | 12 +- .../multipleDeclarations_es2015.2.minified.js | 12 +- .../multipleDeclarations_es5.1.normal.js | 12 +- .../multipleDeclarations_es5.2.minified.js | 12 +- ...ultipleDefaultExports01_es2015.1.normal.js | 3 +- ...tipleDefaultExports01_es2015.2.minified.js | 3 +- .../multipleDefaultExports01_es5.1.normal.js | 3 +- ...multipleDefaultExports01_es5.2.minified.js | 3 +- ...ultipleDefaultExports02_es2015.1.normal.js | 6 +- ...tipleDefaultExports02_es2015.2.minified.js | 6 +- .../multipleDefaultExports02_es5.1.normal.js | 6 +- ...multipleDefaultExports02_es5.2.minified.js | 6 +- ...ultipleDefaultExports04_es2015.1.normal.js | 6 +- ...tipleDefaultExports04_es2015.2.minified.js | 6 +- .../multipleDefaultExports04_es5.1.normal.js | 6 +- ...multipleDefaultExports04_es5.2.minified.js | 6 +- .../multipleExportDefault1_es2015.1.normal.js | 3 +- ...ultipleExportDefault1_es2015.2.minified.js | 3 +- .../multipleExportDefault1_es5.1.normal.js | 3 +- .../multipleExportDefault1_es5.2.minified.js | 3 +- .../multipleExportDefault2_es2015.1.normal.js | 3 +- ...ultipleExportDefault2_es2015.2.minified.js | 3 +- .../multipleExportDefault2_es5.1.normal.js | 3 +- .../multipleExportDefault2_es5.2.minified.js | 3 +- .../multipleExportDefault5_es2015.1.normal.js | 3 +- ...ultipleExportDefault5_es2015.2.minified.js | 3 +- .../multipleExportDefault5_es5.1.normal.js | 3 +- .../multipleExportDefault5_es5.2.minified.js | 3 +- .../nameCollision_es2015.1.normal.js | 30 +- .../nameCollision_es2015.2.minified.js | 12 +- .../nameCollision_es5.1.normal.js | 30 +- .../nameCollision_es5.2.minified.js | 13 +- .../nameWithRelativePaths_es2015.1.normal.js | 3 +- ...nameWithRelativePaths_es2015.2.minified.js | 3 +- .../nameWithRelativePaths_es5.1.normal.js | 3 +- .../nameWithRelativePaths_es5.2.minified.js | 3 +- .../namedTupleMembers_es2015.1.normal.js | 3 +- .../namedTupleMembers_es2015.2.minified.js | 3 +- ...ssignmentToRequireAlias_es2015.1.normal.js | 3 +- ...ignmentToRequireAlias_es2015.2.minified.js | 3 +- ...ceAssignmentToRequireAlias_es5.1.normal.js | 3 +- ...AssignmentToRequireAlias_es5.2.minified.js | 3 +- ...ricTypeFromInstanceof01_es2015.1.normal.js | 6 +- ...enericTypeFromInstanceof01_es5.1.normal.js | 6 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 6 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 9 +- ...teOperatorWithAnyOtherType_es5.1.normal.js | 6 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 9 +- ...OperatorWithBooleanType_es2015.1.normal.js | 3 +- ...eratorWithBooleanType_es2015.2.minified.js | 3 +- ...ateOperatorWithBooleanType_es5.1.normal.js | 3 +- ...eOperatorWithBooleanType_es5.2.minified.js | 3 +- ...ateOperatorWithEnumType_es2015.1.normal.js | 7 +- ...eOperatorWithEnumType_es2015.2.minified.js | 3 +- ...negateOperatorWithEnumType_es5.1.normal.js | 7 +- ...gateOperatorWithEnumType_es5.2.minified.js | 3 +- ...eOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...gateOperatorWithNumberType_es5.1.normal.js | 3 +- ...teOperatorWithNumberType_es5.2.minified.js | 3 +- ...eOperatorWithStringType_es2015.1.normal.js | 3 +- ...peratorWithStringType_es2015.2.minified.js | 3 +- ...gateOperatorWithStringType_es5.1.normal.js | 3 +- ...teOperatorWithStringType_es5.2.minified.js | 3 +- ...dDestructuringOfRequire_es2015.1.normal.js | 3 +- ...estructuringOfRequire_es2015.2.minified.js | 3 +- ...stedDestructuringOfRequire_es5.1.normal.js | 3 +- ...edDestructuringOfRequire_es5.2.minified.js | 3 +- .../nestedModules_es2015.1.normal.js | 12 +- .../nestedModules_es2015.2.minified.js | 6 +- .../nestedModules_es5.1.normal.js | 12 +- .../nestedModules_es5.2.minified.js | 6 +- .../nestedNamespace_es2015.1.normal.js | 3 +- .../nestedNamespace_es2015.2.minified.js | 3 +- .../nestedNamespace_es5.1.normal.js | 3 +- .../nestedNamespace_es5.2.minified.js | 3 +- ...stedPrototypeAssignment_es2015.1.normal.js | 6 +- ...edPrototypeAssignment_es2015.2.minified.js | 4 +- .../nestedPrototypeAssignment_es5.1.normal.js | 6 +- ...estedPrototypeAssignment_es5.2.minified.js | 4 +- .../neverTypeErrors1_es2015.1.normal.js | 12 +- .../neverTypeErrors1_es2015.2.minified.js | 3 +- .../neverTypeErrors1_es5.1.normal.js | 9 +- .../neverTypeErrors1_es5.2.minified.js | 3 +- .../neverTypeErrors2_es2015.1.normal.js | 12 +- .../neverTypeErrors2_es2015.2.minified.js | 3 +- .../neverTypeErrors2_es5.1.normal.js | 9 +- .../neverTypeErrors2_es5.2.minified.js | 3 +- .../neverType_es2015.1.normal.js | 12 +- .../tsc-references/neverType_es5.1.normal.js | 12 +- .../newOperatorConformance_es2015.1.normal.js | 9 +- ...ewOperatorConformance_es2015.2.minified.js | 6 +- .../newOperatorConformance_es5.1.normal.js | 3 +- .../newOperatorConformance_es5.2.minified.js | 3 +- ...rrorCases_noImplicitAny_es2015.1.normal.js | 6 +- ...orCases_noImplicitAny_es2015.2.minified.js | 4 +- ...orErrorCases_noImplicitAny_es5.1.normal.js | 6 +- ...ErrorCases_noImplicitAny_es5.2.minified.js | 4 +- .../newTarget.es5_es5.1.normal.js | 3 +- .../newTarget.es5_es5.2.minified.js | 3 +- .../newTarget.es6_es5.1.normal.js | 3 +- .../newTarget.es6_es5.2.minified.js | 3 +- .../newWithSpreadES5_es2015.1.normal.js | 9 +- .../newWithSpreadES5_es2015.2.minified.js | 9 +- .../newWithSpreadES5_es5.1.normal.js | 3 +- .../newWithSpreadES5_es5.2.minified.js | 3 +- .../newWithSpreadES6_es2015.1.normal.js | 9 +- .../newWithSpreadES6_es2015.2.minified.js | 9 +- .../newWithSpreadES6_es5.1.normal.js | 3 +- .../newWithSpreadES6_es5.2.minified.js | 3 +- .../newWithSpread_es2015.1.normal.js | 9 +- .../newWithSpread_es2015.2.minified.js | 9 +- .../newWithSpread_es5.1.normal.js | 3 +- .../newWithSpread_es5.2.minified.js | 3 +- ...exedAccessDestructuring_es2015.1.normal.js | 12 +- ...edAccessDestructuring_es2015.2.minified.js | 12 +- ...IndexedAccessDestructuring_es5.1.normal.js | 12 +- ...dexedAccessDestructuring_es5.2.minified.js | 12 +- ...oUncheckedIndexedAccess_es2015.1.normal.js | 9 +- ...ncheckedIndexedAccess_es2015.2.minified.js | 5 +- .../noUncheckedIndexedAccess_es5.1.normal.js | 9 +- ...noUncheckedIndexedAccess_es5.2.minified.js | 5 +- ...erenceWithTypeArguments_es2015.1.normal.js | 8 +- ...ReferenceWithTypeArguments_es5.1.normal.js | 8 +- .../nonInstantiatedModule_es2015.1.normal.js | 12 +- ...nonInstantiatedModule_es2015.2.minified.js | 10 +- .../nonInstantiatedModule_es5.1.normal.js | 12 +- .../nonInstantiatedModule_es5.2.minified.js | 10 +- ...nonIterableRestElement1_es2015.1.normal.js | 3 +- ...nIterableRestElement1_es2015.2.minified.js | 3 +- .../nonIterableRestElement1_es5.1.normal.js | 3 +- ...nonIterableRestElement2_es2015.1.normal.js | 3 +- ...nIterableRestElement2_es2015.2.minified.js | 3 +- .../nonIterableRestElement2_es5.1.normal.js | 3 +- ...PrimitiveAccessProperty_es2015.1.normal.js | 3 +- ...imitiveAccessProperty_es2015.2.minified.js | 3 +- ...nonPrimitiveAccessProperty_es5.1.normal.js | 3 +- ...nPrimitiveAccessProperty_es5.2.minified.js | 3 +- ...nonPrimitiveAssignError_es2015.1.normal.js | 3 +- ...nPrimitiveAssignError_es2015.2.minified.js | 3 +- .../nonPrimitiveAssignError_es5.1.normal.js | 3 +- .../nonPrimitiveAssignError_es5.2.minified.js | 3 +- .../nonPrimitiveInFunction_es2015.1.normal.js | 6 +- ...onPrimitiveInFunction_es2015.2.minified.js | 6 +- .../nonPrimitiveInFunction_es5.1.normal.js | 6 +- .../nonPrimitiveInFunction_es5.2.minified.js | 6 +- .../nonPrimitiveInGeneric_es2015.1.normal.js | 12 +- ...nonPrimitiveInGeneric_es2015.2.minified.js | 16 +- .../nonPrimitiveInGeneric_es5.1.normal.js | 12 +- .../nonPrimitiveInGeneric_es5.2.minified.js | 16 +- ...veRhsSideOfInExpression_es2015.1.normal.js | 6 +- ...itiveRhsSideOfInExpression_es5.1.normal.js | 6 +- ...llAssignableToEveryType_es2015.1.normal.js | 3 +- ...AssignableToEveryType_es2015.2.minified.js | 3 +- .../nullAssignableToEveryType_es5.1.normal.js | 3 +- ...ullAssignableToEveryType_es5.2.minified.js | 3 +- ...fEverythingButUndefined_es2015.1.normal.js | 24 +- ...verythingButUndefined_es2015.2.minified.js | 10 +- ...peOfEverythingButUndefined_es5.1.normal.js | 24 +- ...OfEverythingButUndefined_es5.2.minified.js | 10 +- ...ishCoalescingOperator12_es2015.1.normal.js | 3 +- ...lishCoalescingOperator6_es2015.1.normal.js | 3 +- ...arameterBindingPattern.2_es5.2.minified.js | 3 +- ...ParameterBindingPattern_es2015.1.normal.js | 3 +- ...InParameterInitializer.2_es5.2.minified.js | 3 +- ...rInParameterInitializer_es2015.1.normal.js | 3 +- ...orInParameterInitializer_es5.2.minified.js | 3 +- .../numberAssignableToEnum_es2015.1.normal.js | 3 +- ...umberAssignableToEnum_es2015.2.minified.js | 3 +- .../numberAssignableToEnum_es5.1.normal.js | 3 +- .../numberAssignableToEnum_es5.2.minified.js | 3 +- ...rainsPropertyDeclarations2_es5.1.normal.js | 3 +- ...insPropertyDeclarations2_es5.2.minified.js | 3 +- ...insPropertyDeclarations_es2015.1.normal.js | 15 +- ...trainsPropertyDeclarations_es5.1.normal.js | 12 +- ...ainsPropertyDeclarations_es5.2.minified.js | 6 +- ...LiteralContextualTyping_es2015.1.normal.js | 3 +- ...teralContextualTyping_es2015.2.minified.js | 3 +- ...ectLiteralContextualTyping_es5.1.normal.js | 3 +- ...tLiteralContextualTyping_es5.2.minified.js | 3 +- .../objectLiteralErrorsES3_es2015.1.normal.js | 6 +- .../objectLiteralErrorsES3_es5.1.normal.js | 6 +- ...iteralGettersAndSetters_es2015.1.normal.js | 24 +- ...ctLiteralGettersAndSetters_es5.1.normal.js | 24 +- ...ectLiteralNormalization_es2015.1.normal.js | 33 +- ...tLiteralNormalization_es2015.2.minified.js | 16 +- ...objectLiteralNormalization_es5.1.normal.js | 33 +- ...jectLiteralNormalization_es5.2.minified.js | 16 +- ...PropertiesAssignmentES6_es2015.1.normal.js | 3 +- ...andPropertiesAssignmentES6_es5.1.normal.js | 3 +- ...opertiesAssignmentError_es2015.1.normal.js | 3 +- ...dPropertiesAssignmentError_es5.1.normal.js | 3 +- ...andPropertiesAssignment_es2015.1.normal.js | 3 +- ...rthandPropertiesAssignment_es5.1.normal.js | 3 +- ...lShorthandPropertiesES6_es2015.1.normal.js | 3 +- ...horthandPropertiesES6_es2015.2.minified.js | 3 +- ...eralShorthandPropertiesES6_es5.1.normal.js | 3 +- ...alShorthandPropertiesES6_es5.2.minified.js | 3 +- ...ertiesFunctionArgument2_es2015.1.normal.js | 3 +- ...ropertiesFunctionArgument2_es5.1.normal.js | 3 +- ...pertiesFunctionArgument_es2015.1.normal.js | 3 +- ...PropertiesFunctionArgument_es5.1.normal.js | 3 +- ...PropertiesWithModuleES6_es2015.1.normal.js | 6 +- ...opertiesWithModuleES6_es2015.2.minified.js | 3 +- ...andPropertiesWithModuleES6_es5.1.normal.js | 6 +- ...dPropertiesWithModuleES6_es5.2.minified.js | 3 +- ...andPropertiesWithModule_es2015.1.normal.js | 6 +- ...dPropertiesWithModule_es2015.2.minified.js | 3 +- ...rthandPropertiesWithModule_es5.1.normal.js | 6 +- ...handPropertiesWithModule_es5.2.minified.js | 3 +- ...eralShorthandProperties_es2015.1.normal.js | 3 +- ...alShorthandProperties_es2015.2.minified.js | 3 +- ...LiteralShorthandProperties_es5.1.normal.js | 3 +- ...teralShorthandProperties_es5.2.minified.js | 3 +- .../objectRest2_es2015.1.normal.js | 6 +- .../objectRest2_es2015.2.minified.js | 6 +- .../objectRest2_es5.1.normal.js | 6 +- .../objectRest2_es5.2.minified.js | 6 +- .../objectRestAssignment_es2015.1.normal.js | 15 +- .../objectRestAssignment_es2015.2.minified.js | 15 +- .../objectRestAssignment_es5.1.normal.js | 15 +- .../objectRestAssignment_es5.2.minified.js | 15 +- .../objectRestCatchES5_es2015.1.normal.js | 12 +- .../objectRestCatchES5_es2015.2.minified.js | 12 +- .../objectRestCatchES5_es5.1.normal.js | 12 +- .../objectRestCatchES5_es5.2.minified.js | 12 +- .../objectRestForOf_es2015.1.normal.js | 15 +- .../objectRestForOf_es2015.2.minified.js | 15 +- .../objectRestForOf_es5.1.normal.js | 15 +- .../objectRestForOf_es5.2.minified.js | 15 +- .../objectRestParameterES5_es2015.1.normal.js | 15 +- ...bjectRestParameterES5_es2015.2.minified.js | 15 +- .../objectRestParameterES5_es5.1.normal.js | 15 +- .../objectRestParameterES5_es5.2.minified.js | 12 +- .../objectRestParameter_es2015.1.normal.js | 15 +- .../objectRestParameter_es2015.2.minified.js | 15 +- .../objectRestParameter_es5.1.normal.js | 15 +- .../objectRestParameter_es5.2.minified.js | 12 +- .../objectRestReadonly_es2015.1.normal.js | 9 +- .../objectRestReadonly_es2015.2.minified.js | 9 +- .../objectRestReadonly_es5.1.normal.js | 9 +- .../objectRestReadonly_es5.2.minified.js | 9 +- .../objectRest_es2015.1.normal.js | 24 +- .../objectRest_es2015.2.minified.js | 24 +- .../tsc-references/objectRest_es5.1.normal.js | 24 +- .../objectRest_es5.2.minified.js | 24 +- ...tSpreadComputedProperty_es2015.1.normal.js | 17 +- ...jectSpreadComputedProperty_es5.1.normal.js | 20 +- ...ectSpreadIndexSignature_es2015.1.normal.js | 15 +- ...tSpreadIndexSignature_es2015.2.minified.js | 13 +- ...objectSpreadIndexSignature_es5.1.normal.js | 15 +- ...jectSpreadIndexSignature_es5.2.minified.js | 13 +- .../objectSpreadNegative_es2015.1.normal.js | 58 +- .../objectSpreadNegative_es2015.2.minified.js | 48 +- .../objectSpreadNegative_es5.1.normal.js | 59 +- .../objectSpreadNegative_es5.2.minified.js | 45 +- ...objectSpreadNoTransform_es2015.1.normal.js | 12 +- ...jectSpreadNoTransform_es2015.2.minified.js | 12 +- .../objectSpreadNoTransform_es5.1.normal.js | 12 +- .../objectSpreadNoTransform_es5.2.minified.js | 12 +- ...preadRepeatedComplexity_es2015.1.normal.js | 6 +- ...ctSpreadRepeatedComplexity_es5.1.normal.js | 6 +- ...adRepeatedNullCheckPerf_es2015.1.normal.js | 6 +- ...RepeatedNullCheckPerf_es2015.2.minified.js | 6 +- ...preadRepeatedNullCheckPerf_es5.1.normal.js | 6 +- ...eadRepeatedNullCheckPerf_es5.2.minified.js | 6 +- ...ctSpreadSetonlyAccessor_es2015.1.normal.js | 9 +- ...SpreadSetonlyAccessor_es2015.2.minified.js | 9 +- ...bjectSpreadSetonlyAccessor_es5.1.normal.js | 9 +- ...ectSpreadSetonlyAccessor_es5.2.minified.js | 9 +- .../objectSpreadStrictNull_es2015.1.normal.js | 33 +- ...bjectSpreadStrictNull_es2015.2.minified.js | 6 +- .../objectSpreadStrictNull_es5.1.normal.js | 33 +- .../objectSpreadStrictNull_es5.2.minified.js | 6 +- .../objectSpread_es2015.1.normal.js | 131 +-- .../objectSpread_es2015.2.minified.js | 51 +- .../objectSpread_es5.1.normal.js | 134 +-- .../objectSpread_es5.2.minified.js | 51 +- ...MembersOfExtendedObject_es2015.1.normal.js | 6 +- ...mbersOfExtendedObject_es2015.2.minified.js | 3 +- ...ingMembersOfExtendedObject_es5.1.normal.js | 9 +- ...gMembersOfExtendedObject_es5.2.minified.js | 9 +- ...ObjectAssignmentCompat2_es2015.1.normal.js | 3 +- ...jectAssignmentCompat2_es2015.2.minified.js | 3 +- ...sOfObjectAssignmentCompat2_es5.1.normal.js | 3 +- ...fObjectAssignmentCompat2_es5.2.minified.js | 3 +- ...fObjectAssignmentCompat_es2015.1.normal.js | 6 +- ...bjectAssignmentCompat_es2015.2.minified.js | 3 +- ...rsOfObjectAssignmentCompat_es5.1.normal.js | 6 +- ...OfObjectAssignmentCompat_es5.2.minified.js | 6 +- ...peHidingMembersOfObject_es2015.1.normal.js | 6 +- ...HidingMembersOfObject_es2015.2.minified.js | 3 +- ...tTypeHidingMembersOfObject_es5.1.normal.js | 6 +- ...ypeHidingMembersOfObject_es5.2.minified.js | 6 +- ...exerHidingObjectIndexer_es2015.1.normal.js | 3 +- ...erHidingObjectIndexer_es2015.2.minified.js | 3 +- ...IndexerHidingObjectIndexer_es5.1.normal.js | 3 +- ...dexerHidingObjectIndexer_es5.2.minified.js | 3 +- .../objectTypesIdentity2_es2015.1.normal.js | 36 +- .../objectTypesIdentity2_es2015.2.minified.js | 3 +- .../objectTypesIdentity2_es5.1.normal.js | 36 +- .../objectTypesIdentity2_es5.2.minified.js | 3 +- ...tityWithCallSignatures2_es2015.1.normal.js | 57 +- ...dentityWithCallSignatures2_es5.1.normal.js | 57 +- ...tityWithCallSignatures3_es2015.1.normal.js | 21 +- ...dentityWithCallSignatures3_es5.1.normal.js | 21 +- ...esDifferingParamCounts2_es2015.1.normal.js | 24 +- ...turesDifferingParamCounts2_es5.1.normal.js | 24 +- ...resDifferingParamCounts_es2015.1.normal.js | 57 +- ...aturesDifferingParamCounts_es5.1.normal.js | 57 +- ...SignaturesWithOverloads_es2015.1.normal.js | 57 +- ...allSignaturesWithOverloads_es5.1.normal.js | 57 +- ...ntityWithCallSignatures_es2015.1.normal.js | 57 +- ...IdentityWithCallSignatures_es5.1.normal.js | 57 +- ...yWithComplexConstraints_es2015.1.normal.js | 3 +- ...tityWithComplexConstraints_es5.1.normal.js | 3 +- ...ithConstructSignatures2_es2015.1.normal.js | 42 +- ...tyWithConstructSignatures2_es5.1.normal.js | 42 +- ...resDifferingParamCounts_es2015.1.normal.js | 42 +- ...aturesDifferingParamCounts_es5.1.normal.js | 42 +- ...WithConstructSignatures_es2015.1.normal.js | 57 +- ...ityWithConstructSignatures_es5.1.normal.js | 48 +- ...hGenericCallSignatures2_es2015.1.normal.js | 57 +- ...WithGenericCallSignatures2_es5.1.normal.js | 57 +- ...DifferingByConstraints2_es2015.1.normal.js | 63 +- ...resDifferingByConstraints2_es5.1.normal.js | 63 +- ...DifferingByConstraints3_es2015.1.normal.js | 63 +- ...resDifferingByConstraints3_es5.1.normal.js | 63 +- ...sDifferingByConstraints_es2015.1.normal.js | 57 +- ...uresDifferingByConstraints_es5.1.normal.js | 57 +- ...sDifferingByReturnType2_es2015.1.normal.js | 57 +- ...uresDifferingByReturnType2_es5.1.normal.js | 57 +- ...esDifferingByReturnType_es2015.1.normal.js | 57 +- ...turesDifferingByReturnType_es5.1.normal.js | 57 +- ...ingTypeParameterCounts2_es2015.1.normal.js | 21 +- ...feringTypeParameterCounts2_es5.1.normal.js | 21 +- ...ringTypeParameterCounts_es2015.1.normal.js | 57 +- ...fferingTypeParameterCounts_es5.1.normal.js | 57 +- ...eringTypeParameterNames_es2015.1.normal.js | 57 +- ...ifferingTypeParameterNames_es5.1.normal.js | 57 +- ...gnaturesOptionalParams2_es2015.1.normal.js | 57 +- ...lSignaturesOptionalParams2_es5.1.normal.js | 57 +- ...gnaturesOptionalParams3_es2015.1.normal.js | 57 +- ...lSignaturesOptionalParams3_es5.1.normal.js | 57 +- ...ignaturesOptionalParams_es2015.1.normal.js | 57 +- ...llSignaturesOptionalParams_es5.1.normal.js | 57 +- ...thGenericCallSignatures_es2015.1.normal.js | 57 +- ...yWithGenericCallSignatures_es5.1.normal.js | 57 +- ...DifferingByConstraints2_es2015.1.normal.js | 45 +- ...resDifferingByConstraints2_es5.1.normal.js | 45 +- ...DifferingByConstraints3_es2015.1.normal.js | 45 +- ...resDifferingByConstraints3_es5.1.normal.js | 45 +- ...sDifferingByConstraints_es2015.1.normal.js | 39 +- ...uresDifferingByConstraints_es5.1.normal.js | 39 +- ...sDifferingByReturnType2_es2015.1.normal.js | 42 +- ...uresDifferingByReturnType2_es5.1.normal.js | 42 +- ...esDifferingByReturnType_es2015.1.normal.js | 45 +- ...turesDifferingByReturnType_es5.1.normal.js | 45 +- ...ringTypeParameterCounts_es2015.1.normal.js | 39 +- ...fferingTypeParameterCounts_es5.1.normal.js | 39 +- ...eringTypeParameterNames_es2015.1.normal.js | 39 +- ...ifferingTypeParameterNames_es5.1.normal.js | 39 +- ...gnaturesOptionalParams2_es2015.1.normal.js | 39 +- ...tSignaturesOptionalParams2_es5.1.normal.js | 39 +- ...gnaturesOptionalParams3_es2015.1.normal.js | 39 +- ...tSignaturesOptionalParams3_es5.1.normal.js | 39 +- ...ignaturesOptionalParams_es2015.1.normal.js | 39 +- ...ctSignaturesOptionalParams_es5.1.normal.js | 39 +- ...ityWithNumericIndexers1_es2015.1.normal.js | 69 +- ...entityWithNumericIndexers1_es5.1.normal.js | 72 +- ...tityWithNumericIndexers1_es5.2.minified.js | 3 +- ...ityWithNumericIndexers2_es2015.1.normal.js | 69 +- ...entityWithNumericIndexers2_es5.1.normal.js | 72 +- ...tityWithNumericIndexers2_es5.2.minified.js | 3 +- ...ityWithNumericIndexers3_es2015.1.normal.js | 69 +- ...entityWithNumericIndexers3_es5.1.normal.js | 72 +- ...tityWithNumericIndexers3_es5.2.minified.js | 3 +- ...IdentityWithOptionality_es2015.1.normal.js | 27 +- ...pesIdentityWithOptionality_es5.1.normal.js | 27 +- ...esIdentityWithPrivates2_es2015.1.normal.js | 18 +- ...IdentityWithPrivates2_es2015.2.minified.js | 3 +- ...TypesIdentityWithPrivates2_es5.1.normal.js | 21 +- ...pesIdentityWithPrivates2_es5.2.minified.js | 6 +- ...TypesIdentityWithPrivates3_es5.1.normal.js | 3 +- ...pesIdentityWithPrivates3_es5.2.minified.js | 3 +- ...pesIdentityWithPrivates_es2015.1.normal.js | 69 +- ...tTypesIdentityWithPrivates_es5.1.normal.js | 72 +- ...ypesIdentityWithPrivates_es5.2.minified.js | 3 +- ...ypesIdentityWithPublics_es2015.1.normal.js | 51 +- ...ctTypesIdentityWithPublics_es5.1.normal.js | 51 +- ...tityWithStringIndexers2_es2015.1.normal.js | 69 +- ...dentityWithStringIndexers2_es5.1.normal.js | 72 +- ...ntityWithStringIndexers2_es5.2.minified.js | 3 +- ...ntityWithStringIndexers_es2015.1.normal.js | 69 +- ...IdentityWithStringIndexers_es5.1.normal.js | 72 +- ...entityWithStringIndexers_es5.2.minified.js | 3 +- .../objectTypesIdentity_es2015.1.normal.js | 51 +- .../objectTypesIdentity_es5.1.normal.js | 51 +- ...orsAndIntersectionTypes_es2015.1.normal.js | 6 +- ...sAndIntersectionTypes_es2015.2.minified.js | 6 +- ...ratorsAndIntersectionTypes_es5.1.normal.js | 6 +- ...torsAndIntersectionTypes_es5.2.minified.js | 6 +- ...ionalBindingParameters1_es2015.1.normal.js | 3 +- ...nalBindingParameters1_es2015.2.minified.js | 3 +- ...ionalBindingParameters2_es2015.1.normal.js | 3 +- ...nalBindingParameters2_es2015.2.minified.js | 3 +- ...gParametersInOverloads1_es2015.1.normal.js | 3 +- ...arametersInOverloads1_es2015.2.minified.js | 3 +- ...gParametersInOverloads2_es2015.1.normal.js | 3 +- ...arametersInOverloads2_es2015.2.minified.js | 3 +- ...arameterBindingPattern.2_es5.2.minified.js | 3 +- ...ParameterBindingPattern_es2015.1.normal.js | 3 +- ...InParameterInitializer.2_es5.2.minified.js | 3 +- ...gInParameterInitializer_es2015.1.normal.js | 3 +- ...ngInParameterInitializer_es5.2.minified.js | 3 +- ...ionalMethodDeclarations_es2015.1.normal.js | 3 +- ...optionalMethodDeclarations_es5.1.normal.js | 3 +- ...tionalMethodDeclarations_es5.2.minified.js | 3 +- .../optionalMethod_es2015.1.normal.js | 3 +- .../optionalMethod_es5.1.normal.js | 3 +- .../optionalMethod_es5.2.minified.js | 3 +- .../optionalMethods_es5.1.normal.js | 3 +- .../optionalMethods_es5.2.minified.js | 3 +- ...lutionClassConstructors_es2015.1.normal.js | 15 +- ...tionClassConstructors_es2015.2.minified.js | 15 +- ...esolutionClassConstructors_es5.1.normal.js | 6 +- ...olutionClassConstructors_es5.2.minified.js | 6 +- ...dResolutionConstructors_es2015.1.normal.js | 3 +- ...esolutionConstructors_es2015.2.minified.js | 3 +- ...loadResolutionConstructors_es5.1.normal.js | 6 +- ...adResolutionConstructors_es5.2.minified.js | 6 +- .../overloadResolution_es2015.1.normal.js | 6 +- .../overloadResolution_es2015.2.minified.js | 12 +- .../overloadResolution_es5.1.normal.js | 9 +- .../overloadResolution_es5.2.minified.js | 15 +- .../overrideInterfaceProperty_es5.1.normal.js | 3 +- ...verrideInterfaceProperty_es5.2.minified.js | 3 +- ...sAddOptionalUndefined_es2015.2.minified.js | 3 +- ...ketsAddOptionalUndefined_es5.2.minified.js | 3 +- ...paramTagTypeResolution2_es2015.1.normal.js | 3 +- .../paramTagTypeResolution2_es5.1.normal.js | 3 +- .../paramTagTypeResolution_es2015.1.normal.js | 3 +- ...aramTagTypeResolution_es2015.2.minified.js | 3 +- .../paramTagTypeResolution_es5.1.normal.js | 3 +- .../paramTagTypeResolution_es5.2.minified.js | 3 +- .../paramTagWrapping_es2015.1.normal.js | 6 +- .../paramTagWrapping_es5.1.normal.js | 6 +- ...zersBackwardReferencing_es2015.1.normal.js | 7 +- ...alizersBackwardReferencing_es5.1.normal.js | 7 +- ...ersForwardReferencing.2_es2015.1.normal.js | 12 +- ...lizersForwardReferencing.2_es5.1.normal.js | 12 +- ...zersForwardReferencing1_es2015.1.normal.js | 3 +- ...ForwardReferencing1_es6_es2015.1.normal.js | 3 +- ...izersForwardReferencing_es2015.1.normal.js | 15 +- ...thesizedContexualTyping1_es5.2.minified.js | 12 +- ...sizedContexualTyping2_es2015.2.minified.js | 3 +- ...thesizedContexualTyping2_es5.2.minified.js | 12 +- ...essibilityAfterStatic11_es2015.1.normal.js | 3 +- ...AccessibilityAfterStatic11_es5.1.normal.js | 3 +- ...cessibilityAfterStatic11_es5.2.minified.js | 3 +- ...essibilityAfterStatic14_es2015.1.normal.js | 3 +- ...AccessibilityAfterStatic14_es5.1.normal.js | 3 +- ...cessibilityAfterStatic14_es5.2.minified.js | 3 +- .../parserAccessors1_es2015.1.normal.js | 3 +- .../parserAccessors1_es5.1.normal.js | 3 +- .../parserAccessors1_es5.2.minified.js | 3 +- .../parserAccessors2_es2015.1.normal.js | 3 +- .../parserAccessors2_es5.1.normal.js | 3 +- .../parserAccessors2_es5.2.minified.js | 3 +- .../parserAccessors3_es2015.1.normal.js | 3 +- .../parserAccessors3_es5.1.normal.js | 3 +- .../parserAccessors4_es2015.1.normal.js | 3 +- .../parserAccessors4_es5.1.normal.js | 3 +- ...uityWithBinaryOperator1_es2015.1.normal.js | 3 +- ...biguityWithBinaryOperator1_es5.1.normal.js | 3 +- ...uityWithBinaryOperator2_es2015.1.normal.js | 3 +- ...biguityWithBinaryOperator2_es5.1.normal.js | 3 +- ...uityWithBinaryOperator3_es2015.1.normal.js | 3 +- ...biguityWithBinaryOperator3_es5.1.normal.js | 3 +- ...uityWithBinaryOperator4_es2015.1.normal.js | 3 +- ...biguityWithBinaryOperator4_es5.1.normal.js | 3 +- ...rrowFunctionExpression4_es2015.1.normal.js | 3 +- ...owFunctionExpression4_es2015.2.minified.js | 3 +- ...erArrowFunctionExpression4_es5.1.normal.js | 3 +- ...rrowFunctionExpression5_es2015.1.normal.js | 4 +- ...owFunctionExpression5_es2015.2.minified.js | 4 +- ...erArrowFunctionExpression5_es5.1.normal.js | 4 +- ...ArrowFunctionExpression5_es5.2.minified.js | 4 +- ...rrowFunctionExpression6_es2015.1.normal.js | 3 +- ...erArrowFunctionExpression6_es5.1.normal.js | 3 +- ...rrowFunctionExpression7_es2015.1.normal.js | 3 +- ...erArrowFunctionExpression7_es5.1.normal.js | 3 +- .../parserAstSpans1_es2015.1.normal.js | 30 +- .../parserAstSpans1_es2015.2.minified.js | 30 +- .../parserAstSpans1_es5.1.normal.js | 33 +- .../parserAstSpans1_es5.2.minified.js | 33 +- .../parserClass1_es2015.1.normal.js | 3 +- .../parserClass1_es2015.2.minified.js | 3 +- .../parserClass1_es5.1.normal.js | 3 +- .../parserClass1_es5.2.minified.js | 3 +- ...arserClassDeclaration11_es2015.1.normal.js | 3 +- .../parserClassDeclaration11_es5.1.normal.js | 3 +- ...parserClassDeclaration11_es5.2.minified.js | 3 +- ...arserClassDeclaration12_es2015.1.normal.js | 3 +- ...arserClassDeclaration13_es2015.1.normal.js | 3 +- .../parserClassDeclaration13_es5.1.normal.js | 3 +- ...parserClassDeclaration13_es5.2.minified.js | 3 +- ...arserClassDeclaration15_es2015.1.normal.js | 3 +- ...arserClassDeclaration16_es2015.1.normal.js | 3 +- .../parserClassDeclaration16_es5.1.normal.js | 3 +- ...parserClassDeclaration16_es5.2.minified.js | 3 +- ...arserClassDeclaration19_es2015.1.normal.js | 3 +- .../parserClassDeclaration19_es5.1.normal.js | 3 +- ...parserClassDeclaration19_es5.2.minified.js | 3 +- ...arserClassDeclaration20_es2015.1.normal.js | 3 +- .../parserClassDeclaration20_es5.1.normal.js | 3 +- ...parserClassDeclaration20_es5.2.minified.js | 3 +- ...arserClassDeclaration21_es2015.1.normal.js | 3 +- .../parserClassDeclaration21_es5.1.normal.js | 3 +- ...parserClassDeclaration21_es5.2.minified.js | 3 +- ...arserClassDeclaration22_es2015.1.normal.js | 3 +- .../parserClassDeclaration22_es5.1.normal.js | 3 +- ...parserClassDeclaration22_es5.2.minified.js | 3 +- ...rCommaInTypeMemberList2_es2015.1.normal.js | 3 +- ...ommaInTypeMemberList2_es2015.2.minified.js | 3 +- ...rserCommaInTypeMemberList2_es5.1.normal.js | 3 +- ...erCommaInTypeMemberList2_es5.2.minified.js | 3 +- ...rComputedPropertyName12_es2015.1.normal.js | 3 +- ...rserComputedPropertyName12_es5.1.normal.js | 3 +- ...erComputedPropertyName12_es5.2.minified.js | 3 +- ...rComputedPropertyName17_es2015.1.normal.js | 3 +- ...rserComputedPropertyName17_es5.1.normal.js | 8 +- ...erComputedPropertyName17_es5.2.minified.js | 8 +- ...rComputedPropertyName24_es2015.1.normal.js | 3 +- ...rserComputedPropertyName24_es5.1.normal.js | 3 +- ...erComputedPropertyName24_es5.2.minified.js | 3 +- ...arserComputedPropertyName2_es5.1.normal.js | 3 +- ...serComputedPropertyName2_es5.2.minified.js | 3 +- ...erComputedPropertyName3_es2015.1.normal.js | 3 +- ...arserComputedPropertyName3_es5.1.normal.js | 4 +- ...serComputedPropertyName3_es5.2.minified.js | 4 +- ...rComputedPropertyName40_es2015.1.normal.js | 3 +- ...rserComputedPropertyName40_es5.1.normal.js | 3 +- ...erComputedPropertyName40_es5.2.minified.js | 3 +- ...rserComputedPropertyName41_es5.1.normal.js | 3 +- ...erComputedPropertyName41_es5.2.minified.js | 3 +- ...erComputedPropertyName4_es2015.1.normal.js | 3 +- ...arserComputedPropertyName4_es5.1.normal.js | 8 +- ...serComputedPropertyName4_es5.2.minified.js | 8 +- ...arserComputedPropertyName6_es5.1.normal.js | 3 +- ...serComputedPropertyName6_es5.2.minified.js | 3 +- ...ConstructorDeclaration1_es2015.1.normal.js | 3 +- ...ConstructorDeclaration5_es2015.1.normal.js | 3 +- .../parserDoStatement2_es2015.1.normal.js | 3 +- .../parserDoStatement2_es5.1.normal.js | 3 +- .../parserES3Accessors1_es2015.1.normal.js | 3 +- .../parserES3Accessors1_es5.1.normal.js | 3 +- .../parserES3Accessors1_es5.2.minified.js | 3 +- .../parserES3Accessors2_es2015.1.normal.js | 3 +- .../parserES3Accessors2_es5.1.normal.js | 3 +- .../parserES3Accessors2_es5.2.minified.js | 3 +- .../parserES3Accessors3_es2015.1.normal.js | 3 +- .../parserES3Accessors3_es5.1.normal.js | 3 +- .../parserES3Accessors4_es2015.1.normal.js | 3 +- .../parserES3Accessors4_es5.1.normal.js | 3 +- ...erES5ComputedPropertyName2_es5.1.normal.js | 3 +- ...ES5ComputedPropertyName2_es5.2.minified.js | 3 +- ...S5ComputedPropertyName3_es2015.1.normal.js | 3 +- ...erES5ComputedPropertyName3_es5.1.normal.js | 4 +- ...ES5ComputedPropertyName3_es5.2.minified.js | 4 +- ...S5ComputedPropertyName4_es2015.1.normal.js | 3 +- ...erES5ComputedPropertyName4_es5.1.normal.js | 8 +- ...ES5ComputedPropertyName4_es5.2.minified.js | 8 +- ...rserES5ForOfStatement10_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement11_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement12_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement13_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement14_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement15_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement16_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement17_es2015.1.normal.js | 3 +- .../parserES5ForOfStatement17_es5.1.normal.js | 3 +- ...rserES5ForOfStatement18_es2015.1.normal.js | 3 +- ...rserES5ForOfStatement19_es2015.1.normal.js | 3 +- .../parserES5ForOfStatement19_es5.1.normal.js | 3 +- ...arserES5ForOfStatement8_es2015.1.normal.js | 3 +- ...arserES5ForOfStatement9_es2015.1.normal.js | 3 +- ...arserES5SymbolProperty7_es2015.1.normal.js | 3 +- .../parserES5SymbolProperty7_es5.1.normal.js | 3 +- ...parserES5SymbolProperty7_es5.2.minified.js | 3 +- .../parserEnum1_es2015.1.normal.js | 3 +- .../parserEnum1_es2015.2.minified.js | 3 +- .../parserEnum1_es5.1.normal.js | 3 +- .../parserEnum1_es5.2.minified.js | 3 +- .../parserEnum2_es2015.1.normal.js | 3 +- .../parserEnum2_es2015.2.minified.js | 3 +- .../parserEnum2_es5.1.normal.js | 3 +- .../parserEnum2_es5.2.minified.js | 3 +- .../parserEnum3_es2015.1.normal.js | 4 +- .../parserEnum3_es5.1.normal.js | 4 +- .../parserEnum6_es2015.1.normal.js | 3 +- .../parserEnum6_es2015.2.minified.js | 3 +- .../parserEnum6_es5.1.normal.js | 3 +- .../parserEnum6_es5.2.minified.js | 3 +- .../parserEnumDeclaration1_es2015.1.normal.js | 3 +- ...arserEnumDeclaration1_es2015.2.minified.js | 3 +- .../parserEnumDeclaration1_es5.1.normal.js | 3 +- .../parserEnumDeclaration1_es5.2.minified.js | 3 +- ...arserEnumDeclaration2.d_es2015.1.normal.js | 4 +- .../parserEnumDeclaration2.d_es5.1.normal.js | 4 +- .../parserEnumDeclaration3_es2015.1.normal.js | 3 +- ...arserEnumDeclaration3_es2015.2.minified.js | 3 +- .../parserEnumDeclaration3_es5.1.normal.js | 3 +- .../parserEnumDeclaration3_es5.2.minified.js | 3 +- .../parserEnumDeclaration5_es2015.1.normal.js | 3 +- ...arserEnumDeclaration5_es2015.2.minified.js | 3 +- .../parserEnumDeclaration5_es5.1.normal.js | 3 +- .../parserEnumDeclaration5_es5.2.minified.js | 3 +- .../parserEnumDeclaration6_es2015.1.normal.js | 3 +- ...arserEnumDeclaration6_es2015.2.minified.js | 3 +- .../parserEnumDeclaration6_es5.1.normal.js | 3 +- .../parserEnumDeclaration6_es5.2.minified.js | 3 +- ...completeMemberVariable1_es2015.1.normal.js | 3 +- ...mpleteMemberVariable1_es2015.2.minified.js | 3 +- ..._IncompleteMemberVariable1_es5.1.normal.js | 3 +- ...ncompleteMemberVariable1_es5.2.minified.js | 3 +- ...Recovery_ParameterList6_es2015.1.normal.js | 3 +- ...rorRecovery_ParameterList6_es5.1.normal.js | 3 +- ...rRecovery_ParameterList6_es5.2.minified.js | 3 +- .../parserForOfStatement10_es2015.1.normal.js | 3 +- .../parserForOfStatement11_es2015.1.normal.js | 3 +- .../parserForOfStatement12_es2015.1.normal.js | 3 +- .../parserForOfStatement13_es2015.1.normal.js | 3 +- .../parserForOfStatement14_es2015.1.normal.js | 3 +- .../parserForOfStatement15_es2015.1.normal.js | 3 +- .../parserForOfStatement16_es2015.1.normal.js | 3 +- .../parserForOfStatement17_es2015.1.normal.js | 3 +- .../parserForOfStatement17_es5.1.normal.js | 3 +- .../parserForOfStatement18_es2015.1.normal.js | 3 +- .../parserForOfStatement19_es2015.1.normal.js | 3 +- .../parserForOfStatement19_es5.1.normal.js | 3 +- .../parserForOfStatement8_es2015.1.normal.js | 3 +- .../parserForOfStatement9_es2015.1.normal.js | 3 +- .../parserForStatement2_es2015.1.normal.js | 3 +- .../parserForStatement2_es5.1.normal.js | 3 +- ...serFunctionDeclaration4_es2015.1.normal.js | 3 +- ...parserFunctionDeclaration4_es5.1.normal.js | 3 +- ...serFunctionDeclaration5_es2015.1.normal.js | 3 +- ...parserFunctionDeclaration5_es5.1.normal.js | 3 +- ...serFunctionDeclaration6_es2015.1.normal.js | 3 +- ...parserFunctionDeclaration6_es5.1.normal.js | 3 +- ...tionPropertyAssignment1_es2015.1.normal.js | 3 +- ...unctionPropertyAssignment1_es5.1.normal.js | 3 +- ...tionPropertyAssignment2_es2015.1.normal.js | 3 +- ...unctionPropertyAssignment2_es5.1.normal.js | 3 +- ...tionPropertyAssignment3_es2015.1.normal.js | 3 +- ...unctionPropertyAssignment3_es5.1.normal.js | 3 +- ...tionPropertyAssignment4_es2015.1.normal.js | 3 +- ...unctionPropertyAssignment4_es5.1.normal.js | 3 +- ...GenericsInTypeContexts1_es2015.1.normal.js | 6 +- ...serGenericsInTypeContexts1_es5.1.normal.js | 9 +- ...rGenericsInTypeContexts1_es5.2.minified.js | 3 +- ...GenericsInTypeContexts2_es2015.1.normal.js | 6 +- ...serGenericsInTypeContexts2_es5.1.normal.js | 9 +- ...rGenericsInTypeContexts2_es5.2.minified.js | 3 +- .../parserIfStatement2_es2015.1.normal.js | 3 +- .../parserIfStatement2_es5.1.normal.js | 3 +- ...InterfaceKeywordInEnum1_es2015.1.normal.js | 3 +- ...terfaceKeywordInEnum1_es2015.2.minified.js | 3 +- ...serInterfaceKeywordInEnum1_es5.1.normal.js | 3 +- ...rInterfaceKeywordInEnum1_es5.2.minified.js | 3 +- ...rInterfaceKeywordInEnum_es2015.1.normal.js | 3 +- ...nterfaceKeywordInEnum_es2015.2.minified.js | 3 +- ...rserInterfaceKeywordInEnum_es5.1.normal.js | 3 +- ...erInterfaceKeywordInEnum_es5.2.minified.js | 3 +- .../parserMemberAccessor1_es2015.1.normal.js | 6 +- .../parserMemberAccessor1_es5.1.normal.js | 6 +- .../parserMemberAccessor1_es5.2.minified.js | 6 +- ...berAccessorDeclaration1_es2015.1.normal.js | 3 +- ...MemberAccessorDeclaration1_es5.1.normal.js | 3 +- ...mberAccessorDeclaration1_es5.2.minified.js | 3 +- ...berAccessorDeclaration2_es2015.1.normal.js | 3 +- ...MemberAccessorDeclaration2_es5.1.normal.js | 3 +- ...mberAccessorDeclaration2_es5.2.minified.js | 3 +- ...berAccessorDeclaration3_es2015.1.normal.js | 3 +- ...MemberAccessorDeclaration3_es5.1.normal.js | 3 +- ...mberAccessorDeclaration3_es5.2.minified.js | 3 +- ...berAccessorDeclaration4_es2015.1.normal.js | 3 +- ...MemberAccessorDeclaration4_es5.1.normal.js | 3 +- ...mberAccessorDeclaration4_es5.2.minified.js | 3 +- ...berAccessorDeclaration5_es2015.1.normal.js | 3 +- ...MemberAccessorDeclaration5_es5.1.normal.js | 3 +- ...mberAccessorDeclaration5_es5.2.minified.js | 3 +- ...berAccessorDeclaration6_es2015.1.normal.js | 3 +- ...MemberAccessorDeclaration6_es5.1.normal.js | 3 +- ...mberAccessorDeclaration6_es5.2.minified.js | 3 +- ...DeclarationAmbiguities1_es2015.1.normal.js | 24 +- ...ionDeclarationAmbiguities1_es5.1.normal.js | 12 +- ...nDeclarationAmbiguities1_es5.2.minified.js | 12 +- .../parserModule1_es2015.1.normal.js | 3 +- .../parserModule1_es2015.2.minified.js | 3 +- .../parserModule1_es5.1.normal.js | 3 +- .../parserModule1_es5.2.minified.js | 3 +- ...fterFunctionExpression1_es2015.1.normal.js | 3 +- ...llAfterFunctionExpression1_es5.1.normal.js | 3 +- .../parserNotRegex2_es2015.1.normal.js | 4 +- .../parserNotRegex2_es2015.2.minified.js | 4 +- .../parserNotRegex2_es5.1.normal.js | 4 +- .../parserNotRegex2_es5.2.minified.js | 4 +- .../parserParameterList12_es2015.1.normal.js | 3 +- .../parserParameterList12_es5.1.normal.js | 3 +- ...bleAndFunctionInTernary_es2015.1.normal.js | 3 +- ...riableAndFunctionInTernary_es5.1.normal.js | 3 +- .../parserRealSource12_es2015.1.normal.js | 6 +- .../parserRealSource12_es2015.2.minified.js | 12 +- .../parserRealSource12_es5.1.normal.js | 6 +- .../parserRealSource12_es5.2.minified.js | 12 +- .../parserRealSource13_es2015.1.normal.js | 6 +- .../parserRealSource13_es2015.2.minified.js | 4 +- .../parserRealSource13_es5.1.normal.js | 6 +- .../parserRealSource13_es5.2.minified.js | 4 +- .../parserRealSource14_es2015.1.normal.js | 6 +- .../parserRealSource14_es2015.2.minified.js | 6 +- .../parserRealSource14_es5.1.normal.js | 6 +- .../parserRealSource14_es5.2.minified.js | 6 +- .../parserRealSource1_es2015.1.normal.js | 9 +- .../parserRealSource1_es2015.2.minified.js | 7 +- .../parserRealSource1_es5.1.normal.js | 9 +- .../parserRealSource1_es5.2.minified.js | 9 +- .../parserRealSource2_es2015.1.normal.js | 45 +- .../parserRealSource2_es2015.2.minified.js | 45 +- .../parserRealSource2_es5.1.normal.js | 45 +- .../parserRealSource2_es5.2.minified.js | 21 +- .../parserRealSource3_es2015.1.normal.js | 6 +- .../parserRealSource3_es2015.2.minified.js | 6 +- .../parserRealSource3_es5.1.normal.js | 6 +- .../parserRealSource3_es5.2.minified.js | 6 +- .../parserRealSource5_es2015.1.normal.js | 3 +- .../parserRealSource5_es2015.2.minified.js | 3 +- .../parserRealSource5_es5.1.normal.js | 3 +- .../parserRealSource5_es5.2.minified.js | 3 +- .../parserRealSource6_es2015.1.normal.js | 3 +- .../parserRealSource6_es2015.2.minified.js | 3 +- .../parserRealSource6_es5.1.normal.js | 3 +- .../parserRealSource6_es5.2.minified.js | 3 +- .../parserRealSource8_es2015.1.normal.js | 3 +- .../parserRealSource8_es2015.2.minified.js | 3 +- .../parserRealSource8_es5.1.normal.js | 3 +- .../parserRealSource8_es5.2.minified.js | 3 +- .../parserSbp_7.9_A9_T3_es2015.1.normal.js | 3 +- .../parserSbp_7.9_A9_T3_es5.1.normal.js | 3 +- .../parserSuperExpression1_es2015.1.normal.js | 6 +- .../parserSuperExpression1_es5.1.normal.js | 6 +- .../parserSuperExpression1_es5.2.minified.js | 6 +- .../parserSuperExpression4_es2015.1.normal.js | 6 +- .../parserSuperExpression4_es5.1.normal.js | 6 +- .../parserSuperExpression4_es5.2.minified.js | 6 +- .../parserSymbolProperty7_es2015.1.normal.js | 3 +- .../parserSymbolProperty7_es5.1.normal.js | 3 +- .../parserSymbolProperty7_es5.2.minified.js | 3 +- ...odeWhitespaceCharacter1_es2015.1.normal.js | 3 +- ...nicodeWhitespaceCharacter1_es5.1.normal.js | 3 +- ...ConstructorAsIdentifier_es2015.1.normal.js | 9 +- ...ingConstructorAsIdentifier_es5.1.normal.js | 9 +- ...serVariableDeclaration2_es2015.1.normal.js | 6 +- ...parserVariableDeclaration2_es5.1.normal.js | 6 +- .../parserX_ArrowFunction4_es2015.1.normal.js | 3 +- .../parserX_ArrowFunction4_es5.1.normal.js | 3 +- .../parser_duplicateLabel3_es2015.1.normal.js | 3 +- .../parser_duplicateLabel3_es5.1.normal.js | 3 +- .../parser_duplicateLabel4_es2015.1.normal.js | 6 +- .../parser_duplicateLabel4_es5.1.normal.js | 6 +- .../parserindenter_es2015.1.normal.js | 3 +- .../parserindenter_es2015.2.minified.js | 3 +- .../parserindenter_es5.1.normal.js | 3 +- .../parserindenter_es5.2.minified.js | 3 +- ...dFunctionInferenceError_es2015.1.normal.js | 9 +- ...unctionInferenceError_es2015.2.minified.js | 5 +- ...atedFunctionInferenceError_es5.1.normal.js | 12 +- ...edFunctionInferenceError_es5.2.minified.js | 8 +- ...erenceWithTypeParameter_es2015.1.normal.js | 27 +- ...enceWithTypeParameter_es2015.2.minified.js | 11 +- ...InferenceWithTypeParameter_es5.1.normal.js | 21 +- ...ferenceWithTypeParameter_es5.2.minified.js | 13 +- ...tionWitoutTypeParameter_es2015.1.normal.js | 6 +- ...onWitoutTypeParameter_es2015.2.minified.js | 4 +- ...unctionWitoutTypeParameter_es5.1.normal.js | 6 +- ...ctionWitoutTypeParameter_es5.2.minified.js | 4 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 9 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 12 +- ...usOperatorWithAnyOtherType_es5.1.normal.js | 9 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 12 +- ...OperatorWithBooleanType_es2015.1.normal.js | 3 +- ...eratorWithBooleanType_es2015.2.minified.js | 3 +- ...lusOperatorWithBooleanType_es5.1.normal.js | 3 +- ...sOperatorWithBooleanType_es5.2.minified.js | 3 +- ...lusOperatorWithEnumType_es2015.1.normal.js | 7 +- ...sOperatorWithEnumType_es2015.2.minified.js | 3 +- .../plusOperatorWithEnumType_es5.1.normal.js | 7 +- ...plusOperatorWithEnumType_es5.2.minified.js | 3 +- ...sOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...plusOperatorWithNumberType_es5.1.normal.js | 3 +- ...usOperatorWithNumberType_es5.2.minified.js | 3 +- ...sOperatorWithStringType_es2015.1.normal.js | 3 +- ...peratorWithStringType_es2015.2.minified.js | 3 +- ...plusOperatorWithStringType_es5.1.normal.js | 3 +- ...usOperatorWithStringType_es5.2.minified.js | 3 +- ...imtiveTypesAreIdentical_es2015.1.normal.js | 24 +- ...tiveTypesAreIdentical_es2015.2.minified.js | 3 +- .../primtiveTypesAreIdentical_es5.1.normal.js | 24 +- ...rimtiveTypesAreIdentical_es5.2.minified.js | 3 +- ...rtyAccessibleWithinClass_es5.2.minified.js | 15 +- ...rivateIdentifierExpando_es2015.1.normal.js | 3 +- ...vateIdentifierExpando_es2015.2.minified.js | 3 +- .../privateIdentifierExpando_es5.1.normal.js | 3 +- ...privateIdentifierExpando_es5.2.minified.js | 3 +- ...NameAndObjectRestSpread_es2015.1.normal.js | 9 +- ...ateNameAndObjectRestSpread_es5.1.normal.js | 9 +- ...eNameAndObjectRestSpread_es5.2.minified.js | 7 +- ...perUseDefineForClassFields_es5.1.normal.js | 3 +- ...rUseDefineForClassFields_es5.2.minified.js | 3 +- .../privateNameBadSuper_es5.1.normal.js | 3 +- .../privateNameBadSuper_es5.2.minified.js | 3 +- ...meComputedPropertyName2_es2015.1.normal.js | 3 +- ...ComputedPropertyName2_es2015.2.minified.js | 3 +- ...eNameComputedPropertyName2_es5.1.normal.js | 3 +- ...ameComputedPropertyName2_es5.2.minified.js | 3 +- .../privateNameDeclaration_es2015.1.normal.js | 3 +- .../privateNameDeclaration_es5.1.normal.js | 3 +- .../privateNameDeclaration_es5.2.minified.js | 3 +- ...NameFieldCallExpression_es2015.1.normal.js | 3 +- ...meFieldCallExpression_es2015.2.minified.js | 3 +- ...ateNameFieldCallExpression_es5.1.normal.js | 3 +- ...eNameFieldCallExpression_es5.2.minified.js | 3 +- ...eNameFieldUnaryMutation_es2015.1.normal.js | 12 +- ...vateNameFieldUnaryMutation_es5.1.normal.js | 12 +- .../privateNamesAndFields_es5.1.normal.js | 3 +- .../privateNamesAndFields_es5.2.minified.js | 3 +- ...AccessibleDestructuring_es2015.1.normal.js | 6 +- ...cessibleDestructuring_es2015.2.minified.js | 3 +- ...NotAccessibleDestructuring_es5.1.normal.js | 6 +- ...tAccessibleDestructuring_es5.2.minified.js | 6 +- ...eStaticMemberAccessibility_es5.1.normal.js | 3 +- ...taticMemberAccessibility_es5.2.minified.js | 3 +- ...NotAccessibleInClodule2_es2015.1.normal.js | 3 +- ...tAccessibleInClodule2_es2015.2.minified.js | 3 +- ...ticNotAccessibleInClodule2_es5.1.normal.js | 6 +- ...cNotAccessibleInClodule2_es5.2.minified.js | 6 +- ...cNotAccessibleInClodule_es2015.1.normal.js | 3 +- ...otAccessibleInClodule_es2015.2.minified.js | 3 +- ...aticNotAccessibleInClodule_es5.1.normal.js | 3 +- ...icNotAccessibleInClodule_es5.2.minified.js | 3 +- ...ricConstructorFunctions_es2015.1.normal.js | 3 +- ...cConstructorFunctions_es2015.2.minified.js | 3 +- ...enericConstructorFunctions_es5.1.normal.js | 6 +- ...ericConstructorFunctions_es5.2.minified.js | 4 +- ...eParameterWithConstraints2_es5.1.normal.js | 3 +- ...arameterWithConstraints2_es5.2.minified.js | 3 +- ...eParameterWithConstraints3_es5.1.normal.js | 3 +- ...arameterWithConstraints3_es5.2.minified.js | 3 +- ...eParameterWithConstraints5_es5.1.normal.js | 3 +- ...arameterWithConstraints5_es5.2.minified.js | 3 +- .../propertyAccessWidening_es2015.1.normal.js | 12 +- .../propertyAccessWidening_es5.1.normal.js | 12 +- .../propertyAccess_es2015.1.normal.js | 9 +- .../propertyAccess_es2015.2.minified.js | 9 +- .../propertyAccess_es5.1.normal.js | 12 +- .../propertyAccess_es5.2.minified.js | 12 +- ...AndAccessorWithSameName_es2015.1.normal.js | 6 +- ...rtyAndAccessorWithSameName_es5.1.normal.js | 6 +- ...yAndAccessorWithSameName_es5.2.minified.js | 6 +- ...AndFunctionWithSameName_es2015.1.normal.js | 3 +- ...rtyAndFunctionWithSameName_es5.1.normal.js | 3 +- ...yAndFunctionWithSameName_es5.2.minified.js | 3 +- ...ignmentOnImportedSymbol_es2015.1.normal.js | 3 +- ...nmentOnImportedSymbol_es2015.2.minified.js | 3 +- ...AssignmentOnImportedSymbol_es5.1.normal.js | 3 +- ...signmentOnImportedSymbol_es5.2.minified.js | 3 +- ...ntOnParenthesizedNumber_es2015.1.normal.js | 3 +- ...OnParenthesizedNumber_es2015.2.minified.js | 3 +- ...nmentOnParenthesizedNumber_es5.1.normal.js | 3 +- ...entOnParenthesizedNumber_es5.2.minified.js | 3 +- ...ropertyOverridesAccessors2_es5.1.normal.js | 3 +- ...pertyOverridesAccessors2_es5.2.minified.js | 3 +- ...ropertyOverridesAccessors3_es5.1.normal.js | 3 +- ...pertyOverridesAccessors3_es5.2.minified.js | 3 +- ...ropertyOverridesAccessors4_es5.1.normal.js | 3 +- ...pertyOverridesAccessors4_es5.2.minified.js | 3 +- ...ropertyOverridesAccessors5_es5.1.normal.js | 3 +- ...pertyOverridesAccessors5_es5.2.minified.js | 3 +- ...propertyOverridesAccessors_es5.1.normal.js | 3 +- ...opertyOverridesAccessors_es5.2.minified.js | 3 +- ...propertyOverridesMethod_es2015.1.normal.js | 3 +- .../propertyOverridesMethod_es5.1.normal.js | 6 +- .../propertyOverridesMethod_es5.2.minified.js | 6 +- ...rtyAccessibleWithinClass_es5.2.minified.js | 15 +- ...sibleWithinNestedSubclass1_es5.1.normal.js | 3 +- ...bleWithinNestedSubclass1_es5.2.minified.js | 3 +- ...ssibleWithinNestedSubclass_es5.1.normal.js | 3 +- ...ibleWithinNestedSubclass_es5.2.minified.js | 3 +- ...yAccessibleWithinSubclass2_es5.1.normal.js | 3 +- ...ccessibleWithinSubclass2_es5.2.minified.js | 3 +- ...yAccessibleWithinSubclass3_es5.1.normal.js | 3 +- ...ccessibleWithinSubclass3_es5.2.minified.js | 3 +- ...tyAccessibleWithinSubclass_es5.1.normal.js | 3 +- ...AccessibleWithinSubclass_es5.2.minified.js | 3 +- ...nstanceMemberAccessibility_es5.1.normal.js | 3 +- ...tanceMemberAccessibility_es5.2.minified.js | 3 +- ...yAccessibleWithinSubclass2_es5.1.normal.js | 3 +- ...ccessibleWithinSubclass2_es5.2.minified.js | 3 +- ...essibleWithinSubclass_es2015.2.minified.js | 12 +- ...tyAccessibleWithinSubclass_es5.1.normal.js | 3 +- ...AccessibleWithinSubclass_es5.2.minified.js | 3 +- ...cNotAccessibleInClodule_es2015.1.normal.js | 3 +- ...otAccessibleInClodule_es2015.2.minified.js | 3 +- ...aticNotAccessibleInClodule_es5.1.normal.js | 3 +- ...icNotAccessibleInClodule_es5.2.minified.js | 3 +- ...gnmentMergeAcrossFiles2_es2015.1.normal.js | 15 +- ...mentMergeAcrossFiles2_es2015.2.minified.js | 13 +- ...ssignmentMergeAcrossFiles2_es5.1.normal.js | 15 +- ...ignmentMergeAcrossFiles2_es5.2.minified.js | 13 +- ...ergeWithInterfaceMethod_es2015.1.normal.js | 6 +- ...geWithInterfaceMethod_es2015.2.minified.js | 4 +- ...ntMergeWithInterfaceMethod_es5.1.normal.js | 6 +- ...MergeWithInterfaceMethod_es5.2.minified.js | 4 +- .../quotedConstructors_es2015.1.normal.js | 3 +- .../quotedConstructors_es5.1.normal.js | 3 +- .../reExportDefaultExport_es2015.1.normal.js | 3 +- ...reExportDefaultExport_es2015.2.minified.js | 3 +- .../reExportDefaultExport_es5.1.normal.js | 3 +- .../reExportDefaultExport_es5.2.minified.js | 3 +- ...donlyConstructorAssignment_es5.1.normal.js | 3 +- ...nlyConstructorAssignment_es5.2.minified.js | 3 +- ...ecursiveTypeReferences2_es2015.1.normal.js | 3 +- .../recursiveTypeReferences2_es5.1.normal.js | 3 +- ...sedAsFunctionParameters_es2015.1.normal.js | 12 +- ...esUsedAsFunctionParameters_es5.1.normal.js | 12 +- .../reexportClassDefinition_es5.1.normal.js | 3 +- .../reexportClassDefinition_es5.2.minified.js | 3 +- .../tsc-references/renamed_es2015.1.normal.js | 3 +- .../tsc-references/renamed_es5.1.normal.js | 3 +- ...eOfESWithPropertyAccess_es2015.1.normal.js | 3 +- ...fESWithPropertyAccess_es2015.2.minified.js | 3 +- ...uireOfESWithPropertyAccess_es5.1.normal.js | 3 +- ...reOfESWithPropertyAccess_es5.2.minified.js | 3 +- ...mentWithNullInitializer_es2015.1.normal.js | 13 +- ...ElementWithNullInitializer_es5.1.normal.js | 3 +- ...plesFromContextualTypes_es2015.1.normal.js | 120 +-- ...esFromContextualTypes_es2015.2.minified.js | 20 +- ...tTuplesFromContextualTypes_es5.1.normal.js | 24 +- ...uplesFromContextualTypes_es5.2.minified.js | 21 +- .../returnStatements_es2015.1.normal.js | 3 +- .../returnStatements_es5.1.normal.js | 6 +- .../returnStatements_es5.2.minified.js | 6 +- .../scannerEnum1_es2015.1.normal.js | 3 +- .../scannerEnum1_es2015.2.minified.js | 3 +- .../scannerEnum1_es5.1.normal.js | 3 +- .../scannerEnum1_es5.2.minified.js | 3 +- ...peResolutionIdentifiers_es2015.1.normal.js | 12 +- ...ResolutionIdentifiers_es2015.2.minified.js | 3 +- ...scopeResolutionIdentifiers_es5.1.normal.js | 12 +- ...opeResolutionIdentifiers_es5.2.minified.js | 3 +- .../shadowedInternalModule_es2015.1.normal.js | 12 +- ...hadowedInternalModule_es2015.2.minified.js | 6 +- .../shadowedInternalModule_es5.1.normal.js | 12 +- .../shadowedInternalModule_es5.2.minified.js | 6 +- ...NonSpecializedSignature_es2015.1.normal.js | 12 +- ...eOfNonSpecializedSignature_es5.1.normal.js | 12 +- ...fNonSpecializedSignature_es5.2.minified.js | 9 +- ...NonSpecializedSignature_es2015.1.normal.js | 12 +- ...eOfNonSpecializedSignature_es5.1.normal.js | 12 +- ...fNonSpecializedSignature_es5.2.minified.js | 9 +- ...tualTypedBindingPattern_es2015.1.normal.js | 6 +- ...alTypedBindingPattern_es2015.2.minified.js | 6 +- ...textualTypedBindingPattern_es5.1.normal.js | 6 +- ...xtualTypedBindingPattern_es5.2.minified.js | 6 +- .../spreadExcessProperty_es2015.1.normal.js | 6 +- .../spreadExcessProperty_es2015.2.minified.js | 6 +- .../spreadExcessProperty_es5.1.normal.js | 6 +- .../spreadExcessProperty_es5.2.minified.js | 6 +- .../spreadMethods_es2015.1.normal.js | 30 +- .../spreadMethods_es2015.2.minified.js | 24 +- .../spreadMethods_es5.1.normal.js | 30 +- .../spreadMethods_es5.2.minified.js | 24 +- .../spreadNonPrimitive_es2015.1.normal.js | 3 +- .../spreadNonPrimitive_es2015.2.minified.js | 3 +- .../spreadNonPrimitive_es5.1.normal.js | 3 +- .../spreadNonPrimitive_es5.2.minified.js | 3 +- ...verwritesPropertyStrict_es2015.1.normal.js | 18 +- ...rwritesPropertyStrict_es2015.2.minified.js | 12 +- ...adOverwritesPropertyStrict_es5.1.normal.js | 18 +- ...OverwritesPropertyStrict_es5.2.minified.js | 12 +- ...preadOverwritesProperty_es2015.1.normal.js | 6 +- ...eadOverwritesProperty_es2015.2.minified.js | 6 +- .../spreadOverwritesProperty_es5.1.normal.js | 6 +- ...spreadOverwritesProperty_es5.2.minified.js | 6 +- .../spreadTypeVariable_es2015.1.normal.js | 21 +- .../spreadTypeVariable_es5.1.normal.js | 21 +- .../spreadUnion2_es2015.1.normal.js | 21 +- .../spreadUnion2_es2015.2.minified.js | 11 +- .../spreadUnion2_es5.1.normal.js | 21 +- .../spreadUnion2_es5.2.minified.js | 11 +- .../spreadUnion3_es2015.1.normal.js | 12 +- .../spreadUnion3_es2015.2.minified.js | 10 +- .../spreadUnion3_es5.1.normal.js | 12 +- .../spreadUnion3_es5.2.minified.js | 10 +- .../spreadUnion_es2015.1.normal.js | 12 +- .../spreadUnion_es2015.2.minified.js | 10 +- .../spreadUnion_es5.1.normal.js | 12 +- .../spreadUnion_es5.2.minified.js | 10 +- ...taticPropertiesSameName_es2015.1.normal.js | 6 +- ...onStaticPropertiesSameName_es5.1.normal.js | 6 +- ...StaticPropertiesSameName_es5.2.minified.js | 6 +- .../staticFactory1_es5.1.normal.js | 3 +- .../staticFactory1_es5.2.minified.js | 3 +- ...structorFunctionMembers_es2015.1.normal.js | 6 +- ...ructorFunctionMembers_es2015.2.minified.js | 6 +- ...ConstructorFunctionMembers_es5.1.normal.js | 6 +- ...nstructorFunctionMembers_es5.2.minified.js | 6 +- ...UsingClassTypeParameter_es2015.1.normal.js | 9 +- ...ersUsingClassTypeParameter_es5.1.normal.js | 9 +- ...sUsingClassTypeParameter_es5.2.minified.js | 9 +- ...AndFunctionWithSameName_es2015.1.normal.js | 3 +- ...rtyAndFunctionWithSameName_es5.1.normal.js | 3 +- ...yAndFunctionWithSameName_es5.2.minified.js | 3 +- ...cPropertyNotInClassType_es2015.1.normal.js | 18 +- ...ropertyNotInClassType_es2015.2.minified.js | 18 +- ...aticPropertyNotInClassType_es5.1.normal.js | 18 +- ...icPropertyNotInClassType_es5.2.minified.js | 18 +- .../strictBindCallApply1_es2015.1.normal.js | 3 +- .../strictBindCallApply1_es2015.2.minified.js | 6 +- .../strictBindCallApply1_es5.2.minified.js | 3 +- .../strictBindCallApply2_es2015.1.normal.js | 3 +- .../strictBindCallApply2_es2015.2.minified.js | 3 +- .../strictBindCallApply2_es5.1.normal.js | 3 +- .../strictBindCallApply2_es5.2.minified.js | 3 +- ...ngEnumInElementAccess01_es2015.1.normal.js | 3 +- ...EnumInElementAccess01_es2015.2.minified.js | 3 +- ...tringEnumInElementAccess01_es5.1.normal.js | 3 +- ...ingEnumInElementAccess01_es5.2.minified.js | 3 +- ...stringEnumLiteralTypes1_es2015.1.normal.js | 3 +- ...ringEnumLiteralTypes1_es2015.2.minified.js | 3 +- .../stringEnumLiteralTypes1_es5.1.normal.js | 3 +- .../stringEnumLiteralTypes1_es5.2.minified.js | 3 +- ...stringEnumLiteralTypes2_es2015.1.normal.js | 3 +- ...ringEnumLiteralTypes2_es2015.2.minified.js | 3 +- .../stringEnumLiteralTypes2_es5.1.normal.js | 3 +- .../stringEnumLiteralTypes2_es5.2.minified.js | 3 +- ...stringEnumLiteralTypes3_es2015.1.normal.js | 3 +- ...ringEnumLiteralTypes3_es2015.2.minified.js | 3 +- .../stringEnumLiteralTypes3_es5.1.normal.js | 3 +- .../stringEnumLiteralTypes3_es5.2.minified.js | 3 +- ...rainsPropertyDeclarations2_es5.1.normal.js | 3 +- ...insPropertyDeclarations2_es5.2.minified.js | 3 +- ...insPropertyDeclarations_es2015.1.normal.js | 15 +- ...trainsPropertyDeclarations_es5.1.normal.js | 12 +- ...ainsPropertyDeclarations_es5.2.minified.js | 6 +- ...alTypeIsSubtypeOfString_es2015.1.normal.js | 51 +- ...TypeIsSubtypeOfString_es2015.2.minified.js | 3 +- ...teralTypeIsSubtypeOfString_es5.1.normal.js | 51 +- ...ralTypeIsSubtypeOfString_es5.2.minified.js | 3 +- .../stringLiteralType_es2015.1.normal.js | 3 +- .../stringLiteralType_es5.1.normal.js | 3 +- ...plementationSignatures2_es2015.1.normal.js | 12 +- ...nImplementationSignatures2_es5.1.normal.js | 12 +- ...mplementationSignatures2_es5.2.minified.js | 9 +- ...mplementationSignatures_es2015.1.normal.js | 21 +- ...InImplementationSignatures_es5.1.normal.js | 21 +- ...ImplementationSignatures_es5.2.minified.js | 3 +- ...LiteralTypesOverloads01_es2015.1.normal.js | 6 +- ...teralTypesOverloads01_es2015.2.minified.js | 6 +- ...ingLiteralTypesOverloads01_es5.1.normal.js | 6 +- ...gLiteralTypesOverloads01_es5.2.minified.js | 6 +- ...LiteralTypesOverloads02_es2015.1.normal.js | 6 +- ...teralTypesOverloads02_es2015.2.minified.js | 6 +- ...ingLiteralTypesOverloads02_es5.1.normal.js | 6 +- ...gLiteralTypesOverloads02_es5.2.minified.js | 6 +- ...teralTypesOverloads03_es2015.2.minified.js | 6 +- .../subtypesOfAny_es2015.1.normal.js | 12 +- .../subtypesOfAny_es2015.2.minified.js | 10 +- .../subtypesOfAny_es5.1.normal.js | 12 +- .../subtypesOfAny_es5.2.minified.js | 10 +- ...rameterWithConstraints2_es2015.1.normal.js | 24 +- ...meterWithConstraints2_es2015.2.minified.js | 10 +- ...eParameterWithConstraints2_es5.1.normal.js | 24 +- ...arameterWithConstraints2_es5.2.minified.js | 10 +- ...eParameterWithConstraints4_es5.1.normal.js | 3 +- ...arameterWithConstraints4_es5.2.minified.js | 3 +- ...peParameterWithConstraints_es5.1.normal.js | 3 +- ...ParameterWithConstraints_es5.2.minified.js | 3 +- ...ithRecursiveConstraints_es2015.1.normal.js | 6 +- ...erWithRecursiveConstraints_es5.1.normal.js | 9 +- ...WithRecursiveConstraints_es5.2.minified.js | 9 +- ...subtypesOfTypeParameter_es2015.1.normal.js | 24 +- ...btypesOfTypeParameter_es2015.2.minified.js | 10 +- .../subtypesOfTypeParameter_es5.1.normal.js | 27 +- .../subtypesOfTypeParameter_es5.2.minified.js | 13 +- .../subtypesOfUnion_es2015.1.normal.js | 12 +- .../subtypesOfUnion_es2015.2.minified.js | 10 +- .../subtypesOfUnion_es5.1.normal.js | 12 +- .../subtypesOfUnion_es5.2.minified.js | 12 +- ...pingWithCallSignatures2_es2015.1.normal.js | 3 +- ...btypingWithCallSignatures2_es5.1.normal.js | 6 +- ...ypingWithCallSignatures2_es5.2.minified.js | 3 +- ...pingWithCallSignatures3_es2015.1.normal.js | 6 +- ...ngWithCallSignatures3_es2015.2.minified.js | 6 +- ...btypingWithCallSignatures3_es5.1.normal.js | 9 +- ...ypingWithCallSignatures3_es5.2.minified.js | 7 +- ...pingWithCallSignatures4_es2015.1.normal.js | 3 +- ...btypingWithCallSignatures4_es5.1.normal.js | 6 +- ...ypingWithCallSignatures4_es5.2.minified.js | 3 +- ...ypingWithCallSignatures_es2015.1.normal.js | 3 +- ...ingWithCallSignatures_es2015.2.minified.js | 3 +- ...ubtypingWithCallSignatures_es5.1.normal.js | 3 +- ...typingWithCallSignatures_es5.2.minified.js | 3 +- ...ngWithConstructSignatures2_es5.1.normal.js | 3 +- ...WithConstructSignatures2_es5.2.minified.js | 3 +- ...ithConstructSignatures3_es2015.1.normal.js | 6 +- ...hConstructSignatures3_es2015.2.minified.js | 6 +- ...ngWithConstructSignatures3_es5.1.normal.js | 9 +- ...WithConstructSignatures3_es5.2.minified.js | 9 +- ...ngWithConstructSignatures4_es5.1.normal.js | 3 +- ...WithConstructSignatures4_es5.2.minified.js | 3 +- ...ngWithConstructSignatures5_es5.1.normal.js | 3 +- ...WithConstructSignatures5_es5.2.minified.js | 3 +- ...ngWithConstructSignatures6_es5.1.normal.js | 3 +- ...WithConstructSignatures6_es5.2.minified.js | 3 +- ...WithConstructSignatures_es2015.1.normal.js | 3 +- ...thConstructSignatures_es2015.2.minified.js | 3 +- ...ingWithConstructSignatures_es5.1.normal.js | 3 +- ...gWithConstructSignatures_es5.2.minified.js | 3 +- ...pingWithNumericIndexer3_es2015.1.normal.js | 3 +- ...btypingWithNumericIndexer3_es5.1.normal.js | 6 +- ...ypingWithNumericIndexer3_es5.2.minified.js | 6 +- ...pingWithNumericIndexer4_es2015.1.normal.js | 3 +- ...btypingWithNumericIndexer4_es5.1.normal.js | 6 +- ...ypingWithNumericIndexer4_es5.2.minified.js | 6 +- ...pingWithNumericIndexer5_es2015.1.normal.js | 3 +- ...btypingWithNumericIndexer5_es5.1.normal.js | 3 +- ...ypingWithNumericIndexer5_es5.2.minified.js | 3 +- ...ypingWithNumericIndexer_es2015.1.normal.js | 3 +- ...ubtypingWithNumericIndexer_es5.1.normal.js | 6 +- ...typingWithNumericIndexer_es5.2.minified.js | 6 +- ...ubtypingWithObjectMembers4_es5.1.normal.js | 3 +- ...typingWithObjectMembers4_es5.2.minified.js | 3 +- ...ypingWithObjectMembers5_es2015.1.normal.js | 6 +- ...ubtypingWithObjectMembers5_es5.1.normal.js | 6 +- ...typingWithObjectMembers5_es5.2.minified.js | 6 +- ...ctMembersAccessibility2_es2015.1.normal.js | 6 +- ...bjectMembersAccessibility2_es5.1.normal.js | 9 +- ...ectMembersAccessibility2_es5.2.minified.js | 9 +- ...ObjectMembersAccessibility_es5.1.normal.js | 3 +- ...jectMembersAccessibility_es5.2.minified.js | 3 +- ...bjectMembersOptionality_es2015.1.normal.js | 3 +- ...thObjectMembersOptionality_es5.1.normal.js | 3 +- ...typingWithObjectMembers_es2015.1.normal.js | 3 +- ...subtypingWithObjectMembers_es5.1.normal.js | 6 +- ...btypingWithObjectMembers_es5.2.minified.js | 6 +- ...ypingWithStringIndexer3_es2015.1.normal.js | 3 +- ...ubtypingWithStringIndexer3_es5.1.normal.js | 6 +- ...typingWithStringIndexer3_es5.2.minified.js | 6 +- ...ypingWithStringIndexer4_es2015.1.normal.js | 3 +- ...ubtypingWithStringIndexer4_es5.1.normal.js | 6 +- ...typingWithStringIndexer4_es5.2.minified.js | 6 +- ...typingWithStringIndexer_es2015.1.normal.js | 3 +- ...subtypingWithStringIndexer_es5.1.normal.js | 6 +- ...btypingWithStringIndexer_es5.2.minified.js | 6 +- ...allBeforeThisAccessing1_es2015.1.normal.js | 3 +- ...erCallBeforeThisAccessing1_es5.1.normal.js | 3 +- ...CallBeforeThisAccessing1_es5.2.minified.js | 3 +- ...allBeforeThisAccessing2_es2015.1.normal.js | 3 +- ...erCallBeforeThisAccessing2_es5.1.normal.js | 3 +- ...CallBeforeThisAccessing2_es5.2.minified.js | 3 +- ...erCallBeforeThisAccessing5_es5.1.normal.js | 3 +- ...CallBeforeThisAccessing5_es5.2.minified.js | 3 +- ...allBeforeThisAccessing8_es2015.1.normal.js | 3 +- ...erCallBeforeThisAccessing8_es5.1.normal.js | 3 +- ...CallBeforeThisAccessing8_es5.2.minified.js | 3 +- ...ParameterContextualTyping1_es5.1.normal.js | 3 +- ...rameterContextualTyping1_es5.2.minified.js | 3 +- ...ParameterContextualTyping2_es5.1.normal.js | 3 +- ...rameterContextualTyping2_es5.2.minified.js | 3 +- ...ameterContextualTyping3_es2015.1.normal.js | 6 +- ...ParameterContextualTyping3_es5.1.normal.js | 6 +- ...rameterContextualTyping3_es5.2.minified.js | 6 +- .../superCalls_es2015.1.normal.js | 3 +- .../tsc-references/superCalls_es5.1.normal.js | 6 +- .../superCalls_es5.2.minified.js | 3 +- .../superMethodCall_es2015.1.normal.js | 3 +- .../superMethodCall_es5.1.normal.js | 6 +- .../superMethodCall_es5.2.minified.js | 6 +- ...superPropertyAccessNoError_es5.1.normal.js | 3 +- ...perPropertyAccessNoError_es5.2.minified.js | 3 +- .../superSymbolIndexedAccess1_es5.1.normal.js | 3 +- ...uperSymbolIndexedAccess1_es5.2.minified.js | 3 +- .../superSymbolIndexedAccess2_es5.1.normal.js | 3 +- ...uperSymbolIndexedAccess2_es5.2.minified.js | 3 +- .../superSymbolIndexedAccess3_es5.1.normal.js | 3 +- ...uperSymbolIndexedAccess3_es5.2.minified.js | 3 +- .../superSymbolIndexedAccess5_es5.1.normal.js | 3 +- ...uperSymbolIndexedAccess5_es5.2.minified.js | 3 +- .../superSymbolIndexedAccess6_es5.1.normal.js | 3 +- ...uperSymbolIndexedAccess6_es5.2.minified.js | 3 +- .../switchBreakStatements_es2015.1.normal.js | 3 +- .../switchBreakStatements_es5.1.normal.js | 3 +- .../switchStatements_es2015.1.normal.js | 9 +- .../switchStatements_es2015.2.minified.js | 9 +- .../switchStatements_es5.1.normal.js | 12 +- .../switchStatements_es5.2.minified.js | 12 +- ...symbolDeclarationEmit10_es2015.1.normal.js | 3 +- .../symbolDeclarationEmit10_es5.1.normal.js | 11 +- .../symbolDeclarationEmit10_es5.2.minified.js | 11 +- ...symbolDeclarationEmit11_es2015.1.normal.js | 6 +- ...mbolDeclarationEmit11_es2015.2.minified.js | 6 +- .../symbolDeclarationEmit11_es5.1.normal.js | 6 +- .../symbolDeclarationEmit11_es5.2.minified.js | 6 +- ...symbolDeclarationEmit12_es2015.1.normal.js | 9 +- ...mbolDeclarationEmit12_es2015.2.minified.js | 15 +- .../symbolDeclarationEmit12_es5.1.normal.js | 9 +- .../symbolDeclarationEmit12_es5.2.minified.js | 15 +- ...symbolDeclarationEmit13_es2015.1.normal.js | 3 +- .../symbolDeclarationEmit13_es5.1.normal.js | 3 +- .../symbolDeclarationEmit13_es5.2.minified.js | 3 +- .../symbolDeclarationEmit3_es2015.1.normal.js | 3 +- .../symbolDeclarationEmit3_es5.1.normal.js | 3 +- .../symbolDeclarationEmit3_es5.2.minified.js | 3 +- .../symbolDeclarationEmit4_es2015.1.normal.js | 3 +- .../symbolDeclarationEmit4_es5.1.normal.js | 3 +- .../symbolDeclarationEmit4_es5.2.minified.js | 3 +- .../symbolDeclarationEmit8_es5.1.normal.js | 3 +- .../symbolDeclarationEmit8_es5.2.minified.js | 3 +- .../symbolDeclarationEmit9_es2015.1.normal.js | 3 +- .../symbolDeclarationEmit9_es5.1.normal.js | 4 +- .../symbolDeclarationEmit9_es5.2.minified.js | 4 +- .../symbolProperty18_es2015.1.normal.js | 3 +- .../symbolProperty18_es2015.2.minified.js | 3 +- .../symbolProperty18_es5.1.normal.js | 10 +- .../symbolProperty18_es5.2.minified.js | 8 +- .../symbolProperty19_es5.1.normal.js | 3 +- .../symbolProperty19_es5.2.minified.js | 3 +- .../symbolProperty1_es2015.1.normal.js | 3 +- .../symbolProperty1_es5.1.normal.js | 8 +- .../symbolProperty1_es5.2.minified.js | 8 +- .../symbolProperty20_es5.1.normal.js | 3 +- .../symbolProperty20_es5.2.minified.js | 3 +- .../symbolProperty21_es5.1.normal.js | 3 +- .../symbolProperty21_es5.2.minified.js | 3 +- .../symbolProperty22_es5.1.normal.js | 3 +- .../symbolProperty22_es5.2.minified.js | 3 +- .../symbolProperty26_es5.1.normal.js | 3 +- .../symbolProperty26_es5.2.minified.js | 3 +- .../symbolProperty27_es2015.1.normal.js | 3 +- .../symbolProperty27_es5.1.normal.js | 6 +- .../symbolProperty27_es5.2.minified.js | 6 +- .../symbolProperty28_es5.1.normal.js | 3 +- .../symbolProperty28_es5.2.minified.js | 3 +- .../symbolProperty2_es2015.1.normal.js | 3 +- .../symbolProperty2_es5.1.normal.js | 8 +- .../symbolProperty2_es5.2.minified.js | 8 +- .../symbolProperty36_es5.1.normal.js | 3 +- .../symbolProperty36_es5.2.minified.js | 3 +- .../symbolProperty39_es5.2.minified.js | 6 +- .../symbolProperty3_es2015.1.normal.js | 3 +- .../symbolProperty3_es5.1.normal.js | 8 +- .../symbolProperty3_es5.2.minified.js | 8 +- .../symbolProperty40_es2015.2.minified.js | 3 +- .../symbolProperty40_es5.2.minified.js | 3 +- .../symbolProperty41_es2015.2.minified.js | 3 +- .../symbolProperty41_es5.2.minified.js | 3 +- .../symbolProperty42_es5.2.minified.js | 3 +- .../symbolProperty46_es2015.1.normal.js | 3 +- .../symbolProperty46_es2015.2.minified.js | 3 +- .../symbolProperty46_es5.1.normal.js | 3 +- .../symbolProperty46_es5.2.minified.js | 3 +- .../symbolProperty47_es2015.1.normal.js | 3 +- .../symbolProperty47_es2015.2.minified.js | 3 +- .../symbolProperty47_es5.1.normal.js | 3 +- .../symbolProperty47_es5.2.minified.js | 3 +- .../symbolProperty48_es2015.1.normal.js | 6 +- .../symbolProperty48_es2015.2.minified.js | 3 +- .../symbolProperty48_es5.1.normal.js | 6 +- .../symbolProperty48_es5.2.minified.js | 6 +- .../symbolProperty49_es2015.1.normal.js | 6 +- .../symbolProperty49_es2015.2.minified.js | 3 +- .../symbolProperty49_es5.1.normal.js | 6 +- .../symbolProperty49_es5.2.minified.js | 6 +- .../symbolProperty4_es2015.1.normal.js | 3 +- .../symbolProperty4_es5.1.normal.js | 8 +- .../symbolProperty4_es5.2.minified.js | 8 +- .../symbolProperty50_es2015.1.normal.js | 6 +- .../symbolProperty50_es5.1.normal.js | 6 +- .../symbolProperty50_es5.2.minified.js | 6 +- .../symbolProperty51_es2015.1.normal.js | 6 +- .../symbolProperty51_es5.1.normal.js | 6 +- .../symbolProperty51_es5.2.minified.js | 6 +- .../symbolProperty52_es2015.1.normal.js | 3 +- .../symbolProperty52_es2015.2.minified.js | 3 +- .../symbolProperty52_es5.1.normal.js | 6 +- .../symbolProperty52_es5.2.minified.js | 6 +- .../symbolProperty53_es5.1.normal.js | 3 +- .../symbolProperty53_es5.2.minified.js | 3 +- .../symbolProperty54_es5.1.normal.js | 3 +- .../symbolProperty54_es5.2.minified.js | 3 +- .../symbolProperty55_es2015.1.normal.js | 3 +- .../symbolProperty55_es2015.2.minified.js | 3 +- .../symbolProperty55_es5.1.normal.js | 6 +- .../symbolProperty55_es5.2.minified.js | 4 +- .../symbolProperty56_es2015.1.normal.js | 3 +- .../symbolProperty56_es2015.2.minified.js | 3 +- .../symbolProperty56_es5.1.normal.js | 6 +- .../symbolProperty56_es5.2.minified.js | 4 +- .../symbolProperty57_es5.1.normal.js | 3 +- .../symbolProperty57_es5.2.minified.js | 3 +- .../symbolProperty58_es5.1.normal.js | 3 +- .../symbolProperty58_es5.2.minified.js | 3 +- .../symbolProperty5_es2015.1.normal.js | 3 +- .../symbolProperty5_es5.1.normal.js | 8 +- .../symbolProperty5_es5.2.minified.js | 8 +- .../symbolProperty6_es2015.1.normal.js | 3 +- .../symbolProperty6_es5.1.normal.js | 3 +- .../symbolProperty6_es5.2.minified.js | 3 +- .../symbolType11_es2015.1.normal.js | 3 +- .../symbolType11_es5.1.normal.js | 3 +- .../symbolType13_es2015.1.normal.js | 10 +- .../symbolType13_es2015.2.minified.js | 3 +- .../symbolType13_es5.1.normal.js | 10 +- .../symbolType13_es5.2.minified.js | 3 +- .../symbolType19_es2015.1.normal.js | 4 +- .../symbolType19_es5.1.normal.js | 4 +- .../symbolType1_es2015.1.normal.js | 6 +- .../symbolType1_es2015.2.minified.js | 4 +- .../symbolType1_es5.1.normal.js | 6 +- .../symbolType1_es5.2.minified.js | 4 +- .../symbolType2_es2015.1.normal.js | 3 +- .../symbolType2_es2015.2.minified.js | 3 +- .../symbolType2_es5.1.normal.js | 3 +- .../symbolType2_es5.2.minified.js | 3 +- ...lateContextualTyping1_es2015.2.minified.js | 3 +- ...lateContextualTyping2_es2015.2.minified.js | 3 +- ...ArePartsOfEscapes01_ES6_es2015.1.normal.js | 3 +- ...ePartsOfEscapes01_ES6_es2015.2.minified.js | 3 +- ...ThatArePartsOfEscapes01_es2015.1.normal.js | 3 +- ...atArePartsOfEscapes01_es2015.2.minified.js | 3 +- ...ArePartsOfEscapes02_ES6_es2015.1.normal.js | 3 +- ...ePartsOfEscapes02_ES6_es2015.2.minified.js | 3 +- ...ypeArgumentInferenceES6_es2015.1.normal.js | 33 +- ...eArgumentInferenceES6_es2015.2.minified.js | 25 +- ...gsTypeArgumentInferenceES6_es5.1.normal.js | 33 +- ...TypeArgumentInferenceES6_es5.2.minified.js | 24 +- ...gsTypeArgumentInference_es2015.1.normal.js | 33 +- ...TypeArgumentInference_es2015.2.minified.js | 25 +- ...ringsTypeArgumentInference_es5.1.normal.js | 33 +- ...ngsTypeArgumentInference_es5.2.minified.js | 24 +- ...erloadResolution1_ES6_es2015.2.minified.js | 3 +- ...thOverloadResolution1_es2015.2.minified.js | 3 +- ...erloadResolution2_ES6_es2015.2.minified.js | 6 +- ...thOverloadResolution2_es2015.2.minified.js | 6 +- ...OverloadResolution3_ES6_es2015.1.normal.js | 6 +- ...erloadResolution3_ES6_es2015.2.minified.js | 12 +- ...ithOverloadResolution3_ES6_es5.1.normal.js | 6 +- ...hOverloadResolution3_ES6_es5.2.minified.js | 12 +- ...WithOverloadResolution3_es2015.1.normal.js | 6 +- ...thOverloadResolution3_es2015.2.minified.js | 12 +- ...ngsWithOverloadResolution3_es5.1.normal.js | 6 +- ...sWithOverloadResolution3_es5.2.minified.js | 12 +- ...sWithTagNamedDeclareES6_es2015.1.normal.js | 3 +- ...ithTagNamedDeclareES6_es2015.2.minified.js | 3 +- ...ingsWithTagNamedDeclare_es2015.1.normal.js | 3 +- ...gsWithTagNamedDeclare_es2015.2.minified.js | 3 +- ...bstitutionExpressionES6_es2015.1.normal.js | 3 +- ...titutionExpressionES6_es2015.2.minified.js | 3 +- ...nSubstitutionExpression_es2015.1.normal.js | 3 +- ...ubstitutionExpression_es2015.2.minified.js | 3 +- ...latesWithTypeArguments1_es2015.1.normal.js | 9 +- ...tesWithTypeArguments1_es2015.2.minified.js | 9 +- ...emplatesWithTypeArguments1_es5.1.normal.js | 9 +- ...platesWithTypeArguments1_es5.2.minified.js | 9 +- ...ateLiteralTypesPatterns_es2015.1.normal.js | 3 +- ...eLiteralTypesPatterns_es2015.2.minified.js | 3 +- ...mplateLiteralTypesPatterns_es5.1.normal.js | 3 +- ...lateLiteralTypesPatterns_es5.2.minified.js | 3 +- .../thisMethodCall_es2015.1.normal.js | 3 +- .../thisMethodCall_es5.1.normal.js | 3 +- .../thisMethodCall_es5.2.minified.js | 3 +- .../thisPropertyAssignment_es2015.1.normal.js | 24 +- ...hisPropertyAssignment_es2015.2.minified.js | 12 +- .../thisPropertyAssignment_es5.1.normal.js | 24 +- .../thisPropertyAssignment_es5.2.minified.js | 12 +- ...pertyOverridesAccessors_es2015.1.normal.js | 3 +- ...PropertyOverridesAccessors_es5.1.normal.js | 6 +- ...opertyOverridesAccessors_es5.2.minified.js | 6 +- .../thisTypeErrors2_es2015.1.normal.js | 3 +- .../thisTypeErrors_es2015.1.normal.js | 3 +- .../thisTypeErrors_es2015.2.minified.js | 6 +- .../thisTypeErrors_es5.1.normal.js | 3 +- .../thisTypeErrors_es5.2.minified.js | 12 +- .../thisTypeInClasses_es5.2.minified.js | 9 +- .../thisTypeInFunctions3_es5.1.normal.js | 3 +- .../thisTypeInFunctions3_es5.2.minified.js | 3 +- .../thisTypeInFunctions_es5.1.normal.js | 3 +- .../thisTypeInFunctions_es5.2.minified.js | 3 +- ...isTypeInObjectLiterals2_es2015.1.normal.js | 3 +- ...TypeInObjectLiterals2_es2015.2.minified.js | 3 +- .../thisTypeInObjectLiterals2_es5.1.normal.js | 3 +- ...hisTypeInObjectLiterals2_es5.2.minified.js | 3 +- ...hisTypeSyntacticContext_es2015.1.normal.js | 3 +- ...sTypeSyntacticContext_es2015.2.minified.js | 3 +- .../thisTypeSyntacticContext_es5.1.normal.js | 3 +- ...thisTypeSyntacticContext_es5.2.minified.js | 3 +- ...owInEnclosingStatements_es2015.1.normal.js | 3 +- ...InEnclosingStatements_es2015.2.minified.js | 3 +- ...throwInEnclosingStatements_es5.1.normal.js | 3 +- ...rowInEnclosingStatements_es5.2.minified.js | 3 +- .../throwStatements_es2015.1.normal.js | 3 +- .../throwStatements_es2015.2.minified.js | 3 +- .../throwStatements_es5.1.normal.js | 3 +- .../throwStatements_es5.2.minified.js | 3 +- .../tryStatements_es2015.1.normal.js | 35 +- .../tryStatements_es5.1.normal.js | 35 +- .../tsNoCheckForTypescript_es2015.1.normal.js | 3 +- ...sNoCheckForTypescript_es2015.2.minified.js | 3 +- .../tsNoCheckForTypescript_es5.1.normal.js | 3 +- .../tsNoCheckForTypescript_es5.2.minified.js | 3 +- .../tsxAttributeErrorsx_es2015.1.normal.js | 3 +- .../tsxAttributeErrorsx_es2015.2.minified.js | 3 +- .../tsxAttributeErrorsx_es5.1.normal.js | 3 +- .../tsxAttributeErrorsx_es5.2.minified.js | 3 +- ...xAttributeResolution10x_es2015.1.normal.js | 3 +- ...ttributeResolution10x_es2015.2.minified.js | 3 +- .../tsxAttributeResolution10x_es5.1.normal.js | 3 +- ...sxAttributeResolution10x_es5.2.minified.js | 3 +- ...xAttributeResolution11x_es2015.1.normal.js | 3 +- ...ttributeResolution11x_es2015.2.minified.js | 3 +- .../tsxAttributeResolution11x_es5.1.normal.js | 3 +- ...sxAttributeResolution11x_es5.2.minified.js | 3 +- ...xAttributeResolution13x_es2015.1.normal.js | 3 +- ...ttributeResolution13x_es2015.2.minified.js | 3 +- .../tsxAttributeResolution13x_es5.1.normal.js | 3 +- ...sxAttributeResolution13x_es5.2.minified.js | 3 +- .../tsxAttributeResolution15x_es5.1.normal.js | 3 +- ...sxAttributeResolution15x_es5.2.minified.js | 3 +- .../tsxAttributeResolution16x_es5.1.normal.js | 3 +- ...sxAttributeResolution16x_es5.2.minified.js | 3 +- ...sxAttributeResolution3x_es2015.1.normal.js | 15 +- ...AttributeResolution3x_es2015.2.minified.js | 15 +- .../tsxAttributeResolution3x_es5.1.normal.js | 15 +- ...tsxAttributeResolution3x_es5.2.minified.js | 15 +- ...sxAttributeResolution4x_es2015.1.normal.js | 6 +- ...AttributeResolution4x_es2015.2.minified.js | 6 +- .../tsxAttributeResolution4x_es5.1.normal.js | 6 +- ...tsxAttributeResolution4x_es5.2.minified.js | 6 +- ...sxAttributeResolution8x_es2015.1.normal.js | 3 +- ...AttributeResolution8x_es2015.2.minified.js | 3 +- .../tsxAttributeResolution8x_es5.1.normal.js | 3 +- ...tsxAttributeResolution8x_es5.2.minified.js | 3 +- ...sxAttributeResolution9x_es2015.1.normal.js | 3 +- ...AttributeResolution9x_es2015.2.minified.js | 3 +- .../tsxAttributeResolution9x_es5.1.normal.js | 3 +- ...tsxAttributeResolution9x_es5.2.minified.js | 3 +- ...yParseLessThanComparison1x_es5.1.normal.js | 3 +- ...arseLessThanComparison1x_es5.2.minified.js | 3 +- ...aultAttributesResolution1x_es5.1.normal.js | 3 +- ...ltAttributesResolution1x_es5.2.minified.js | 3 +- ...aultAttributesResolution2x_es5.1.normal.js | 3 +- ...ltAttributesResolution2x_es5.2.minified.js | 3 +- ...aultAttributesResolution3x_es5.1.normal.js | 3 +- ...ltAttributesResolution3x_es5.2.minified.js | 3 +- .../tsxDynamicTagName5x_es5.1.normal.js | 3 +- .../tsxDynamicTagName5x_es5.2.minified.js | 3 +- .../tsxDynamicTagName7x_es5.1.normal.js | 3 +- .../tsxDynamicTagName7x_es5.2.minified.js | 3 +- .../tsxDynamicTagName8x_es5.1.normal.js | 3 +- .../tsxDynamicTagName8x_es5.2.minified.js | 3 +- .../tsxDynamicTagName9x_es5.1.normal.js | 3 +- .../tsxDynamicTagName9x_es5.2.minified.js | 3 +- ...tsxElementResolution12x_es2015.1.normal.js | 7 +- ...xElementResolution12x_es2015.2.minified.js | 5 +- .../tsxElementResolution12x_es5.1.normal.js | 7 +- .../tsxElementResolution12x_es5.2.minified.js | 5 +- .../tsxElementResolution7x_es2015.1.normal.js | 6 +- ...sxElementResolution7x_es2015.2.minified.js | 6 +- .../tsxElementResolution7x_es5.1.normal.js | 6 +- .../tsxElementResolution7x_es5.2.minified.js | 6 +- .../tsxElementResolutionx_es2015.1.normal.js | 3 +- ...tsxElementResolutionx_es2015.2.minified.js | 3 +- .../tsxElementResolutionx_es5.1.normal.js | 3 +- .../tsxElementResolutionx_es5.2.minified.js | 3 +- .../tsxEmit2x_es2015.1.normal.js | 9 +- .../tsxEmit2x_es2015.2.minified.js | 7 +- .../tsc-references/tsxEmit2x_es5.1.normal.js | 9 +- .../tsxEmit2x_es5.2.minified.js | 7 +- .../tsxEmit3x_es2015.1.normal.js | 21 +- .../tsxEmit3x_es2015.2.minified.js | 15 +- .../tsc-references/tsxEmit3x_es5.1.normal.js | 18 +- .../tsxEmit3x_es5.2.minified.js | 10 +- .../tsxExternalModuleEmit1x_es5.1.normal.js | 3 +- .../tsxExternalModuleEmit1x_es5.2.minified.js | 3 +- ...tsxExternalModuleEmit2x_es2015.1.normal.js | 3 +- ...xExternalModuleEmit2x_es2015.2.minified.js | 3 +- .../tsxExternalModuleEmit2x_es5.1.normal.js | 3 +- .../tsxExternalModuleEmit2x_es5.2.minified.js | 3 +- ...GenericAttributesType1x_es2015.1.normal.js | 6 +- ...tsxGenericAttributesType1x_es5.1.normal.js | 6 +- ...GenericAttributesType2x_es2015.1.normal.js | 3 +- ...tsxGenericAttributesType2x_es5.1.normal.js | 3 +- ...GenericAttributesType3x_es2015.1.normal.js | 3 +- ...nericAttributesType3x_es2015.2.minified.js | 3 +- ...tsxGenericAttributesType3x_es5.1.normal.js | 6 +- ...xGenericAttributesType3x_es5.2.minified.js | 6 +- ...GenericAttributesType4x_es2015.1.normal.js | 3 +- ...nericAttributesType4x_es2015.2.minified.js | 3 +- ...tsxGenericAttributesType4x_es5.1.normal.js | 6 +- ...xGenericAttributesType4x_es5.2.minified.js | 6 +- ...GenericAttributesType5x_es2015.1.normal.js | 3 +- ...nericAttributesType5x_es2015.2.minified.js | 3 +- ...tsxGenericAttributesType5x_es5.1.normal.js | 6 +- ...xGenericAttributesType5x_es5.2.minified.js | 6 +- ...GenericAttributesType6x_es2015.1.normal.js | 3 +- ...nericAttributesType6x_es2015.2.minified.js | 3 +- ...tsxGenericAttributesType6x_es5.1.normal.js | 6 +- ...xGenericAttributesType6x_es5.2.minified.js | 6 +- ...GenericAttributesType7x_es2015.1.normal.js | 6 +- ...tsxGenericAttributesType7x_es5.1.normal.js | 6 +- ...GenericAttributesType8x_es2015.1.normal.js | 6 +- ...tsxGenericAttributesType8x_es5.1.normal.js | 6 +- ...GenericAttributesType9x_es2015.1.normal.js | 3 +- ...nericAttributesType9x_es2015.2.minified.js | 3 +- ...tsxGenericAttributesType9x_es5.1.normal.js | 6 +- ...xGenericAttributesType9x_es5.2.minified.js | 6 +- ...xLibraryManagedAttributesx_es5.1.normal.js | 3 +- ...ibraryManagedAttributesx_es5.2.minified.js | 3 +- .../tsxPreserveEmit1x_es2015.1.normal.js | 6 +- .../tsxPreserveEmit1x_es2015.2.minified.js | 4 +- .../tsxPreserveEmit1x_es5.1.normal.js | 6 +- .../tsxPreserveEmit1x_es5.2.minified.js | 4 +- .../tsxReactEmit2x_es2015.1.normal.js | 9 +- .../tsxReactEmit2x_es2015.2.minified.js | 7 +- .../tsxReactEmit2x_es5.1.normal.js | 9 +- .../tsxReactEmit2x_es5.2.minified.js | 7 +- .../tsxReactEmit4x_es2015.1.normal.js | 3 +- .../tsxReactEmit4x_es2015.2.minified.js | 3 +- .../tsxReactEmit4x_es5.1.normal.js | 3 +- .../tsxReactEmit4x_es5.2.minified.js | 3 +- .../tsxReactEmit6x_es2015.1.normal.js | 6 +- .../tsxReactEmit6x_es2015.2.minified.js | 6 +- .../tsxReactEmit6x_es5.1.normal.js | 6 +- .../tsxReactEmit6x_es5.2.minified.js | 6 +- ...inedStrictNullChecksx_es2015.2.minified.js | 3 +- ...definedStrictNullChecksx_es5.2.minified.js | 4 +- ...AttributesResolution10x_es2015.1.normal.js | 12 +- ...tributesResolution10x_es2015.2.minified.js | 10 +- ...eadAttributesResolution10x_es5.1.normal.js | 15 +- ...dAttributesResolution10x_es5.2.minified.js | 13 +- ...AttributesResolution11x_es2015.1.normal.js | 15 +- ...tributesResolution11x_es2015.2.minified.js | 13 +- ...eadAttributesResolution11x_es5.1.normal.js | 18 +- ...dAttributesResolution11x_es5.2.minified.js | 16 +- ...AttributesResolution12x_es2015.1.normal.js | 9 +- ...tributesResolution12x_es2015.2.minified.js | 7 +- ...eadAttributesResolution12x_es5.1.normal.js | 12 +- ...dAttributesResolution12x_es5.2.minified.js | 10 +- ...AttributesResolution13x_es2015.1.normal.js | 6 +- ...tributesResolution13x_es2015.2.minified.js | 3 +- ...eadAttributesResolution13x_es5.1.normal.js | 6 +- ...dAttributesResolution13x_es5.2.minified.js | 3 +- ...AttributesResolution14x_es2015.1.normal.js | 3 +- ...tributesResolution14x_es2015.2.minified.js | 3 +- ...eadAttributesResolution14x_es5.1.normal.js | 3 +- ...dAttributesResolution14x_es5.2.minified.js | 3 +- ...AttributesResolution15x_es2015.1.normal.js | 3 +- ...tributesResolution15x_es2015.2.minified.js | 3 +- ...eadAttributesResolution15x_es5.1.normal.js | 3 +- ...dAttributesResolution15x_es5.2.minified.js | 3 +- ...AttributesResolution16x_es2015.1.normal.js | 3 +- ...tributesResolution16x_es2015.2.minified.js | 3 +- ...eadAttributesResolution16x_es5.1.normal.js | 3 +- ...dAttributesResolution16x_es5.2.minified.js | 3 +- ...AttributesResolution17x_es2015.1.normal.js | 3 +- ...tributesResolution17x_es2015.2.minified.js | 3 +- ...eadAttributesResolution17x_es5.1.normal.js | 6 +- ...dAttributesResolution17x_es5.2.minified.js | 6 +- ...dAttributesResolution1x_es2015.1.normal.js | 6 +- ...ttributesResolution1x_es2015.2.minified.js | 4 +- ...readAttributesResolution1x_es5.1.normal.js | 9 +- ...adAttributesResolution1x_es5.2.minified.js | 7 +- ...dAttributesResolution2x_es2015.1.normal.js | 15 +- ...ttributesResolution2x_es2015.2.minified.js | 13 +- ...readAttributesResolution2x_es5.1.normal.js | 18 +- ...adAttributesResolution2x_es5.2.minified.js | 16 +- ...dAttributesResolution3x_es2015.1.normal.js | 3 +- ...ttributesResolution3x_es2015.2.minified.js | 3 +- ...readAttributesResolution3x_es5.1.normal.js | 6 +- ...adAttributesResolution3x_es5.2.minified.js | 6 +- ...dAttributesResolution4x_es2015.1.normal.js | 16 +- ...ttributesResolution4x_es2015.2.minified.js | 12 +- ...readAttributesResolution4x_es5.1.normal.js | 19 +- ...adAttributesResolution4x_es5.2.minified.js | 15 +- ...dAttributesResolution5x_es2015.1.normal.js | 6 +- ...ttributesResolution5x_es2015.2.minified.js | 6 +- ...readAttributesResolution5x_es5.1.normal.js | 9 +- ...adAttributesResolution5x_es5.2.minified.js | 9 +- ...readAttributesResolution6x_es5.1.normal.js | 3 +- ...adAttributesResolution6x_es5.2.minified.js | 3 +- ...dAttributesResolution7x_es2015.1.normal.js | 9 +- ...ttributesResolution7x_es2015.2.minified.js | 9 +- ...readAttributesResolution7x_es5.1.normal.js | 12 +- ...adAttributesResolution7x_es5.2.minified.js | 12 +- ...dAttributesResolution8x_es2015.1.normal.js | 9 +- ...ttributesResolution8x_es2015.2.minified.js | 7 +- ...readAttributesResolution8x_es5.1.normal.js | 12 +- ...adAttributesResolution8x_es5.2.minified.js | 10 +- ...dAttributesResolution9x_es2015.1.normal.js | 12 +- ...ttributesResolution9x_es2015.2.minified.js | 6 +- ...readAttributesResolution9x_es5.1.normal.js | 15 +- ...adAttributesResolution9x_es5.2.minified.js | 9 +- ...eadChildrenInvalidTypex_es2015.1.normal.js | 3 +- ...dChildrenInvalidTypex_es2015.2.minified.js | 3 +- ...SpreadChildrenInvalidTypex_es5.1.normal.js | 3 +- ...readChildrenInvalidTypex_es5.2.minified.js | 3 +- .../tsxSpreadChildrenx_es2015.1.normal.js | 3 +- .../tsxSpreadChildrenx_es2015.2.minified.js | 3 +- .../tsxSpreadChildrenx_es5.1.normal.js | 3 +- .../tsxSpreadChildrenx_es5.2.minified.js | 3 +- ...tionComponentOverload2x_es2015.1.normal.js | 25 +- ...onComponentOverload2x_es2015.2.minified.js | 19 +- ...unctionComponentOverload2x_es5.1.normal.js | 25 +- ...ctionComponentOverload2x_es5.2.minified.js | 19 +- ...tionComponentOverload3x_es2015.1.normal.js | 9 +- ...onComponentOverload3x_es2015.2.minified.js | 9 +- ...unctionComponentOverload3x_es5.1.normal.js | 9 +- ...ctionComponentOverload3x_es5.2.minified.js | 9 +- ...tionComponentOverload4x_es2015.1.normal.js | 18 +- ...onComponentOverload4x_es2015.2.minified.js | 18 +- ...unctionComponentOverload4x_es5.1.normal.js | 18 +- ...ctionComponentOverload4x_es5.2.minified.js | 18 +- ...tionComponentOverload5x_es2015.1.normal.js | 39 +- ...onComponentOverload5x_es2015.2.minified.js | 39 +- ...unctionComponentOverload5x_es5.1.normal.js | 39 +- ...ctionComponentOverload5x_es5.2.minified.js | 39 +- ...tionComponentOverload6x_es2015.1.normal.js | 33 +- ...onComponentOverload6x_es2015.2.minified.js | 29 +- ...unctionComponentOverload6x_es5.1.normal.js | 33 +- ...ctionComponentOverload6x_es5.2.minified.js | 29 +- ...telessFunctionComponents2x_es5.1.normal.js | 3 +- ...lessFunctionComponents2x_es5.2.minified.js | 3 +- ...entsWithTypeArguments1x_es2015.1.normal.js | 6 +- ...tsWithTypeArguments1x_es2015.2.minified.js | 3 +- ...ponentsWithTypeArguments1x_es5.1.normal.js | 6 +- ...nentsWithTypeArguments1x_es5.2.minified.js | 3 +- ...entsWithTypeArguments2x_es2015.1.normal.js | 9 +- ...tsWithTypeArguments2x_es2015.2.minified.js | 3 +- ...ponentsWithTypeArguments2x_es5.1.normal.js | 9 +- ...nentsWithTypeArguments2x_es5.2.minified.js | 3 +- ...entsWithTypeArguments3x_es2015.1.normal.js | 21 +- ...ponentsWithTypeArguments3x_es5.1.normal.js | 21 +- ...entsWithTypeArguments4x_es2015.1.normal.js | 3 +- ...ponentsWithTypeArguments4x_es5.1.normal.js | 3 +- ...entsWithTypeArguments5x_es2015.1.normal.js | 18 +- ...ponentsWithTypeArguments5x_es5.1.normal.js | 18 +- .../tsxUnionElementType3x_es2015.1.normal.js | 3 +- ...tsxUnionElementType3x_es2015.2.minified.js | 3 +- .../tsxUnionElementType3x_es5.1.normal.js | 6 +- .../tsxUnionElementType3x_es5.2.minified.js | 6 +- .../tsxUnionElementType4x_es2015.1.normal.js | 3 +- ...tsxUnionElementType4x_es2015.2.minified.js | 3 +- .../tsxUnionElementType4x_es5.1.normal.js | 6 +- .../tsxUnionElementType4x_es5.2.minified.js | 6 +- .../tsxUnionTypeComponent1x_es5.1.normal.js | 3 +- .../tsxUnionTypeComponent1x_es5.2.minified.js | 3 +- .../tupleElementTypes2_es2015.1.normal.js | 3 +- .../tupleElementTypes4_es2015.1.normal.js | 3 +- ...oAccessorsWithSameName2_es2015.1.normal.js | 9 +- .../twoAccessorsWithSameName2_es5.1.normal.js | 6 +- ...woAccessorsWithSameName2_es5.2.minified.js | 6 +- ...cesDifferentRootModule2_es2015.1.normal.js | 6 +- ...sDifferentRootModule2_es2015.2.minified.js | 6 +- ...rfacesDifferentRootModule2_es5.1.normal.js | 6 +- ...acesDifferentRootModule2_es5.2.minified.js | 6 +- ...acesDifferentRootModule_es2015.1.normal.js | 3 +- ...esDifferentRootModule_es2015.2.minified.js | 3 +- ...erfacesDifferentRootModule_es5.1.normal.js | 3 +- ...facesDifferentRootModule_es5.2.minified.js | 3 +- ...WithDifferingOverloads2_es2015.1.normal.js | 3 +- ...thDifferingOverloads2_es2015.2.minified.js | 3 +- ...cesWithDifferingOverloads2_es5.1.normal.js | 3 +- ...sWithDifferingOverloads2_es5.2.minified.js | 3 +- .../typeAliases_es2015.1.normal.js | 3 +- .../typeAliases_es2015.2.minified.js | 3 +- .../typeAliases_es5.1.normal.js | 3 +- .../typeAliases_es5.2.minified.js | 3 +- ...renceConstructSignatures_es5.2.minified.js | 3 +- ...ArgumentInferenceErrors_es2015.1.normal.js | 12 +- ...ypeArgumentInferenceErrors_es5.1.normal.js | 12 +- ...eWithClassExpression1_es2015.2.minified.js | 3 +- ...eWithClassExpression2_es2015.2.minified.js | 3 +- ...eWithClassExpression3_es2015.2.minified.js | 3 +- ...nferenceWithConstraints_es2015.1.normal.js | 30 +- ...erenceWithConstraints_es2015.2.minified.js | 30 +- ...ntInferenceWithConstraints_es5.1.normal.js | 30 +- ...InferenceWithConstraints_es5.2.minified.js | 33 +- ...erenceWithObjectLiteral_es2015.1.normal.js | 9 +- ...enceWithObjectLiteral_es2015.2.minified.js | 7 +- ...InferenceWithObjectLiteral_es5.1.normal.js | 9 +- ...ferenceWithObjectLiteral_es5.2.minified.js | 7 +- .../typeArgumentInference_es2015.1.normal.js | 30 +- ...typeArgumentInference_es2015.2.minified.js | 30 +- .../typeArgumentInference_es5.1.normal.js | 30 +- .../typeArgumentInference_es5.2.minified.js | 33 +- ...ithStringLiteralTypes01_es2015.1.normal.js | 9 +- ...hStringLiteralTypes01_es2015.2.minified.js | 9 +- ...tsWithStringLiteralTypes01_es5.1.normal.js | 9 +- ...WithStringLiteralTypes01_es5.2.minified.js | 9 +- .../typeFromJSInitializer_es2015.1.normal.js | 15 +- ...typeFromJSInitializer_es2015.2.minified.js | 5 +- .../typeFromJSInitializer_es5.1.normal.js | 15 +- .../typeFromJSInitializer_es5.2.minified.js | 5 +- ...mPropertyAssignment10_1_es2015.1.normal.js | 6 +- ...ropertyAssignment10_1_es2015.2.minified.js | 7 +- ...FromPropertyAssignment10_1_es5.1.normal.js | 6 +- ...omPropertyAssignment10_1_es5.2.minified.js | 7 +- ...romPropertyAssignment10_es2015.1.normal.js | 6 +- ...mPropertyAssignment10_es2015.2.minified.js | 7 +- ...peFromPropertyAssignment10_es5.1.normal.js | 6 +- ...FromPropertyAssignment10_es5.2.minified.js | 7 +- ...romPropertyAssignment11_es2015.1.normal.js | 6 +- ...mPropertyAssignment11_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment11_es5.1.normal.js | 6 +- ...FromPropertyAssignment11_es5.2.minified.js | 6 +- ...romPropertyAssignment12_es2015.1.normal.js | 6 +- ...mPropertyAssignment12_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment12_es5.1.normal.js | 6 +- ...FromPropertyAssignment12_es5.2.minified.js | 6 +- ...romPropertyAssignment13_es2015.1.normal.js | 9 +- ...mPropertyAssignment13_es2015.2.minified.js | 9 +- ...peFromPropertyAssignment13_es5.1.normal.js | 9 +- ...FromPropertyAssignment13_es5.2.minified.js | 9 +- ...romPropertyAssignment14_es2015.1.normal.js | 9 +- ...mPropertyAssignment14_es2015.2.minified.js | 9 +- ...peFromPropertyAssignment14_es5.1.normal.js | 9 +- ...FromPropertyAssignment14_es5.2.minified.js | 9 +- ...romPropertyAssignment15_es2015.1.normal.js | 6 +- ...mPropertyAssignment15_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment15_es5.1.normal.js | 6 +- ...FromPropertyAssignment15_es5.2.minified.js | 6 +- ...romPropertyAssignment16_es2015.1.normal.js | 9 +- ...mPropertyAssignment16_es2015.2.minified.js | 9 +- ...peFromPropertyAssignment16_es5.1.normal.js | 9 +- ...FromPropertyAssignment16_es5.2.minified.js | 9 +- ...romPropertyAssignment17_es2015.1.normal.js | 9 +- ...mPropertyAssignment17_es2015.2.minified.js | 9 +- ...peFromPropertyAssignment17_es5.1.normal.js | 9 +- ...FromPropertyAssignment17_es5.2.minified.js | 9 +- ...romPropertyAssignment18_es2015.1.normal.js | 6 +- ...mPropertyAssignment18_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment18_es5.1.normal.js | 6 +- ...FromPropertyAssignment18_es5.2.minified.js | 6 +- ...mPropertyAssignment22_es2015.2.minified.js | 3 +- ...FromPropertyAssignment22_es5.2.minified.js | 3 +- ...romPropertyAssignment23_es2015.1.normal.js | 6 +- ...mPropertyAssignment23_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment23_es5.1.normal.js | 9 +- ...FromPropertyAssignment23_es5.2.minified.js | 9 +- ...romPropertyAssignment24_es2015.1.normal.js | 6 +- ...mPropertyAssignment24_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment24_es5.1.normal.js | 6 +- ...FromPropertyAssignment24_es5.2.minified.js | 6 +- ...romPropertyAssignment25_es2015.1.normal.js | 3 +- ...mPropertyAssignment25_es2015.2.minified.js | 3 +- ...peFromPropertyAssignment25_es5.1.normal.js | 6 +- ...FromPropertyAssignment25_es5.2.minified.js | 6 +- ...romPropertyAssignment26_es2015.1.normal.js | 3 +- ...mPropertyAssignment26_es2015.2.minified.js | 3 +- ...peFromPropertyAssignment26_es5.1.normal.js | 6 +- ...FromPropertyAssignment26_es5.2.minified.js | 6 +- ...romPropertyAssignment29_es2015.1.normal.js | 12 +- ...mPropertyAssignment29_es2015.2.minified.js | 10 +- ...peFromPropertyAssignment29_es5.1.normal.js | 12 +- ...FromPropertyAssignment29_es5.2.minified.js | 10 +- ...romPropertyAssignment30_es2015.1.normal.js | 3 +- ...mPropertyAssignment30_es2015.2.minified.js | 3 +- ...peFromPropertyAssignment30_es5.1.normal.js | 3 +- ...FromPropertyAssignment30_es5.2.minified.js | 3 +- ...romPropertyAssignment31_es2015.1.normal.js | 6 +- ...mPropertyAssignment31_es2015.2.minified.js | 4 +- ...peFromPropertyAssignment31_es5.1.normal.js | 6 +- ...FromPropertyAssignment31_es5.2.minified.js | 4 +- ...romPropertyAssignment32_es2015.1.normal.js | 6 +- ...mPropertyAssignment32_es2015.2.minified.js | 4 +- ...peFromPropertyAssignment32_es5.1.normal.js | 6 +- ...FromPropertyAssignment32_es5.2.minified.js | 4 +- ...romPropertyAssignment33_es2015.1.normal.js | 6 +- ...mPropertyAssignment33_es2015.2.minified.js | 4 +- ...peFromPropertyAssignment33_es5.1.normal.js | 6 +- ...FromPropertyAssignment33_es5.2.minified.js | 4 +- ...romPropertyAssignment34_es2015.1.normal.js | 9 +- ...mPropertyAssignment34_es2015.2.minified.js | 7 +- ...peFromPropertyAssignment34_es5.1.normal.js | 9 +- ...FromPropertyAssignment34_es5.2.minified.js | 7 +- ...romPropertyAssignment35_es2015.1.normal.js | 3 +- ...mPropertyAssignment35_es2015.2.minified.js | 3 +- ...peFromPropertyAssignment35_es5.1.normal.js | 3 +- ...FromPropertyAssignment35_es5.2.minified.js | 3 +- ...romPropertyAssignment36_es2015.1.normal.js | 9 +- ...mPropertyAssignment36_es2015.2.minified.js | 9 +- ...peFromPropertyAssignment36_es5.1.normal.js | 9 +- ...FromPropertyAssignment36_es5.2.minified.js | 9 +- ...romPropertyAssignment37_es2015.1.normal.js | 6 +- ...mPropertyAssignment37_es2015.2.minified.js | 3 +- ...peFromPropertyAssignment37_es5.1.normal.js | 6 +- ...FromPropertyAssignment37_es5.2.minified.js | 3 +- ...romPropertyAssignment38_es2015.1.normal.js | 6 +- ...mPropertyAssignment38_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment38_es5.1.normal.js | 6 +- ...FromPropertyAssignment38_es5.2.minified.js | 4 +- ...romPropertyAssignment39_es2015.1.normal.js | 6 +- ...mPropertyAssignment39_es2015.2.minified.js | 6 +- ...peFromPropertyAssignment39_es5.1.normal.js | 6 +- ...FromPropertyAssignment39_es5.2.minified.js | 6 +- ...FromPropertyAssignment4_es2015.1.normal.js | 3 +- ...omPropertyAssignment4_es2015.2.minified.js | 3 +- ...ypeFromPropertyAssignment4_es5.1.normal.js | 3 +- ...eFromPropertyAssignment4_es5.2.minified.js | 3 +- ...FromPropertyAssignment5_es2015.1.normal.js | 3 +- ...omPropertyAssignment5_es2015.2.minified.js | 3 +- ...ypeFromPropertyAssignment5_es5.1.normal.js | 3 +- ...eFromPropertyAssignment5_es5.2.minified.js | 3 +- ...FromPropertyAssignment6_es2015.1.normal.js | 3 +- ...ypeFromPropertyAssignment6_es5.1.normal.js | 3 +- ...FromPropertyAssignment7_es2015.1.normal.js | 3 +- ...omPropertyAssignment7_es2015.2.minified.js | 3 +- ...ypeFromPropertyAssignment7_es5.1.normal.js | 3 +- ...eFromPropertyAssignment7_es5.2.minified.js | 3 +- ...omPropertyAssignment8_1_es2015.1.normal.js | 12 +- ...PropertyAssignment8_1_es2015.2.minified.js | 14 +- ...eFromPropertyAssignment8_1_es5.1.normal.js | 12 +- ...romPropertyAssignment8_1_es5.2.minified.js | 14 +- ...FromPropertyAssignment8_es2015.1.normal.js | 12 +- ...omPropertyAssignment8_es2015.2.minified.js | 14 +- ...ypeFromPropertyAssignment8_es5.1.normal.js | 12 +- ...eFromPropertyAssignment8_es5.2.minified.js | 14 +- ...omPropertyAssignment9_1_es2015.1.normal.js | 18 +- ...PropertyAssignment9_1_es2015.2.minified.js | 16 +- ...eFromPropertyAssignment9_1_es5.1.normal.js | 18 +- ...romPropertyAssignment9_1_es5.2.minified.js | 16 +- ...FromPropertyAssignment9_es2015.1.normal.js | 18 +- ...omPropertyAssignment9_es2015.2.minified.js | 16 +- ...ypeFromPropertyAssignment9_es5.1.normal.js | 18 +- ...eFromPropertyAssignment9_es5.2.minified.js | 16 +- ...rtyAssignmentOutOfOrder_es2015.1.normal.js | 9 +- ...yAssignmentOutOfOrder_es2015.2.minified.js | 5 +- ...opertyAssignmentOutOfOrder_es5.1.normal.js | 12 +- ...ertyAssignmentOutOfOrder_es5.2.minified.js | 8 +- ...rtyAssignmentWithExport_es2015.1.normal.js | 9 +- ...yAssignmentWithExport_es2015.2.minified.js | 7 +- ...opertyAssignmentWithExport_es5.1.normal.js | 9 +- ...ertyAssignmentWithExport_es5.2.minified.js | 7 +- ...eFromPropertyAssignment_es2015.1.normal.js | 6 +- ...romPropertyAssignment_es2015.2.minified.js | 6 +- ...typeFromPropertyAssignment_es5.1.normal.js | 6 +- ...peFromPropertyAssignment_es5.2.minified.js | 6 +- ...romPrototypeAssignment2_es2015.1.normal.js | 3 +- ...peFromPrototypeAssignment2_es5.1.normal.js | 3 +- ...romPrototypeAssignment3_es2015.1.normal.js | 3 +- ...mPrototypeAssignment3_es2015.2.minified.js | 3 +- ...peFromPrototypeAssignment3_es5.1.normal.js | 3 +- ...FromPrototypeAssignment3_es5.2.minified.js | 3 +- ...romPrototypeAssignment4_es2015.1.normal.js | 12 +- ...mPrototypeAssignment4_es2015.2.minified.js | 8 +- ...peFromPrototypeAssignment4_es5.1.normal.js | 12 +- ...FromPrototypeAssignment4_es5.2.minified.js | 8 +- ...FromPrototypeAssignment_es2015.1.normal.js | 3 +- ...omPrototypeAssignment_es2015.2.minified.js | 3 +- ...ypeFromPrototypeAssignment_es5.1.normal.js | 3 +- ...eFromPrototypeAssignment_es5.2.minified.js | 3 +- .../typeGuardEnums_es2015.1.normal.js | 8 +- .../typeGuardEnums_es5.1.normal.js | 8 +- .../typeGuardFunctionGenerics_es5.1.normal.js | 3 +- ...ypeGuardFunctionGenerics_es5.2.minified.js | 3 +- ...unctionOfFormThisErrors_es2015.1.normal.js | 6 +- ...ctionOfFormThisErrors_es2015.2.minified.js | 6 +- ...rdFunctionOfFormThisErrors_es5.1.normal.js | 9 +- ...FunctionOfFormThisErrors_es5.2.minified.js | 9 +- ...GuardFunctionOfFormThis_es2015.1.normal.js | 18 +- ...ardFunctionOfFormThis_es2015.2.minified.js | 18 +- ...ypeGuardFunctionOfFormThis_es5.1.normal.js | 21 +- ...eGuardFunctionOfFormThis_es5.2.minified.js | 21 +- .../typeGuardFunction_es5.1.normal.js | 3 +- .../typeGuardFunction_es5.2.minified.js | 3 +- ...wsPrimitiveIntersection_es2015.1.normal.js | 4 +- ...rrowsPrimitiveIntersection_es5.1.normal.js | 4 +- ...peGuardOfFormInstanceOf_es2015.1.normal.js | 3 +- .../typeGuardOfFormInstanceOf_es5.1.normal.js | 6 +- ...ypeGuardOfFormInstanceOf_es5.2.minified.js | 3 +- .../typeGuardOfFormIsType_es5.1.normal.js | 3 +- .../typeGuardOfFormIsType_es5.2.minified.js | 3 +- ...FromPropNameInUnionType_es2015.1.normal.js | 3 +- ...dOfFromPropNameInUnionType_es5.1.normal.js | 3 +- ...nFunctionAndModuleBlock_es2015.1.normal.js | 15 +- ...unctionAndModuleBlock_es2015.2.minified.js | 13 +- ...dsInFunctionAndModuleBlock_es5.1.normal.js | 15 +- ...InFunctionAndModuleBlock_es5.2.minified.js | 13 +- .../typeGuardsInModule_es2015.1.normal.js | 15 +- .../typeGuardsInModule_es2015.2.minified.js | 15 +- .../typeGuardsInModule_es5.1.normal.js | 15 +- .../typeGuardsInModule_es5.2.minified.js | 15 +- ...peGuardsOnClassProperty_es2015.1.normal.js | 6 +- .../typeGuardsOnClassProperty_es5.1.normal.js | 6 +- ...ypeGuardsWithInstanceOf_es2015.1.normal.js | 9 +- .../typeGuardsWithInstanceOf_es5.1.normal.js | 9 +- ...typeGuardsWithInstanceOf_es5.2.minified.js | 3 +- .../typeLookupInIIFE_es2015.1.normal.js | 3 +- .../typeLookupInIIFE_es5.1.normal.js | 3 +- ...sInConstructorParamList_es2015.1.normal.js | 3 +- ...hisInFunctionExpression_es2015.1.normal.js | 3 +- ...OfThisInFunctionExpression_es5.1.normal.js | 3 +- ...ThisInFunctionExpression_es5.2.minified.js | 4 +- ...eOfThisInMemberFunctions_es5.2.minified.js | 18 +- ...peOfThisInStaticMembers_es2015.1.normal.js | 6 +- ...OfThisInStaticMembers_es2015.2.minified.js | 6 +- ...rowedWithLoopAntecedent_es2015.1.normal.js | 6 +- ...NarrowedWithLoopAntecedent_es5.1.normal.js | 6 +- .../typeOfThis_es2015.2.minified.js | 12 +- .../typeOfThis_es5.2.minified.js | 6 +- .../typeParameterAsBaseType_es5.1.normal.js | 3 +- .../typeParameterAsBaseType_es5.2.minified.js | 3 +- ...ypeParameterConstraint2_es2015.1.normal.js | 6 +- ...eParameterConstraint2_es2015.2.minified.js | 6 +- ...AsTypeParameterConstraint2_es5.1.normal.js | 6 +- ...TypeParameterConstraint2_es5.2.minified.js | 6 +- ...ConstraintTransitively2_es2015.1.normal.js | 5 +- ...nstraintTransitively2_es2015.2.minified.js | 5 +- ...terConstraintTransitively2_es5.1.normal.js | 5 +- ...rConstraintTransitively2_es5.2.minified.js | 5 +- ...rConstraintTransitively_es2015.1.normal.js | 5 +- ...onstraintTransitively_es2015.2.minified.js | 5 +- ...eterConstraintTransitively_es5.1.normal.js | 5 +- ...erConstraintTransitively_es5.2.minified.js | 5 +- ...TypeParameterConstraint_es2015.1.normal.js | 6 +- ...peParameterConstraint_es2015.2.minified.js | 6 +- ...rAsTypeParameterConstraint_es5.1.normal.js | 6 +- ...sTypeParameterConstraint_es5.2.minified.js | 6 +- ...ctlyConstrainedToItself_es2015.1.normal.js | 12 +- ...irectlyConstrainedToItself_es5.1.normal.js | 12 +- ...ctlyConstrainedToItself_es2015.1.normal.js | 15 +- ...irectlyConstrainedToItself_es5.1.normal.js | 15 +- ...rameterUsedAsConstraint_es2015.1.normal.js | 36 +- ...eParameterUsedAsConstraint_es5.1.normal.js | 36 +- ...reIdenticalToThemselves_es2015.1.normal.js | 33 +- ...rsAreIdenticalToThemselves_es5.1.normal.js | 33 +- ...AreIdenticalToThemselves_es5.2.minified.js | 21 +- ...vailableInNestedScope_es2015.2.minified.js | 6 +- ...rsAvailableInNestedScope_es5.2.minified.js | 6 +- .../typeQueryOnClass_es2015.1.normal.js | 15 +- .../typeQueryOnClass_es2015.2.minified.js | 12 +- .../typeQueryOnClass_es5.1.normal.js | 15 +- .../typeQueryOnClass_es5.2.minified.js | 15 +- ...eQueryWithReservedWords_es2015.1.normal.js | 9 +- ...typeQueryWithReservedWords_es5.1.normal.js | 9 +- ...peQueryWithReservedWords_es5.2.minified.js | 9 +- .../typeRelationships_es5.1.normal.js | 3 +- .../typeRelationships_es5.2.minified.js | 3 +- ...ceOnConstructorFunction_es2015.1.normal.js | 6 +- ...OnConstructorFunction_es2015.2.minified.js | 4 +- ...renceOnConstructorFunction_es5.1.normal.js | 6 +- ...nceOnConstructorFunction_es5.2.minified.js | 4 +- ...eTagPrototypeAssignment_es2015.1.normal.js | 3 +- ...agPrototypeAssignment_es2015.2.minified.js | 3 +- ...typeTagPrototypeAssignment_es5.1.normal.js | 3 +- ...peTagPrototypeAssignment_es5.2.minified.js | 3 +- .../typedefCrossModule3_es2015.1.normal.js | 3 +- .../typedefCrossModule3_es2015.2.minified.js | 3 +- .../typedefCrossModule3_es5.1.normal.js | 3 +- .../typedefCrossModule3_es5.2.minified.js | 3 +- .../typedefInnerNamepaths_es2015.1.normal.js | 3 +- ...ypedefTagTypeResolution_es2015.1.normal.js | 6 +- .../typedefTagTypeResolution_es5.1.normal.js | 6 +- .../typeofANonExportedType_es2015.1.normal.js | 12 +- ...ypeofANonExportedType_es2015.2.minified.js | 10 +- .../typeofANonExportedType_es5.1.normal.js | 12 +- .../typeofANonExportedType_es5.2.minified.js | 10 +- .../typeofAnExportedType_es2015.1.normal.js | 12 +- .../typeofAnExportedType_es2015.2.minified.js | 12 +- .../typeofAnExportedType_es5.1.normal.js | 12 +- .../typeofAnExportedType_es5.2.minified.js | 12 +- .../typeofClass2_es2015.1.normal.js | 15 +- .../typeofClass2_es5.1.normal.js | 15 +- .../typeofClass2_es5.2.minified.js | 15 +- ...eofModuleWithoutExports_es2015.1.normal.js | 3 +- ...typeofModuleWithoutExports_es5.1.normal.js | 3 +- ...peofModuleWithoutExports_es5.2.minified.js | 3 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 9 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 6 +- ...ofOperatorWithAnyOtherType_es5.1.normal.js | 9 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 9 +- ...OperatorWithBooleanType_es2015.1.normal.js | 3 +- ...eratorWithBooleanType_es2015.2.minified.js | 3 +- ...eofOperatorWithBooleanType_es5.1.normal.js | 3 +- ...fOperatorWithBooleanType_es5.2.minified.js | 3 +- ...eofOperatorWithEnumType_es2015.1.normal.js | 11 +- ...fOperatorWithEnumType_es2015.2.minified.js | 3 +- ...typeofOperatorWithEnumType_es5.1.normal.js | 11 +- ...peofOperatorWithEnumType_es5.2.minified.js | 3 +- ...fOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...peofOperatorWithNumberType_es5.1.normal.js | 3 +- ...ofOperatorWithNumberType_es5.2.minified.js | 3 +- ...fOperatorWithStringType_es2015.1.normal.js | 3 +- ...peratorWithStringType_es2015.2.minified.js | 3 +- ...peofOperatorWithStringType_es5.1.normal.js | 3 +- ...ofOperatorWithStringType_es5.2.minified.js | 3 +- ...syncGenerators.es2018.1_es2015.1.normal.js | 3 +- ...ncGenerators.es2018.1_es2015.2.minified.js | 3 +- ...syncGenerators.es2018.2_es2015.1.normal.js | 6 +- ...ncGenerators.es2018.2_es2015.2.minified.js | 6 +- ...s.asyncGenerators.es2018.2_es5.1.normal.js | 6 +- ...asyncGenerators.es2018.2_es5.2.minified.js | 6 +- ...types.forAwait.es2018.2_es2015.1.normal.js | 12 +- ...pes.forAwait.es2018.2_es2015.2.minified.js | 6 +- .../types.forAwait.es2018.2_es5.1.normal.js | 6 +- .../types.forAwait.es2018.2_es5.2.minified.js | 6 +- ...types.forAwait.es2018.3_es2015.1.normal.js | 12 +- ...pes.forAwait.es2018.3_es2015.2.minified.js | 12 +- .../types.forAwait.es2018.3_es5.1.normal.js | 12 +- .../types.forAwait.es2018.3_es5.2.minified.js | 12 +- ...lModuleStillHasInstance_es2015.1.normal.js | 3 +- ...rnalModuleStillHasInstance_es5.1.normal.js | 3 +- ...DuplicateTypeParameters_es2015.1.normal.js | 6 +- ...ithDuplicateTypeParameters_es5.1.normal.js | 6 +- ...sWithPrivateConstructor_es2015.1.normal.js | 6 +- ...ithPrivateConstructor_es2015.2.minified.js | 6 +- ...ithProtectedConstructor_es2015.1.normal.js | 6 +- ...hProtectedConstructor_es2015.2.minified.js | 6 +- ...esWithPublicConstructor_es2015.1.normal.js | 6 +- ...WithPublicConstructor_es2015.2.minified.js | 6 +- ...hSpecializedCallSignatures_es5.1.normal.js | 3 +- ...pecializedCallSignatures_es5.2.minified.js | 3 +- ...ializedConstructSignatures_es5.1.normal.js | 3 +- ...lizedConstructSignatures_es5.2.minified.js | 3 +- ...edParametersAreOptional_es2015.1.normal.js | 18 +- ...ParametersAreOptional_es2015.2.minified.js | 15 +- ...tatedParametersAreOptional_es5.1.normal.js | 18 +- ...tedParametersAreOptional_es5.2.minified.js | 15 +- ...edAssignableToEveryType_es2015.1.normal.js | 3 +- ...AssignableToEveryType_es2015.2.minified.js | 3 +- ...finedAssignableToEveryType_es5.1.normal.js | 3 +- ...nedAssignableToEveryType_es5.2.minified.js | 3 +- ...edIsSubtypeOfEverything_es2015.1.normal.js | 12 +- ...IsSubtypeOfEverything_es2015.2.minified.js | 10 +- ...finedIsSubtypeOfEverything_es5.1.normal.js | 15 +- ...nedIsSubtypeOfEverything_es5.2.minified.js | 15 +- ...dIntersectionInference1_es2015.1.normal.js | 6 +- ...ntersectionInference1_es2015.2.minified.js | 6 +- ...nAndIntersectionInference1_es5.1.normal.js | 6 +- ...ndIntersectionInference1_es5.2.minified.js | 6 +- ...onstituentTypeIsSubtype_es2015.1.normal.js | 15 +- ...stituentTypeIsSubtype_es2015.2.minified.js | 11 +- ...ryConstituentTypeIsSubtype_es5.1.normal.js | 15 +- ...ConstituentTypeIsSubtype_es5.2.minified.js | 13 +- ...nionTypeCallSignatures3_es2015.1.normal.js | 21 +- .../unionTypeCallSignatures3_es5.1.normal.js | 12 +- .../unionTypeEquivalence_es2015.1.normal.js | 3 +- .../unionTypeEquivalence_es5.1.normal.js | 6 +- .../unionTypeEquivalence_es5.2.minified.js | 6 +- ...ionTypeFromArrayLiteral_es2015.1.normal.js | 12 +- .../unionTypeFromArrayLiteral_es5.1.normal.js | 15 +- ...nionTypeFromArrayLiteral_es5.2.minified.js | 15 +- .../unionTypeReduction2_es2015.1.normal.js | 3 +- .../unionTypeReduction2_es5.1.normal.js | 3 +- ...unionTypesAssignability_es2015.1.normal.js | 6 +- .../unionTypesAssignability_es5.1.normal.js | 9 +- .../unionTypesAssignability_es5.2.minified.js | 9 +- ...mbolsDeclarationsErrors_es2015.1.normal.js | 12 +- ...olsDeclarationsErrors_es2015.2.minified.js | 18 +- ...eSymbolsDeclarationsErrors_es5.1.normal.js | 12 +- ...ymbolsDeclarationsErrors_es5.2.minified.js | 18 +- .../uniqueSymbolsDeclarations_es5.1.normal.js | 3 +- ...niqueSymbolsDeclarations_es5.2.minified.js | 3 +- .../uniqueSymbols_es2015.1.normal.js | 3 +- .../uniqueSymbols_es5.1.normal.js | 6 +- .../uniqueSymbols_es5.2.minified.js | 3 +- .../unknownType1_es2015.1.normal.js | 12 +- .../unknownType1_es5.1.normal.js | 12 +- .../unknownType2_es2015.1.normal.js | 39 +- .../unknownType2_es2015.2.minified.js | 4 +- .../unknownType2_es5.1.normal.js | 39 +- .../unknownType2_es5.2.minified.js | 4 +- .../validEnumAssignments_es2015.1.normal.js | 3 +- .../validEnumAssignments_es2015.2.minified.js | 3 +- .../validEnumAssignments_es5.1.normal.js | 3 +- .../validEnumAssignments_es5.2.minified.js | 3 +- ...pleVariableDeclarations_es2015.1.normal.js | 3 +- ...ltipleVariableDeclarations_es5.1.normal.js | 3 +- .../validNullAssignments_es2015.1.normal.js | 6 +- .../validNullAssignments_es2015.2.minified.js | 4 +- .../validNullAssignments_es5.1.normal.js | 6 +- .../validNullAssignments_es5.2.minified.js | 6 +- .../validNumberAssignments_es2015.1.normal.js | 3 +- ...alidNumberAssignments_es2015.2.minified.js | 3 +- .../validNumberAssignments_es5.1.normal.js | 3 +- .../validNumberAssignments_es5.2.minified.js | 3 +- .../variadicTuples1_es2015.1.normal.js | 3 +- .../variadicTuples1_es2015.2.minified.js | 3 +- .../variadicTuples1_es5.1.normal.js | 3 +- .../variadicTuples1_es5.2.minified.js | 3 +- .../variance_es2015.1.normal.js | 3 +- .../variance_es2015.2.minified.js | 3 +- .../tsc-references/variance_es5.1.normal.js | 3 +- .../tsc-references/variance_es5.2.minified.js | 3 +- ...peratorWithAnyOtherType_es2015.1.normal.js | 3 +- ...ratorWithAnyOtherType_es2015.2.minified.js | 6 +- ...idOperatorWithAnyOtherType_es5.1.normal.js | 3 +- ...OperatorWithAnyOtherType_es5.2.minified.js | 6 +- ...OperatorWithBooleanType_es2015.1.normal.js | 3 +- ...eratorWithBooleanType_es2015.2.minified.js | 3 +- ...oidOperatorWithBooleanType_es5.1.normal.js | 3 +- ...dOperatorWithBooleanType_es5.2.minified.js | 3 +- ...oidOperatorWithEnumType_es2015.1.normal.js | 7 +- ...dOperatorWithEnumType_es2015.2.minified.js | 3 +- .../voidOperatorWithEnumType_es5.1.normal.js | 7 +- ...voidOperatorWithEnumType_es5.2.minified.js | 3 +- ...dOperatorWithNumberType_es2015.1.normal.js | 3 +- ...peratorWithNumberType_es2015.2.minified.js | 3 +- ...voidOperatorWithNumberType_es5.1.normal.js | 3 +- ...idOperatorWithNumberType_es5.2.minified.js | 3 +- ...dOperatorWithStringType_es2015.1.normal.js | 3 +- ...peratorWithStringType_es2015.2.minified.js | 3 +- ...voidOperatorWithStringType_es5.1.normal.js | 3 +- ...idOperatorWithStringType_es5.2.minified.js | 3 +- .../whileBreakStatements_es2015.1.normal.js | 3 +- .../whileBreakStatements_es5.1.normal.js | 3 +- ...whileContinueStatements_es2015.1.normal.js | 3 +- .../whileContinueStatements_es5.1.normal.js | 3 +- .../tsc-references/witness_es2015.1.normal.js | 3 +- .../witness_es2015.2.minified.js | 3 +- .../tsc-references/witness_es5.1.normal.js | 3 +- .../tsc-references/witness_es5.2.minified.js | 3 +- ...ndRecursiveConstraints2_es2015.1.normal.js | 3 +- ...RecursiveConstraints2_es2015.2.minified.js | 3 +- ...ndRecursiveConstraints3_es2015.1.normal.js | 3 +- ...RecursiveConstraints3_es2015.2.minified.js | 3 +- ...ndRecursiveConstraints4_es2015.1.normal.js | 3 +- ...RecursiveConstraints4_es2015.2.minified.js | 3 +- .../full/firebase/dist/1/output/index.js | 12 +- .../full/react-autosuggest/1/output/index.js | 15 +- .../full/react-autowhatever/1/output/index.js | 15 +- .../full/react-autowhatever/2/output/index.js | 15 +- .../vercel/full/react-hooks/1/output/index.js | 3 +- .../react-instantsearch/2/output/index.js | 76 +- .../vercel/loader-only/2/output/index.js | 3 +- .../loader-only/next-31627/1/output/index.js | 12 +- .../react-autowhatever/1/output/index.js | 9 +- .../react-instantsearch/1/output/index.js | 78 +- .../deno-10141/case1/output/entry.inlined.ts | 9 +- .../fixture/deno-10141/case1/output/entry.ts | 9 +- .../deno-10820/case1/output/entry.inlined.ts | 3 +- .../fixture/deno-10820/case1/output/entry.ts | 3 +- .../deno-8148/test-2/output/entry.inlined.ts | 3 +- .../fixture/deno-8148/test-2/output/entry.ts | 3 +- .../deno-8211-3/output/entry.inlined.ts | 293 ++---- .../tests/fixture/deno-8211-3/output/entry.ts | 293 ++---- .../fixture/deno-8478/output/entry.inlined.ts | 3 +- .../tests/fixture/deno-8478/output/entry.ts | 3 +- .../fixture/deno-8574/output/entry.inlined.ts | 54 +- .../tests/fixture/deno-8574/output/entry.ts | 54 +- .../fixture/deno-8584/output/entry.inlined.ts | 6 +- .../tests/fixture/deno-8584/output/entry.ts | 6 +- .../fixture/deno-8734/output/entry.inlined.ts | 4 +- .../tests/fixture/deno-8734/output/entry.ts | 4 +- .../deno-9200/case1/output/entry.inlined.ts | 3 +- .../fixture/deno-9200/case1/output/entry.ts | 3 +- .../deno-9200/case2/output/entry.inlined.ts | 3 +- .../fixture/deno-9200/case2/output/entry.ts | 3 +- .../deno-9212/case1/output/entry.inlined.ts | 211 ++-- .../fixture/deno-9212/case1/output/entry.ts | 211 ++-- .../deno-9219/case1/output/entry.inlined.ts | 22 +- .../fixture/deno-9219/case1/output/entry.ts | 22 +- .../deno-9220/case1/output/entry.inlined.ts | 12 +- .../fixture/deno-9220/case1/output/entry.ts | 12 +- .../deno-9250/case1/output/entry.inlined.ts | 3 +- .../fixture/deno-9250/case1/output/entry.ts | 3 +- .../fixture/deno-9591/output/entry.inlined.ts | 124 +-- .../tests/fixture/deno-9591/output/entry.ts | 124 +-- .../deno-9620/case1/output/entry.inlined.ts | 12 +- .../fixture/deno-9620/case1/output/entry.ts | 12 +- .../issue-1150-2/output/entry.inlined.ts | 6 +- .../fixture/issue-1150-2/output/entry.ts | 6 +- .../issue-1150/output/entry.inlined.ts | 6 +- .../tests/fixture/issue-1150/output/entry.ts | 6 +- .../named-export/output/entry.inlined.ts | 9 +- .../issue-2124/named-export/output/entry.ts | 9 +- .../namespace-export/output/entry.inlined.ts | 9 +- .../namespace-export/output/entry.ts | 9 +- .../issue-3043/case1/output/entry.inlined.ts | 3 +- .../fixture/issue-3043/case1/output/entry.ts | 3 +- .../reexport/nested/output/entry.inlined.js | 3 +- .../fixture/reexport/nested/output/entry.js | 3 +- .../sort/enum-access/output/entry.inlined.ts | 3 +- .../fixture/sort/enum-access/output/entry.ts | 3 +- .../enum-reexport/output/entry.inlined.ts | 3 +- .../sort/enum-reexport/output/entry.ts | 3 +- crates/swc_ecma_codegen/src/lib.rs | 46 +- crates/swc_ecma_codegen/src/stmt.rs | 30 +- .../output.js | 3 +- .../output.js | 3 +- .../tests/fixture/semi/pending/001/output.js | 3 +- .../tests/fixture/semi/pending/006/output.js | 6 +- .../tests/test262/006949a4f1471866.js | 3 +- .../tests/test262/0228be549a7706e7.js | 3 +- .../tests/test262/028846a58c67687f.js | 9 +- .../tests/test262/03608b6e222ae700.js | 3 +- .../tests/test262/05089e6cc717523e.js | 3 +- .../tests/test262/05448bc107f9b759.js | 6 +- .../tests/test262/05fcc31bfd8d3e60.js | 3 +- .../tests/test262/066b76285ce79182.js | 6 +- .../tests/test262/075c7204d0b0af60.js | 3 +- .../tests/test262/0813adc754c82a98.js | 3 +- .../tests/test262/0827a8316cca777a.js | 3 +- .../tests/test262/08c3105bb3f7ccb7.js | 3 +- .../tests/test262/09be3a3198b40536.js | 3 +- .../tests/test262/09e84f25af85b836.js | 3 +- .../tests/test262/0b881b80b7220fad.js | 3 +- .../tests/test262/0bbda5d7d8ae8990.js | 3 +- .../tests/test262/0d7e3e1647af9ba6.js | 3 +- .../tests/test262/0da6496ed75822b1.module.js | 3 +- .../tests/test262/0de4ef1344cbb907.js | 3 +- .../tests/test262/0e22e969622bf137.js | 3 +- .../tests/test262/10857a84ed2962f1.js | 6 +- .../tests/test262/10d6486502949e74.js | 3 +- .../tests/test262/10f0ef998c05c611.js | 3 +- .../tests/test262/119e9dce4feae643.js | 3 +- .../tests/test262/121491a690a13543.js | 3 +- .../tests/test262/123bfcc3f6cf379f.js | 3 +- .../tests/test262/12556d5e39db1cea.js | 3 +- .../tests/test262/126a6455f0f721fe.js | 3 +- .../tests/test262/12d5bedf1812952a.js | 6 +- .../tests/test262/12ef713cb7737bdd.js | 6 +- .../tests/test262/13045bfdda0434e0.js | 3 +- .../tests/test262/1325417193f50cc3.js | 3 +- .../tests/test262/14360fa75e6ae228.js | 3 +- .../tests/test262/14551b80fa8a0ce1.module.js | 3 +- .../tests/test262/153bd6819f5fa69b.js | 3 +- .../tests/test262/16d0c12aad83f9b3.js | 3 +- .../tests/test262/18cc9a6b7038070f.js | 51 +- .../tests/test262/1938db3bb862ded1.js | 3 +- .../tests/test262/194b702816a7e5e5.js | 3 +- .../tests/test262/1a0dac12dbd33ef6.js | 3 +- .../tests/test262/1b6e33ab982844af.js | 6 +- .../tests/test262/1b884461ff1acfc6.js | 3 +- .../tests/test262/1c6c67fcd71f2d08.js | 3 +- .../tests/test262/1db0d98ff1726af8.js | 3 +- .../tests/test262/1ea254c74f1071de.js | 3 +- .../tests/test262/1f039e0eeb1bc271.js | 3 +- .../tests/test262/20f9bec9f3215688.js | 3 +- .../tests/test262/212d2ca66d97a90f.js | 3 +- .../tests/test262/218e751b8b453b9b.js | 3 +- .../tests/test262/2207b24e625f30db.js | 3 +- .../tests/test262/227118dffd2c9935.js | 3 +- .../tests/test262/22dc0bb1d4e8d89f.js | 3 +- .../tests/test262/23869c020fc2cb0f.js | 3 +- .../tests/test262/242ede66951e11b1.js | 4 +- .../tests/test262/24fa28a37061a18f.js | 3 +- .../tests/test262/252bb992a448270e.js | 3 +- .../tests/test262/26aa8b685715d445.module.js | 3 +- .../tests/test262/27409f5b7b692b24.js | 3 +- .../tests/test262/290fdc5a2f826ead.js | 3 +- .../tests/test262/2976a1598d3a75e1.js | 3 +- .../tests/test262/29ef8a7a1cbfda7f.js | 3 +- .../tests/test262/2ab9ca1f6a30c203.js | 6 +- .../tests/test262/2b83dea123ed2e2e.js | 3 +- .../tests/test262/2c7e2fecbc1cb477.js | 3 +- .../tests/test262/2d3273e0386e9cb8.js | 3 +- .../tests/test262/2e7f443b2f555bc5.js | 3 +- .../tests/test262/2f6d8a2215407ae3.js | 3 +- .../tests/test262/315692af7fe2aad3.js | 3 +- .../tests/test262/317532451c2ce8ff.js | 3 +- .../tests/test262/31cca30ad2bf696d.js | 3 +- .../tests/test262/32efa0efd255748a.js | 3 +- .../tests/test262/36224cf8215ad8e4.js | 6 +- .../tests/test262/36fb3e9c8cedf764.js | 3 +- .../tests/test262/37e4a6eca1ece7e5.js | 3 +- .../tests/test262/380e999de8f31c7d.js | 3 +- .../tests/test262/38284ea2d9914d86.js | 6 +- .../tests/test262/38befc89fcf92e25.js | 3 +- .../tests/test262/3a5a7699f0631c6f.js | 4 +- .../tests/test262/3aa600e48cbd8a5c.js | 3 +- .../tests/test262/3bac973df7480fe9.js | 3 +- .../tests/test262/3bbd75d597d54fe6.js | 3 +- .../tests/test262/3e69c5cc1a7ac103.js | 4 +- .../tests/test262/3eac36e29398cdc5.js | 4 +- .../tests/test262/3ff52d86c77678bd.js | 3 +- .../tests/test262/409f30dc7efe75d5.js | 6 +- .../tests/test262/43023cd549deee77.js | 4 +- .../tests/test262/44136fa355b3678a.js | 3 +- .../tests/test262/444856ec05e8d330.js | 3 +- .../tests/test262/4694af065eecd95a.js | 3 +- .../tests/test262/47ddfd79dcd20fd5.js | 3 +- .../tests/test262/4869454dd215468e.js | 5 +- .../tests/test262/488cd27c94308caa.js | 3 +- .../tests/test262/48bb091783df3da9.js | 3 +- .../tests/test262/48bb138a6b033a34.js | 3 +- .../tests/test262/4a56cf2dea99fcd6.js | 3 +- .../tests/test262/4b6559716b2f7b21.js | 3 +- .../tests/test262/4bd3199f5a4d8e52.js | 4 +- .../tests/test262/4beb0b6ae8b9801a.js | 3 +- .../tests/test262/4c71e11fbbc56349.js | 6 +- .../tests/test262/4d310ef039a7435c.js | 3 +- .../tests/test262/4d88f169e3827587.js | 4 +- .../tests/test262/4e7c58761e24d77c.js | 3 +- .../tests/test262/4e8e7d6fe1e67ce5.js | 3 +- .../tests/test262/4eafc760484cd72b.js | 9 +- .../tests/test262/50ac15a08f7c812f.js | 3 +- .../tests/test262/515825915b8d1cd8.js | 4 +- .../tests/test262/51a3505b43223a9f.js | 4 +- .../tests/test262/51fd2b53ad7e1581.js | 3 +- .../tests/test262/521b6dfff0a28aa1.js | 3 +- .../tests/test262/52ce5853ea953f0f.js | 3 +- .../tests/test262/541ee533b54ae664.js | 3 +- .../tests/test262/5495e25325fdd364.js | 3 +- .../tests/test262/54e70df597a4f9a3.js | 4 +- .../tests/test262/5526c98fdf9150c1.js | 3 +- .../tests/test262/55b74de671f60184.js | 6 +- .../tests/test262/55c27b3727ba1165.js | 3 +- .../tests/test262/5641ad33abcd1752.js | 3 +- .../tests/test262/56dcd0733a23aa26.js | 8 +- .../tests/test262/587400d1c019785a.js | 3 +- .../tests/test262/5a54ee2c0b326b18.js | 3 +- .../tests/test262/5b39aca97d9006f4.js | 3 +- .../tests/test262/5b8d2b991d2c1f5b.js | 3 +- .../tests/test262/5b9f113c3bdd0c49.js | 6 +- .../tests/test262/5bae374be95382c6.js | 3 +- .../tests/test262/5c57eec29a019ebb.js | 6 +- .../tests/test262/5cf0dc4259e98c15.js | 6 +- .../tests/test262/5e6d5c3edf519b99.js | 3 +- .../tests/test262/5ecbbdc097bee212.js | 3 +- .../tests/test262/5ed18bdbe48cc4c3.js | 3 +- .../tests/test262/5f730961df66e8e8.js | 3 +- .../tests/test262/5f85b0b6828b081b.js | 3 +- .../tests/test262/5fa8c711247d70f5.js | 3 +- .../tests/test262/60dcd48a3f6af44f.js | 3 +- .../tests/test262/61f55d9f22cc8426.js | 3 +- .../tests/test262/624bc7f99260037f.js | 3 +- .../tests/test262/62ab44289ebbba49.js | 3 +- .../tests/test262/64cc57f82a54b7fb.js | 3 +- .../tests/test262/64ff3b3ee7f636c5.js | 3 +- .../tests/test262/655eab0815e0567e.js | 3 +- .../tests/test262/66bd9903ea05f8cc.js | 6 +- .../tests/test262/6733f491913ccff2.js | 3 +- .../tests/test262/673e6f2765ef3cb3.js | 3 +- .../tests/test262/6776e2c88e03f1a2.js | 3 +- .../tests/test262/687b7b904904fcfd.js | 3 +- .../tests/test262/698a8cfb0705c277.js | 3 +- .../tests/test262/69bbdc7c34ed23cc.js | 3 +- .../tests/test262/6b68aefbfbf0beb9.js | 3 +- .../tests/test262/6b76b8761a049c19.js | 3 +- .../tests/test262/6c27d048b07ca7e0.js | 12 +- .../tests/test262/6edc155d463535cb.js | 3 +- .../tests/test262/6f824ec22e22a198.js | 3 +- .../tests/test262/70bf2c409480ae10.js | 3 +- .../tests/test262/73298cb8636154f2.js | 3 +- .../tests/test262/75172741c27c7703.js | 3 +- .../tests/test262/753341b6f22ec11f.js | 3 +- .../tests/test262/753a8b016a700975.js | 3 +- .../tests/test262/75bb6594d6ad253f.module.js | 3 +- .../tests/test262/779e65d6349f1616.js | 6 +- .../tests/test262/784a059faa166072.js | 3 +- .../tests/test262/7855fbf5ea10e622.js | 3 +- .../tests/test262/78ea6e4e98c18f91.js | 3 +- .../tests/test262/78ecd285b8b44e99.js | 3 +- .../tests/test262/78fa04077cf1950c.js | 3 +- .../tests/test262/790a34467d7d9d58.js | 3 +- .../tests/test262/791ee64772f0ea45.js | 3 +- .../tests/test262/7bdcce70c382a9a4.js | 3 +- .../tests/test262/7dea677261fc5dd8.module.js | 3 +- .../tests/test262/7e99cc8b7ce365fb.js | 3 +- .../tests/test262/7fbe94acda67721e.js | 3 +- .../tests/test262/80d2351a5ae68524.js | 3 +- .../tests/test262/81be1572d1eebdf2.js | 3 +- .../tests/test262/820521ef532dce18.js | 3 +- .../tests/test262/8286caaa8e0196bb.js | 3 +- .../tests/test262/8340cdb8653046bb.js | 3 +- .../tests/test262/83fc5b5bbdb601ef.js | 9 +- .../tests/test262/8411f3c15e3e8529.js | 3 +- .../tests/test262/845631d1a33b3409.js | 6 +- .../tests/test262/85263ecacc7a4dc5.js | 3 +- .../tests/test262/8628cd459b39ffe8.js | 4 +- .../tests/test262/8664d1a4e7a73078.js | 3 +- .../tests/test262/86f68610fcefaeae.js | 6 +- .../tests/test262/870a0b8d891753e9.js | 3 +- .../tests/test262/88d42455ac933ef5.js | 6 +- .../tests/test262/88e99d6cd8e8d87f.js | 3 +- .../tests/test262/891fc3470b618587.js | 3 +- .../tests/test262/8c5c46a300d5addb.module.js | 3 +- .../tests/test262/8d14286a8cc6ee9d.js | 3 +- .../tests/test262/8d470354c5d2e216.js | 3 +- .../tests/test262/8d67ad04bfc356c9.js | 3 +- .../tests/test262/8d7d59e5d573ca84.js | 3 +- .../tests/test262/8dbf5f9322d8b5ac.js | 3 +- .../tests/test262/8de47a8b53495792.js | 3 +- .../tests/test262/8e6c915d1746636d.js | 3 +- .../tests/test262/8ecaef2617d8c6a7.js | 4 +- .../tests/test262/8f659ed872554f99.js | 3 +- .../tests/test262/8f9e8be5a6c50e77.js | 3 +- .../tests/test262/901fca17189cd709.js | 3 +- .../tests/test262/90abe26c46af6975.js | 3 +- .../tests/test262/914ae3168da48965.js | 3 +- .../tests/test262/918e105a2ff6c64a.js | 3 +- .../tests/test262/92fd8e24864fde0a.js | 3 +- .../tests/test262/939479d60d564ccd.js | 3 +- .../tests/test262/93c75264893587a5.js | 3 +- .../tests/test262/9495a0dcecf5713c.js | 3 +- .../tests/test262/94b8a654a87039b9.js | 3 +- .../tests/test262/94cb828d5dcfd136.js | 4 +- .../tests/test262/973cbc9ece13acbc.js | 6 +- .../tests/test262/976afd9ae5f5d71a.module.js | 3 +- .../tests/test262/98df58b0c40fac90.js | 3 +- .../tests/test262/99cdfc40e20af6f5.js | 3 +- .../tests/test262/99fceed987b8ec3d.js | 3 +- .../tests/test262/9aa93e1e417ce8e3.js | 3 +- .../tests/test262/9c30b0817f412a30.js | 3 +- .../tests/test262/9d3d960e32528788.js | 3 +- .../tests/test262/9dc20e081005fba4.js | 3 +- .../tests/test262/9e3e46891aaf13de.js | 3 +- .../tests/test262/9fd584806e085e35.js | 6 +- .../tests/test262/a08ed291f78352a0.js | 3 +- .../tests/test262/a1594a4d0c0ee99a.js | 3 +- .../tests/test262/a18a8865e65d4bdd.js | 3 +- .../tests/test262/a2798917405b080b.js | 4 +- .../tests/test262/a2cb5a14559c6a50.js | 4 +- .../tests/test262/a3b497c58f78b243.js | 3 +- .../tests/test262/a42a93f3af33bbc5.js | 3 +- .../tests/test262/a454d2e2ab3484e6.js | 3 +- .../tests/test262/a54cca69085ad35a.js | 3 +- .../tests/test262/a8535eac4c7c9c3a.js | 3 +- .../tests/test262/a86a29773d1168d3.js | 4 +- .../tests/test262/a9e4ff39f145a1fd.js | 3 +- .../tests/test262/a9f99e657441a735.js | 3 +- .../tests/test262/aaf1be6cd60a9ac9.js | 3 +- .../tests/test262/ab452fc45813857a.js | 3 +- .../tests/test262/ac09566949f0db57.js | 3 +- .../tests/test262/ad6bf12aa7eda975.js | 3 +- .../tests/test262/ad7d61a732903cd8.js | 3 +- .../tests/test262/ae89d08bdd65b56b.js | 6 +- .../tests/test262/af1d905ed056724f.js | 3 +- .../tests/test262/af4bbcea9802b120.js | 3 +- .../tests/test262/afa63b136c835723.js | 6 +- .../tests/test262/affd557fd820e1f2.js | 6 +- .../tests/test262/b030378ad6e36751.js | 3 +- .../tests/test262/b0659cf9cb6793a2.js | 3 +- .../tests/test262/b0c6752e1db068ed.js | 3 +- .../tests/test262/b1c37dedeec0b867.js | 3 +- .../tests/test262/b24fa2a1936d38d9.js | 3 +- .../tests/test262/b29070859dbeaf08.js | 3 +- .../tests/test262/b2e6c124e2822117.js | 6 +- .../tests/test262/b363a70923be42c8.js | 3 +- .../tests/test262/b42377ca7015e7d4.js | 3 +- .../tests/test262/b433b0cfef2a3cd1.js | 3 +- .../tests/test262/b471292fedf2f813.js | 3 +- .../tests/test262/b549d045fc8e93bf.js | 4 +- .../tests/test262/b5a1e1a3679f81ba.js | 3 +- .../tests/test262/b77549e54bfef0f9.js | 3 +- .../tests/test262/b7a6a807ae6db312.js | 3 +- .../tests/test262/b7cd8df8dc875529.js | 3 +- .../tests/test262/b7d99c0034be0ce1.js | 3 +- .../tests/test262/b86b0122e80c330e.js | 3 +- .../tests/test262/b8705496c9c1ff60.js | 3 +- .../tests/test262/b93d116fd0409637.js | 3 +- .../tests/test262/b96ba7cdf0b42ca9.js | 3 +- .../tests/test262/ba21e63736d8fd46.js | 3 +- .../tests/test262/ba4cc699857f41f2.js | 6 +- .../tests/test262/ba9a047839eb4682.js | 3 +- .../tests/test262/bb447d4ed988a1cb.js | 3 +- .../tests/test262/bb7db120ad2fe995.js | 3 +- .../tests/test262/bbff5671643cc2ea.js | 3 +- .../tests/test262/bbffb851469a3f0e.js | 3 +- .../tests/test262/bc89b2b2f1e19f9e.js | 3 +- .../tests/test262/bd28a7d19ac0d50b.js | 3 +- .../tests/test262/bd697f0fda948394.js | 3 +- .../tests/test262/bdc4accd07049034.js | 6 +- .../tests/test262/bde1a5ea9aebf9d2.js | 3 +- .../tests/test262/be9d538d5041fd5f.js | 3 +- .../tests/test262/bf210a4f0cf9e352.js | 6 +- .../tests/test262/bf8ffad512a5f568.js | 12 +- .../tests/test262/c0f5f3f7db69c5a0.js | 3 +- .../tests/test262/c1c5c5d42a32aac1.js | 3 +- .../tests/test262/c2558dc20a45b0a8.js | 3 +- .../tests/test262/c2f12d66ce17d5ab.js | 3 +- .../tests/test262/c35dcf99291ec6be.js | 3 +- .../tests/test262/c4a57a72e25e042c.js | 3 +- .../tests/test262/c5b2ea7da55d24c1.js | 6 +- .../tests/test262/c5bd72f618d7cade.js | 3 +- .../tests/test262/c756f39dca1f7423.js | 3 +- .../tests/test262/c771490bbb3dd6e9.js | 3 +- .../tests/test262/c8513472857eae9c.js | 3 +- .../tests/test262/c8565124aee75c69.js | 3 +- .../tests/test262/c8689b6da6fd227a.js | 3 +- .../tests/test262/c87859666bd18c8c.js | 3 +- .../tests/test262/c92dc954a0ce196d.module.js | 3 +- .../tests/test262/c963ac653b30699b.js | 3 +- .../tests/test262/c964ed7bc2373c54.js | 6 +- .../tests/test262/ca20c15b39c87033.js | 3 +- .../tests/test262/ca7a0ca0d22f30f8.js | 3 +- .../tests/test262/cda499c521ff60c7.js | 18 +- .../tests/test262/cdca52810bbe4532.js | 3 +- .../tests/test262/cdf411040ab4b29b.js | 3 +- .../tests/test262/ce0aaec02d5d4465.js | 3 +- .../tests/test262/ce8c443eb361e1a2.js | 3 +- .../tests/test262/cec2d94dc09a6a71.js | 6 +- .../tests/test262/d010d377bcfd5565.js | 6 +- .../tests/test262/d33efc20e46c3961.js | 3 +- .../tests/test262/d37653c5aedf3d46.js | 3 +- .../tests/test262/d3c1ea553fea8944.js | 3 +- .../tests/test262/d3d6ca7932414eed.js | 12 +- .../tests/test262/d4b898b45172a637.js | 6 +- .../tests/test262/d53aef16fe683218.js | 3 +- .../tests/test262/d767138e133ad239.js | 3 +- .../tests/test262/d82ae3dbc61808f8.js | 3 +- .../tests/test262/da3756d1f8acb3c5.js | 3 +- .../tests/test262/da671a25e498bcac.module.js | 3 +- .../tests/test262/da9fdc3a2d7f9452.js | 3 +- .../tests/test262/dc1acc240053a397.js | 3 +- .../tests/test262/dc2b756c7828d827.module.js | 3 +- .../tests/test262/dcc5609dcc043200.js | 3 +- .../tests/test262/dcc9c2ff46392f30.js | 3 +- .../tests/test262/dcfb11abc780d6d9.js | 3 +- .../tests/test262/de6dd6b2ec971861.js | 3 +- .../tests/test262/dec1ae80150e1664.js | 3 +- .../tests/test262/dfa22e3eac3cd26e.js | 3 +- .../tests/test262/dfbd1b07bd57a08d.js | 3 +- .../tests/test262/e01c7172cf204b92.js | 3 +- .../tests/test262/e08e181172bad2b1.js | 6 +- .../tests/test262/e0c3f07a142a589d.js | 3 +- .../tests/test262/e0fc2148b455a6be.js | 3 +- .../tests/test262/e1d373aa5d926fde.module.js | 3 +- .../tests/test262/e1dd1979a86a5f1d.js | 4 +- .../tests/test262/e2470430b235b9bb.module.js | 3 +- .../tests/test262/e42f306327c0f578.js | 3 +- .../tests/test262/e54c1a2fc15cd4b8.js | 9 +- .../tests/test262/e6b424d430520bf2.js | 3 +- .../tests/test262/e71a91c61343cdb1.js | 3 +- .../tests/test262/e78c7b54fc87d08c.js | 3 +- .../tests/test262/e7fa87b10d5136a0.js | 6 +- .../tests/test262/e9d44e4cbaf92011.js | 3 +- .../tests/test262/ec99a663d6f3983d.js | 3 +- .../tests/test262/edd1f39f90576180.js | 3 +- .../tests/test262/ef086346e9707e91.js | 3 +- .../tests/test262/efef19e06f58fdd9.js | 3 +- .../tests/test262/f01d9f3c7b2b2717.js | 3 +- .../tests/test262/f13a130829aa77c5.js | 3 +- .../tests/test262/f404f7ff29ba5d1a.module.js | 3 +- .../tests/test262/f597b0312e2b678c.js | 3 +- .../tests/test262/f658dbaa20c36388.js | 3 +- .../tests/test262/f7291c5ec70a4152.js | 3 +- .../tests/test262/f8cf06a0d5699319.js | 3 +- .../tests/test262/fa5b398eeef697a6.js | 3 +- .../tests/test262/fa9eaf58f51d6926.js | 3 +- .../tests/test262/faa4a026e1e86145.js | 3 +- .../tests/test262/fada2c7bbfabe14a.js | 3 +- .../tests/test262/fb8db7a71f3755fc.js | 3 +- .../tests/test262/fbde237f11796df9.js | 3 +- .../tests/test262/fc035551a2a4c15c.js | 3 +- .../tests/test262/fc063bfba795ad91.js | 3 +- .../tests/test262/fc1ba7d289fb1af1.js | 3 +- .../tests/test262/fd167642d02f2c66.js | 3 +- .../tests/test262/fdb05dfd469c46c4.js | 3 +- .../tests/test262/fe5f0dcb8e902857.js | 3 +- .../tests/test262/ffcf0064736d41e7.js | 3 +- .../fixture/issues/2044/pass-1/output.js | 4 +- .../fixture/issues/2044/pass-10/output.js | 4 +- .../fixture/issues/2257/full/output.js | 981 ++++++------------ .../compress/fixture/issues/2558/1/output.js | 6 +- .../compress/fixture/issues/2807/1/output.js | 3 +- .../fixture/issues/d3-time-format/3/output.js | 3 +- .../fixture/issues/emotion/react/1/output.js | 24 +- .../fixture/issues/firebase-core/1/output.js | 155 +-- .../issues/firebase-firestore/1/output.js | 209 ++-- .../fixture/issues/firebase/2/output.js | 3 +- .../fixture/issues/firebase/dist/1/output.js | 12 +- .../fixture/issues/issue-2604/1/output.js | 3 +- .../fixture/issues/moment/1/output.js | 73 +- .../fixture/issues/quagga2/1.4.2/1/output.js | 224 ++-- .../issues/react-autosuggest/1/output.js | 15 +- .../issues/react-autowhatever/1/output.js | 6 +- .../fixture/issues/react-countup/1/output.js | 49 +- .../issues/react-instancesearch/002/output.js | 24 +- .../issues/react-instancesearch/003/output.js | 24 +- .../issues/react-instancesearch/004/output.js | 76 +- .../fixture/issues/react/hooks/1/output.js | 3 +- .../fixture/issues/react/hooks/3/output.js | 3 +- .../fixture/issues/react/hooks/5/output.js | 3 +- .../fixture/issues/vercel/003/output.js | 3 +- .../fixture/issues/vercel/006/output.js | 3 +- .../fixture/projects/backbone/10/output.js | 3 +- .../fixture/projects/backbone/13/output.js | 3 +- .../fixture/projects/backbone/14/output.js | 7 +- .../fixture/projects/backbone/15/output.js | 3 +- .../fixture/projects/backbone/16/output.js | 3 +- .../fixture/projects/backbone/17/output.js | 3 +- .../fixture/projects/backbone/19/output.js | 3 +- .../fixture/projects/backbone/2/output.js | 3 +- .../fixture/projects/backbone/20/output.js | 6 +- .../fixture/projects/backbone/4/output.js | 3 +- .../fixture/projects/backbone/5/output.js | 3 +- .../fixture/projects/backbone/9/output.js | 3 +- .../fixture/projects/jquery/11/output.js | 9 +- .../fixture/projects/jquery/12/output.js | 4 +- .../fixture/projects/jquery/16/output.js | 4 +- .../fixture/projects/jquery/2/output.js | 8 +- .../fixture/projects/jquery/23/output.js | 3 +- .../fixture/projects/mootools/7/output.js | 3 +- .../383.5942fafdbede773d29c7/output.js | 3 +- .../808.7518829f34ebf3ce0082/output.js | 3 +- .../output.js | 27 +- .../function-7fe8439c89afccb77983/output.js | 27 +- .../head-432fc3a9a66c90ce2ec2/output.js | 27 +- .../output.js | 48 +- .../nested-05a7ce04b1f7eb6da341/output.js | 27 +- .../no-chunk-e2d9573b8d7df68a6cde/output.js | 30 +- .../no-ssr-9ced90e71a0d75a11cdd/output.js | 27 +- .../output.js | 27 +- .../ssr-994266264fb6ff57d32c/output.js | 27 +- .../ssr-true-6d4aa8fc503b9d073aef/output.js | 27 +- .../fixture/projects/react/10/output.js | 3 +- .../fixture/projects/react/5/output.js | 6 +- .../fixture/projects/underscore/8/output.js | 3 +- .../chunks/hoofd.module.6c5395cb/output.js | 6 +- .../fixture/projects/yui/13/output.js | 3 +- .../compress/fixture/projects/yui/3/output.js | 3 +- .../compress/fixture/projects/yui/4/output.js | 3 +- .../compress/fixture/projects/yui/7/output.js | 3 +- .../compress/fixture/projects/yui/9/output.js | 4 +- .../fixture/simple/issues/2007/1/output.js | 6 +- .../fixture/simple/order/fn/1/output.js | 6 +- .../tests/mangle/1/output.js | 3 +- .../tests/mangle/reuse/2/output.js | 24 +- .../tests/mangle/reuse/3/output.js | 51 +- .../tests/projects/output/angular-1.2.5.js | 263 ++--- .../tests/projects/output/backbone-1.1.0.js | 129 +-- .../tests/projects/output/jquery-1.9.1.js | 229 ++-- .../projects/output/jquery.mobile-1.4.2.js | 216 ++-- .../tests/projects/output/mootools-1.4.5.js | 318 ++---- .../tests/projects/output/react-17.0.2.js | 78 +- .../tests/projects/output/react-dom-17.0.2.js | 264 ++--- .../tests/projects/output/underscore-1.5.2.js | 36 +- .../tests/projects/output/yui-3.12.0.js | 221 ++-- .../corejs2/exclude-include/output.mjs | 3 +- .../corejs3/exclude-include/output.mjs | 3 +- .../tests/resolver/class/block/1/output.js | 3 +- .../tests/resolver/class/block/2/output.js | 3 +- .../class/var/constructor-only/output.js | 3 +- .../tests/resolver/issue/1140/output.js | 3 +- .../tests/resolver/issue/281/2/output.js | 3 +- .../tests/resolver/issue/295/output.js | 3 +- .../tests/resolver/issue/308/1/output.js | 3 +- .../tests/resolver/issue/308/2/output.js | 3 +- .../tests/resolver/issue/369/2/output.js | 6 +- .../tests/resolver/issue/396/1/output.js | 3 +- .../tests/resolver/issue/396/2/output.js | 3 +- .../tests/resolver/issue/454/1/output.js | 3 +- .../tests/resolver/issue/454/2/output.js | 6 +- .../tests/resolver/issue/454/3/output.js | 3 +- .../tests/resolver/issue/699/1/output.js | 3 +- .../tests/resolver/issue/760/output.js | 4 +- .../tests/resolver/minifier/0001/output.js | 3 +- .../nested/fn_expr/var/scope/fn/output.js | 3 +- .../tests/resolver/pr_1171/1/output.js | 6 +- .../tests/resolver/pr_1171/2/output.js | 6 +- .../vercel/next/server/render/1/output.js | 36 +- .../tests/ts-resolver/deno/9650/1/output.ts | 3 +- .../ts-resolver/deno/lint/612/1/output.ts | 6 +- .../codeGeneration/importStatements/output.ts | 3 +- .../ts-resolver/ts_module_name_1/output.ts | 3 +- .../ts_resolver_deno_undef_001/output.ts | 3 +- .../ts_resolver_nested_enum/output.ts | 6 +- .../ts_resolver_nested_interface/output.ts | 6 +- .../ts_resolver_nested_type_alias/output.ts | 6 +- .../tsc/computed/property/name/11/output.ts | 15 +- .../tsc/generatedContextualTyping/1/output.ts | 6 +- .../output.ts | 3 +- .../fixture/classes/next-31627/1/output.js | 3 +- .../fixture/next/server/render/1/output.js | 36 +- .../pass/alias/import/multi/output/entry.js | 6 +- .../pass/alias/import/simple/output/entry.js | 3 +- .../pass/cjs/common-library/output/entry.js | 9 +- .../pass/cjs/conditional/output/entry.js | 9 +- .../output/entry.js | 9 +- .../output/entry.js | 9 +- .../tests/pass/cjs/mixed/output/entry.js | 9 +- .../tests/pass/cjs/nested/output/entry.js | 9 +- .../tests/pass/deno-001/full/output/entry.js | 7 +- .../pass/deno-001/simple-1/output/entry.js | 3 +- .../pass/deno-001/simple-2/output/entry.js | 15 +- .../pass/deno-001/simple-3/output/entry.js | 3 +- .../pass/deno-001/simple-4/output/entry.js | 3 +- .../pass/deno-001/simple-5/output/entry.js | 6 +- .../side-effect/import-multi/output/entry.js | 6 +- .../name-conflict/in-entry/output/entry.js | 9 +- .../import/namespace/simple/output/entry.js | 6 +- .../pass/issue-1138/example-1/output/entry.js | 3 +- .../pass/issue-1138/example-2/output/entry.js | 3 +- .../pass/issue-1138/example-3/output/entry.js | 3 +- .../tests/pass/issue-1225/cjs/output/entry.js | 9 +- .../tests/pass/issue-1225/esm/output/entry.js | 9 +- .../pass/issue-1328/case1/output/entry.js | 39 +- .../issue-2124/named-export/output/entry.js | 9 +- .../library/simple/output/entry.js | 21 +- .../tests/pass/regenerator/1/output/entry.js | 39 +- .../pass/resolve-name-fix/output/entry.js | 225 ++-- .../import/simple-2/output/entry.js | 3 +- .../preserve-import/output/entry-a.js | 3 +- 5754 files changed, 15965 insertions(+), 33166 deletions(-) diff --git a/crates/swc/tests/fixture/issue-1160/output/entry.ts b/crates/swc/tests/fixture/issue-1160/output/entry.ts index 3852ac816f6..8126735cf92 100644 --- a/crates/swc/tests/fixture/issue-1160/output/entry.ts +++ b/crates/swc/tests/fixture/issue-1160/output/entry.ts @@ -1,7 +1,6 @@ "use strict"; function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = { - }; + var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); @@ -42,8 +41,7 @@ var MyEnum; (function(MyEnum) { MyEnum["x"] = "xxx"; MyEnum["y"] = "yyy"; -})(MyEnum || (MyEnum = { -})); +})(MyEnum || (MyEnum = {})); let Xpto = ((_class = class Xpto { constructor(){ _initializerDefineProperty(this, "value", _descriptor, this); @@ -58,6 +56,5 @@ let Xpto = ((_class = class Xpto { initializer: void 0 }), _class); function Decorator() { - return function(...args) { - }; + return function(...args) {}; } diff --git a/crates/swc/tests/fixture/issue-1232/cjs/output/index.js b/crates/swc/tests/fixture/issue-1232/cjs/output/index.js index b0c1c3699cf..3e1ac6b1210 100644 --- a/crates/swc/tests/fixture/issue-1232/cjs/output/index.js +++ b/crates/swc/tests/fixture/issue-1232/cjs/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1278/output/index.ts b/crates/swc/tests/fixture/issue-1278/output/index.ts index f46fdfe073c..c2b734dc36b 100644 --- a/crates/swc/tests/fixture/issue-1278/output/index.ts +++ b/crates/swc/tests/fixture/issue-1278/output/index.ts @@ -1,7 +1,6 @@ "use strict"; function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = { - }; + var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); diff --git a/crates/swc/tests/fixture/issue-1307/output/index.ts b/crates/swc/tests/fixture/issue-1307/output/index.ts index 4412c2e4f88..3fe2d7faf20 100644 --- a/crates/swc/tests/fixture/issue-1307/output/index.ts +++ b/crates/swc/tests/fixture/issue-1307/output/index.ts @@ -8,13 +8,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1333/case2/output/index.js b/crates/swc/tests/fixture/issue-1333/case2/output/index.js index 1afabd1fe3e..545f79a9dd8 100644 --- a/crates/swc/tests/fixture/issue-1333/case2/output/index.js +++ b/crates/swc/tests/fixture/issue-1333/case2/output/index.js @@ -80,8 +80,7 @@ class Shard extends _utils.Emitter { /** * Destroys this shard. * @param {ShardDestroyOptions} [options={}] - */ destroy({ code =1000 , emit =true , log =true , reset =false } = { - }) { + */ destroy({ code =1000 , emit =true , log =true , reset =false } = {}) { if (log) { this._debug(`Destroying; Code = ${code}, Resetting? = ${reset ? "yes" : "no"}`); } diff --git a/crates/swc/tests/fixture/issue-1345/output/index.ts b/crates/swc/tests/fixture/issue-1345/output/index.ts index 5210b29581c..dcb8a4d76ff 100644 --- a/crates/swc/tests/fixture/issue-1345/output/index.ts +++ b/crates/swc/tests/fixture/issue-1345/output/index.ts @@ -1,6 +1,5 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = { - }; + var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); diff --git a/crates/swc/tests/fixture/issue-1362/case1/output/index.ts b/crates/swc/tests/fixture/issue-1362/case1/output/index.ts index a565626f450..f85295f676e 100644 --- a/crates/swc/tests/fixture/issue-1362/case1/output/index.ts +++ b/crates/swc/tests/fixture/issue-1362/case1/output/index.ts @@ -7,8 +7,7 @@ var _common = require("@nestjs/common"); var _appService = require("./app.service"); var _createUserDto = require("./dtos/CreateUserDto"); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = { - }; + var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); diff --git a/crates/swc/tests/fixture/issue-1421/case1/output/index.ts b/crates/swc/tests/fixture/issue-1421/case1/output/index.ts index 2ce3568b60a..dc929a55096 100644 --- a/crates/swc/tests/fixture/issue-1421/case1/output/index.ts +++ b/crates/swc/tests/fixture/issue-1421/case1/output/index.ts @@ -1,8 +1,7 @@ "use strict"; require("reflect-metadata"); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = { - }; + var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); diff --git a/crates/swc/tests/fixture/issue-1449/case1/output/index.js b/crates/swc/tests/fixture/issue-1449/case1/output/index.js index 360698c2e80..922dfe92dc2 100644 --- a/crates/swc/tests/fixture/issue-1449/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-1449/case1/output/index.js @@ -40,8 +40,7 @@ function _foo() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - tmp = baz.bar, ref = tmp === void 0 ? { - } : tmp, ref = ref !== null ? ref : _throw(new TypeError("Cannot destructure undefined")); + tmp = baz.bar, ref = tmp === void 0 ? {} : tmp, ref = ref !== null ? ref : _throw(new TypeError("Cannot destructure undefined")); case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/fixture/issue-1456/case2/output/index.ts b/crates/swc/tests/fixture/issue-1456/case2/output/index.ts index 9089e199246..9c1ab59dae0 100644 --- a/crates/swc/tests/fixture/issue-1456/case2/output/index.ts +++ b/crates/swc/tests/fixture/issue-1456/case2/output/index.ts @@ -7,8 +7,7 @@ var _dec = typeof Reflect !== "undefined" && typeof Reflect.metadata === "functi }; let MyClass1 = _class = _dec2(_class = _dec1(_class = _dec((_class = // work class MyClass1 { - constructor(param1){ - } + constructor(param1){} }) || _class) || _class) || _class) || _class; var _dec3 = typeof Reflect !== "undefined" && typeof Reflect.metadata === "function" && Reflect.metadata("design:paramtypes", [ typeof Injected === "undefined" ? Object : Injected, diff --git a/crates/swc/tests/fixture/issue-1490/case1/output/index.js b/crates/swc/tests/fixture/issue-1490/case1/output/index.js index 30d8feb4d11..ab8de2e03b1 100644 --- a/crates/swc/tests/fixture/issue-1490/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-1490/case1/output/index.js @@ -87,8 +87,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1490/full/output/index.js b/crates/swc/tests/fixture/issue-1490/full/output/index.js index 39780ffba4a..a7a9a01916a 100644 --- a/crates/swc/tests/fixture/issue-1490/full/output/index.js +++ b/crates/swc/tests/fixture/issue-1490/full/output/index.js @@ -15,8 +15,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -145,8 +144,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1505/case1/output/index.ts b/crates/swc/tests/fixture/issue-1505/case1/output/index.ts index 2ac95832424..c9a6490cf04 100644 --- a/crates/swc/tests/fixture/issue-1505/case1/output/index.ts +++ b/crates/swc/tests/fixture/issue-1505/case1/output/index.ts @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1505/case2/output/index.ts b/crates/swc/tests/fixture/issue-1505/case2/output/index.ts index 3241620dd79..48adcbeed60 100644 --- a/crates/swc/tests/fixture/issue-1505/case2/output/index.ts +++ b/crates/swc/tests/fixture/issue-1505/case2/output/index.ts @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1505/case3/output/index.tsx b/crates/swc/tests/fixture/issue-1505/case3/output/index.tsx index ab83bf1c11a..f4e6b90b1da 100644 --- a/crates/swc/tests/fixture/issue-1505/case3/output/index.tsx +++ b/crates/swc/tests/fixture/issue-1505/case3/output/index.tsx @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1505/case4/output/index.tsx b/crates/swc/tests/fixture/issue-1505/case4/output/index.tsx index e282ed1f0f4..2e13cd3b398 100644 --- a/crates/swc/tests/fixture/issue-1505/case4/output/index.tsx +++ b/crates/swc/tests/fixture/issue-1505/case4/output/index.tsx @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1505/case5/output/index.tsx b/crates/swc/tests/fixture/issue-1505/case5/output/index.tsx index d20b6ed77bc..4148a1388c4 100644 --- a/crates/swc/tests/fixture/issue-1505/case5/output/index.tsx +++ b/crates/swc/tests/fixture/issue-1505/case5/output/index.tsx @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1505/tsx-default/output/index.ts b/crates/swc/tests/fixture/issue-1505/tsx-default/output/index.ts index 3241620dd79..48adcbeed60 100644 --- a/crates/swc/tests/fixture/issue-1505/tsx-default/output/index.ts +++ b/crates/swc/tests/fixture/issue-1505/tsx-default/output/index.ts @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1515/case1/output/input.ts b/crates/swc/tests/fixture/issue-1515/case1/output/input.ts index 4c07ab73cff..86706e81eac 100644 --- a/crates/swc/tests/fixture/issue-1515/case1/output/input.ts +++ b/crates/swc/tests/fixture/issue-1515/case1/output/input.ts @@ -20,8 +20,7 @@ exports.ServiceError = ServiceError; Code[Code["timedOut"] = 504] = "timedOut"; Code[Code["badRequest"] = 400] = "badRequest"; Code[Code["badResponse"] = 422] = "badResponse"; - })(Code = ServiceError1.Code || (ServiceError1.Code = { - })); + })(Code = ServiceError1.Code || (ServiceError1.Code = {})); class ServiceNotFound extends ServiceError { constructor(...args){ super(...args); @@ -37,5 +36,4 @@ exports.ServiceError = ServiceError; }; } ServiceError1.toMessageBody = toMessageBody; -})(ServiceError || (ServiceError = { -})); +})(ServiceError || (ServiceError = {})); diff --git a/crates/swc/tests/fixture/issue-1525/case1/output/index.tsx b/crates/swc/tests/fixture/issue-1525/case1/output/index.tsx index 25f46b77e36..cfc27680fee 100644 --- a/crates/swc/tests/fixture/issue-1525/case1/output/index.tsx +++ b/crates/swc/tests/fixture/issue-1525/case1/output/index.tsx @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1554/case1/output/index.js b/crates/swc/tests/fixture/issue-1554/case1/output/index.js index 27aaea928e3..390fa56a0d4 100644 --- a/crates/swc/tests/fixture/issue-1554/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-1554/case1/output/index.js @@ -19,13 +19,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1554/case2/output/index.js b/crates/swc/tests/fixture/issue-1554/case2/output/index.js index d6dc334d643..b5fe1333540 100644 --- a/crates/swc/tests/fixture/issue-1554/case2/output/index.js +++ b/crates/swc/tests/fixture/issue-1554/case2/output/index.js @@ -25,13 +25,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1575/case1/output/index.js b/crates/swc/tests/fixture/issue-1575/case1/output/index.js index eef4f4aefb7..b473c691836 100644 --- a/crates/swc/tests/fixture/issue-1575/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-1575/case1/output/index.js @@ -35,8 +35,7 @@ Vue.component('test', { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - if (this.msg === '') { - } + if (this.msg === '') {} case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/fixture/issue-1600/output/index.js b/crates/swc/tests/fixture/issue-1600/output/index.js index c8b16608c70..855d1ef95fa 100644 --- a/crates/swc/tests/fixture/issue-1600/output/index.js +++ b/crates/swc/tests/fixture/issue-1600/output/index.js @@ -1,4 +1,2 @@ -var x = function a() { -}; -var y = function a() { -}; +var x = function a() {}; +var y = function a() {}; diff --git a/crates/swc/tests/fixture/issue-1614/case1/output/index.ts b/crates/swc/tests/fixture/issue-1614/case1/output/index.ts index 2cf1b3465b4..63a7c70b3ff 100644 --- a/crates/swc/tests/fixture/issue-1614/case1/output/index.ts +++ b/crates/swc/tests/fixture/issue-1614/case1/output/index.ts @@ -3,13 +3,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1660/case1/output/index.js b/crates/swc/tests/fixture/issue-1660/case1/output/index.js index 9d7635dd2f9..527eceaa2f1 100644 --- a/crates/swc/tests/fixture/issue-1660/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-1660/case1/output/index.js @@ -25,8 +25,7 @@ console.log(/*#__PURE__*/ function() { _createClass(_class, [ { key: "run", - value: function run() { - } + value: function run() {} } ]); return _class; diff --git a/crates/swc/tests/fixture/issue-1660/case3/output/index.js b/crates/swc/tests/fixture/issue-1660/case3/output/index.js index 9d7635dd2f9..527eceaa2f1 100644 --- a/crates/swc/tests/fixture/issue-1660/case3/output/index.js +++ b/crates/swc/tests/fixture/issue-1660/case3/output/index.js @@ -25,8 +25,7 @@ console.log(/*#__PURE__*/ function() { _createClass(_class, [ { key: "run", - value: function run() { - } + value: function run() {} } ]); return _class; diff --git a/crates/swc/tests/fixture/issue-1660/es3/output/index.js b/crates/swc/tests/fixture/issue-1660/es3/output/index.js index 9d7635dd2f9..527eceaa2f1 100644 --- a/crates/swc/tests/fixture/issue-1660/es3/output/index.js +++ b/crates/swc/tests/fixture/issue-1660/es3/output/index.js @@ -25,8 +25,7 @@ console.log(/*#__PURE__*/ function() { _createClass(_class, [ { key: "run", - value: function run() { - } + value: function run() {} } ]); return _class; diff --git a/crates/swc/tests/fixture/issue-1660/es5/output/index.js b/crates/swc/tests/fixture/issue-1660/es5/output/index.js index 9d7635dd2f9..527eceaa2f1 100644 --- a/crates/swc/tests/fixture/issue-1660/es5/output/index.js +++ b/crates/swc/tests/fixture/issue-1660/es5/output/index.js @@ -25,8 +25,7 @@ console.log(/*#__PURE__*/ function() { _createClass(_class, [ { key: "run", - value: function run() { - } + value: function run() {} } ]); return _class; diff --git a/crates/swc/tests/fixture/issue-1682/case2/output/index.ts b/crates/swc/tests/fixture/issue-1682/case2/output/index.ts index ea6287821d4..7ac41e47185 100644 --- a/crates/swc/tests/fixture/issue-1682/case2/output/index.ts +++ b/crates/swc/tests/fixture/issue-1682/case2/output/index.ts @@ -8,13 +8,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1687/output/input.tsx b/crates/swc/tests/fixture/issue-1687/output/input.tsx index 6248fba4f7e..e486fad88bc 100644 --- a/crates/swc/tests/fixture/issue-1687/output/input.tsx +++ b/crates/swc/tests/fixture/issue-1687/output/input.tsx @@ -8,8 +8,7 @@ import { render } from 'react-dom'; import zhCN from 'antd/es/locale/zh_CN'; import { Button, ConfigProvider } from 'antd'; function App() { - var ref = swcHelpers.slicedToArray(useState({ - }), 2), state = ref[0], setState = ref[1]; + var ref = swcHelpers.slicedToArray(useState({}), 2), state = ref[0], setState = ref[1]; useEffect(function() { swcHelpers.asyncToGenerator(regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { @@ -39,5 +38,4 @@ function App() { ] })); } -render(/*#__PURE__*/ _jsx(App, { -}), document.getElementById('root')); +render(/*#__PURE__*/ _jsx(App, {}), document.getElementById('root')); diff --git a/crates/swc/tests/fixture/issue-1714/case1/output/index.js b/crates/swc/tests/fixture/issue-1714/case1/output/index.js index 26fb3e02c4b..12d0439df56 100644 --- a/crates/swc/tests/fixture/issue-1714/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-1714/case1/output/index.js @@ -28,13 +28,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1729/case1/output/index.ts b/crates/swc/tests/fixture/issue-1729/case1/output/index.ts index 9d17e9a88a9..3e13cdb6f4e 100644 --- a/crates/swc/tests/fixture/issue-1729/case1/output/index.ts +++ b/crates/swc/tests/fixture/issue-1729/case1/output/index.ts @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/issue-1734/case1-B/output/index.js b/crates/swc/tests/fixture/issue-1734/case1-B/output/index.js index 8f5036f0724..095c983028d 100644 --- a/crates/swc/tests/fixture/issue-1734/case1-B/output/index.js +++ b/crates/swc/tests/fixture/issue-1734/case1-B/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1734/case2-C/output/index.js b/crates/swc/tests/fixture/issue-1734/case2-C/output/index.js index cd044e5ba70..2726629649f 100644 --- a/crates/swc/tests/fixture/issue-1734/case2-C/output/index.js +++ b/crates/swc/tests/fixture/issue-1734/case2-C/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1734/case3-D/output/index.js b/crates/swc/tests/fixture/issue-1734/case3-D/output/index.js index 8f5036f0724..095c983028d 100644 --- a/crates/swc/tests/fixture/issue-1734/case3-D/output/index.js +++ b/crates/swc/tests/fixture/issue-1734/case3-D/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1859/case1-js/output/index.js b/crates/swc/tests/fixture/issue-1859/case1-js/output/index.js index 2fd4e8cd951..d24cc18ca96 100644 --- a/crates/swc/tests/fixture/issue-1859/case1-js/output/index.js +++ b/crates/swc/tests/fixture/issue-1859/case1-js/output/index.js @@ -2,8 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _exportNames = { -}; +var _exportNames = {}; var _appConfig = _interopRequireWildcard(require("./app.config")); Object.keys(_appConfig).forEach(function(key) { if (key === "default" || key === "__esModule") return; @@ -32,13 +31,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1859/case2-ts/output/index.ts b/crates/swc/tests/fixture/issue-1859/case2-ts/output/index.ts index 2fd4e8cd951..d24cc18ca96 100644 --- a/crates/swc/tests/fixture/issue-1859/case2-ts/output/index.ts +++ b/crates/swc/tests/fixture/issue-1859/case2-ts/output/index.ts @@ -2,8 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _exportNames = { -}; +var _exportNames = {}; var _appConfig = _interopRequireWildcard(require("./app.config")); Object.keys(_appConfig).forEach(function(key) { if (key === "default" || key === "__esModule") return; @@ -32,13 +31,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1859/case3/output/bar.ts b/crates/swc/tests/fixture/issue-1859/case3/output/bar.ts index 71233eff035..db33db9ecc4 100644 --- a/crates/swc/tests/fixture/issue-1859/case3/output/bar.ts +++ b/crates/swc/tests/fixture/issue-1859/case3/output/bar.ts @@ -3,6 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.bar = void 0; -var bar = function() { -}; +var bar = function() {}; exports.bar = bar; diff --git a/crates/swc/tests/fixture/issue-1859/case3/output/foo.ts b/crates/swc/tests/fixture/issue-1859/case3/output/foo.ts index a792d763462..488a7b85a7d 100644 --- a/crates/swc/tests/fixture/issue-1859/case3/output/foo.ts +++ b/crates/swc/tests/fixture/issue-1859/case3/output/foo.ts @@ -3,6 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.foo = void 0; -var foo = function() { -}; +var foo = function() {}; exports.foo = foo; diff --git a/crates/swc/tests/fixture/issue-1859/case3/output/index.ts b/crates/swc/tests/fixture/issue-1859/case3/output/index.ts index f5c044bdab4..365bac3270b 100644 --- a/crates/swc/tests/fixture/issue-1859/case3/output/index.ts +++ b/crates/swc/tests/fixture/issue-1859/case3/output/index.ts @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1859/case3/output/lib.ts b/crates/swc/tests/fixture/issue-1859/case3/output/lib.ts index 883a0886349..be748f1a65a 100644 --- a/crates/swc/tests/fixture/issue-1859/case3/output/lib.ts +++ b/crates/swc/tests/fixture/issue-1859/case3/output/lib.ts @@ -2,8 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _exportNames = { -}; +var _exportNames = {}; var _foo = _interopRequireWildcard(require("./foo")); Object.keys(_foo).forEach(function(key) { if (key === "default" || key === "__esModule") return; @@ -32,13 +31,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-1918/es5-after-other/output/index.js b/crates/swc/tests/fixture/issue-1918/es5-after-other/output/index.js index 5de09770e64..cba7fe56ec6 100644 --- a/crates/swc/tests/fixture/issue-1918/es5-after-other/output/index.js +++ b/crates/swc/tests/fixture/issue-1918/es5-after-other/output/index.js @@ -71,8 +71,7 @@ _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee1() { promise = new Promise(function(r) { return resolve = r; }); - iterable = _defineProperty({ - }, Symbol.asyncIterator, function() { + iterable = _defineProperty({}, Symbol.asyncIterator, function() { return { next: function next() { return promise; diff --git a/crates/swc/tests/fixture/issue-1918/es5/output/index.js b/crates/swc/tests/fixture/issue-1918/es5/output/index.js index 217dd631af0..f961aebc8e8 100644 --- a/crates/swc/tests/fixture/issue-1918/es5/output/index.js +++ b/crates/swc/tests/fixture/issue-1918/es5/output/index.js @@ -71,8 +71,7 @@ _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee1() { promise = new Promise(function(r) { return resolve = r; }); - iterable = _defineProperty({ - }, Symbol.asyncIterator, function() { + iterable = _defineProperty({}, Symbol.asyncIterator, function() { return { next: function next() { return promise; diff --git a/crates/swc/tests/fixture/issue-1938/cjs/output/index.js b/crates/swc/tests/fixture/issue-1938/cjs/output/index.js index c88eeabc073..4746127eb75 100644 --- a/crates/swc/tests/fixture/issue-1938/cjs/output/index.js +++ b/crates/swc/tests/fixture/issue-1938/cjs/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-2022/no-opt/output/index.js b/crates/swc/tests/fixture/issue-2022/no-opt/output/index.js index 42b505424d5..9aea88b00ed 100644 --- a/crates/swc/tests/fixture/issue-2022/no-opt/output/index.js +++ b/crates/swc/tests/fixture/issue-2022/no-opt/output/index.js @@ -1,5 +1,4 @@ export function example() { - var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'click', b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { - }, c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; + var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'click', b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; console.log(a, b, c); } diff --git a/crates/swc/tests/fixture/issue-2027/case1/output/index.js b/crates/swc/tests/fixture/issue-2027/case1/output/index.js index 35eee0ab698..abca02ee83a 100644 --- a/crates/swc/tests/fixture/issue-2027/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-2027/case1/output/index.js @@ -10,6 +10,5 @@ var keys = { a: 1, b: 2 }; -var controller = { -}; +var controller = {}; for(var key in keys)_loop(key); diff --git a/crates/swc/tests/fixture/issue-2150/output/index.js b/crates/swc/tests/fixture/issue-2150/output/index.js index e2a77a43ef4..ae85d966813 100644 --- a/crates/swc/tests/fixture/issue-2150/output/index.js +++ b/crates/swc/tests/fixture/issue-2150/output/index.js @@ -1,5 +1,4 @@ var obj = { - fn: function fn() { - } + fn: function fn() {} }; console.log(obj.fn.name); diff --git a/crates/swc/tests/fixture/issue-2164/es2015/output/index.js b/crates/swc/tests/fixture/issue-2164/es2015/output/index.js index 4dc9d2fb665..a9b6b66c58f 100644 --- a/crates/swc/tests/fixture/issue-2164/es2015/output/index.js +++ b/crates/swc/tests/fixture/issue-2164/es2015/output/index.js @@ -32,8 +32,7 @@ function fn() { } function _fn() { _fn = _asyncToGenerator(function*() { - for(const key in { - }); + for(const key in {}); }); return _fn.apply(this, arguments); } diff --git a/crates/swc/tests/fixture/issue-2164/es2016/output/index.js b/crates/swc/tests/fixture/issue-2164/es2016/output/index.js index 4dc9d2fb665..a9b6b66c58f 100644 --- a/crates/swc/tests/fixture/issue-2164/es2016/output/index.js +++ b/crates/swc/tests/fixture/issue-2164/es2016/output/index.js @@ -32,8 +32,7 @@ function fn() { } function _fn() { _fn = _asyncToGenerator(function*() { - for(const key in { - }); + for(const key in {}); }); return _fn.apply(this, arguments); } diff --git a/crates/swc/tests/fixture/issue-2164/es2018/output/index.js b/crates/swc/tests/fixture/issue-2164/es2018/output/index.js index 293d0f68ed4..004bd436d3c 100644 --- a/crates/swc/tests/fixture/issue-2164/es2018/output/index.js +++ b/crates/swc/tests/fixture/issue-2164/es2018/output/index.js @@ -1,4 +1,3 @@ async function fn() { - for(const key in { - }); + for(const key in {}); } diff --git a/crates/swc/tests/fixture/issue-2164/es5/output/index.js b/crates/swc/tests/fixture/issue-2164/es5/output/index.js index 585f7b75498..7216be6282a 100644 --- a/crates/swc/tests/fixture/issue-2164/es5/output/index.js +++ b/crates/swc/tests/fixture/issue-2164/es5/output/index.js @@ -37,8 +37,7 @@ function _fn() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - for(key in { - }); + for(key in {}); case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/fixture/issue-2214/output/index.tsx b/crates/swc/tests/fixture/issue-2214/output/index.tsx index f54f2f328cb..f82f03ec597 100644 --- a/crates/swc/tests/fixture/issue-2214/output/index.tsx +++ b/crates/swc/tests/fixture/issue-2214/output/index.tsx @@ -2,5 +2,4 @@ import React from "react"; export var Test; (function(Test1) { var content = Test1.content = /*#__PURE__*/ React.createElement("div", null, "Content"); -})(Test || (Test = { -})); +})(Test || (Test = {})); diff --git a/crates/swc/tests/fixture/issue-2225/case1/output/index.js b/crates/swc/tests/fixture/issue-2225/case1/output/index.js index 2602327b4c7..fe38f8bf566 100644 --- a/crates/swc/tests/fixture/issue-2225/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-2225/case1/output/index.js @@ -1,3 +1,2 @@ -async function f() { -} +async function f() {} await f(); diff --git a/crates/swc/tests/fixture/issue-2232/case1/output/index.js b/crates/swc/tests/fixture/issue-2232/case1/output/index.js index 805ee54a120..66bc6707354 100644 --- a/crates/swc/tests/fixture/issue-2232/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-2232/case1/output/index.js @@ -48,8 +48,7 @@ function _createClass(Constructor, protoProps, staticProps) { return Constructor; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -64,10 +63,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/fixture/issue-2232/case2/output/index.ts b/crates/swc/tests/fixture/issue-2232/case2/output/index.ts index c488cf50119..b3e33f5dac1 100644 --- a/crates/swc/tests/fixture/issue-2232/case2/output/index.ts +++ b/crates/swc/tests/fixture/issue-2232/case2/output/index.ts @@ -29,8 +29,7 @@ function _asyncToGenerator(fn) { }; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -45,10 +44,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/fixture/issue-2310/output/index.tsx b/crates/swc/tests/fixture/issue-2310/output/index.tsx index 0cf03bd5471..6d2977f1259 100644 --- a/crates/swc/tests/fixture/issue-2310/output/index.tsx +++ b/crates/swc/tests/fixture/issue-2310/output/index.tsx @@ -3,5 +3,4 @@ var A; var Foo = A1.Foo = function() { return(/*#__PURE__*/ React.createElement("div", null)); }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/fixture/issue-2352/1/output/index.js b/crates/swc/tests/fixture/issue-2352/1/output/index.js index 041031aee84..b53fa3d9024 100644 --- a/crates/swc/tests/fixture/issue-2352/1/output/index.js +++ b/crates/swc/tests/fixture/issue-2352/1/output/index.js @@ -1,6 +1,5 @@ async function test(listings) { - for (const listing of listings){ - } + for (const listing of listings){} for (const listing1 of activeAndOpen){ const listing11 = await foo(listing1); console.log(listing11); diff --git a/crates/swc/tests/fixture/issue-2428/1/output/index.ts b/crates/swc/tests/fixture/issue-2428/1/output/index.ts index d1b7971fe9a..00c97e08879 100644 --- a/crates/swc/tests/fixture/issue-2428/1/output/index.ts +++ b/crates/swc/tests/fixture/issue-2428/1/output/index.ts @@ -1,7 +1,6 @@ "use strict"; function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = { - }; + var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); @@ -60,12 +59,10 @@ function _asyncToGenerator(fn) { var _class, _dec, _dec1, _dec2, _dec3, _dec4, _dec5; let Foo = ((_class = class Foo { fnName1(argName) { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } fnName2(argName = false) { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }) || _class, _dec = function(target, key) { return Arg('GraphQLArgName', { diff --git a/crates/swc/tests/fixture/issue-2468/1/output/index.js b/crates/swc/tests/fixture/issue-2468/1/output/index.js index a874f64549e..67d46f5bc6d 100644 --- a/crates/swc/tests/fixture/issue-2468/1/output/index.js +++ b/crates/swc/tests/fixture/issue-2468/1/output/index.js @@ -26,8 +26,7 @@ function _templateObject1() { }; return data; } -function myTag(strings) { -} +function myTag(strings) {} function f1() { return myTag(_templateObject()); } diff --git a/crates/swc/tests/fixture/issue-2531/1/output/index.js b/crates/swc/tests/fixture/issue-2531/1/output/index.js index ed3a1766fa2..dc145779cd9 100644 --- a/crates/swc/tests/fixture/issue-2531/1/output/index.js +++ b/crates/swc/tests/fixture/issue-2531/1/output/index.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/fixture/issue-2531/2/output/index.js b/crates/swc/tests/fixture/issue-2531/2/output/index.js index 26f644aefe4..52a55384522 100644 --- a/crates/swc/tests/fixture/issue-2531/2/output/index.js +++ b/crates/swc/tests/fixture/issue-2531/2/output/index.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/fixture/issue-2539/1/output/index.js b/crates/swc/tests/fixture/issue-2539/1/output/index.js index 9bb58181020..d47cd90176e 100644 --- a/crates/swc/tests/fixture/issue-2539/1/output/index.js +++ b/crates/swc/tests/fixture/issue-2539/1/output/index.js @@ -5,10 +5,8 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _default = { foo: { - func1 (index) { - }, - func2 (index, index1) { - } + func1 (index) {}, + func2 (index, index1) {} } }; exports.default = _default; diff --git a/crates/swc/tests/fixture/issue-2606/1/output/index.ts b/crates/swc/tests/fixture/issue-2606/1/output/index.ts index d976e1613a3..76249b36240 100644 --- a/crates/swc/tests/fixture/issue-2606/1/output/index.ts +++ b/crates/swc/tests/fixture/issue-2606/1/output/index.ts @@ -7,11 +7,9 @@ exports.test2 = exports.test = void 0; function warn() { throw new Error("this should not be called"); } -const test = { -}; +const test = {}; exports.test = test; -const test2 = { -}; +const test2 = {}; exports.test2 = test2; Object.defineProperty(test, "warn", { get: ()=>warn diff --git a/crates/swc/tests/fixture/issue-2856/1/output/index.js b/crates/swc/tests/fixture/issue-2856/1/output/index.js index 9e0577c765f..14786931fbc 100644 --- a/crates/swc/tests/fixture/issue-2856/1/output/index.js +++ b/crates/swc/tests/fixture/issue-2856/1/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/issue-2988/output/index.ts b/crates/swc/tests/fixture/issue-2988/output/index.ts index 31044ef4cc9..f6fe2c829f7 100644 --- a/crates/swc/tests/fixture/issue-2988/output/index.ts +++ b/crates/swc/tests/fixture/issue-2988/output/index.ts @@ -5,14 +5,11 @@ export var Test; b["Test"] = "1"; b["Test2"] = "2"; b["Test3"] = "3"; - })(b = a.testEnum || (a.testEnum = { - })); + })(b = a.testEnum || (a.testEnum = {})); let c; (function(c) { c["Test"] = "1"; c["Test2"] = "2"; c["Test3"] = "3"; - })(c = a.testEnum2 || (a.testEnum2 = { - })); -})(Test || (Test = { -})); + })(c = a.testEnum2 || (a.testEnum2 = {})); +})(Test || (Test = {})); diff --git a/crates/swc/tests/fixture/issue-3073/1/output/index.ts b/crates/swc/tests/fixture/issue-3073/1/output/index.ts index 4f4eb927ffd..b4c1a7ed023 100644 --- a/crates/swc/tests/fixture/issue-3073/1/output/index.ts +++ b/crates/swc/tests/fixture/issue-3073/1/output/index.ts @@ -4,5 +4,4 @@ var n; ref = { a: 1 }, n1.a = ref.a, ref; -})(n || (n = { -})); +})(n || (n = {})); diff --git a/crates/swc/tests/fixture/issue-3073/2/output/index.ts b/crates/swc/tests/fixture/issue-3073/2/output/index.ts index 0d743301a56..e86736ae736 100644 --- a/crates/swc/tests/fixture/issue-3073/2/output/index.ts +++ b/crates/swc/tests/fixture/issue-3073/2/output/index.ts @@ -5,5 +5,4 @@ var Foo; a: 1, b: 2 }, Foo1.A = ref.a, Foo1.B = ref.b, ref; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); diff --git a/crates/swc/tests/fixture/issue-846/case1/output/index.js b/crates/swc/tests/fixture/issue-846/case1/output/index.js index 9317e7eba65..dc9137e7863 100644 --- a/crates/swc/tests/fixture/issue-846/case1/output/index.js +++ b/crates/swc/tests/fixture/issue-846/case1/output/index.js @@ -277,8 +277,7 @@ function _toElementDescriptor(elementObject) { kind: kind, key: key, placement: placement, - descriptor: Object.assign({ - }, descriptor) + descriptor: Object.assign({}, descriptor) }; if (kind !== "field") { _disallowProperty(elementObject, "initializer", "A method descriptor"); @@ -447,8 +446,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -482,8 +480,7 @@ var SomeClass = _decorate([], function(_initialize) { dec ], key: "someMethod", - value: function someMethod() { - } + value: function someMethod() {} } ] }; diff --git a/crates/swc/tests/fixture/module/ignore-dynamic/1/output/index.js b/crates/swc/tests/fixture/module/ignore-dynamic/1/output/index.js index ec42591b532..5e846e7f8b6 100644 --- a/crates/swc/tests/fixture/module/ignore-dynamic/1/output/index.js +++ b/crates/swc/tests/fixture/module/ignore-dynamic/1/output/index.js @@ -4,13 +4,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { diff --git a/crates/swc/tests/fixture/new-target/output/class-extends-error.ts b/crates/swc/tests/fixture/new-target/output/class-extends-error.ts index c01ef359d79..c946b70dcb1 100644 --- a/crates/swc/tests/fixture/new-target/output/class-extends-error.ts +++ b/crates/swc/tests/fixture/new-target/output/class-extends-error.ts @@ -14,8 +14,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -107,8 +106,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/fixture/next.js/server/render/1/output/index.tsx b/crates/swc/tests/fixture/next.js/server/render/1/output/index.tsx index fe6e6db9e3d..1cba9990094 100644 --- a/crates/swc/tests/fixture/next.js/server/render/1/output/index.tsx +++ b/crates/swc/tests/fixture/next.js/server/render/1/output/index.tsx @@ -125,10 +125,8 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { // TODO: remove this workaround when https://bugs.webkit.org/show_bug.cgi?id=187726 is fixed. renderOpts.devOnlyCacheBusterQueryString = renderOpts.dev ? renderOpts.devOnlyCacheBusterQueryString || `?ts=${Date.now()}` : ""; // don't modify original query object - query = Object.assign({ - }, query); - const { err , dev =false , ampPath ="" , App , Document , pageConfig ={ - } , Component , buildManifest , fontManifest , reactLoadableManifest , ErrorDebug , getStaticProps , getStaticPaths , getServerSideProps , isDataReq , params , previewProps , basePath , devOnlyCacheBusterQueryString , supportsDynamicHTML , concurrentFeatures , } = renderOpts; + query = Object.assign({}, query); + const { err , dev =false , ampPath ="" , App , Document , pageConfig ={} , Component , buildManifest , fontManifest , reactLoadableManifest , ErrorDebug , getStaticProps , getStaticPaths , getServerSideProps , isDataReq , params , previewProps , basePath , devOnlyCacheBusterQueryString , supportsDynamicHTML , concurrentFeatures , } = renderOpts; const getFontDefinition = (url)=>{ if (fontManifest) { return getFontDefinitionFromManifest(url, fontManifest); @@ -136,8 +134,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { return ""; }; const callMiddleware = async (method, args, props = false)=>{ - let results = props ? { - } : []; + let results = props ? {} : []; if (Document[`${method}Middleware`]) { let middlewareFunc = await Document[`${method}Middleware`]; middlewareFunc = middlewareFunc.default || middlewareFunc; @@ -211,8 +208,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { query = { ...query.amp ? { amp: query.amp - } : { - } + } : {} }; asPath = `${pathname}${// ensure trailing slash is present for non-dynamic auto-export pages req.url.endsWith("/") && pathname !== "/" && !pageIsDynamic ? "/" : ""}`; @@ -252,16 +248,14 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { locales: renderOpts.locales, defaultLocale: renderOpts.defaultLocale, AppTree: (props)=>{ - return(/*#__PURE__*/ React.createElement(AppContainer, null, /*#__PURE__*/ React.createElement(App, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(AppContainer, null, /*#__PURE__*/ React.createElement(App, _extends({}, props, { Component: Component, router: router })))); }, defaultGetInitialProps: async (docCtx)=>{ const enhanceApp = (AppComp)=>{ - return (props)=>/*#__PURE__*/ React.createElement(AppComp, _extends({ - }, props)) + return (props)=>/*#__PURE__*/ React.createElement(AppComp, _extends({}, props)) ; }; const { html , head } = await docCtx.renderPage({ @@ -284,8 +278,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { const inAmpMode = isInAmpMode(ampState); const reactLoadableModules = []; let head1 = defaultHead(inAmpMode); - let scriptLoader = { - }; + let scriptLoader = {}; const nextExport = !isSSG && (renderOpts.nextExport || dev && (isAutoExport || isFallback)); const AppContainer = ({ children })=>/*#__PURE__*/ React.createElement(RouterContext.Provider, { value: router @@ -299,8 +292,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { updateScripts: (scripts)=>{ scriptLoader = scripts; }, - scripts: { - }, + scripts: {}, mountedInstances: new Set() } }, /*#__PURE__*/ React.createElement(LoadableContext.Provider, { @@ -409,8 +401,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { // By default, we never revalidate. (data).revalidate = false; } - props1.pageProps = Object.assign({ - }, props1.pageProps, "props" in data ? data.props : undefined); + props1.pageProps = Object.assign({}, props1.pageProps, "props" in data ? data.props : undefined); // pass up revalidate and props for export // TODO: change this to a different passing mechanism (renderOpts).revalidate = "revalidate" in data ? data.revalidate : undefined; @@ -502,12 +493,10 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { // this fn should throw an error instead of ever returning `false` throw new Error("invariant: getServerSideProps did not return valid props. Please report this."); } - props1.pageProps = Object.assign({ - }, props1.pageProps, data.props); + props1.pageProps = Object.assign({}, props1.pageProps, data.props); renderOpts.pageData = props1; } - if (!isSSG && !getServerSideProps && process.env.NODE_ENV !== "production" && Object.keys(props1?.pageProps || { - }).includes("url")) { + if (!isSSG && !getServerSideProps && process.env.NODE_ENV !== "production" && Object.keys(props1?.pageProps || {}).includes("url")) { console.warn(`The prop \`url\` is a reserved prop in Next.js for legacy reasons and will be overridden on page ${pathname}\n` + `See more info here: https://nextjs.org/docs/messages/reserved-page-prop`); } // Avoid rendering page un-necessarily for getServerSideProps data request @@ -518,8 +507,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { // We don't call getStaticProps or getServerSideProps while generating // the fallback so make sure to set pageProps to an empty object if (isFallback) { - props1.pageProps = { - }; + props1.pageProps = {}; } // the response might be finished on the getInitialProps call if (isResSent(res) && !isSSG) return null; @@ -562,8 +550,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { */ const generateStaticHTML = supportsDynamicHTML !== true; const renderDocument = async ()=>{ if (Document.getInitialProps) { - const renderPage = (options = { - })=>{ + const renderPage = (options = {})=>{ if (ctx.err && ErrorDebug) { const html = ReactDOMServer.renderToString(/*#__PURE__*/ React.createElement(ErrorDebug, { error: ctx.err @@ -601,8 +588,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { bodyResult: piperFromArray([ docProps.html ]), - documentElement: (htmlProps)=>/*#__PURE__*/ React.createElement(Document, _extends({ - }, htmlProps, docProps)) + documentElement: (htmlProps)=>/*#__PURE__*/ React.createElement(Document, _extends({}, htmlProps, docProps)) , head: docProps.head, headTags: await headTags(documentCtx), @@ -611,8 +597,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { } else { const content = ctx.err && ErrorDebug ? /*#__PURE__*/ React.createElement(ErrorDebug, { error: ctx.err - }) : /*#__PURE__*/ React.createElement(AppContainer, null, /*#__PURE__*/ React.createElement(App, _extends({ - }, props1, { + }) : /*#__PURE__*/ React.createElement(AppContainer, null, /*#__PURE__*/ React.createElement(App, _extends({}, props1, { Component: Component, router: router }))); @@ -645,8 +630,7 @@ export async function renderToHTML(req, res, pathname, query, renderOpts) { } } const hybridAmp = ampState.hybrid; - const docComponentsRendered = { - }; + const docComponentsRendered = {}; const { assetPrefix , buildId , customServer , defaultLocale , disableOptimizedLoading , domainLocales , locale , locales , runtimeConfig , } = renderOpts; const htmlProps1 = { __NEXT_DATA__: { diff --git a/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts b/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts index c936a165e16..e1c3788203b 100644 --- a/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts +++ b/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts @@ -123,8 +123,7 @@ var Router = /*#__PURE__*/ function() { _ctx.next = 18; break; } - return _ctx.abrupt("return", new Promise(function() { - })); + return _ctx.abrupt("return", new Promise(function() {})); case 18: if (!options._h) { this.isSsr = false; @@ -242,8 +241,7 @@ var Router = /*#__PURE__*/ function() { routeRegex = getRouteRegex(route); routeMatch = getRouteMatcher(routeRegex)(asPathname); shouldInterpolate = route === asPathname; - interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : { - }; + interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {}; if (!(!routeMatch || shouldInterpolate && !interpolatedAs.result)) { _ctx.next = 79; break; @@ -264,8 +262,7 @@ var Router = /*#__PURE__*/ function() { break; case 79: if (shouldInterpolate) { - as = formatWithValidation(Object.assign({ - }, parsedAs1, { + as = formatWithValidation(Object.assign({}, parsedAs1, { pathname: interpolatedAs.result, query: omitParmsFromQuery(query, interpolatedAs.params) })); @@ -301,8 +298,7 @@ var Router = /*#__PURE__*/ function() { return _ctx.abrupt("return", this.change(method, newUrl, newAs, options)); case 95: window.location.href = destination; - return _ctx.abrupt("return", new Promise(function() { - })); + return _ctx.abrupt("return", new Promise(function() {})); case 97: this.isPreview = !!props.__N_PREVIEW; if (!(props.notFound === SSG_DATA_NOT_FOUND)) { diff --git a/crates/swc/tests/fixture/next.js/slack-2/es5/output/index.js b/crates/swc/tests/fixture/next.js/slack-2/es5/output/index.js index 006b134ddd5..ef44c885a3e 100644 --- a/crates/swc/tests/fixture/next.js/slack-2/es5/output/index.js +++ b/crates/swc/tests/fixture/next.js/slack-2/es5/output/index.js @@ -25,8 +25,7 @@ var Foo = /*#__PURE__*/ function() { _createClass(Foo, [ { key: "true", - value: function _true() { - } + value: function _true() {} } ]); return Foo; diff --git a/crates/swc/tests/fixture/paths/ext/002/output/foo.ts/index.js b/crates/swc/tests/fixture/paths/ext/002/output/foo.ts/index.js index dbfeaef972f..93c04ca181e 100644 --- a/crates/swc/tests/fixture/paths/ext/002/output/foo.ts/index.js +++ b/crates/swc/tests/fixture/paths/ext/002/output/foo.ts/index.js @@ -1,2 +1 @@ -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/fixture/pr-1524/comment-1/output/index.tsx b/crates/swc/tests/fixture/pr-1524/comment-1/output/index.tsx index 57e8a6d1fc9..3092ca770d9 100644 --- a/crates/swc/tests/fixture/pr-1524/comment-1/output/index.tsx +++ b/crates/swc/tests/fixture/pr-1524/comment-1/output/index.tsx @@ -47,7 +47,6 @@ function _unsupportedIterableToArray(o, minLen) { function Bar() { var ref = _slicedToArray(useState(0), 2), foo = ref[0], setFoo = ref[1]; // @refresh reset - React.useEffect(function() { - }); + React.useEffect(function() {}); return(/*#__PURE__*/ React.createElement("h1", null, foo, " ")); } diff --git a/crates/swc/tests/fixture/pr-1579/checkingExtend/output/index.js b/crates/swc/tests/fixture/pr-1579/checkingExtend/output/index.js index 042a826a394..a6f83ab4abf 100644 --- a/crates/swc/tests/fixture/pr-1579/checkingExtend/output/index.js +++ b/crates/swc/tests/fixture/pr-1579/checkingExtend/output/index.js @@ -1,5 +1,3 @@ import * as swcHelpers from "@swc/helpers"; -var a = { -}; -var b = swcHelpers["extends"]({ -}, a); +var a = {}; +var b = swcHelpers["extends"]({}, a); diff --git a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.1.normal.js index 1c0f7f36e6d..d2901f4e1d2 100644 --- a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.1.normal.js @@ -8,8 +8,7 @@ var A; } } A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); // @filename: test.ts var p; var p = A.Point.Origin; diff --git a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.2.minified.js index ccf99c3ff0a..5b4b2039e46 100644 --- a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es2015.2.minified.js @@ -1,6 +1,5 @@ var A; -(A || (A = { -})).Point = class { +(A || (A = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } diff --git a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.1.normal.js index d4ae11dd556..5fdf30b0118 100644 --- a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.1.normal.js @@ -13,8 +13,7 @@ var A; this.y = y; }; A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); // @filename: test.ts var p; var p = A.Point.Origin; diff --git a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.2.minified.js index 13299d6489b..a56c135b1e0 100644 --- a/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot_es5.2.minified.js @@ -7,5 +7,4 @@ var A; })(this, Point), this.x = x, this.y = y; }; A1.Point = Point; -}(A || (A = { -})), A.Point.Origin, new A.Point(0, 0); +}(A || (A = {})), A.Point.Origin, new A.Point(0, 0); diff --git a/crates/swc/tests/tsc-references/ArrowFunction4_es2015.1.normal.js b/crates/swc/tests/tsc-references/ArrowFunction4_es2015.1.normal.js index dfc78b49c15..9fff181dcfd 100644 --- a/crates/swc/tests/tsc-references/ArrowFunction4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ArrowFunction4_es2015.1.normal.js @@ -1,2 +1 @@ -var v = (a, b)=>{ -}; +var v = (a, b)=>{}; diff --git a/crates/swc/tests/tsc-references/ArrowFunction4_es5.1.normal.js b/crates/swc/tests/tsc-references/ArrowFunction4_es5.1.normal.js index faf6d136971..e86465c2e95 100644 --- a/crates/swc/tests/tsc-references/ArrowFunction4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ArrowFunction4_es5.1.normal.js @@ -1,2 +1 @@ -var v = function(a, b) { -}; +var v = function(a, b) {}; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.1.normal.js index 3c359292b45..ea4341db201 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.1.normal.js @@ -2,30 +2,25 @@ class clodule1 { } (function(clodule1) { - function f(x) { - } -})(clodule1 || (clodule1 = { -})); + function f(x) {} +})(clodule1 || (clodule1 = {})); class clodule2 { } (function(clodule2) { var x; class D { } -})(clodule2 || (clodule2 = { -})); +})(clodule2 || (clodule2 = {})); class clodule3 { } (function(clodule31) { var y = clodule31.y = { id: T }; -})(clodule3 || (clodule3 = { -})); +})(clodule3 || (clodule3 = {})); class clodule4 { } (function(clodule4) { class D { } -})(clodule4 || (clodule4 = { -})); +})(clodule4 || (clodule4 = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.2.minified.js index a3c1eac9ec6..d215bd1206b 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es2015.2.minified.js @@ -1,6 +1,5 @@ class clodule3 { } -(clodule3 || (clodule3 = { -})).y = { +(clodule3 || (clodule3 = {})).y = { id: T }; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.1.normal.js index 3160c329b24..40cdcc6d086 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.1.normal.js @@ -8,10 +8,8 @@ var clodule1 = function clodule1() { _classCallCheck(this, clodule1); }; (function(clodule1) { - var f = function f(x) { - }; -})(clodule1 || (clodule1 = { -})); + var f = function f(x) {}; +})(clodule1 || (clodule1 = {})); var clodule2 = function clodule2() { "use strict"; _classCallCheck(this, clodule2); @@ -22,8 +20,7 @@ var clodule2 = function clodule2() { "use strict"; _classCallCheck(this, D); }; -})(clodule2 || (clodule2 = { -})); +})(clodule2 || (clodule2 = {})); var clodule3 = function clodule3() { "use strict"; _classCallCheck(this, clodule3); @@ -32,8 +29,7 @@ var clodule3 = function clodule3() { var y = clodule3.y = { id: T }; -})(clodule3 || (clodule3 = { -})); +})(clodule3 || (clodule3 = {})); var clodule4 = function clodule4() { "use strict"; _classCallCheck(this, clodule4); @@ -43,5 +39,4 @@ var clodule4 = function clodule4() { "use strict"; _classCallCheck(this, D); }; -})(clodule4 || (clodule4 = { -})); +})(clodule4 || (clodule4 = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.2.minified.js index d4786127c8b..c4453abb236 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter_es5.2.minified.js @@ -13,14 +13,12 @@ var clodule1 = function() { "use strict"; _classCallCheck(this, D); }; -}(clodule2 || (clodule2 = { -})); +}(clodule2 || (clodule2 = {})); var clodule3 = function() { "use strict"; _classCallCheck(this, clodule3); }; -(clodule3 || (clodule3 = { -})).y = { +(clodule3 || (clodule3 = {})).y = { id: T }; var clodule4 = function() { @@ -32,5 +30,4 @@ var clodule4 = function() { "use strict"; _classCallCheck(this, D); }; -}(clodule4 || (clodule4 = { -})); +}(clodule4 || (clodule4 = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js index dce7274a2e6..1332e3c89b1 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js @@ -1,11 +1,9 @@ class clodule { - static fn(id) { - } + static fn(id) {} } (function(clodule1) { function fn(x, y) { return x; } clodule1.fn = fn; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js index 6282455d244..3e6b394bd97 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js @@ -1,8 +1,6 @@ class clodule { - static fn(id) { - } + static fn(id) {} } -(clodule || (clodule = { -})).fn = function(x, y) { +(clodule || (clodule = {})).fn = function(x, y) { return x; }; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.1.normal.js index 1e06d93525b..822ad354cd4 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.1.normal.js @@ -25,8 +25,7 @@ var clodule = /*#__PURE__*/ function() { _createClass(clodule, null, [ { key: "fn", - value: function fn(id) { - } + value: function fn(id) {} } ]); return clodule; @@ -36,5 +35,4 @@ var clodule = /*#__PURE__*/ function() { return x; }; clodule.fn = fn; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.2.minified.js index 198f298c2f7..6a6f2e2e3b3 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName_es5.2.minified.js @@ -15,12 +15,10 @@ var clodule = function() { return Constructor = clodule, protoProps = null, staticProps = [ { key: "fn", - value: function(id) { - } + value: function(id) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), clodule; }(); -(clodule || (clodule = { -})).fn = function(x, y) { +(clodule || (clodule = {})).fn = function(x, y) { return x; }; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js index dce7274a2e6..1332e3c89b1 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.1.normal.js @@ -1,11 +1,9 @@ class clodule { - static fn(id) { - } + static fn(id) {} } (function(clodule1) { function fn(x, y) { return x; } clodule1.fn = fn; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js index 6282455d244..3e6b394bd97 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es2015.2.minified.js @@ -1,8 +1,6 @@ class clodule { - static fn(id) { - } + static fn(id) {} } -(clodule || (clodule = { -})).fn = function(x, y) { +(clodule || (clodule = {})).fn = function(x, y) { return x; }; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.1.normal.js index 1e06d93525b..822ad354cd4 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.1.normal.js @@ -25,8 +25,7 @@ var clodule = /*#__PURE__*/ function() { _createClass(clodule, null, [ { key: "fn", - value: function fn(id) { - } + value: function fn(id) {} } ]); return clodule; @@ -36,5 +35,4 @@ var clodule = /*#__PURE__*/ function() { return x; }; clodule.fn = fn; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.2.minified.js index 198f298c2f7..6a6f2e2e3b3 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName_es5.2.minified.js @@ -15,12 +15,10 @@ var clodule = function() { return Constructor = clodule, protoProps = null, staticProps = [ { key: "fn", - value: function(id) { - } + value: function(id) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), clodule; }(); -(clodule || (clodule = { -})).fn = function(x, y) { +(clodule || (clodule = {})).fn = function(x, y) { return x; }; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.1.normal.js index 9daf9bedea8..4c5dd441973 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.1.normal.js @@ -8,5 +8,4 @@ class clodule { return clodule.sfn('a'); } clodule1.fn = fn; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.2.minified.js index 151b9f98885..9fd305a647b 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es2015.2.minified.js @@ -3,7 +3,6 @@ class clodule { return 42; } } -(clodule || (clodule = { -})).fn = function(x, y) { +(clodule || (clodule = {})).fn = function(x, y) { return clodule.sfn("a"); }; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.1.normal.js index e910e7a89d6..a6ee22aabbc 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.1.normal.js @@ -37,5 +37,4 @@ var clodule = /*#__PURE__*/ function() { return clodule.sfn('a'); }; clodule1.fn = fn; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.2.minified.js index d8193e5f526..719781457cf 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics_es5.2.minified.js @@ -26,5 +26,4 @@ var clodule = function() { return clodule.sfn("a"); }; clodule1.fn = fn; -}(clodule || (clodule = { -})); +}(clodule || (clodule = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.1.normal.js index 1f41cfdda13..51ac36b599c 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.1.normal.js @@ -15,8 +15,7 @@ class Point { return null; } //expected duplicate identifier error Point1.Origin = Origin; -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { class Point2 { @@ -37,7 +36,5 @@ var A; return ""; } //expected duplicate identifier error Point3.Origin = Origin; - })(Point2 = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point2 = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.2.minified.js index cf60d1d52be..ceb06e1f621 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es2015.2.minified.js @@ -10,8 +10,7 @@ class Point { this.x = x, this.y = y; } } -(Point || (Point = { -})).Origin = function() { +(Point || (Point = {})).Origin = function() { return null; }, (function(A1) { class Point1 { @@ -25,9 +24,7 @@ class Point { this.x = x, this.y = y; } } - A1.Point = Point1, (Point1 = A1.Point || (A1.Point = { - })).Origin = function() { + A1.Point = Point1, (Point1 = A1.Point || (A1.Point = {})).Origin = function() { return ""; }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.1.normal.js index 8d1682df252..b6bc228a83a 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.1.normal.js @@ -43,8 +43,7 @@ var Point = /*#__PURE__*/ function() { } //expected duplicate identifier error ; Point.Origin = Origin; -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { var Point = /*#__PURE__*/ function() { @@ -73,7 +72,5 @@ var A; return ""; } //expected duplicate identifier error Point.Origin = Origin; - })(Point = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.2.minified.js index 344beff9d23..06984a7e02f 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName_es5.2.minified.js @@ -27,8 +27,7 @@ var A, Point = function() { } ]), Point; }(); -(Point || (Point = { -})).Origin = function() { +(Point || (Point = {})).Origin = function() { return null; }, (function(A1) { var Point = function() { @@ -48,9 +47,7 @@ var A, Point = function() { } ]), Point; }(); - A1.Point = Point, (Point = A1.Point || (A1.Point = { - })).Origin = function() { + A1.Point = Point, (Point = A1.Point || (A1.Point = {})).Origin = function() { return ""; }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.1.normal.js index acab8a49f78..a27579857df 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.1.normal.js @@ -14,8 +14,7 @@ class Point { function Origin() { return ""; } // not an error, since not exported -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { class Point1 { @@ -35,7 +34,5 @@ var A; function Origin() { return ""; } // not an error since not exported - })(Point1 = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point1 = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.2.minified.js index 3e0f1ce59de..1a7f50b9560 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es2015.2.minified.js @@ -1,6 +1,5 @@ var A; -(A || (A = { -})).Point = class { +(A || (A = {})).Point = class { static Origin() { return { x: 0, diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.1.normal.js index b959938d6d0..d0fe1af37d0 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.1.normal.js @@ -42,8 +42,7 @@ var Point = /*#__PURE__*/ function() { return ""; } // not an error, since not exported ; -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { var Point = /*#__PURE__*/ function() { @@ -71,7 +70,5 @@ var A; function Origin() { return ""; } // not an error since not exported - })(Point = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.2.minified.js index 52e7afdf6b4..2be57f9ec57 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName_es5.2.minified.js @@ -46,5 +46,4 @@ var A, Point = function() { ]), Point; }(); A1.Point = Point; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.1.normal.js index b280dbc8763..04195570fd9 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.1.normal.js @@ -10,8 +10,7 @@ Point.Origin = { }; (function(Point1) { var Origin = Point1.Origin = ""; -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { class Point2 { @@ -27,7 +26,5 @@ var A; }; (function(Point3) { var Origin = Point3.Origin = ""; - })(Point2 = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point2 = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.2.minified.js index bf3a0845aa6..ed847449a73 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es2015.2.minified.js @@ -7,8 +7,7 @@ class Point { Point.Origin = { x: 0, y: 0 -}, (Point || (Point = { -})).Origin = "", (function(A1) { +}, (Point || (Point = {})).Origin = "", (function(A1) { class Point1 { constructor(x, y){ this.x = x, this.y = y; @@ -17,7 +16,5 @@ Point.Origin = { A1.Point = Point1, Point1.Origin = { x: 0, y: 0 - }, (Point1 = A1.Point || (A1.Point = { - })).Origin = ""; -})(A || (A = { -})); + }, (Point1 = A1.Point || (A1.Point = {})).Origin = ""; +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.1.normal.js index 72b0a09eb75..7af69c574f7 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.1.normal.js @@ -15,8 +15,7 @@ Point.Origin = { }; (function(Point) { var Origin = Point.Origin = ""; -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { var Point = function Point(x, y) { @@ -32,7 +31,5 @@ var A; }; (function(Point) { var Origin = Point.Origin = ""; - })(Point = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.2.minified.js index e0c7d48a9ed..2565f386142 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName_es5.2.minified.js @@ -8,8 +8,7 @@ var A, Point = function(x, y) { Point.Origin = { x: 0, y: 0 -}, (Point || (Point = { -})).Origin = "", (function(A1) { +}, (Point || (Point = {})).Origin = "", (function(A1) { var Point1 = function(x, y) { "use strict"; _classCallCheck(this, Point1), this.x = x, this.y = y; @@ -17,7 +16,5 @@ Point.Origin = { A1.Point = Point1, Point1.Origin = { x: 0, y: 0 - }, (Point1 = A1.Point || (A1.Point = { - })).Origin = ""; -})(A || (A = { -})); + }, (Point1 = A1.Point || (A1.Point = {})).Origin = ""; +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.1.normal.js index 2449dedb27f..da13f2eb217 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.1.normal.js @@ -10,8 +10,7 @@ Point.Origin = { }; (function(Point) { var Origin = ""; // not an error, since not exported -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { class Point1 { @@ -27,7 +26,5 @@ var A; }; (function(Point) { var Origin = ""; // not an error since not exported - })(Point1 = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point1 = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.2.minified.js index 686c2603b78..15786a38c4a 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es2015.2.minified.js @@ -16,5 +16,4 @@ var A; x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.1.normal.js index 193d2d32f83..441d273f1ae 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.1.normal.js @@ -15,8 +15,7 @@ Point.Origin = { }; (function(Point) { var Origin = ""; // not an error, since not exported -})(Point || (Point = { -})); +})(Point || (Point = {})); var A; (function(A1) { var Point = function Point(x, y) { @@ -32,7 +31,5 @@ var A; }; (function(Point) { var Origin = ""; // not an error since not exported - })(Point = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point = A1.Point || (A1.Point = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.2.minified.js index e44864c93c3..3873eaf2c35 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName_es5.2.minified.js @@ -17,5 +17,4 @@ Point.Origin = { x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.1.normal.js index 389f08bb62f..71277128f65 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.1.normal.js @@ -11,22 +11,17 @@ var X; } } Y.Point = Point; - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { let Y2; (function(Y) { let Point1; (function(Point) { var Origin = Point.Origin = new Point1(0, 0); - })(Point1 = Y.Point || (Y.Point = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Point1 = Y.Point || (Y.Point = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); // @filename: test.ts //var cl: { x: number; y: number; } var cl = new X.Y.Point(1, 1); @@ -36,8 +31,7 @@ class A { } (function(A1) { var Instance = A1.Instance = new A(); -})(A || (A = { -})); +})(A || (A = {})); // ensure merging works as expected var a = A.Instance; var a = new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.2.minified.js index 9bfd539102d..4767d6d1dfd 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es2015.2.minified.js @@ -1,19 +1,13 @@ var X, X1; -((X1 = X || (X = { -})).Y || (X1.Y = { -})).Point = class { +((X1 = X || (X = {})).Y || (X1.Y = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } }, (function(X2) { var Y; let Point; - (Point = (Y = X2.Y || (X2.Y = { - })).Point || (Y.Point = { - })).Origin = new Point(0, 0); -})(X || (X = { -})), new X.Y.Point(1, 1), X.Y.Point.Origin; + (Point = (Y = X2.Y || (X2.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0); +})(X || (X = {})), new X.Y.Point(1, 1), X.Y.Point.Origin; class A { } -(A || (A = { -})).Instance = new A(), new A(); +(A || (A = {})).Instance = new A(), new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.1.normal.js index 4982c63664f..2ff904701a2 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.1.normal.js @@ -16,22 +16,17 @@ var X; this.y = y; }; Y.Point = Point; - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { var Y2; (function(Y) { var Point1; (function(Point) { var Origin = Point.Origin = new Point1(0, 0); - })(Point1 = Y.Point || (Y.Point = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Point1 = Y.Point || (Y.Point = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); // @filename: test.ts //var cl: { x: number; y: number; } var cl = new X.Y.Point(1, 1); @@ -42,8 +37,7 @@ var A = function A() { }; (function(A1) { var Instance = A1.Instance = new A(); -})(A || (A = { -})); +})(A || (A = {})); // ensure merging works as expected var a = A.Instance; var a = new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.2.minified.js index 46deeda547a..66d338358cb 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRootES6_es5.2.minified.js @@ -3,22 +3,16 @@ function _classCallCheck(instance, Constructor) { } !function(X1) { var Y, Point; - Y = X1.Y || (X1.Y = { - }), Point = function(x, y) { + Y = X1.Y || (X1.Y = {}), Point = function(x, y) { "use strict"; _classCallCheck(this, Point), this.x = x, this.y = y; }, Y.Point = Point; -}(X || (X = { -})), (function(X2) { +}(X || (X = {})), (function(X2) { var Y, Point; - (Point = (Y = X2.Y || (X2.Y = { - })).Point || (Y.Point = { - })).Origin = new Point(0, 0); -})(X || (X = { -})), new X.Y.Point(1, 1), X.Y.Point.Origin; + (Point = (Y = X2.Y || (X2.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0); +})(X || (X = {})), new X.Y.Point(1, 1), X.Y.Point.Origin; var X, A = function() { "use strict"; _classCallCheck(this, A); }; -(A || (A = { -})).Instance = new A(), A.Instance, new A(); +(A || (A = {})).Instance = new A(), A.Instance, new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js index c9fd21e2000..71e5de5d6cb 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js @@ -10,22 +10,17 @@ var X; } } Y.Point = Point; - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { let Y2; (function(Y) { let Point1; (function(Point) { var Origin = Point.Origin = new Point1(0, 0); - })(Point1 = Y.Point || (Y.Point = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Point1 = Y.Point || (Y.Point = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); // @filename: test.ts //var cl: { x: number; y: number; } var cl = new X.Y.Point(1, 1); @@ -35,8 +30,7 @@ class A { } (function(A1) { var Instance = A1.Instance = new A(); -})(A || (A = { -})); +})(A || (A = {})); // ensure merging works as expected var a = A.Instance; var a = new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js index 9bfd539102d..4767d6d1dfd 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js @@ -1,19 +1,13 @@ var X, X1; -((X1 = X || (X = { -})).Y || (X1.Y = { -})).Point = class { +((X1 = X || (X = {})).Y || (X1.Y = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } }, (function(X2) { var Y; let Point; - (Point = (Y = X2.Y || (X2.Y = { - })).Point || (Y.Point = { - })).Origin = new Point(0, 0); -})(X || (X = { -})), new X.Y.Point(1, 1), X.Y.Point.Origin; + (Point = (Y = X2.Y || (X2.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0); +})(X || (X = {})), new X.Y.Point(1, 1), X.Y.Point.Origin; class A { } -(A || (A = { -})).Instance = new A(), new A(); +(A || (A = {})).Instance = new A(), new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.1.normal.js index a8afa95e2c0..099f8753aec 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.1.normal.js @@ -15,22 +15,17 @@ var X; this.y = y; }; Y.Point = Point; - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { var Y2; (function(Y) { var Point1; (function(Point) { var Origin = Point.Origin = new Point1(0, 0); - })(Point1 = Y.Point || (Y.Point = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Point1 = Y.Point || (Y.Point = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); // @filename: test.ts //var cl: { x: number; y: number; } var cl = new X.Y.Point(1, 1); @@ -41,8 +36,7 @@ var A = function A() { }; (function(A1) { var Instance = A1.Instance = new A(); -})(A || (A = { -})); +})(A || (A = {})); // ensure merging works as expected var a = A.Instance; var a = new A(); diff --git a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.2.minified.js index 46deeda547a..66d338358cb 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleWithSameNameAndCommonRoot_es5.2.minified.js @@ -3,22 +3,16 @@ function _classCallCheck(instance, Constructor) { } !function(X1) { var Y, Point; - Y = X1.Y || (X1.Y = { - }), Point = function(x, y) { + Y = X1.Y || (X1.Y = {}), Point = function(x, y) { "use strict"; _classCallCheck(this, Point), this.x = x, this.y = y; }, Y.Point = Point; -}(X || (X = { -})), (function(X2) { +}(X || (X = {})), (function(X2) { var Y, Point; - (Point = (Y = X2.Y || (X2.Y = { - })).Point || (Y.Point = { - })).Origin = new Point(0, 0); -})(X || (X = { -})), new X.Y.Point(1, 1), X.Y.Point.Origin; + (Point = (Y = X2.Y || (X2.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0); +})(X || (X = {})), new X.Y.Point(1, 1), X.Y.Point.Origin; var X, A = function() { "use strict"; _classCallCheck(this, A); }; -(A || (A = { -})).Instance = new A(), A.Instance, new A(); +(A || (A = {})).Instance = new A(), A.Instance, new A(); diff --git a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck1_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck1_es2015.1.normal.js index 2058ab79530..b60897bcb55 100644 --- a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck1_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES3 -for (var v of ""){ -} +for (var v of ""){} diff --git a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck2_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck2_es2015.1.normal.js index 21c1d1d16a3..b9347609330 100644 --- a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck2_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES3 for (var v of [ true -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck4_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck4_es2015.1.normal.js index 135e9446525..655e2f32157 100644 --- a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck4_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES3 var union; -for (const v of union){ -} +for (const v of union){} diff --git a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck6_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck6_es2015.1.normal.js index f8a145b56e5..9a6abb1d13c 100644 --- a/crates/swc/tests/tsc-references/ES3For-ofTypeCheck6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES3For-ofTypeCheck6_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES3 var union; -for (var v of union){ -} +for (var v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-of11_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of11_es2015.1.normal.js index af9dbd6e5bf..c46d49e6e6d 100644 --- a/crates/swc/tests/tsc-references/ES5For-of11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of11_es2015.1.normal.js @@ -1,3 +1,2 @@ var v; -for (v of []){ -} +for (v of []){} diff --git a/crates/swc/tests/tsc-references/ES5For-of21_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of21_es2015.1.normal.js index 5efae24773d..64f150cef0d 100644 --- a/crates/swc/tests/tsc-references/ES5For-of21_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of21_es2015.1.normal.js @@ -1,4 +1,3 @@ for (let v of []){ - for (let _i of []){ - } + for (let _i of []){} } diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck10_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck10_es2015.1.normal.js index 54b691dd468..5c9ca091e84 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck10_es2015.1.normal.js @@ -12,5 +12,4 @@ class StringIterator { return this; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck11_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck11_es2015.1.normal.js index 3d4915b7776..a87e8e43f62 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck11_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES5 var union; var v; -for (v of union){ -} +for (v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck12_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck12_es2015.1.normal.js index 586d20e36da..9f20a06fe94 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck12_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (const v of 0){ -} +for (const v of 0){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13_es2015.1.normal.js index efa53c86703..e3c9628a0fe 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13_es2015.1.normal.js @@ -3,5 +3,4 @@ const strSet = new Set(); strSet.add('Hello'); strSet.add('World'); -for (const str of strSet){ -} +for (const str of strSet){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck14_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck14_es2015.1.normal.js index d708728f919..6169e43acf3 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck14_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES5 //@lib: ES6 var union; -for (const e of union){ -} +for (const e of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck1_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck1_es2015.1.normal.js index 5b537199476..721345453d2 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck1_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (var v of ""){ -} +for (var v of ""){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck2_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck2_es2015.1.normal.js index b1510b8d654..2ef8f43a2ea 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck2_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES5 for (var v of [ true -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck3_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck3_es2015.1.normal.js index 44d18b02ad2..f2a6b1efa51 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck3_es2015.1.normal.js @@ -3,5 +3,4 @@ var tuple = [ "", 0 ]; -for (var v of tuple){ -} +for (var v of tuple){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck4_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck4_es2015.1.normal.js index 3cee781fbe7..a28fddf4da1 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck4_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES5 var union; -for (const v of union){ -} +for (const v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck5_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck5_es2015.1.normal.js index 9d6e2975498..8d131faa069 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck5_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES5 var union; -for (var v of union){ -} +for (var v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck6_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck6_es2015.1.normal.js index 9d6e2975498..8d131faa069 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck6_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES5 var union; -for (var v of union){ -} +for (var v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck7_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck7_es2015.1.normal.js index 9d6e2975498..8d131faa069 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck7_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES5 var union; -for (var v of union){ -} +for (var v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck8_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck8_es2015.1.normal.js index 3d4915b7776..a87e8e43f62 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck8_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES5 var union; var v; -for (v of union){ -} +for (v of union){} diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck9_es2015.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck9_es2015.1.normal.js index 4222df39ffb..fe8af3273dc 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck9_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES5 var union; -for (let v of union){ -} +for (let v of union){} diff --git a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js index e9c8d7bff52..b6eacf3467c 100644 --- a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js @@ -2,8 +2,7 @@ var enumdule; (function(enumdule) { enumdule[enumdule["Red"] = 0] = "Red"; enumdule[enumdule["Blue"] = 1] = "Blue"; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); (function(enumdule) { class Point { constructor(x1, y1){ @@ -12,8 +11,7 @@ var enumdule; } } enumdule.Point = Point; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); var x; var x = enumdule.Red; var y; diff --git a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js index e7cd0c3198e..38aa435ac94 100644 --- a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js @@ -1,7 +1,5 @@ var enumdule, enumdule; -(enumdule = enumdule || (enumdule = { -}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", (enumdule || (enumdule = { -})).Point = class { +(enumdule = enumdule || (enumdule = {}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", (enumdule || (enumdule = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } diff --git a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.1.normal.js index 9962a3cf0f0..5ae67adbaf6 100644 --- a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.1.normal.js @@ -7,8 +7,7 @@ var enumdule; (function(enumdule) { enumdule[enumdule["Red"] = 0] = "Red"; enumdule[enumdule["Blue"] = 1] = "Blue"; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); (function(enumdule) { var Point = function Point(x1, y1) { "use strict"; @@ -17,8 +16,7 @@ var enumdule; this.y = y1; }; enumdule.Point = Point; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); var x; var x = enumdule.Red; var y; diff --git a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.2.minified.js index d6c3787488a..60020a9dc3c 100644 --- a/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/EnumAndModuleWithSameNameAndCommonRoot_es5.2.minified.js @@ -1,6 +1,5 @@ var enumdule, enumdule; -(enumdule = enumdule || (enumdule = { -}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", (function(enumdule1) { +(enumdule = enumdule || (enumdule = {}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", (function(enumdule1) { var Point = function(x, y) { "use strict"; (function(instance, Constructor) { @@ -8,5 +7,4 @@ var enumdule, enumdule; })(this, Point), this.x = x, this.y = y; }; enumdule1.Point = Point; -})(enumdule || (enumdule = { -})), enumdule.Red, new enumdule.Point(0, 0); +})(enumdule || (enumdule = {})), enumdule.Red, new enumdule.Point(0, 0); diff --git a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.1.normal.js index c8ae5fcf8fd..590e42a54ab 100644 --- a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.1.normal.js @@ -10,5 +10,4 @@ var A; } } A1.Point2d = Point2d; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.2.minified.js index 02899437a0f..6c2e57b9d76 100644 --- a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es2015.2.minified.js @@ -1,6 +1,5 @@ var A; -(A || (A = { -})).Point2d = class { +(A || (A = {})).Point2d = class { fromOrigin(p) { return 1; } diff --git a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.1.normal.js index 0ef8c563372..fe42374cb43 100644 --- a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.1.normal.js @@ -37,5 +37,4 @@ var A; return Point2d; }(); A1.Point2d = Point2d; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.2.minified.js index 7b7eedca1f1..8ccd0310d0d 100644 --- a/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWhichExtendsInterfaceWithInaccessibleType_es5.2.minified.js @@ -24,5 +24,4 @@ function _defineProperties(target, props) { ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Point2d; }(); A1.Point2d = Point2d; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js index 6a4544128cc..2b493734e7b 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js @@ -22,5 +22,4 @@ var A; } } A1.Line = Line; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js index 26076caea68..e77d8f6af57 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js @@ -15,5 +15,4 @@ var A; this.start = start, this.end = end; } }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js index 1b2448939e2..231d948c47b 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -103,5 +102,4 @@ var A; this.end = end; }; A1.Line = Line; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js index a0279207ccb..5661be9746a 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js @@ -39,8 +39,7 @@ function _setPrototypeOf(o, p) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -72,5 +71,4 @@ function _setPrototypeOf(o, p) { _classCallCheck(this, Line), this.start = start, this.end = end; }; A1.Line = Line; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.1.normal.js index d5bc062e6ae..fed9427ef79 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.1.normal.js @@ -5,5 +5,4 @@ var A; class points { } A1.points = points; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.2.minified.js index c1cbd0af3b2..1d9878e221b 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es2015.2.minified.js @@ -1,4 +1,3 @@ var A; -(A || (A = { -})).points = class { +(A || (A = {})).points = class { }; diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.1.normal.js index 77e8e25361b..10bfd1b8c61 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.1.normal.js @@ -14,5 +14,4 @@ var A; _classCallCheck(this, points); }; A1.points = points; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.2.minified.js index 899f207ef09..d7b30f4ead1 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations_es5.2.minified.js @@ -11,5 +11,4 @@ function _classCallCheck(instance, Constructor) { _classCallCheck(this, points); }; A1.points = points; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js index a20b3a14262..d94f4dcb271 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js @@ -24,5 +24,4 @@ var A; } } A1.Line = Line; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js index 2744ce5d7aa..ca270efeba4 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js @@ -18,5 +18,4 @@ var A; this.start = start, this.end = end; } }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js index 705ed752ad0..12c8b65f657 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -127,5 +126,4 @@ var A; return Line; }(); A1.Line = Line; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js index fa5d69cd388..d2b793cc055 100644 --- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js @@ -39,8 +39,7 @@ function _setPrototypeOf(o, p) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -88,5 +87,4 @@ function _setPrototypeOf(o, p) { ]), Line; }(); A1.Line = Line; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.1.normal.js index 6950c16d26e..b99266f920c 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.1.normal.js @@ -17,5 +17,4 @@ var A; }, p); } A1.fromOrigin = fromOrigin; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.2.minified.js index 32bf5f6fb7d..c1d277b58d6 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es2015.2.minified.js @@ -13,5 +13,4 @@ var A; y: 0 }, p); }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.1.normal.js index 371b581968e..2e38e67a6b3 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.1.normal.js @@ -24,5 +24,4 @@ var A; }; A1.Line = Line; A1.fromOrigin = fromOrigin; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.2.minified.js index a84c160b066..0491a5041bd 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation_es5.2.minified.js @@ -18,5 +18,4 @@ function _classCallCheck(instance, Constructor) { y: 0 }, p); }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.1.normal.js index f2e62f9a416..a8d0324a54d 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.1.normal.js @@ -16,5 +16,4 @@ var A; }, p); } A1.fromOrigin = fromOrigin; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.2.minified.js index 4083519e986..9e4857ca53d 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es2015.2.minified.js @@ -11,5 +11,4 @@ var A; y: 0 }, p); }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.1.normal.js index 057a4d74f0c..93f5e627fa8 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.1.normal.js @@ -23,5 +23,4 @@ var A; }; A1.Line = Line; A1.fromOrigin = fromOrigin; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.2.minified.js index 0eec35448ee..e755c6b50c9 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation_es5.2.minified.js @@ -16,5 +16,4 @@ function _classCallCheck(instance, Constructor) { y: 0 }, p); }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.1.normal.js index 45cff9c3e0b..879a6920da8 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.1.normal.js @@ -16,5 +16,4 @@ var A; }, p); } A1.fromOrigin = fromOrigin; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.2.minified.js index 7a8b22c10c6..bed19922d40 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es2015.2.minified.js @@ -13,5 +13,4 @@ var A; y: 0 }, p); }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.1.normal.js index dca71b42dc7..fb3e223553a 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.1.normal.js @@ -23,5 +23,4 @@ var A; this.end = end; }; A1.fromOrigin = fromOrigin; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.2.minified.js index a1a7927b394..70c3708702c 100644 --- a/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation_es5.2.minified.js @@ -18,5 +18,4 @@ function _classCallCheck(instance, Constructor) { y: 0 }, p); }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js index 0128b1db44b..01bd545046a 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.1.normal.js @@ -9,5 +9,4 @@ var A; y: 0, z: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js index fc4794b23f5..8d14f90e040 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es2015.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).Origin = { +(A1 = A || (A = {})).Origin = { x: 0, y: 0 }, A1.Origin3d = { diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js index 0128b1db44b..01bd545046a 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.1.normal.js @@ -9,5 +9,4 @@ var A; y: 0, z: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js index fc4794b23f5..8d14f90e040 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations_es5.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).Origin = { +(A1 = A || (A = {})).Origin = { x: 0, y: 0 }, A1.Origin3d = { diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js index 0128b1db44b..01bd545046a 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.1.normal.js @@ -9,5 +9,4 @@ var A; y: 0, z: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js index fc4794b23f5..8d14f90e040 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es2015.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).Origin = { +(A1 = A || (A = {})).Origin = { x: 0, y: 0 }, A1.Origin3d = { diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js index 0128b1db44b..01bd545046a 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.1.normal.js @@ -9,5 +9,4 @@ var A; y: 0, z: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js index fc4794b23f5..8d14f90e040 100644 --- a/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint_es5.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).Origin = { +(A1 = A || (A = {})).Origin = { x: 0, y: 0 }, A1.Origin3d = { diff --git a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.1.normal.js index a08d3956d87..d6350eb73c7 100644 --- a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.1.normal.js @@ -17,11 +17,8 @@ var A; y: 0 }, p); } - constructor(start, end){ - } + constructor(start, end){} } B.Line = Line; - })(B1 = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(B1 = A1.B || (A1.B = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.2.minified.js index 05d7c4dcd88..237fefae1e1 100644 --- a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es2015.2.minified.js @@ -14,11 +14,8 @@ var A; y: 0 }, p); } - constructor(start, end){ - } + constructor(start, end){} } B.Line = Line; - })(A1.B || (A1.B = { - })); -}(A || (A = { -})); + })(A1.B || (A1.B = {})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.1.normal.js index fa305997b9f..3a7412abc51 100644 --- a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.1.normal.js @@ -48,7 +48,5 @@ var A; return Line; }(); B.Line = Line; - })(B1 = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(B1 = A1.B || (A1.B = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.2.minified.js index c4d148e94ef..c1dd0026bbf 100644 --- a/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportModuleWithAccessibleTypesOnItsExportedMembers_es5.2.minified.js @@ -7,8 +7,7 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, Point), this.x = x, this.y = y; }; - A1.Point = Point, (B = A1.B || (A1.B = { - })).Origin = new Point(0, 0), Line = (function() { + A1.Point = Point, (B = A1.B || (A1.B = {})).Origin = new Point(0, 0), Line = (function() { "use strict"; var Constructor; function Line(start, end) { @@ -31,5 +30,4 @@ function _classCallCheck(instance, Constructor) { } ]), Line; })(), B.Line = Line; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.1.normal.js index 10f6b79c0c6..7b2d8ef3a3e 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.1.normal.js @@ -14,5 +14,4 @@ var A; start: new Point(0, 0), end: new Point(1, 0) }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.2.minified.js index 005985d9f1a..ab6ed94a4a0 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es2015.2.minified.js @@ -12,5 +12,4 @@ var A; start: new Point(0, 0), end: new Point(1, 0) }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.1.normal.js index ca4707efbaf..6cc61425e92 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.1.normal.js @@ -19,5 +19,4 @@ var A; start: new Point(0, 0), end: new Point(1, 0) }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.2.minified.js index 552d1dd57e3..7ff5765b453 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations_es5.2.minified.js @@ -13,5 +13,4 @@ var A; start: new Point(0, 0), end: new Point(1, 0) }; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.1.normal.js index 77e9657c943..f63a3c0be11 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.1.normal.js @@ -7,5 +7,4 @@ var A; } } var UnitSquare = A1.UnitSquare = null; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.2.minified.js index b4bf1a72d3f..2132d4b0462 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es2015.2.minified.js @@ -1,3 +1,2 @@ var A; -(A || (A = { -})).UnitSquare = null; +(A || (A = {})).UnitSquare = null; diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.1.normal.js index 1901f2ee0fc..cc278923b7d 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.1.normal.js @@ -12,5 +12,4 @@ var A; this.y = y; }; var UnitSquare = A1.UnitSquare = null; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.2.minified.js index 4ce0a0e8755..351cb7bc041 100644 --- a/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations_es5.2.minified.js @@ -7,5 +7,4 @@ var A; }(this, Point), this.x = x, this.y = y; }; A1.UnitSquare = null; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.1.normal.js index e7a862c54cb..ca772b13f04 100644 --- a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.1.normal.js @@ -5,5 +5,4 @@ var A; var beez; var beez2 = A1.beez2 = new Array(); A1.beez = beez; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.2.minified.js index 2369824554e..510bf4de707 100644 --- a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.2.minified.js @@ -2,5 +2,4 @@ var A; !function(A1) { var beez; A1.beez2 = new Array(), A1.beez = beez; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.1.normal.js index e0a12451388..d444150bc2e 100644 --- a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.1.normal.js @@ -12,5 +12,4 @@ var A; var beez; var beez2 = A1.beez2 = new Array(); A1.beez = beez; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.2.minified.js index 7766755c2eb..668ac27c3a4 100644 --- a/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es5.2.minified.js @@ -7,5 +7,4 @@ var A; }(this, B); }; A1.beez2 = new Array(), A1.beez = beez; -}(A || (A = { -})); +}(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.1.normal.js index 33641fff79d..ae0e09e2217 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.1.normal.js @@ -4,5 +4,4 @@ var A; x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.2.minified.js index 511241365a5..9710da0a8b7 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es2015.2.minified.js @@ -1,6 +1,5 @@ var A; -(A || (A = { -})).Origin = { +(A || (A = {})).Origin = { x: 0, y: 0 }; diff --git a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.1.normal.js index 33641fff79d..ae0e09e2217 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.1.normal.js @@ -4,5 +4,4 @@ var A; x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.2.minified.js index 511241365a5..9710da0a8b7 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithAccessibleTypeInTypeAnnotation_es5.2.minified.js @@ -1,6 +1,5 @@ var A; -(A || (A = { -})).Origin = { +(A || (A = {})).Origin = { x: 0, y: 0 }; diff --git a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.1.normal.js b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.1.normal.js index 0128b1db44b..01bd545046a 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.1.normal.js @@ -9,5 +9,4 @@ var A; y: 0, z: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.2.minified.js b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.2.minified.js index fc4794b23f5..8d14f90e040 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es2015.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).Origin = { +(A1 = A || (A = {})).Origin = { x: 0, y: 0 }, A1.Origin3d = { diff --git a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.1.normal.js b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.1.normal.js index 0128b1db44b..01bd545046a 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.1.normal.js @@ -9,5 +9,4 @@ var A; y: 0, z: 0 }; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.2.minified.js b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.2.minified.js index fc4794b23f5..8d14f90e040 100644 --- a/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ExportVariableWithInaccessibleTypeInTypeAnnotation_es5.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).Origin = { +(A1 = A || (A = {})).Origin = { x: 0, y: 0 }, A1.Origin3d = { diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js index bc6902abaa1..a72e5fe0522 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.1.normal.js @@ -8,8 +8,7 @@ var A; }; } A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { let Point1; (function(Point) { @@ -17,10 +16,8 @@ var A; x: 0, y: 0 }; - })(Point1 = A2.Point || (A2.Point = { - })); -})(A || (A = { -})); + })(Point1 = A2.Point || (A2.Point = {})); +})(A || (A = {})); // @filename: test.ts var fn; var fn = A.Point; @@ -42,10 +39,8 @@ var B; x: 0, y: 0 }; - })(Point2 = B1.Point || (B1.Point = { - })); -})(B || (B = { -})); + })(Point2 = B1.Point || (B1.Point = {})); +})(B || (B = {})); var fn; var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected var cl; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js index 21714868181..6a44ffcaef3 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es2015.2.minified.js @@ -1,13 +1,10 @@ var A, B, A1; -(A || (A = { -})).Point = function() { +(A || (A = {})).Point = function() { return { x: 0, y: 0 }; -}, ((A1 = A || (A = { -})).Point || (A1.Point = { -})).Origin = { +}, ((A1 = A || (A = {})).Point || (A1.Point = {})).Origin = { x: 0, y: 0 }, A.Point, A.Point(), A.Point.Origin, (function(B1) { @@ -17,10 +14,8 @@ var A, B, A1; y: 0 }; } - B1.Point = Point, (Point = B1.Point || (B1.Point = { - })).Origin = { + B1.Point = Point, (Point = B1.Point || (B1.Point = {})).Origin = { x: 0, y: 0 }; -})(B || (B = { -})), B.Point, B.Point(), B.Point.Origin; +})(B || (B = {})), B.Point, B.Point(), B.Point.Origin; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.1.normal.js index c0da561beb2..f177133d84a 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.1.normal.js @@ -8,8 +8,7 @@ var A; }; }; A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { var Point1; (function(Point) { @@ -17,10 +16,8 @@ var A; x: 0, y: 0 }; - })(Point1 = A2.Point || (A2.Point = { - })); -})(A || (A = { -})); + })(Point1 = A2.Point || (A2.Point = {})); +})(A || (A = {})); // @filename: test.ts var fn; var fn = A.Point; @@ -42,10 +39,8 @@ var B; x: 0, y: 0 }; - })(Point = B1.Point || (B1.Point = { - })); -})(B || (B = { -})); + })(Point = B1.Point || (B1.Point = {})); +})(B || (B = {})); var fn; var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected var cl; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.2.minified.js index 1375d7223dd..57aeabe973b 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndCommonRoot_es5.2.minified.js @@ -1,13 +1,10 @@ var A, B, A1; -(A || (A = { -})).Point = function() { +(A || (A = {})).Point = function() { return { x: 0, y: 0 }; -}, ((A1 = A || (A = { -})).Point || (A1.Point = { -})).Origin = { +}, ((A1 = A || (A = {})).Point || (A1.Point = {})).Origin = { x: 0, y: 0 }, A.Point, A.Point(), A.Point.Origin, (function(B1) { @@ -17,10 +14,8 @@ var A, B, A1; y: 0 }; }; - B1.Point = Point, (Point = B1.Point || (B1.Point = { - })).Origin = { + B1.Point = Point, (Point = B1.Point || (B1.Point = {})).Origin = { x: 0, y: 0 }; -})(B || (B = { -})), B.Point, B.Point(), B.Point.Origin; +})(B || (B = {})), B.Point, B.Point(), B.Point.Origin; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.1.normal.js index c2ada051590..f57239f9870 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.1.normal.js @@ -8,8 +8,7 @@ var A; }; } A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); // @filename: module.ts var B; (function(B1) { @@ -19,10 +18,8 @@ var B; x: 0, y: 0 }; - })(Point1 = B1.Point || (B1.Point = { - })); -})(B || (B = { -})); + })(Point1 = B1.Point || (B1.Point = {})); +})(B || (B = {})); // @filename: test.ts var fn; var fn = A.Point; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.2.minified.js index 6e0c031fa4c..499f5f2dc39 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es2015.2.minified.js @@ -1,13 +1,10 @@ var A, B, B1; -(A || (A = { -})).Point = function() { +(A || (A = {})).Point = function() { return { x: 0, y: 0 }; -}, ((B1 = B || (B = { -})).Point || (B1.Point = { -})).Origin = { +}, ((B1 = B || (B = {})).Point || (B1.Point = {})).Origin = { x: 0, y: 0 }, A.Point, B.Point.Origin; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.1.normal.js index 2fcee8bedaf..c7a92f5b103 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.1.normal.js @@ -8,8 +8,7 @@ var A; }; }; A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); // @filename: module.ts var B; (function(B1) { @@ -19,10 +18,8 @@ var B; x: 0, y: 0 }; - })(Point1 = B1.Point || (B1.Point = { - })); -})(B || (B = { -})); + })(Point1 = B1.Point || (B1.Point = {})); +})(B || (B = {})); // @filename: test.ts var fn; var fn = A.Point; diff --git a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.2.minified.js index 6e0c031fa4c..499f5f2dc39 100644 --- a/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot_es5.2.minified.js @@ -1,13 +1,10 @@ var A, B, B1; -(A || (A = { -})).Point = function() { +(A || (A = {})).Point = function() { return { x: 0, y: 0 }; -}, ((B1 = B || (B = { -})).Point || (B1.Point = { -})).Origin = { +}, ((B1 = B || (B = {})).Point || (B1.Point = {})).Origin = { x: 0, y: 0 }, A.Point, B.Point.Origin; diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es2015.1.normal.js index 6b5acf002c9..cd0a285efec 100644 --- a/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es2015.1.normal.js @@ -1,3 +1,2 @@ // @target: es6 -function* foo() { -} +function* foo() {} diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js index 2d31a89433f..ebb9f11d3cb 100644 --- a/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js @@ -20,8 +20,7 @@ function foo() { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.t0 = _defineProperty; - _ctx.t1 = { - }; + _ctx.t1 = {}; _ctx.next = 4; return; case 4: diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.2.minified.js index 4d93d4674b3..642b90972e8 100644 --- a/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.2.minified.js @@ -13,8 +13,7 @@ function foo() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _ctx.t0 = _defineProperty, _ctx.t1 = { - }, _ctx.next = 4; + _ctx.t0 = _defineProperty, _ctx.t1 = {}, _ctx.next = 4; return; case 4: _ctx.t2 = _ctx.sent, _ctx.t3 = foo, v = (0, _ctx.t0)(_ctx.t1, _ctx.t2, _ctx.t3); diff --git a/crates/swc/tests/tsc-references/FunctionExpression1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionExpression1_es6_es2015.1.normal.js index 4588944a20b..121fc992c70 100644 --- a/crates/swc/tests/tsc-references/FunctionExpression1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionExpression1_es6_es2015.1.normal.js @@ -1,3 +1,2 @@ // @target: es6 -var v = function*() { -}; +var v = function*() {}; diff --git a/crates/swc/tests/tsc-references/FunctionExpression2_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionExpression2_es6_es2015.1.normal.js index 7e7aba449cc..38e7d5b72c8 100644 --- a/crates/swc/tests/tsc-references/FunctionExpression2_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionExpression2_es6_es2015.1.normal.js @@ -1,3 +1,2 @@ // @target: es6 -var v = function* foo() { -}; +var v = function* foo() {}; diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es2015.1.normal.js index af066a757f2..4e01628921d 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es6 var v = { - *foo () { - } + *foo () {} }; diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es2015.1.normal.js index d5faba2ce91..eeefbe5312a 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es6 var v = { - *[foo()] () { - } + *[foo()] () {} }; diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js index 6c88012e146..ce2c0fdba90 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { return obj; } // @target: es6 -var v = _defineProperty({ -}, foo(), regeneratorRuntime.mark(function _callee() { +var v = _defineProperty({}, foo(), regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.2.minified.js index 1fe6f2d0516..41a5355c1c4 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.2.minified.js @@ -1,7 +1,6 @@ var obj, key, value; import regeneratorRuntime from "regenerator-runtime"; -obj = { -}, key = foo(), value = regeneratorRuntime.mark(function _callee() { +obj = {}, key = foo(), value = regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es2015.1.normal.js index 69697ec1b08..1dbbee671c9 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es6 class C { - *foo() { - } + *foo() {} } diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es2015.1.normal.js index 69697ec1b08..1dbbee671c9 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es6 class C { - *foo() { - } + *foo() {} } diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es2015.1.normal.js index 8079b974be8..6fbe3612e1f 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es2015.1.normal.js @@ -1,6 +1,5 @@ var tmp = foo; // @target: es6 class C { - *[tmp]() { - } + *[tmp]() {} } diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es2015.1.normal.js index 69697ec1b08..1dbbee671c9 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es6 class C { - *foo() { - } + *foo() {} } diff --git a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.1.normal.js index b64306fb418..b4d99c6e1ae 100644 --- a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.1.normal.js @@ -6,12 +6,9 @@ var X; let Point1; (function(Point) { var Origin = Point.Origin = new Point1(0, 0); - })(Point1 = Y.Point || (Y.Point = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Point1 = Y.Point || (Y.Point = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { let Y2; (function(Y) { @@ -22,14 +19,11 @@ var X; } } Y.Point = Point; - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); (function(A1) { var Instance = A1.Instance = new A(); -})(A || (A = { -})); +})(A || (A = {})); // duplicate identifier class A { } diff --git a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.2.minified.js index 441e63f6976..3c17536633c 100644 --- a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es2015.2.minified.js @@ -2,17 +2,11 @@ var X, X1; !function(X2) { var Y; let Point; - (Point = (Y = X2.Y || (X2.Y = { - })).Point || (Y.Point = { - })).Origin = new Point(0, 0); -}(X || (X = { -})), ((X1 = X || (X = { -})).Y || (X1.Y = { -})).Point = class { + (Point = (Y = X2.Y || (X2.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0); +}(X || (X = {})), ((X1 = X || (X = {})).Y || (X1.Y = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } -}, (A || (A = { -})).Instance = new A(); +}, (A || (A = {})).Instance = new A(); class A { } diff --git a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.1.normal.js index 849b4aa24c2..9b1b70393ac 100644 --- a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.1.normal.js @@ -11,12 +11,9 @@ var X; var Point1; (function(Point) { var Origin = Point.Origin = new Point1(0, 0); - })(Point1 = Y.Point || (Y.Point = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Point1 = Y.Point || (Y.Point = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { var Y2; (function(Y) { @@ -27,14 +24,11 @@ var X; this.y = y; }; Y.Point = Point; - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); (function(A1) { var Instance = A1.Instance = new A(); -})(A || (A = { -})); +})(A || (A = {})); var A = function A() { "use strict"; _classCallCheck(this, A); diff --git a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.2.minified.js index 719435e4153..552294235b6 100644 --- a/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleAndClassWithSameNameAndCommonRoot_es5.2.minified.js @@ -3,20 +3,14 @@ function _classCallCheck(instance, Constructor) { } !function(X1) { var Y, Point; - (Point = (Y = X1.Y || (X1.Y = { - })).Point || (Y.Point = { - })).Origin = new Point(0, 0); -}(X || (X = { -})), (function(X2) { + (Point = (Y = X1.Y || (X1.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0); +}(X || (X = {})), (function(X2) { var Y, Point; - Y = X2.Y || (X2.Y = { - }), Point = function(x, y) { + Y = X2.Y || (X2.Y = {}), Point = function(x, y) { "use strict"; _classCallCheck(this, Point), this.x = x, this.y = y; }, Y.Point = Point; -})(X || (X = { -})), (A || (A = { -})).Instance = new A(); +})(X || (X = {})), (A || (A = {})).Instance = new A(); var X, A = function A() { "use strict"; _classCallCheck(this, A); diff --git a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.1.normal.js index 729f995a910..816ad346e3c 100644 --- a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.1.normal.js @@ -7,13 +7,11 @@ var enumdule; } } enumdule1.Point = Point; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); (function(enumdule) { enumdule[enumdule["Red"] = 0] = "Red"; enumdule[enumdule["Blue"] = 1] = "Blue"; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); var x; var x = enumdule.Red; var y; diff --git a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.2.minified.js index ab7314b13c4..06d91cbf4c0 100644 --- a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es2015.2.minified.js @@ -1,8 +1,6 @@ var enumdule, enumdule; -(enumdule || (enumdule = { -})).Point = class { +(enumdule || (enumdule = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } -}, (enumdule = enumdule || (enumdule = { -}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", enumdule.Red, new enumdule.Point(0, 0); +}, (enumdule = enumdule || (enumdule = {}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", enumdule.Red, new enumdule.Point(0, 0); diff --git a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.1.normal.js index 9a372d3448c..cfcd0112d2a 100644 --- a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.1.normal.js @@ -12,13 +12,11 @@ var enumdule; this.y = y1; }; enumdule1.Point = Point; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); (function(enumdule) { enumdule[enumdule["Red"] = 0] = "Red"; enumdule[enumdule["Blue"] = 1] = "Blue"; -})(enumdule || (enumdule = { -})); +})(enumdule || (enumdule = {})); var x; var x = enumdule.Red; var y; diff --git a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.2.minified.js index 85d655d348d..c3bf32cf07a 100644 --- a/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleAndEnumWithSameNameAndCommonRoot_es5.2.minified.js @@ -7,6 +7,4 @@ var enumdule, enumdule; })(this, Point), this.x = x, this.y = y; }; enumdule1.Point = Point; -}(enumdule || (enumdule = { -})), (enumdule = enumdule || (enumdule = { -}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", enumdule.Red, new enumdule.Point(0, 0); +}(enumdule || (enumdule = {})), (enumdule = enumdule || (enumdule = {}))[enumdule.Red = 0] = "Red", enumdule[enumdule.Blue = 1] = "Blue", enumdule.Red, new enumdule.Point(0, 0); diff --git a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.1.normal.js index 486579cb004..99b8e853d78 100644 --- a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.1.normal.js @@ -7,10 +7,8 @@ var A; x: 0, y: 0 }; - })(Point1 = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point1 = A1.Point || (A1.Point = {})); +})(A || (A = {})); (function(A2) { function Point() { return { @@ -19,8 +17,7 @@ var A; }; } A2.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); // @filename: simple.ts var B; (function(B1) { @@ -29,8 +26,7 @@ var B; x: 0, y: 0 }; - })(Point2 = B1.Point || (B1.Point = { - })); + })(Point2 = B1.Point || (B1.Point = {})); function Point2() { return { x: 0, @@ -38,5 +34,4 @@ var B; }; } B1.Point = Point2; -})(B || (B = { -})); +})(B || (B = {})); diff --git a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.2.minified.js index 914c1b0f839..e86b1a59fdf 100644 --- a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es2015.2.minified.js @@ -1,11 +1,8 @@ var A, B, A1; -((A1 = A || (A = { -})).Point || (A1.Point = { -})).Origin = { +((A1 = A || (A = {})).Point || (A1.Point = {})).Origin = { x: 0, y: 0 -}, (A || (A = { -})).Point = function() { +}, (A || (A = {})).Point = function() { return { x: 0, y: 0 @@ -17,10 +14,8 @@ var A, B, A1; y: 0 }; } - (Point = B1.Point || (B1.Point = { - })).Origin = { + (Point = B1.Point || (B1.Point = {})).Origin = { x: 0, y: 0 }, B1.Point = Point; -})(B || (B = { -})); +})(B || (B = {})); diff --git a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.1.normal.js index 0609aa8a532..c2a80a38f99 100644 --- a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.1.normal.js @@ -7,10 +7,8 @@ var A; x: 0, y: 0 }; - })(Point1 = A1.Point || (A1.Point = { - })); -})(A || (A = { -})); + })(Point1 = A1.Point || (A1.Point = {})); +})(A || (A = {})); (function(A2) { var Point = function Point() { return { @@ -19,8 +17,7 @@ var A; }; }; A2.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); // @filename: simple.ts var B; (function(B1) { @@ -35,8 +32,6 @@ var B; x: 0, y: 0 }; - })(Point = B1.Point || (B1.Point = { - })); + })(Point = B1.Point || (B1.Point = {})); B1.Point = Point; -})(B || (B = { -})); +})(B || (B = {})); diff --git a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.2.minified.js index a62228d7dae..64a14c49d5a 100644 --- a/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleAndFunctionWithSameNameAndCommonRoot_es5.2.minified.js @@ -1,11 +1,8 @@ var A, B, A1; -((A1 = A || (A = { -})).Point || (A1.Point = { -})).Origin = { +((A1 = A || (A = {})).Point || (A1.Point = {})).Origin = { x: 0, y: 0 -}, (A || (A = { -})).Point = function() { +}, (A || (A = {})).Point = function() { return { x: 0, y: 0 @@ -17,10 +14,8 @@ var A, B, A1; y: 0 }; }; - (Point = B1.Point || (B1.Point = { - })).Origin = { + (Point = B1.Point || (B1.Point = {})).Origin = { x: 0, y: 0 }, B1.Point = Point; -})(B || (B = { -})); +})(B || (B = {})); diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.1.normal.js index 0454ae4851e..cd45485f71f 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.1.normal.js @@ -10,8 +10,7 @@ var A; } class AG2 { } -})(A || (A = { -})); +})(A || (A = {})); // no errors expected, these are all exported var a; var a = new A.A(); diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.2.minified.js index f39f27b66e3..0e0c1a70d16 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es2015.2.minified.js @@ -1,5 +1,4 @@ var A, A1; -(A = A1 || (A1 = { -})).A = class { +(A = A1 || (A1 = {})).A = class { }, A.AG = class { }, new A1.A(), new A1.AG(), new A1.A2(), new A1.A2(); diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.1.normal.js index 858965a43d7..7ddbb77b05b 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.1.normal.js @@ -23,8 +23,7 @@ var A; "use strict"; _classCallCheck(this, AG2); }; -})(A || (A = { -})); +})(A || (A = {})); // no errors expected, these are all exported var a; var a = new A.A(); diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.2.minified.js index c8d8b205c7c..f9de3fb04ed 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedClasses_es5.2.minified.js @@ -20,5 +20,4 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, AG2); }; -})(A || (A = { -})), new A.A(), new A.AG(), new A.A2(), new A.A2(); +})(A || (A = {})), new A.A(), new A.AG(), new A.A2(), new A.A2(); diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.1.normal.js index e0266a6edbf..6ac90469769 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.1.normal.js @@ -4,16 +4,13 @@ var A; (function(Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Blue"] = 1] = "Blue"; - })(Color = A1.Color || (A1.Color = { - })); + })(Color = A1.Color || (A1.Color = {})); let Day; (function(Day) { Day[Day["Monday"] = 0] = "Monday"; Day[Day["Tuesday"] = 1] = "Tuesday"; - })(Day || (Day = { - })); -})(A || (A = { -})); + })(Day || (Day = {})); +})(A || (A = {})); // not an error since exported var a = A.Color.Red; // error not exported diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.2.minified.js index 838b9398623..2f456efbbdd 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es2015.2.minified.js @@ -2,10 +2,7 @@ var A; (function(A1) { var Color, Day; let Color; - (Color = Color = A1.Color || (A1.Color = { - }))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue"; + (Color = Color = A1.Color || (A1.Color = {}))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue"; let Day; - (Day = Day || (Day = { - }))[Day.Monday = 0] = "Monday", Day[Day.Tuesday = 1] = "Tuesday"; -})(A || (A = { -})), A.Color.Red, A.Day.Monday; + (Day = Day || (Day = {}))[Day.Monday = 0] = "Monday", Day[Day.Tuesday = 1] = "Tuesday"; +})(A || (A = {})), A.Color.Red, A.Day.Monday; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.1.normal.js index 7007413e727..d6306c77de8 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.1.normal.js @@ -4,16 +4,13 @@ var A; (function(Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Blue"] = 1] = "Blue"; - })(Color = A1.Color || (A1.Color = { - })); + })(Color = A1.Color || (A1.Color = {})); var Day; (function(Day) { Day[Day["Monday"] = 0] = "Monday"; Day[Day["Tuesday"] = 1] = "Tuesday"; - })(Day || (Day = { - })); -})(A || (A = { -})); + })(Day || (Day = {})); +})(A || (A = {})); // not an error since exported var a = A.Color.Red; // error not exported diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.2.minified.js index cf9f060d2fe..90922e9f5ed 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedEnums_es5.2.minified.js @@ -1,8 +1,5 @@ var A; (function(A1) { var Color, Day, Color, Day; - (Color = Color = A1.Color || (A1.Color = { - }))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue", (Day = Day || (Day = { - }))[Day.Monday = 0] = "Monday", Day[Day.Tuesday = 1] = "Tuesday"; -})(A || (A = { -})), A.Color.Red, A.Day.Monday; + (Color = Color = A1.Color || (A1.Color = {}))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue", (Day = Day || (Day = {}))[Day.Monday = 0] = "Monday", Day[Day.Tuesday = 1] = "Tuesday"; +})(A || (A = {})), A.Color.Red, A.Day.Monday; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.1.normal.js index c1f51b78a3d..5cff3f9c15a 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.1.normal.js @@ -14,8 +14,7 @@ var A; function fng2(s) { return null; } -})(A || (A = { -})); +})(A || (A = {})); // these should not be errors since the functions are exported var fn; var fn = A.fn; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.2.minified.js index edc34e45229..7d5153bf92e 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es2015.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A = A1 || (A1 = { -})).fn = function(s) { +(A = A1 || (A1 = {})).fn = function(s) { return !0; }, A.fng = function(s) { return null; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.1.normal.js index 630b6e3534a..a9178e07cb2 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.1.normal.js @@ -14,8 +14,7 @@ var A; }; A1.fn = fn; A1.fng = fng; -})(A || (A = { -})); +})(A || (A = {})); // these should not be errors since the functions are exported var fn1; var fn1 = A.fn; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.2.minified.js index 4bd90f4bceb..9bde6e8fcc9 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedFunctions_es5.2.minified.js @@ -1,6 +1,5 @@ var A, A1; -(A1 = A || (A = { -})).fn = function(s) { +(A1 = A || (A = {})).fn = function(s) { return !0; }, A1.fng = function(s) { return null; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.1.normal.js index 1b72f4deed2..4b87dad623a 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.1.normal.js @@ -7,8 +7,7 @@ var B; } } B1.Line = Line; -})(B || (B = { -})); +})(B || (B = {})); var Geometry; (function(Geometry1) { var Points = A; @@ -22,8 +21,7 @@ var Geometry; x: 1, y: 0 }); -})(Geometry || (Geometry = { -})); +})(Geometry || (Geometry = {})); // expected to work since all are exported var p; var p; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.2.minified.js index 5276b132082..9b36341b888 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es2015.2.minified.js @@ -1,6 +1,5 @@ var B, Geometry; -(B || (B = { -})).Line = class { +(B || (B = {})).Line = class { constructor(start, end){ this.start = start, this.end = end; } @@ -14,5 +13,4 @@ var B, Geometry; x: 1, y: 0 }); -})(Geometry || (Geometry = { -})), Geometry.Origin, Geometry.Unit, Geometry.Lines.Line; +})(Geometry || (Geometry = {})), Geometry.Origin, Geometry.Unit, Geometry.Lines.Line; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.1.normal.js index 91df8d555d9..f8fd4fde616 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.1.normal.js @@ -12,8 +12,7 @@ var B; this.end = end; }; B1.Line = Line; -})(B || (B = { -})); +})(B || (B = {})); var Geometry; (function(Geometry1) { var Points = A; @@ -27,8 +26,7 @@ var Geometry; x: 1, y: 0 }); -})(Geometry || (Geometry = { -})); +})(Geometry || (Geometry = {})); // expected to work since all are exported var p; var p; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.2.minified.js index 8517f8ea138..7b1f609655c 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedImportAlias_es5.2.minified.js @@ -7,8 +7,7 @@ var B, Geometry; })(this, Line), this.start = start, this.end = end; }; B1.Line = Line; -})(B || (B = { -})), (function(Geometry1) { +})(B || (B = {})), (function(Geometry1) { Geometry1.Points = A; var Origin = Geometry1.Origin = { x: 0, @@ -18,5 +17,4 @@ var B, Geometry; x: 1, y: 0 }); -})(Geometry || (Geometry = { -})), Geometry.Origin, Geometry.Unit, Geometry.Lines.Line; +})(Geometry || (Geometry = {})), Geometry.Origin, Geometry.Unit, Geometry.Lines.Line; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.1.normal.js index 60f077c8567..e69b3ff3be4 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.1.normal.js @@ -2,8 +2,7 @@ var A; (function(A1) { var x = A1.x = 'hello world'; var y = 12; -})(A || (A = { -})); +})(A || (A = {})); var x; var x = A.x; // Error, since y is not exported diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.2.minified.js index 01a0c0f8c35..f90ba4c3fbe 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es2015.2.minified.js @@ -1,3 +1,2 @@ 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/ModuleWithExportedAndNonExportedVariables_es5.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.1.normal.js index 60f077c8567..e69b3ff3be4 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.1.normal.js @@ -2,8 +2,7 @@ var A; (function(A1) { var x = A1.x = 'hello world'; var y = 12; -})(A || (A = { -})); +})(A || (A = {})); var x; var x = A.x; // Error, since y is not exported diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.2.minified.js index 01a0c0f8c35..f90ba4c3fbe 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables_es5.2.minified.js @@ -1,3 +1,2 @@ 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/Protected3_es2015.1.normal.js b/crates/swc/tests/tsc-references/Protected3_es2015.1.normal.js index e403fc5ee29..e54e9a0ede4 100644 --- a/crates/swc/tests/tsc-references/Protected3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/Protected3_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/Protected5_es2015.1.normal.js b/crates/swc/tests/tsc-references/Protected5_es2015.1.normal.js index e5c4deb8996..b9d2cc34fcb 100644 --- a/crates/swc/tests/tsc-references/Protected5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/Protected5_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - static m() { - } + static m() {} } diff --git a/crates/swc/tests/tsc-references/Protected5_es5.1.normal.js b/crates/swc/tests/tsc-references/Protected5_es5.1.normal.js index 0ddbc850586..644e6efcbc5 100644 --- a/crates/swc/tests/tsc-references/Protected5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/Protected5_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, null, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/Protected5_es5.2.minified.js b/crates/swc/tests/tsc-references/Protected5_es5.2.minified.js index c52ce479a9c..cc147164664 100644 --- a/crates/swc/tests/tsc-references/Protected5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/Protected5_es5.2.minified.js @@ -14,8 +14,7 @@ var C = function() { })(Constructor = C, [ { key: "m", - value: function() { - } + value: function() {} } ]), C; }(); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.1.normal.js index 09c6463074d..3b380a4e0c8 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.1.normal.js @@ -3,8 +3,7 @@ var A; class Point { } A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); (function(A) { class Point { fromCarthesian(p1) { @@ -14,8 +13,7 @@ var A; }; } } -})(A || (A = { -})); +})(A || (A = {})); // ensure merges as expected var p; var p; @@ -28,12 +26,9 @@ var X; class Line { } Z.Line = Line; - })(Z1 = Y.Z || (Y.Z = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Z1 = Y.Z || (Y.Z = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { let Y2; (function(Y) { @@ -41,12 +36,9 @@ var X; (function(Z) { class Line { } - })(Z = Y.Z || (Y.Z = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z = Y.Z || (Y.Z = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); // ensure merges as expected var l; var l; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.2.minified.js index bb8338ae77a..8b5e2abbb81 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es2015.2.minified.js @@ -1,13 +1,7 @@ var A, X, X1; -(A || (A = { -})).Point = class { +(A || (A = {})).Point = class { }, (function(X2) { var Y; - ((Y = X2.Y || (X2.Y = { - })).Z || (Y.Z = { - })).Line = class { + ((Y = X2.Y || (X2.Y = {})).Z || (Y.Z = {})).Line = class { }; -})(X || (X = { -})), (X1 = X || (X = { -})).Y || (X1.Y = { -}); +})(X || (X = {})), (X1 = X || (X = {})).Y || (X1.Y = {}); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.1.normal.js index f8e28fa5d46..7b13bf9cd26 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.1.normal.js @@ -24,8 +24,7 @@ var A; _classCallCheck(this, Point); }; A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); (function(A) { var Point = /*#__PURE__*/ function() { "use strict"; @@ -45,8 +44,7 @@ var A; ]); return Point; }(); -})(A || (A = { -})); +})(A || (A = {})); // ensure merges as expected var p; var p; @@ -61,12 +59,9 @@ var X; _classCallCheck(this, Line); }; Z.Line = Line; - })(Z1 = Y.Z || (Y.Z = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Z1 = Y.Z || (Y.Z = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { var Y2; (function(Y) { @@ -76,12 +71,9 @@ var X; "use strict"; _classCallCheck(this, Line); }; - })(Z = Y.Z || (Y.Z = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z = Y.Z || (Y.Z = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); // ensure merges as expected var l; var l; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.2.minified.js index 73857ee29e5..bc17baae3f2 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName_es5.2.minified.js @@ -14,8 +14,7 @@ function _defineProperties(target, props) { _classCallCheck(this, Point); }; A1.Point = Point; -}(A || (A = { -})), (function(A) { +}(A || (A = {})), (function(A) { var Point = function() { "use strict"; var Constructor, protoProps, staticProps; @@ -34,23 +33,16 @@ function _defineProperties(target, props) { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Point; }(); -})(A || (A = { -})), (function(X1) { +})(A || (A = {})), (function(X1) { var Y, Z, Line; - Z = (Y = X1.Y || (X1.Y = { - })).Z || (Y.Z = { - }), Line = function() { + Z = (Y = X1.Y || (X1.Y = {})).Z || (Y.Z = {}), Line = function() { "use strict"; _classCallCheck(this, Line); }, Z.Line = Line; -})(X || (X = { -})), (function(X2) { +})(X || (X = {})), (function(X2) { var Y, Line; - (Y = X2.Y || (X2.Y = { - })).Z || (Y.Z = { - }), Line = function() { + (Y = X2.Y || (X2.Y = {})).Z || (Y.Z = {}), Line = function() { "use strict"; _classCallCheck(this, Line); }; -})(X || (X = { -})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.1.normal.js index e0e6ed0fb43..06f4aef9c9c 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.1.normal.js @@ -10,14 +10,12 @@ var A; }; } Utils.mirror = mirror; - })(Utils1 = A1.Utils || (A1.Utils = { - })); + })(Utils1 = A1.Utils || (A1.Utils = {})); var Origin = A1.Origin = { x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { // not a collision, since we don't export var Origin = "0,0"; @@ -30,10 +28,8 @@ var A; } } Utils.Plane = Plane; - })(Utils2 = A2.Utils || (A2.Utils = { - })); -})(A || (A = { -})); + })(Utils2 = A2.Utils || (A2.Utils = {})); +})(A || (A = {})); //@filename: part3.ts // test the merging actually worked var o; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.2.minified.js index 43f627fbad3..9a4cf127dd6 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es2015.2.minified.js @@ -1,7 +1,5 @@ var A, A1; -((A = A2 || (A2 = { -})).Utils || (A.Utils = { -})).mirror = function(p) { +((A = A2 || (A2 = {})).Utils || (A.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x @@ -9,9 +7,7 @@ var A, A1; }, A.Origin = { x: 0, y: 0 -}, ((A1 = A2 || (A2 = { -})).Utils || (A1.Utils = { -})).Plane = class { +}, ((A1 = A2 || (A2 = {})).Utils || (A1.Utils = {})).Plane = class { constructor(tl, br){ this.tl = tl, this.br = br; } diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.1.normal.js index e060197ca2d..dd84857bde4 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.1.normal.js @@ -15,14 +15,12 @@ var A; }; } Utils.mirror = mirror; - })(Utils1 = A1.Utils || (A1.Utils = { - })); + })(Utils1 = A1.Utils || (A1.Utils = {})); var Origin = A1.Origin = { x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { // not a collision, since we don't export var Origin = "0,0"; @@ -35,10 +33,8 @@ var A; this.br = br; }; Utils.Plane = Plane; - })(Utils2 = A2.Utils || (A2.Utils = { - })); -})(A || (A = { -})); + })(Utils2 = A2.Utils || (A2.Utils = {})); +})(A || (A = {})); //@filename: part3.ts // test the merging actually worked var o; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.2.minified.js index 0706abf7295..e769458e022 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName_es5.2.minified.js @@ -1,7 +1,5 @@ var A; -((A = A1 || (A1 = { -})).Utils || (A.Utils = { -})).mirror = function(p) { +((A = A1 || (A1 = {})).Utils || (A.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x @@ -11,15 +9,13 @@ var A; y: 0 }, (function(A2) { var Utils, Plane; - Utils = A2.Utils || (A2.Utils = { - }), Plane = function(tl, br) { + Utils = A2.Utils || (A2.Utils = {}), Plane = function(tl, br) { "use strict"; (function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, Plane), this.tl = tl, this.br = br; }, Utils.Plane = Plane; -})(A1 || (A1 = { -})); +})(A1 || (A1 = {})); var A1, o, o, o = A1.Origin, o = A1.Utils.mirror(o); new A1.Utils.Plane(o, { x: 1, diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.1.normal.js index c1352a2c5bc..931d2b98e7c 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.1.normal.js @@ -3,14 +3,12 @@ var A; class Point { } A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { class Point { } A2.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); var X; (function(X1) { let Y1; @@ -20,12 +18,9 @@ var X; class Line { } Z.Line = Line; - })(Z1 = Y.Z || (Y.Z = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Z1 = Y.Z || (Y.Z = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { let Y2; (function(Y) { @@ -34,9 +29,6 @@ var X; class Line { } Z.Line = Line; - })(Z2 = Y.Z || (Y.Z = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z2 = Y.Z || (Y.Z = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.2.minified.js index 7cb3c7cd677..977b5d094c5 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es2015.2.minified.js @@ -1,20 +1,12 @@ var A, X; -(A || (A = { -})).Point = class { -}, (A || (A = { -})).Point = class { +(A || (A = {})).Point = class { +}, (A || (A = {})).Point = class { }, (function(X1) { var Y; - ((Y = X1.Y || (X1.Y = { - })).Z || (Y.Z = { - })).Line = class { + ((Y = X1.Y || (X1.Y = {})).Z || (Y.Z = {})).Line = class { }; -})(X || (X = { -})), (function(X2) { +})(X || (X = {})), (function(X2) { var Y; - ((Y = X2.Y || (X2.Y = { - })).Z || (Y.Z = { - })).Line = class { + ((Y = X2.Y || (X2.Y = {})).Z || (Y.Z = {})).Line = class { }; -})(X || (X = { -})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.1.normal.js index 276a2ca39dd..09b6cbffd6c 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.1.normal.js @@ -10,16 +10,14 @@ var A; _classCallCheck(this, Point); }; A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { var Point = function Point() { "use strict"; _classCallCheck(this, Point); }; A2.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); var X; (function(X1) { var Y1; @@ -31,12 +29,9 @@ var X; _classCallCheck(this, Line); }; Z.Line = Line; - })(Z1 = Y.Z || (Y.Z = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Z1 = Y.Z || (Y.Z = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { var Y2; (function(Y) { @@ -47,9 +42,6 @@ var X; _classCallCheck(this, Line); }; Z.Line = Line; - })(Z2 = Y.Z || (Y.Z = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z2 = Y.Z || (Y.Z = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.2.minified.js index 24d5463e762..4b4814b8179 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName_es5.2.minified.js @@ -8,30 +8,22 @@ function _classCallCheck(instance, Constructor) { _classCallCheck(this, Point); }; A1.Point = Point; -}(A || (A = { -})), (function(A2) { +}(A || (A = {})), (function(A2) { var Point = function() { "use strict"; _classCallCheck(this, Point); }; A2.Point = Point; -})(A || (A = { -})), (function(X1) { +})(A || (A = {})), (function(X1) { var Y, Z, Line; - Z = (Y = X1.Y || (X1.Y = { - })).Z || (Y.Z = { - }), Line = function() { + Z = (Y = X1.Y || (X1.Y = {})).Z || (Y.Z = {}), Line = function() { "use strict"; _classCallCheck(this, Line); }, Z.Line = Line; -})(X || (X = { -})), (function(X2) { +})(X || (X = {})), (function(X2) { var Y, Z, Line; - Z = (Y = X2.Y || (X2.Y = { - })).Z || (Y.Z = { - }), Line = function() { + Z = (Y = X2.Y || (X2.Y = {})).Z || (Y.Z = {}), Line = function() { "use strict"; _classCallCheck(this, Line); }, Z.Line = Line; -})(X || (X = { -})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.1.normal.js index 5201f5e3167..7fc822a79f9 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.1.normal.js @@ -10,14 +10,12 @@ export var A; }; } Utils.mirror = mirror; - })(Utils1 = A1.Utils || (A1.Utils = { - })); + })(Utils1 = A1.Utils || (A1.Utils = {})); var Origin = A1.Origin = { x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { var Origin = A2.Origin = { x: 0, @@ -32,7 +30,5 @@ export var A; } } Utils.Plane = Plane; - })(Utils2 = A2.Utils || (A2.Utils = { - })); -})(A || (A = { -})); + })(Utils2 = A2.Utils || (A2.Utils = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.2.minified.js index 7762d009753..5ee200e566b 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es2015.2.minified.js @@ -1,7 +1,5 @@ var A, A1, A2; -((A1 = A || (A = { -})).Utils || (A1.Utils = { -})).mirror = function(p) { +((A1 = A || (A = {})).Utils || (A1.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x @@ -9,12 +7,10 @@ var A, A1, A2; }, A1.Origin = { x: 0, y: 0 -}, (A2 = A || (A = { -})).Origin = { +}, (A2 = A || (A = {})).Origin = { x: 0, y: 0 -}, (A2.Utils || (A2.Utils = { -})).Plane = class { +}, (A2.Utils || (A2.Utils = {})).Plane = class { constructor(tl, br){ this.tl = tl, this.br = br; } diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.1.normal.js index 8d40f351594..7402835741a 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.1.normal.js @@ -15,14 +15,12 @@ export var A; }; } Utils.mirror = mirror; - })(Utils1 = A1.Utils || (A1.Utils = { - })); + })(Utils1 = A1.Utils || (A1.Utils = {})); var Origin = A1.Origin = { x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); (function(A2) { var Origin = A2.Origin = { x: 0, @@ -37,7 +35,5 @@ export var A; this.br = br; }; Utils.Plane = Plane; - })(Utils2 = A2.Utils || (A2.Utils = { - })); -})(A || (A = { -})); + })(Utils2 = A2.Utils || (A2.Utils = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.2.minified.js index 84576682e79..a9cde778f5c 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName_es5.2.minified.js @@ -1,7 +1,5 @@ var A, A1; -((A1 = A || (A = { -})).Utils || (A1.Utils = { -})).mirror = function(p) { +((A1 = A || (A = {})).Utils || (A1.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x @@ -14,12 +12,10 @@ var A, A1; A2.Origin = { x: 0, y: 0 - }, Utils = A2.Utils || (A2.Utils = { - }), Plane = function(tl, br) { + }, Utils = A2.Utils || (A2.Utils = {}), Plane = function(tl, br) { "use strict"; (function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, Plane), this.tl = tl, this.br = br; }, Utils.Plane = Plane; -})(A || (A = { -})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.1.normal.js index 12981fbcc1a..765c2c352dd 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.1.normal.js @@ -4,19 +4,15 @@ var A; (function(B) { var x1; B.x = x1; - })(B1 = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(B1 = A1.B || (A1.B = {})); +})(A || (A = {})); (function(A) { let B2; (function(B) { var x2; B.x = x2; - })(B2 || (B2 = { - })); -})(A || (A = { -})); + })(B2 || (B2 = {})); +})(A || (A = {})); // ensure the right var decl is exported var x; var x = A.B.x; @@ -29,12 +25,9 @@ var X; class Line { } Z.Line = Line; - })(Z1 = Y.Z || (Y.Z = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Z1 = Y.Z || (Y.Z = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { let Y; (function(Y) { @@ -43,12 +36,9 @@ var X; class Line { } Z.Line = Line; - })(Z2 || (Z2 = { - })); - })(Y = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z2 || (Z2 = {})); + })(Y = X2.Y || (X2.Y = {})); +})(X || (X = {})); // make sure merging works as expected var l; var l; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.2.minified.js index 109f6e7982a..165fd578eb8 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es2015.2.minified.js @@ -1,27 +1,17 @@ var A, X; !function(A1) { var x; - (A1.B || (A1.B = { - })).x = x; -}(A || (A = { -})), (function(A) { + (A1.B || (A1.B = {})).x = x; +}(A || (A = {})), (function(A) { var x; let B; - (B || (B = { - })).x = x; -})(A || (A = { -})), A.B.x, (function(X1) { + (B || (B = {})).x = x; +})(A || (A = {})), A.B.x, (function(X1) { var Y; - ((Y = X1.Y || (X1.Y = { - })).Z || (Y.Z = { - })).Line = class { + ((Y = X1.Y || (X1.Y = {})).Z || (Y.Z = {})).Line = class { }; -})(X || (X = { -})), (function(X2) { +})(X || (X = {})), (function(X2) { let Z; - X2.Y || (X2.Y = { - }), (Z || (Z = { - })).Line = class { + X2.Y || (X2.Y = {}), (Z || (Z = {})).Line = class { }; -})(X || (X = { -})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.1.normal.js index 2c9db6e8423..b9f8801ab5f 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.1.normal.js @@ -9,19 +9,15 @@ var A; (function(B) { var x1; B.x = x1; - })(B1 = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(B1 = A1.B || (A1.B = {})); +})(A || (A = {})); (function(A) { var B2; (function(B) { var x2; B.x = x2; - })(B2 || (B2 = { - })); -})(A || (A = { -})); + })(B2 || (B2 = {})); +})(A || (A = {})); // ensure the right var decl is exported var x; var x = A.B.x; @@ -36,12 +32,9 @@ var X; _classCallCheck(this, Line); }; Z.Line = Line; - })(Z1 = Y.Z || (Y.Z = { - })); - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Z1 = Y.Z || (Y.Z = {})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); (function(X2) { var Y; (function(Y) { @@ -52,12 +45,9 @@ var X; _classCallCheck(this, Line); }; Z.Line = Line; - })(Z2 || (Z2 = { - })); - })(Y = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z2 || (Z2 = {})); + })(Y = X2.Y || (X2.Y = {})); +})(X || (X = {})); // make sure merging works as expected var l; var l; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.2.minified.js index 8e2c39be99c..5ea9575c1d6 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName_es5.2.minified.js @@ -4,30 +4,20 @@ function _classCallCheck(instance, Constructor) { } !function(A1) { var x; - (A1.B || (A1.B = { - })).x = x; -}(A || (A = { -})), (function(A) { + (A1.B || (A1.B = {})).x = x; +}(A || (A = {})), (function(A) { var B, x; - (B || (B = { - })).x = x; -})(A || (A = { -})), A.B.x, (function(X1) { + (B || (B = {})).x = x; +})(A || (A = {})), A.B.x, (function(X1) { var Y, Z, Line; - Z = (Y = X1.Y || (X1.Y = { - })).Z || (Y.Z = { - }), Line = function() { + Z = (Y = X1.Y || (X1.Y = {})).Z || (Y.Z = {}), Line = function() { "use strict"; _classCallCheck(this, Line); }, Z.Line = Line; -})(X || (X = { -})), (function(X2) { +})(X || (X = {})), (function(X2) { var Z, Z1, Line; - X2.Y || (X2.Y = { - }), Z1 = Z || (Z = { - }), Line = function() { + X2.Y || (X2.Y = {}), Z1 = Z || (Z = {}), Line = function() { "use strict"; _classCallCheck(this, Line); }, Z1.Line = Line; -})(X || (X = { -})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.1.normal.js index df29f88f321..8342afd08cc 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.1.normal.js @@ -12,12 +12,9 @@ var Root; }; } Utils.mirror = mirror; - })(Utils1 = A.Utils || (A.Utils = { - })); - })(A1 = Root1.A || (Root1.A = { - })); -})(Root || (Root = { -})); + })(Utils1 = A.Utils || (A.Utils = {})); + })(A1 = Root1.A || (Root1.A = {})); +})(Root || (Root = {})); //@filename: part2.ts var otherRoot; (function(otherRoot1) { @@ -36,9 +33,6 @@ var otherRoot; } } Utils.Plane = Plane; - })(Utils2 = A.Utils || (A.Utils = { - })); - })(A2 = otherRoot1.A || (otherRoot1.A = { - })); -})(otherRoot || (otherRoot = { -})); + })(Utils2 = A.Utils || (A.Utils = {})); + })(A2 = otherRoot1.A || (otherRoot1.A = {})); +})(otherRoot || (otherRoot = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.2.minified.js index ce46c53f68e..7fb63bb7335 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es2015.2.minified.js @@ -1,26 +1,20 @@ var Root, otherRoot; !function(Root1) { var A; - ((A = Root1.A || (Root1.A = { - })).Utils || (A.Utils = { - })).mirror = function(p) { + ((A = Root1.A || (Root1.A = {})).Utils || (A.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x }; }; -}(Root || (Root = { -})), (function(otherRoot1) { +}(Root || (Root = {})), (function(otherRoot1) { var A; - (A = otherRoot1.A || (otherRoot1.A = { - })).Origin = { + (A = otherRoot1.A || (otherRoot1.A = {})).Origin = { x: 0, y: 0 - }, (A.Utils || (A.Utils = { - })).Plane = class { + }, (A.Utils || (A.Utils = {})).Plane = class { constructor(tl, br){ this.tl = tl, this.br = br; } }; -})(otherRoot || (otherRoot = { -})); +})(otherRoot || (otherRoot = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.1.normal.js index 1f615a00792..51778497bef 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.1.normal.js @@ -17,12 +17,9 @@ var Root; }; } Utils.mirror = mirror; - })(Utils1 = A.Utils || (A.Utils = { - })); - })(A1 = Root1.A || (Root1.A = { - })); -})(Root || (Root = { -})); + })(Utils1 = A.Utils || (A.Utils = {})); + })(A1 = Root1.A || (Root1.A = {})); +})(Root || (Root = {})); //@filename: part2.ts var otherRoot; (function(otherRoot1) { @@ -41,9 +38,6 @@ var otherRoot; this.br = br; }; Utils.Plane = Plane; - })(Utils2 = A.Utils || (A.Utils = { - })); - })(A2 = otherRoot1.A || (otherRoot1.A = { - })); -})(otherRoot || (otherRoot = { -})); + })(Utils2 = A.Utils || (A.Utils = {})); + })(A2 = otherRoot1.A || (otherRoot1.A = {})); +})(otherRoot || (otherRoot = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.2.minified.js index 06b3e02646a..a0146b4f7ba 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot_es5.2.minified.js @@ -1,27 +1,21 @@ var Root, otherRoot; !function(Root1) { var A; - ((A = Root1.A || (Root1.A = { - })).Utils || (A.Utils = { - })).mirror = function(p) { + ((A = Root1.A || (Root1.A = {})).Utils || (A.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x }; }; -}(Root || (Root = { -})), (function(otherRoot1) { +}(Root || (Root = {})), (function(otherRoot1) { var A, Utils, Plane; - (A = otherRoot1.A || (otherRoot1.A = { - })).Origin = { + (A = otherRoot1.A || (otherRoot1.A = {})).Origin = { x: 0, y: 0 - }, Utils = A.Utils || (A.Utils = { - }), Plane = function(tl, br) { + }, Utils = A.Utils || (A.Utils = {}), Plane = function(tl, br) { "use strict"; (function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, Plane), this.tl = tl, this.br = br; }, Utils.Plane = Plane; -})(otherRoot || (otherRoot = { -})); +})(otherRoot || (otherRoot = {})); diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.1.normal.js index 01209c89af5..37a62c97d68 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.1.normal.js @@ -10,10 +10,8 @@ var A; }; } Utils.mirror = mirror; - })(Utils1 = A1.Utils || (A1.Utils = { - })); -})(A || (A = { -})); + })(Utils1 = A1.Utils || (A1.Utils = {})); +})(A || (A = {})); (function(A2) { var Origin = A2.Origin = { x: 0, @@ -28,10 +26,8 @@ var A; } } Utils.Plane = Plane; - })(Utils2 = A2.Utils || (A2.Utils = { - })); -})(A || (A = { -})); + })(Utils2 = A2.Utils || (A2.Utils = {})); +})(A || (A = {})); //@filename: part3.ts // test the merging actually worked var o; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.2.minified.js index b91525ca2cb..aa8645f41d4 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es2015.2.minified.js @@ -1,17 +1,13 @@ var A, A1; -((A = A2 || (A2 = { -})).Utils || (A.Utils = { -})).mirror = function(p) { +((A = A2 || (A2 = {})).Utils || (A.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x }; -}, (A1 = A2 || (A2 = { -})).Origin = { +}, (A1 = A2 || (A2 = {})).Origin = { x: 0, y: 0 -}, (A1.Utils || (A1.Utils = { -})).Plane = class { +}, (A1.Utils || (A1.Utils = {})).Plane = class { constructor(tl, br){ this.tl = tl, this.br = br; } diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.1.normal.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.1.normal.js index 5a67fa77d15..34d22a5289a 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.1.normal.js @@ -15,10 +15,8 @@ var A; }; } Utils.mirror = mirror; - })(Utils1 = A1.Utils || (A1.Utils = { - })); -})(A || (A = { -})); + })(Utils1 = A1.Utils || (A1.Utils = {})); +})(A || (A = {})); (function(A2) { var Origin = A2.Origin = { x: 0, @@ -33,10 +31,8 @@ var A; this.br = br; }; Utils.Plane = Plane; - })(Utils2 = A2.Utils || (A2.Utils = { - })); -})(A || (A = { -})); + })(Utils2 = A2.Utils || (A2.Utils = {})); +})(A || (A = {})); //@filename: part3.ts // test the merging actually worked var o; diff --git a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.2.minified.js b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.2.minified.js index 7036629c425..52b2e79345d 100644 --- a/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TwoInternalModulesWithTheSameNameAndSameCommonRoot_es5.2.minified.js @@ -1,7 +1,5 @@ var A; -((A = A1 || (A1 = { -})).Utils || (A.Utils = { -})).mirror = function(p) { +((A = A1 || (A1 = {})).Utils || (A.Utils = {})).mirror = function(p) { return { x: p.y, y: p.x @@ -11,15 +9,13 @@ var A; A2.Origin = { x: 0, y: 0 - }, Utils = A2.Utils || (A2.Utils = { - }), Plane = function(tl, br) { + }, Utils = A2.Utils || (A2.Utils = {}), Plane = function(tl, br) { "use strict"; (function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); })(this, Plane), this.tl = tl, this.br = br; }, Utils.Plane = Plane; -})(A1 || (A1 = { -})); +})(A1 || (A1 = {})); var A1, o, o, o = A1.Origin, o = A1.Utils.mirror(o); new A1.Utils.Plane(o, { x: 1, diff --git a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.1.normal.js b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.1.normal.js index 3f70f44d762..e2eccfd4cb8 100644 --- a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.1.normal.js @@ -3,8 +3,7 @@ var Color; Color[Color["R"] = 0] = "R"; Color[Color["G"] = 1] = "G"; Color[Color["B"] = 2] = "B"; -})(Color || (Color = { -})); +})(Color || (Color = {})); function f1(x) { if (typeof x === "number") { var y = x; diff --git a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.2.minified.js b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.2.minified.js index 519733d4d5f..bd6e48ec684 100644 --- a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es2015.2.minified.js @@ -1,3 +1,2 @@ var Color, Color; -(Color = Color || (Color = { -}))[Color.R = 0] = "R", Color[Color.G = 1] = "G", Color[Color.B = 2] = "B"; +(Color = Color || (Color = {}))[Color.R = 0] = "R", Color[Color.G = 1] = "G", Color[Color.B = 2] = "B"; diff --git a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.1.normal.js b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.1.normal.js index 3f70f44d762..e2eccfd4cb8 100644 --- a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.1.normal.js @@ -3,8 +3,7 @@ var Color; Color[Color["R"] = 0] = "R"; Color[Color["G"] = 1] = "G"; Color[Color["B"] = 2] = "B"; -})(Color || (Color = { -})); +})(Color || (Color = {})); function f1(x) { if (typeof x === "number") { var y = x; diff --git a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.2.minified.js b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.2.minified.js index 519733d4d5f..bd6e48ec684 100644 --- a/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/TypeGuardWithEnumUnion_es5.2.minified.js @@ -1,3 +1,2 @@ var Color, Color; -(Color = Color || (Color = { -}))[Color.R = 0] = "R", Color[Color.G = 1] = "G", Color[Color.B = 2] = "B"; +(Color = Color || (Color = {}))[Color.R = 0] = "R", Color[Color.G = 1] = "G", Color[Color.B = 2] = "B"; diff --git a/crates/swc/tests/tsc-references/abstractProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/abstractProperty_es5.1.normal.js index a88c237790f..c5282b6160b 100644 --- a/crates/swc/tests/tsc-references/abstractProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/abstractProperty_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/abstractProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/abstractProperty_es5.2.minified.js index d5921c22bcc..bdf5613a30f 100644 --- a/crates/swc/tests/tsc-references/abstractProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/abstractProperty_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorWithES3_es2015.1.normal.js b/crates/swc/tests/tsc-references/accessorWithES3_es2015.1.normal.js index 8a51e14817e..e8a675b2bc2 100644 --- a/crates/swc/tests/tsc-references/accessorWithES3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorWithES3_es2015.1.normal.js @@ -6,8 +6,7 @@ class C { } } class D { - set x(v) { - } + set x(v) {} } var x = { get a () { @@ -15,6 +14,5 @@ var x = { } }; var y = { - set b (v){ - } + set b (v){} }; diff --git a/crates/swc/tests/tsc-references/accessorWithES3_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorWithES3_es5.1.normal.js index 1d3b913ce86..506be664dee 100644 --- a/crates/swc/tests/tsc-references/accessorWithES3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorWithES3_es5.1.normal.js @@ -42,8 +42,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "x", - set: function set(v) { - } + set: function set(v) {} } ]); return D; @@ -54,6 +53,5 @@ var x = { } }; var y = { - set b (v){ - } + set b (v){} }; diff --git a/crates/swc/tests/tsc-references/accessorWithES3_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorWithES3_es5.2.minified.js index e407b625ce5..f7b36eddb13 100644 --- a/crates/swc/tests/tsc-references/accessorWithES3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorWithES3_es5.2.minified.js @@ -31,8 +31,7 @@ var C = function() { return _createClass(D, [ { key: "x", - set: function(v) { - } + set: function(v) {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/accessorWithES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/accessorWithES5_es2015.1.normal.js index 9ab3b6d527b..a1c0cb214f5 100644 --- a/crates/swc/tests/tsc-references/accessorWithES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorWithES5_es2015.1.normal.js @@ -5,8 +5,7 @@ class C { } } class D { - set x(v) { - } + set x(v) {} } var x = { get a () { @@ -14,6 +13,5 @@ var x = { } }; var y = { - set b (v){ - } + set b (v){} }; diff --git a/crates/swc/tests/tsc-references/accessorWithES5_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorWithES5_es5.1.normal.js index d8305940e2e..3e49b57c6bf 100644 --- a/crates/swc/tests/tsc-references/accessorWithES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorWithES5_es5.1.normal.js @@ -41,8 +41,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "x", - set: function set(v) { - } + set: function set(v) {} } ]); return D; @@ -53,6 +52,5 @@ var x = { } }; var y = { - set b (v){ - } + set b (v){} }; diff --git a/crates/swc/tests/tsc-references/accessorWithES5_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorWithES5_es5.2.minified.js index e407b625ce5..f7b36eddb13 100644 --- a/crates/swc/tests/tsc-references/accessorWithES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorWithES5_es5.2.minified.js @@ -31,8 +31,7 @@ var C = function() { return _createClass(D, [ { key: "x", - set: function(v) { - } + set: function(v) {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es2015.1.normal.js b/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es2015.1.normal.js index 62f95f35934..77b7a4ec88a 100644 --- a/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es2015.1.normal.js @@ -3,26 +3,22 @@ class C { get x() { return 1; } - set x(v) { - } + set x(v) {} } class D { get x() { return 1; } - set x(v) { - } + set x(v) {} } class E { - set x(v) { - } + set x(v) {} get x() { return 1; } } class F { - static set x(v) { - } + static set x(v) {} static get x() { return 1; } diff --git a/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.1.normal.js index f5746d974c2..c70190ba2dd 100644 --- a/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.1.normal.js @@ -29,8 +29,7 @@ var C = // @target: ES5 get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; @@ -46,8 +45,7 @@ var D = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return D; @@ -63,8 +61,7 @@ var E = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return E; @@ -80,8 +77,7 @@ var F = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return F; diff --git a/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.2.minified.js index 7aa71087ccc..ceb1dceb8df 100644 --- a/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorWithMismatchedAccessibilityModifiers_es5.2.minified.js @@ -21,8 +21,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), C; }(), D = function() { @@ -36,8 +35,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), D; }(), E = function() { @@ -51,8 +49,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), E; }(), F = function() { @@ -66,8 +63,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), F; }(); diff --git a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es2015.1.normal.js b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es2015.1.normal.js index 2fc21f98492..bde4e4ac86b 100644 --- a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es2015.1.normal.js @@ -1,7 +1,6 @@ // accessors are not contextually typed class C { - set x(v) { - } + set x(v) {} get x() { return (x)=>"" ; diff --git a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.1.normal.js index 0ece71d60cf..0a7a2dfb13b 100644 --- a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.1.normal.js @@ -31,8 +31,7 @@ var C = // accessors are not contextually typed return ""; }; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.2.minified.js index 0dcd1d2f034..cfcf45cf015 100644 --- a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped_es5.2.minified.js @@ -20,8 +20,7 @@ var c, C = function() { return ""; }; }, - set: function(v) { - } + set: function(v) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/accessorsOverrideMethod_es2015.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideMethod_es2015.1.normal.js index 902a1c20e88..095672da265 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideMethod_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideMethod_es2015.1.normal.js @@ -1,8 +1,7 @@ // @target: esnext // @useDefineForClassFields: true class A { - m() { - } + m() {} } class B extends A { get m() { diff --git a/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.1.normal.js index ce61411060d..23483c02b34 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -93,8 +92,7 @@ var A = // @target: esnext _createClass(A, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.2.minified.js index 8c7a4faef57..b55a86b5631 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideMethod_es5.2.minified.js @@ -28,8 +28,7 @@ var A = function() { return _createClass(A, [ { key: "m", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -50,8 +49,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.1.normal.js index 796633767d7..8069f5a65d2 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.2.minified.js index 02e184e0c26..15bfc8928e9 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty2_es5.2.minified.js @@ -38,8 +38,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.1.normal.js index caca4a2d060..c90e945b5b2 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.2.minified.js index e2a3f98820f..5f57d2e7ab2 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty3_es5.2.minified.js @@ -32,8 +32,7 @@ var Lion = function(Animal) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.1.normal.js index f70ff7496fc..0769a216dad 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.2.minified.js index 507e9062493..9cfa4c1c7c4 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty4_es5.2.minified.js @@ -32,8 +32,7 @@ var Lion = function(Animal) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es2015.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es2015.1.normal.js index 03243ca1e7d..670f9c85fc4 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es2015.1.normal.js @@ -4,6 +4,5 @@ class C extends B { get p() { return 1; } - set p(value) { - } + set p(value) {} } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.1.normal.js index 0767196f063..232f08fc26d 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,8 +100,7 @@ var C = /*#__PURE__*/ function(B) { get: function get() { return 1; }, - set: function set(value) { - } + set: function set(value) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.2.minified.js index e2fd676b843..10bbcc30ff7 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty5_es5.2.minified.js @@ -38,8 +38,7 @@ var B = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,8 +64,7 @@ var B = function() { get: function() { return 1; }, - set: function(value) { - } + set: function(value) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(B); diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.1.normal.js index 523997cffa9..72de9879b3e 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.2.minified.js index aa43921aebc..42e02edb695 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty6_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.1.normal.js index e3da0ae93bb..d2fd8297e93 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.2.minified.js index 83471e75303..23fac81d54e 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty7_es5.2.minified.js @@ -38,8 +38,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.1.normal.js index 896627e1558..15065786233 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.2.minified.js index aa43921aebc..42e02edb695 100644 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsOverrideProperty_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.1.normal.js index 2679b229b6d..754022c0f56 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.1.normal.js @@ -1,22 +1,18 @@ -function foo() { -} +function foo() {} class C { - static foo() { - } + static foo() {} } var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var M; (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})); +})(M || (M = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.2.minified.js index b31e88871f7..3fef5aa7b0a 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es2015.2.minified.js @@ -1,10 +1,7 @@ var E, E, M, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})), a + a, a + b, a + new class { - static foo() { - } +})(M || (M = {})), a + a, a + b, a + new class { + static foo() {} }(), a + E.a; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.1.normal.js index 3d3ad960adf..f23a27544de 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.1.normal.js @@ -17,8 +17,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function foo() { -} +function foo() {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -27,8 +26,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, null, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; @@ -38,14 +36,12 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var M; (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})); +})(M || (M = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.2.minified.js index 930b66c23c3..d675e2638d0 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType_es5.2.minified.js @@ -14,14 +14,11 @@ var E, M, a, E, C = function() { })(Constructor = C, [ { key: "foo", - value: function() { - } + value: function() {} } ]), C; }(); -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})), a + a, a + new C(), a + E.a; +})(M || (M = {})), a + a, a + new C(), a + E.a; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.1.normal.js index fe529a0c218..02720b9ac1d 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.1.normal.js @@ -1,22 +1,18 @@ -function foo() { -} +function foo() {} class C { - static foo() { - } + static foo() {} } var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var M; (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})); +})(M || (M = {})); var a; var b; var c; @@ -37,9 +33,7 @@ var r9 = c + c; var r10 = a + true; var r11 = true + false; var r12 = true + 123; -var r13 = { -} + { -}; +var r13 = {} + {}; var r14 = b + d; var r15 = b + foo; var r16 = b + foo(); diff --git a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.2.minified.js index d1367ef2cdc..a2748658770 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es2015.2.minified.js @@ -1,11 +1,8 @@ var E, E, M, a, b; class C { - static foo() { - } + static foo() {} } -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})), a + a, a + b, E.a + new C(), E.a + C.foo(), E.a + M; +})(M || (M = {})), a + a, a + b, E.a + new C(), E.a + C.foo(), E.a + M; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.1.normal.js index d0cbcdcffce..6beebc81436 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.1.normal.js @@ -17,8 +17,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function foo() { -} +function foo() {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -27,8 +26,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, null, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; @@ -38,14 +36,12 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var M; (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})); +})(M || (M = {})); var a; var b; var c; @@ -66,9 +62,7 @@ var r9 = c + c; var r10 = a + true; var r11 = true + false; var r12 = true + 123; -var r13 = { -} + { -}; +var r13 = {} + {}; var r14 = b + d; var r15 = b + foo; var r16 = b + foo(); diff --git a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.2.minified.js index 16eec187c31..35d0502e7ec 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithInvalidOperands_es5.2.minified.js @@ -14,14 +14,11 @@ var E, M, a, E, C = function() { })(Constructor = C, [ { key: "foo", - value: function() { - } + value: function() {} } ]), C; }(); -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (function(M1) { var a1; M1.a = a1; -})(M || (M = { -})), a + a, E.a + new C(), E.a + C.foo(), E.a + M; +})(M || (M = {})), a + a, E.a + new C(), E.a + C.foo(), E.a + M; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es2015.1.normal.js index 35a4ab7c1a8..14123023767 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es2015.1.normal.js @@ -20,5 +20,4 @@ var r9 = null + { a: '' }; var r10 = null + foo(); -var r11 = null + (()=>{ -}); +var r11 = null + (()=>{}); diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es5.1.normal.js index ff3df0ae13c..2d7245b578b 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator_es5.1.normal.js @@ -20,5 +20,4 @@ var r9 = null + { a: '' }; var r10 = null + foo(); -var r11 = null + function() { -}; +var r11 = null + function() {}; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.1.normal.js index 18b80f7bfa4..ac4f2d49511 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.1.normal.js @@ -4,8 +4,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.2.minified.js index 0ae5f977bf3..52fbf30ad8f 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", null + a, a + null, null + E.a, null + E.a, E.a + null, E.a + null; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", null + a, a + null, null + E.a, null + E.a, E.a + null, E.a + null; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.1.normal.js index 18b80f7bfa4..ac4f2d49511 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.1.normal.js @@ -4,8 +4,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.2.minified.js index 0ae5f977bf3..52fbf30ad8f 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", null + a, a + null, null + E.a, null + E.a, E.a + null, E.a + null; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", null + a, a + null, null + E.a, null + E.a, E.a + null, E.a + null; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.1.normal.js index b087335c53b..4ddb5f4d234 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.1.normal.js @@ -2,14 +2,12 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["c"] = 0] = "c"; F[F["d"] = 1] = "d"; -})(F || (F = { -})); +})(F || (F = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.2.minified.js index cbdc8eb8e44..4ab00392403 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es2015.2.minified.js @@ -1,4 +1,2 @@ var E, F, E, F, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = { -}))[F.c = 0] = "c", F[F.d = 1] = "d", a + a, a + b, E.a + 0, E.a + E.b, E.a + E.b, E.a + F.c; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = {}))[F.c = 0] = "c", F[F.d = 1] = "d", a + a, a + b, E.a + 0, E.a + E.b, E.a + E.b, E.a + F.c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.1.normal.js index b087335c53b..4ddb5f4d234 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.1.normal.js @@ -2,14 +2,12 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["c"] = 0] = "c"; F[F["d"] = 1] = "d"; -})(F || (F = { -})); +})(F || (F = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.2.minified.js index cbdc8eb8e44..4ab00392403 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNumberAndEnum_es5.2.minified.js @@ -1,4 +1,2 @@ var E, F, E, F, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = { -}))[F.c = 0] = "c", F[F.d = 1] = "d", a + a, a + b, E.a + 0, E.a + E.b, E.a + E.b, E.a + F.c; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = {}))[F.c = 0] = "c", F[F.d = 1] = "d", a + a, a + b, E.a + 0, E.a + E.b, E.a + E.b, E.a + F.c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.1.normal.js index 4af23efb6b2..c7799886181 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.2.minified.js index bd2a65826fa..35a731fe70d 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, x; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x + a, x + b, x + E.a; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x + a, x + b, x + E.a; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.1.normal.js index 4af23efb6b2..c7799886181 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.2.minified.js index bd2a65826fa..35a731fe70d 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, x; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x + a, x + b, x + E.a; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x + a, x + b, x + E.a; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.1.normal.js index 0a6e2892814..7f9c54b49d5 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.1.normal.js @@ -3,8 +3,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t, u) { var a; var b; @@ -34,7 +33,6 @@ function foo(t, u) { var r16 = t + undefined; var r17 = t + t; var r18 = t + u; - var r19 = t + (()=>{ - }); + var r19 = t + (()=>{}); var r20 = t + []; } diff --git a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.2.minified.js index 3a9ea1a3e4e..bd64e1c79db 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b"; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.1.normal.js index 84606822d4c..9b4919ffa54 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.1.normal.js @@ -3,8 +3,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t, u) { var a; var b; @@ -34,7 +33,6 @@ function foo(t, u) { var r16 = t + undefined; var r17 = t + t; var r18 = t + u; - var r19 = t + function() { - }; + var r19 = t + function() {}; var r20 = t + []; } diff --git a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.2.minified.js index 3a9ea1a3e4e..bd64e1c79db 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithTypeParameter_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b"; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js index c25877b9d3e..81c4450860f 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js @@ -20,5 +20,4 @@ var r9 = undefined + { a: '' }; var r10 = undefined + foo(); -var r11 = undefined + (()=>{ -}); +var r11 = undefined + (()=>{}); diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js index 882dacc92a0..291b4cad025 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js @@ -20,5 +20,4 @@ var r9 = undefined + { a: '' }; var r10 = undefined + foo(); -var r11 = undefined + function() { -}; +var r11 = undefined + function() {}; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.1.normal.js index 4ea1bf86bdf..776d4cc1620 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.1.normal.js @@ -4,8 +4,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.2.minified.js index 39113f88817..f6e46b171b1 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (void 0) + a, a + void 0, (void 0) + E.a, (void 0) + E.a, E.a + void 0, E.a + void 0; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (void 0) + a, a + void 0, (void 0) + E.a, (void 0) + E.a, E.a + void 0, E.a + void 0; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.1.normal.js index 4ea1bf86bdf..776d4cc1620 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.1.normal.js @@ -4,8 +4,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.2.minified.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.2.minified.js index 39113f88817..f6e46b171b1 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (void 0) + a, a + void 0, (void 0) + E.a, (void 0) + E.a, E.a + void 0, E.a + void 0; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", (void 0) + a, a + void 0, (void 0) + E.a, (void 0) + E.a, E.a + void 0, E.a + void 0; diff --git a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.1.normal.js index 838b3fc6857..85f35fad65a 100644 --- a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.1.normal.js @@ -3,8 +3,7 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); // @Filename: foo_1.ts const foo = require("./foo_0"); if (foo.E1.A === 0) { diff --git a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.2.minified.js index f215e6b892e..1fece3c294b 100644 --- a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es2015.2.minified.js @@ -1,5 +1,4 @@ var E1, E1; -(E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C"; +(E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C"; const foo = require("./foo_0"); 0 === foo.E1.A; diff --git a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.1.normal.js index cf77d8bea5d..0fbba96929e 100644 --- a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.1.normal.js @@ -3,8 +3,7 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); // @Filename: foo_1.ts var foo = require("./foo_0"); if (foo.E1.A === 0) { diff --git a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.2.minified.js index 9b6c0c49bdd..0a437a93783 100644 --- a/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/amdImportAsPrimaryExpression_es5.2.minified.js @@ -1,3 +1,2 @@ var E1, E1; -(E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", 0 === require("./foo_0").E1.A; +(E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", 0 === require("./foo_0").E1.A; diff --git a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.1.normal.js index b6fe5df12ff..be75dee606b 100644 --- a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.1.normal.js @@ -11,13 +11,11 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); // @Filename: foo_1.ts const foo = require("./foo_0"); var i; -var x = { -}; +var x = {}; var y = false; var z; var e = 0; diff --git a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.2.minified.js index 54585c7e769..d62f0a2dfc9 100644 --- a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es2015.2.minified.js @@ -4,5 +4,4 @@ export class C1 { this.m1 = 42; } } -C1.s1 = !0, (E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); +C1.s1 = !0, (E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.1.normal.js index 23aaf113d25..bd853f5a22f 100644 --- a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.1.normal.js @@ -16,13 +16,11 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); // @Filename: foo_1.ts var foo = require("./foo_0"); var i; -var x = { -}; +var x = {}; var y = false; var z; var e = 0; diff --git a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.2.minified.js index 06ef9fb1916..1f2f151f729 100644 --- a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression_es5.2.minified.js @@ -4,5 +4,4 @@ export var E1, E1, i, z, C1 = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C1), this.m1 = 42; }; -C1.s1 = !0, (E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); +C1.s1 = !0, (E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.1.normal.js b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.1.normal.js index e540126a07d..a5c97b5ab96 100644 --- a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.1.normal.js @@ -3,14 +3,12 @@ // @checkJs: true // @Filename: Compilation.js // from webpack/lib/Compilation.js and filed at #26427 -/** @param {{ [s: string]: number }} map */ function mappy(map) { -} +/** @param {{ [s: string]: number }} map */ function mappy(map) {} export class C { m() { mappy(this.assets); } constructor(){ - /** @type {{ [assetName: string]: number}} */ this.assets = { - }; + /** @type {{ [assetName: string]: number}} */ this.assets = {}; } } diff --git a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.2.minified.js b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.2.minified.js index ad916150bf9..c3007a3550c 100644 --- a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es2015.2.minified.js @@ -1,8 +1,6 @@ export class C { - m() { - } + m() {} constructor(){ - this.assets = { - }; + this.assets = {}; } } diff --git a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.1.normal.js b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.1.normal.js index 3fa1a0829e2..839b6d86013 100644 --- a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.1.normal.js @@ -22,14 +22,12 @@ function _createClass(Constructor, protoProps, staticProps) { // @checkJs: true // @Filename: Compilation.js // from webpack/lib/Compilation.js and filed at #26427 -/** @param {{ [s: string]: number }} map */ function mappy(map) { -} +/** @param {{ [s: string]: number }} map */ function mappy(map) {} export var C = /*#__PURE__*/ function() { "use strict"; function C() { _classCallCheck(this, C); - /** @type {{ [assetName: string]: number}} */ this.assets = { - }; + /** @type {{ [assetName: string]: number}} */ this.assets = {}; } _createClass(C, [ { diff --git a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.2.minified.js b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.2.minified.js index 34cf42cc5da..9bf22cd590b 100644 --- a/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/annotatedThisPropertyInitializerDoesntNarrow_es5.2.minified.js @@ -10,14 +10,12 @@ export var C = function() { function C() { !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, C), this.assets = { - }; + }(this, C), this.assets = {}; } return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.1.normal.js index 92777775a16..8bc96a01e60 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.1.normal.js @@ -5,5 +5,4 @@ class _class { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.2.minified.js index 915be6afe6c..dc89c26c6f0 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es2015.2.minified.js @@ -1,5 +1,4 @@ class _class { } export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.1.normal.js index f94005adfb3..37b7259bf4a 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.1.normal.js @@ -12,5 +12,4 @@ var _class = function _class() { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.2.minified.js index a3406e112d9..6c47ab2c232 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsAmd_es5.2.minified.js @@ -5,5 +5,4 @@ var _class = function() { }(this, _class); }; export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.1.normal.js index 561d98c4688..4f02ce3726b 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.1.normal.js @@ -5,5 +5,4 @@ class _class { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.2.minified.js index 915be6afe6c..dc89c26c6f0 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es2015.2.minified.js @@ -1,5 +1,4 @@ class _class { } export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.1.normal.js index baa5005c10f..679fb54e558 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.1.normal.js @@ -12,5 +12,4 @@ var _class = function _class() { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.2.minified.js index a3406e112d9..6c47ab2c232 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsCommonjs_es5.2.minified.js @@ -5,5 +5,4 @@ var _class = function() { }(this, _class); }; export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.1.normal.js index 8ea5599ac08..b485f0a9202 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.1.normal.js @@ -5,5 +5,4 @@ class _class { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.2.minified.js index 915be6afe6c..dc89c26c6f0 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es2015.2.minified.js @@ -1,5 +1,4 @@ class _class { } export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.1.normal.js index bad6fe9f413..e8c083ea29b 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.1.normal.js @@ -12,5 +12,4 @@ var _class = function _class() { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.2.minified.js index a3406e112d9..6c47ab2c232 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsSystem_es5.2.minified.js @@ -5,5 +5,4 @@ var _class = function() { }(this, _class); }; export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.1.normal.js index f33773e97b9..9f3bff7885b 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.1.normal.js @@ -5,5 +5,4 @@ class _class { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.2.minified.js index 915be6afe6c..dc89c26c6f0 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es2015.2.minified.js @@ -1,5 +1,4 @@ class _class { } export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.1.normal.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.1.normal.js index 25e5b50746b..aeca6e97d9a 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.1.normal.js @@ -12,5 +12,4 @@ var _class = function _class() { // @filename: a.ts export { _class as default }; // @filename: b.ts -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.2.minified.js b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.2.minified.js index a3406e112d9..6c47ab2c232 100644 --- a/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anonymousDefaultExportsUmd_es5.2.minified.js @@ -5,5 +5,4 @@ var _class = function() { }(this, _class); }; export { _class as default }; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.1.normal.js b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.1.normal.js index 3046fc1f287..bd9b344928d 100644 --- a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.1.normal.js @@ -18,22 +18,18 @@ var r3 = foo3(a); // any var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var r3 = foo3(a); // any -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var r3 = foo3(a); // any class CC { } (function(CC1) { var bar = CC1.bar = 1; -})(CC || (CC = { -})); +})(CC || (CC = {})); var r3 = foo3(a); // any var r3 = foo3(a); // any var r3 = foo3(a); // any diff --git a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.2.minified.js b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.2.minified.js index 17ef92de451..f3aaac44eb1 100644 --- a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es2015.2.minified.js @@ -1,10 +1,6 @@ var a, E, E; -function f() { -} -foo2(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), (E = E || (E = { -}))[E.A = 0] = "A", foo3(a), (f || (f = { -})).bar = 1, foo3(a); +function f() {} +foo2(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), foo3(a), (E = E || (E = {}))[E.A = 0] = "A", foo3(a), (f || (f = {})).bar = 1, foo3(a); class CC { } -(CC || (CC = { -})).bar = 1, foo3(a), foo3(a), foo3(a); +(CC || (CC = {})).bar = 1, foo3(a), foo3(a), foo3(a); diff --git a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.1.normal.js b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.1.normal.js index efbc5010d4c..dd94655af58 100644 --- a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.1.normal.js @@ -27,15 +27,12 @@ var r3 = foo3(a); // any var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var r3 = foo3(a); // any -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var r3 = foo3(a); // any var CC = function CC() { "use strict"; @@ -43,8 +40,7 @@ var CC = function CC() { }; (function(CC) { var bar = CC.bar = 1; -})(CC || (CC = { -})); +})(CC || (CC = {})); var r3 = foo3(a); // any var r3 = foo3(a); // any var r3 = foo3(a); // any diff --git a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.2.minified.js b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.2.minified.js index 48d0b1d2c42..2dd627e6557 100644 --- a/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAssignabilityInInheritance_es5.2.minified.js @@ -11,14 +11,10 @@ var A2 = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -foo3(a), foo3(a), foo3(a), (E = E || (E = { -}))[E.A = 0] = "A", foo3(a), (f || (f = { -})).bar = 1, foo3(a); +function f() {} +foo3(a), foo3(a), foo3(a), (E = E || (E = {}))[E.A = 0] = "A", foo3(a), (f || (f = {})).bar = 1, foo3(a); var a, E, E, CC = function() { "use strict"; _classCallCheck(this, CC); }; -(CC || (CC = { -})).bar = 1, foo3(a), foo3(a), foo3(a); +(CC || (CC = {})).bar = 1, foo3(a), foo3(a), foo3(a); diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.1.normal.js index 233a154065a..e424b41aaf5 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.1.normal.js @@ -5,17 +5,13 @@ class A2 { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.2.minified.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.2.minified.js index a2e87ad744c..3f3700c80c3 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.1.normal.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.1.normal.js index 9cbe663529a..831f86df045 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.1.normal.js @@ -14,19 +14,15 @@ var A2 = function A2() { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.2.minified.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.2.minified.js index 6507a42018d..13efea2d586 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType2_es5.2.minified.js @@ -8,14 +8,10 @@ var E, E, A = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.1.normal.js index 187b7466773..c07c2ebc5c3 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.1.normal.js @@ -6,8 +6,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b = a; var c = a; diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.1.normal.js index 37779b024d3..6e467a78d05 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.1.normal.js @@ -13,8 +13,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b = a; var c = a; diff --git a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.2.minified.js index b3226de6741..f70e6cc54e8 100644 --- a/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAssignableToEveryType_es5.2.minified.js @@ -4,5 +4,4 @@ var E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.1.normal.js b/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.1.normal.js index bbe26099633..1c9ad9cf4ba 100644 --- a/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.2.minified.js b/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.2.minified.js index 68322582ea3..190ab2ca1b4 100644 --- a/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/apparentTypeSubtyping_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.1.normal.js b/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.1.normal.js index 9b4d15a5b33..9ad3e821843 100644 --- a/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.2.minified.js b/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.2.minified.js index 66b84cf0a70..b832662b059 100644 --- a/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/apparentTypeSupertype_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.1.normal.js b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.1.normal.js index b43b4ae7b49..e1f101c40f8 100644 --- a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.1.normal.js @@ -1,12 +1,9 @@ // In a typed function call, argument expressions are contextually typed by their corresponding parameter types. -function foo({ x: [a, b] , y: { c , d , e } }) { -} +function foo({ x: [a, b] , y: { c , d , e } }) {} function bar({ x: [a, b = 10] , y: { c , d , e ={ f: 1 -} } }) { -} -function baz(x) { -} +} } }) {} +function baz(x) {} var o = { x: [ "string", diff --git a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.2.minified.js b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.2.minified.js index 13bf3745854..b032045c0dc 100644 --- a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es2015.2.minified.js @@ -1,7 +1,5 @@ -function foo({ x: [a, b] , y: { c , d , e } }) { -} -function baz(x) { -} +function foo({ x: [a, b] , y: { c , d , e } }) {} +function baz(x) {} foo({ x: [ "string", diff --git a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.1.normal.js b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.1.normal.js index 41dcb130ef5..0f2822fc1e7 100644 --- a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.1.normal.js @@ -65,8 +65,7 @@ function bar(param) { f: 1 } : _e; } -function baz(x) { -} +function baz(x) {} var o = { x: [ "string", diff --git a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.2.minified.js b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.2.minified.js index 529032fd47c..b7d59983502 100644 --- a/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/argumentExpressionContextualTyping_es5.2.minified.js @@ -36,8 +36,7 @@ function foo(param) { }()), a = _x[0], b = _x[1], _y = param.y; _y.c, _y.d, _y.e; } -function baz(x) { -} +function baz(x) {} foo({ x: [ "string", diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.1.normal.js index 346b3c8cc14..d18781edb16 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.1.normal.js @@ -3,14 +3,12 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["c"] = 0] = "c"; F[F["d"] = 1] = "d"; -})(F || (F = { -})); +})(F || (F = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.2.minified.js index 0ae17bc1a9a..c7a2c2fe54d 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es2015.2.minified.js @@ -1,4 +1,2 @@ var E, F, E, F, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = { -}))[F.c = 0] = "c", F[F.d = 1] = "d", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = {}))[F.c = 0] = "c", F[F.d = 1] = "d", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.1.normal.js index 346b3c8cc14..d18781edb16 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.1.normal.js @@ -3,14 +3,12 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["c"] = 0] = "c"; F[F["d"] = 1] = "d"; -})(F || (F = { -})); +})(F || (F = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.2.minified.js index 0ae17bc1a9a..c7a2c2fe54d 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnumUnion_es5.2.minified.js @@ -1,4 +1,2 @@ var E, F, E, F, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = { -}))[F.c = 0] = "c", F[F.d = 1] = "d", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = {}))[F.c = 0] = "c", F[F.d = 1] = "d", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.1.normal.js index 6e1ccf976be..c9b738bdd41 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.1.normal.js @@ -3,8 +3,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.2.minified.js index 7d724ecdd0f..2185635013d 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.1.normal.js index 6e1ccf976be..c9b738bdd41 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.1.normal.js @@ -3,8 +3,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.2.minified.js index 7d724ecdd0f..2185635013d 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithEnum_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", c * a, c * b, E.a * a, E.a * b, E.a * E.b, 1 * E.a, a * E.b, b * E.b, 1 * E.b, E.a / a, E.a / b, E.a / E.b, E.a / 1, a / E.b, b / E.b, 1 / E.b, E.a % a, E.a % b, E.a % E.b, E.a % 1, a % E.b, b % E.b, 1 % E.b, E.a - a, E.a - b, E.a - E.b, E.a - 1, a - E.b, b - E.b, 1 - E.b, E.a << a, E.a << b, E.a << E.b, E.a << 1, a << E.b, b << E.b, 1 << E.b, E.a >> a, E.a >> b, E.a >> E.b, E.a >> 1, a >> E.b, b >> E.b, 1 >> E.b, E.a >>> a, E.a >>> b, E.a >>> E.b, E.a >>> 1, a >>> E.b, b >>> E.b, 1 >>> E.b, E.a & a, E.a & b, E.a & E.b, 1 & E.a, a & E.b, b & E.b, 1 & E.b, E.a ^ a, E.a ^ b, E.a ^ E.b, 1 ^ E.a, a ^ E.b, b ^ E.b, 1 ^ E.b, E.a | a, E.a | b, E.a | E.b, 1 | E.a, a | E.b, b | E.b, 1 | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.1.normal.js index 64455a26f66..b0ba0ae0fff 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.1.normal.js @@ -5,8 +5,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.2.minified.js index ca43cf366cf..ffc8a88c2c7 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c, d, e, f; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a * a, a * b, E.a * a, E.a * b, E.a * c, E.a * d, E.a * e, E.a * f, a * E.b, b * E.b, c * E.b, d * E.b, e * E.b, f * E.b, E.a / a, E.a / b, E.a / c, E.a / d, E.a / e, E.a / f, a / E.b, b / E.b, c / E.b, d / E.b, e / E.b, f / E.b, E.a % a, E.a % b, E.a % c, E.a % d, E.a % e, E.a % f, a % E.b, b % E.b, c % E.b, d % E.b, e % E.b, f % E.b, E.a - a, E.a - b, E.a - c, E.a - d, E.a - e, E.a - f, a - E.b, b - E.b, c - E.b, d - E.b, e - E.b, f - E.b, E.a << a, E.a << b, E.a << c, E.a << d, E.a << e, E.a << f, a << E.b, b << E.b, c << E.b, d << E.b, e << E.b, f << E.b, E.a >> a, E.a >> b, E.a >> c, E.a >> d, E.a >> e, E.a >> f, a >> E.b, b >> E.b, c >> E.b, d >> E.b, e >> E.b, f >> E.b, E.a >>> a, E.a >>> b, E.a >>> c, E.a >>> d, E.a >>> e, E.a >>> f, a >>> E.b, b >>> E.b, c >>> E.b, d >>> E.b, e >>> E.b, f >>> E.b, E.a & a, E.a & b, E.a & c, E.a & d, E.a & e, E.a & f, a & E.b, b & E.b, c & E.b, d & E.b, e & E.b, f & E.b, E.a ^ a, E.a ^ b, E.a ^ c, E.a ^ d, E.a ^ e, E.a ^ f, a ^ E.b, b ^ E.b, c ^ E.b, d ^ E.b, e ^ E.b, f ^ E.b, E.a | a, E.a | b, E.a | c, E.a | d, E.a | e, E.a | f, a | E.b, b | E.b, c | E.b, d | E.b, e | E.b, f | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a * a, a * b, E.a * a, E.a * b, E.a * c, E.a * d, E.a * e, E.a * f, a * E.b, b * E.b, c * E.b, d * E.b, e * E.b, f * E.b, E.a / a, E.a / b, E.a / c, E.a / d, E.a / e, E.a / f, a / E.b, b / E.b, c / E.b, d / E.b, e / E.b, f / E.b, E.a % a, E.a % b, E.a % c, E.a % d, E.a % e, E.a % f, a % E.b, b % E.b, c % E.b, d % E.b, e % E.b, f % E.b, E.a - a, E.a - b, E.a - c, E.a - d, E.a - e, E.a - f, a - E.b, b - E.b, c - E.b, d - E.b, e - E.b, f - E.b, E.a << a, E.a << b, E.a << c, E.a << d, E.a << e, E.a << f, a << E.b, b << E.b, c << E.b, d << E.b, e << E.b, f << E.b, E.a >> a, E.a >> b, E.a >> c, E.a >> d, E.a >> e, E.a >> f, a >> E.b, b >> E.b, c >> E.b, d >> E.b, e >> E.b, f >> E.b, E.a >>> a, E.a >>> b, E.a >>> c, E.a >>> d, E.a >>> e, E.a >>> f, a >>> E.b, b >>> E.b, c >>> E.b, d >>> E.b, e >>> E.b, f >>> E.b, E.a & a, E.a & b, E.a & c, E.a & d, E.a & e, E.a & f, a & E.b, b & E.b, c & E.b, d & E.b, e & E.b, f & E.b, E.a ^ a, E.a ^ b, E.a ^ c, E.a ^ d, E.a ^ e, E.a ^ f, a ^ E.b, b ^ E.b, c ^ E.b, d ^ E.b, e ^ E.b, f ^ E.b, E.a | a, E.a | b, E.a | c, E.a | d, E.a | e, E.a | f, a | E.b, b | E.b, c | E.b, d | E.b, e | E.b, f | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.1.normal.js index 64455a26f66..b0ba0ae0fff 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.1.normal.js @@ -5,8 +5,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.2.minified.js index ca43cf366cf..ffc8a88c2c7 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithInvalidOperands_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c, d, e, f; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a * a, a * b, E.a * a, E.a * b, E.a * c, E.a * d, E.a * e, E.a * f, a * E.b, b * E.b, c * E.b, d * E.b, e * E.b, f * E.b, E.a / a, E.a / b, E.a / c, E.a / d, E.a / e, E.a / f, a / E.b, b / E.b, c / E.b, d / E.b, e / E.b, f / E.b, E.a % a, E.a % b, E.a % c, E.a % d, E.a % e, E.a % f, a % E.b, b % E.b, c % E.b, d % E.b, e % E.b, f % E.b, E.a - a, E.a - b, E.a - c, E.a - d, E.a - e, E.a - f, a - E.b, b - E.b, c - E.b, d - E.b, e - E.b, f - E.b, E.a << a, E.a << b, E.a << c, E.a << d, E.a << e, E.a << f, a << E.b, b << E.b, c << E.b, d << E.b, e << E.b, f << E.b, E.a >> a, E.a >> b, E.a >> c, E.a >> d, E.a >> e, E.a >> f, a >> E.b, b >> E.b, c >> E.b, d >> E.b, e >> E.b, f >> E.b, E.a >>> a, E.a >>> b, E.a >>> c, E.a >>> d, E.a >>> e, E.a >>> f, a >>> E.b, b >>> E.b, c >>> E.b, d >>> E.b, e >>> E.b, f >>> E.b, E.a & a, E.a & b, E.a & c, E.a & d, E.a & e, E.a & f, a & E.b, b & E.b, c & E.b, d & E.b, e & E.b, f & E.b, E.a ^ a, E.a ^ b, E.a ^ c, E.a ^ d, E.a ^ e, E.a ^ f, a ^ E.b, b ^ E.b, c ^ E.b, d ^ E.b, e ^ E.b, f ^ E.b, E.a | a, E.a | b, E.a | c, E.a | d, E.a | e, E.a | f, a | E.b, b | E.b, c | E.b, d | E.b, e | E.b, f | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a * a, a * b, E.a * a, E.a * b, E.a * c, E.a * d, E.a * e, E.a * f, a * E.b, b * E.b, c * E.b, d * E.b, e * E.b, f * E.b, E.a / a, E.a / b, E.a / c, E.a / d, E.a / e, E.a / f, a / E.b, b / E.b, c / E.b, d / E.b, e / E.b, f / E.b, E.a % a, E.a % b, E.a % c, E.a % d, E.a % e, E.a % f, a % E.b, b % E.b, c % E.b, d % E.b, e % E.b, f % E.b, E.a - a, E.a - b, E.a - c, E.a - d, E.a - e, E.a - f, a - E.b, b - E.b, c - E.b, d - E.b, e - E.b, f - E.b, E.a << a, E.a << b, E.a << c, E.a << d, E.a << e, E.a << f, a << E.b, b << E.b, c << E.b, d << E.b, e << E.b, f << E.b, E.a >> a, E.a >> b, E.a >> c, E.a >> d, E.a >> e, E.a >> f, a >> E.b, b >> E.b, c >> E.b, d >> E.b, e >> E.b, f >> E.b, E.a >>> a, E.a >>> b, E.a >>> c, E.a >>> d, E.a >>> e, E.a >>> f, a >>> E.b, b >>> E.b, c >>> E.b, d >>> E.b, e >>> E.b, f >>> E.b, E.a & a, E.a & b, E.a & c, E.a & d, E.a & e, E.a & f, a & E.b, b & E.b, c & E.b, d & E.b, e & E.b, f & E.b, E.a ^ a, E.a ^ b, E.a ^ c, E.a ^ d, E.a ^ e, E.a ^ f, a ^ E.b, b ^ E.b, c ^ E.b, d ^ E.b, e ^ E.b, f ^ E.b, E.a | a, E.a | b, E.a | c, E.a | d, E.a | e, E.a | f, a | E.b, b | E.b, c | E.b, d | E.b, e | E.b, f | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js index df1638524c8..e91630ee6fe 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js @@ -12,12 +12,10 @@ var r1b2 = b * null; var r1b3 = c * null; var r1c1 = null * true; var r1c2 = null * ''; -var r1c3 = null * { -}; +var r1c3 = null * {}; var r1d1 = true * null; var r1d2 = '' * null; -var r1d3 = { -} * null; +var r1d3 = {} * null; // operator / var r2a1 = null / a; var r2a2 = null / b; @@ -27,12 +25,10 @@ var r2b2 = b / null; var r2b3 = c / null; var r2c1 = null / true; var r2c2 = null / ''; -var r2c3 = null / { -}; +var r2c3 = null / {}; var r2d1 = true / null; var r2d2 = '' / null; -var r2d3 = { -} / null; +var r2d3 = {} / null; // operator % var r3a1 = null % a; var r3a2 = null % b; @@ -42,12 +38,10 @@ var r3b2 = b % null; var r3b3 = c % null; var r3c1 = null % true; var r3c2 = null % ''; -var r3c3 = null % { -}; +var r3c3 = null % {}; var r3d1 = true % null; var r3d2 = '' % null; -var r3d3 = { -} % null; +var r3d3 = {} % null; // operator - var r4a1 = null - a; var r4a2 = null - b; @@ -57,12 +51,10 @@ var r4b2 = b - null; var r4b3 = c - null; var r4c1 = null - true; var r4c2 = null - ''; -var r4c3 = null - { -}; +var r4c3 = null - {}; var r4d1 = true - null; var r4d2 = '' - null; -var r4d3 = { -} - null; +var r4d3 = {} - null; // operator << var r5a1 = null << a; var r5a2 = null << b; @@ -72,12 +64,10 @@ var r5b2 = b << null; var r5b3 = c << null; var r5c1 = null << true; var r5c2 = null << ''; -var r5c3 = null << { -}; +var r5c3 = null << {}; var r5d1 = true << null; var r5d2 = '' << null; -var r5d3 = { -} << null; +var r5d3 = {} << null; // operator >> var r6a1 = null >> a; var r6a2 = null >> b; @@ -87,12 +77,10 @@ var r6b2 = b >> null; var r6b3 = c >> null; var r6c1 = null >> true; var r6c2 = null >> ''; -var r6c3 = null >> { -}; +var r6c3 = null >> {}; var r6d1 = true >> null; var r6d2 = '' >> null; -var r6d3 = { -} >> null; +var r6d3 = {} >> null; // operator >>> var r7a1 = null >>> a; var r7a2 = null >>> b; @@ -102,12 +90,10 @@ var r7b2 = b >>> null; var r7b3 = c >>> null; var r7c1 = null >>> true; var r7c2 = null >>> ''; -var r7c3 = null >>> { -}; +var r7c3 = null >>> {}; var r7d1 = true >>> null; var r7d2 = '' >>> null; -var r7d3 = { -} >>> null; +var r7d3 = {} >>> null; // operator & var r8a1 = null & a; var r8a2 = null & b; @@ -117,12 +103,10 @@ var r8b2 = b & null; var r8b3 = c & null; var r8c1 = null & true; var r8c2 = null & ''; -var r8c3 = null & { -}; +var r8c3 = null & {}; var r8d1 = true & null; var r8d2 = '' & null; -var r8d3 = { -} & null; +var r8d3 = {} & null; // operator ^ var r9a1 = null ^ a; var r9a2 = null ^ b; @@ -132,12 +116,10 @@ var r9b2 = b ^ null; var r9b3 = c ^ null; var r9c1 = null ^ true; var r9c2 = null ^ ''; -var r9c3 = null ^ { -}; +var r9c3 = null ^ {}; var r9d1 = true ^ null; var r9d2 = '' ^ null; -var r9d3 = { -} ^ null; +var r9d3 = {} ^ null; // operator | var r10a1 = null | a; var r10a2 = null | b; @@ -147,9 +129,7 @@ var r10b2 = b | null; var r10b3 = c | null; var r10c1 = null | true; var r10c2 = null | ''; -var r10c3 = null | { -}; +var r10c3 = null | {}; var r10d1 = true | null; var r10d2 = '' | null; -var r10d3 = { -} | null; +var r10d3 = {} | null; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es5.1.normal.js index df1638524c8..e91630ee6fe 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands_es5.1.normal.js @@ -12,12 +12,10 @@ var r1b2 = b * null; var r1b3 = c * null; var r1c1 = null * true; var r1c2 = null * ''; -var r1c3 = null * { -}; +var r1c3 = null * {}; var r1d1 = true * null; var r1d2 = '' * null; -var r1d3 = { -} * null; +var r1d3 = {} * null; // operator / var r2a1 = null / a; var r2a2 = null / b; @@ -27,12 +25,10 @@ var r2b2 = b / null; var r2b3 = c / null; var r2c1 = null / true; var r2c2 = null / ''; -var r2c3 = null / { -}; +var r2c3 = null / {}; var r2d1 = true / null; var r2d2 = '' / null; -var r2d3 = { -} / null; +var r2d3 = {} / null; // operator % var r3a1 = null % a; var r3a2 = null % b; @@ -42,12 +38,10 @@ var r3b2 = b % null; var r3b3 = c % null; var r3c1 = null % true; var r3c2 = null % ''; -var r3c3 = null % { -}; +var r3c3 = null % {}; var r3d1 = true % null; var r3d2 = '' % null; -var r3d3 = { -} % null; +var r3d3 = {} % null; // operator - var r4a1 = null - a; var r4a2 = null - b; @@ -57,12 +51,10 @@ var r4b2 = b - null; var r4b3 = c - null; var r4c1 = null - true; var r4c2 = null - ''; -var r4c3 = null - { -}; +var r4c3 = null - {}; var r4d1 = true - null; var r4d2 = '' - null; -var r4d3 = { -} - null; +var r4d3 = {} - null; // operator << var r5a1 = null << a; var r5a2 = null << b; @@ -72,12 +64,10 @@ var r5b2 = b << null; var r5b3 = c << null; var r5c1 = null << true; var r5c2 = null << ''; -var r5c3 = null << { -}; +var r5c3 = null << {}; var r5d1 = true << null; var r5d2 = '' << null; -var r5d3 = { -} << null; +var r5d3 = {} << null; // operator >> var r6a1 = null >> a; var r6a2 = null >> b; @@ -87,12 +77,10 @@ var r6b2 = b >> null; var r6b3 = c >> null; var r6c1 = null >> true; var r6c2 = null >> ''; -var r6c3 = null >> { -}; +var r6c3 = null >> {}; var r6d1 = true >> null; var r6d2 = '' >> null; -var r6d3 = { -} >> null; +var r6d3 = {} >> null; // operator >>> var r7a1 = null >>> a; var r7a2 = null >>> b; @@ -102,12 +90,10 @@ var r7b2 = b >>> null; var r7b3 = c >>> null; var r7c1 = null >>> true; var r7c2 = null >>> ''; -var r7c3 = null >>> { -}; +var r7c3 = null >>> {}; var r7d1 = true >>> null; var r7d2 = '' >>> null; -var r7d3 = { -} >>> null; +var r7d3 = {} >>> null; // operator & var r8a1 = null & a; var r8a2 = null & b; @@ -117,12 +103,10 @@ var r8b2 = b & null; var r8b3 = c & null; var r8c1 = null & true; var r8c2 = null & ''; -var r8c3 = null & { -}; +var r8c3 = null & {}; var r8d1 = true & null; var r8d2 = '' & null; -var r8d3 = { -} & null; +var r8d3 = {} & null; // operator ^ var r9a1 = null ^ a; var r9a2 = null ^ b; @@ -132,12 +116,10 @@ var r9b2 = b ^ null; var r9b3 = c ^ null; var r9c1 = null ^ true; var r9c2 = null ^ ''; -var r9c3 = null ^ { -}; +var r9c3 = null ^ {}; var r9d1 = true ^ null; var r9d2 = '' ^ null; -var r9d3 = { -} ^ null; +var r9d3 = {} ^ null; // operator | var r10a1 = null | a; var r10a2 = null | b; @@ -147,9 +129,7 @@ var r10b2 = b | null; var r10b3 = c | null; var r10c1 = null | true; var r10c2 = null | ''; -var r10c3 = null | { -}; +var r10c3 = null | {}; var r10d1 = true | null; var r10d2 = '' | null; -var r10d3 = { -} | null; +var r10d3 = {} | null; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.1.normal.js index eb0f4b184f7..d7577333476 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator * diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.2.minified.js index f5b9313f3eb..883ddd346c3 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", null * a, null * b, null * E.a, null * E.b, null / E.a, E.b / null, null % E.a, E.b % null, null - E.a, E.b - null, null << E.a, E.b << null, null >> E.a, E.b >> null, null >>> E.a, E.b >>> null, null & E.a, null & E.b, null ^ E.a, null ^ E.b, null | E.a, null | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", null * a, null * b, null * E.a, null * E.b, null / E.a, E.b / null, null % E.a, E.b % null, null - E.a, E.b - null, null << E.a, E.b << null, null >> E.a, E.b >> null, null >>> E.a, E.b >>> null, null & E.a, null & E.b, null ^ E.a, null ^ E.b, null | E.a, null | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.1.normal.js index eb0f4b184f7..d7577333476 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator * diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.2.minified.js index f5b9313f3eb..883ddd346c3 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", null * a, null * b, null * E.a, null * E.b, null / E.a, E.b / null, null % E.a, E.b % null, null - E.a, E.b - null, null << E.a, E.b << null, null >> E.a, E.b >> null, null >>> E.a, E.b >>> null, null & E.a, null & E.b, null ^ E.a, null ^ E.b, null | E.a, null | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", null * a, null * b, null * E.a, null * E.b, null / E.a, E.b / null, null % E.a, E.b % null, null - E.a, E.b - null, null << E.a, E.b << null, null >> E.a, E.b >> null, null >>> E.a, E.b >>> null, null & E.a, null & E.b, null ^ E.a, null ^ E.b, null | E.a, null | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js index 4de21eecbfe..580c4ceba65 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js @@ -12,12 +12,10 @@ var r1b2 = b * undefined; var r1b3 = c * undefined; var r1c1 = undefined * true; var r1c2 = undefined * ''; -var r1c3 = undefined * { -}; +var r1c3 = undefined * {}; var r1d1 = true * undefined; var r1d2 = '' * undefined; -var r1d3 = { -} * undefined; +var r1d3 = {} * undefined; // operator / var r2a1 = undefined / a; var r2a2 = undefined / b; @@ -27,12 +25,10 @@ var r2b2 = b / undefined; var r2b3 = c / undefined; var r2c1 = undefined / true; var r2c2 = undefined / ''; -var r2c3 = undefined / { -}; +var r2c3 = undefined / {}; var r2d1 = true / undefined; var r2d2 = '' / undefined; -var r2d3 = { -} / undefined; +var r2d3 = {} / undefined; // operator % var r3a1 = undefined % a; var r3a2 = undefined % b; @@ -42,12 +38,10 @@ var r3b2 = b % undefined; var r3b3 = c % undefined; var r3c1 = undefined % true; var r3c2 = undefined % ''; -var r3c3 = undefined % { -}; +var r3c3 = undefined % {}; var r3d1 = true % undefined; var r3d2 = '' % undefined; -var r3d3 = { -} % undefined; +var r3d3 = {} % undefined; // operator - var r4a1 = undefined - a; var r4a2 = undefined - b; @@ -57,12 +51,10 @@ var r4b2 = b - undefined; var r4b3 = c - undefined; var r4c1 = undefined - true; var r4c2 = undefined - ''; -var r4c3 = undefined - { -}; +var r4c3 = undefined - {}; var r4d1 = true - undefined; var r4d2 = '' - undefined; -var r4d3 = { -} - undefined; +var r4d3 = {} - undefined; // operator << var r5a1 = undefined << a; var r5a2 = undefined << b; @@ -72,12 +64,10 @@ var r5b2 = b << undefined; var r5b3 = c << undefined; var r5c1 = undefined << true; var r5c2 = undefined << ''; -var r5c3 = undefined << { -}; +var r5c3 = undefined << {}; var r5d1 = true << undefined; var r5d2 = '' << undefined; -var r5d3 = { -} << undefined; +var r5d3 = {} << undefined; // operator >> var r6a1 = undefined >> a; var r6a2 = undefined >> b; @@ -87,12 +77,10 @@ var r6b2 = b >> undefined; var r6b3 = c >> undefined; var r6c1 = undefined >> true; var r6c2 = undefined >> ''; -var r6c3 = undefined >> { -}; +var r6c3 = undefined >> {}; var r6d1 = true >> undefined; var r6d2 = '' >> undefined; -var r6d3 = { -} >> undefined; +var r6d3 = {} >> undefined; // operator >>> var r7a1 = undefined >>> a; var r7a2 = undefined >>> b; @@ -102,12 +90,10 @@ var r7b2 = b >>> undefined; var r7b3 = c >>> undefined; var r7c1 = undefined >>> true; var r7c2 = undefined >>> ''; -var r7c3 = undefined >>> { -}; +var r7c3 = undefined >>> {}; var r7d1 = true >>> undefined; var r7d2 = '' >>> undefined; -var r7d3 = { -} >>> undefined; +var r7d3 = {} >>> undefined; // operator & var r8a1 = undefined & a; var r8a2 = undefined & b; @@ -117,12 +103,10 @@ var r8b2 = b & undefined; var r8b3 = c & undefined; var r8c1 = undefined & true; var r8c2 = undefined & ''; -var r8c3 = undefined & { -}; +var r8c3 = undefined & {}; var r8d1 = true & undefined; var r8d2 = '' & undefined; -var r8d3 = { -} & undefined; +var r8d3 = {} & undefined; // operator ^ var r9a1 = undefined ^ a; var r9a2 = undefined ^ b; @@ -132,12 +116,10 @@ var r9b2 = b ^ undefined; var r9b3 = c ^ undefined; var r9c1 = undefined ^ true; var r9c2 = undefined ^ ''; -var r9c3 = undefined ^ { -}; +var r9c3 = undefined ^ {}; var r9d1 = true ^ undefined; var r9d2 = '' ^ undefined; -var r9d3 = { -} ^ undefined; +var r9d3 = {} ^ undefined; // operator | var r10a1 = undefined | a; var r10a2 = undefined | b; @@ -147,9 +129,7 @@ var r10b2 = b | undefined; var r10b3 = c | undefined; var r10c1 = undefined | true; var r10c2 = undefined | ''; -var r10c3 = undefined | { -}; +var r10c3 = undefined | {}; var r10d1 = true | undefined; var r10d2 = '' | undefined; -var r10d3 = { -} | undefined; +var r10d3 = {} | undefined; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js index 4de21eecbfe..580c4ceba65 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js @@ -12,12 +12,10 @@ var r1b2 = b * undefined; var r1b3 = c * undefined; var r1c1 = undefined * true; var r1c2 = undefined * ''; -var r1c3 = undefined * { -}; +var r1c3 = undefined * {}; var r1d1 = true * undefined; var r1d2 = '' * undefined; -var r1d3 = { -} * undefined; +var r1d3 = {} * undefined; // operator / var r2a1 = undefined / a; var r2a2 = undefined / b; @@ -27,12 +25,10 @@ var r2b2 = b / undefined; var r2b3 = c / undefined; var r2c1 = undefined / true; var r2c2 = undefined / ''; -var r2c3 = undefined / { -}; +var r2c3 = undefined / {}; var r2d1 = true / undefined; var r2d2 = '' / undefined; -var r2d3 = { -} / undefined; +var r2d3 = {} / undefined; // operator % var r3a1 = undefined % a; var r3a2 = undefined % b; @@ -42,12 +38,10 @@ var r3b2 = b % undefined; var r3b3 = c % undefined; var r3c1 = undefined % true; var r3c2 = undefined % ''; -var r3c3 = undefined % { -}; +var r3c3 = undefined % {}; var r3d1 = true % undefined; var r3d2 = '' % undefined; -var r3d3 = { -} % undefined; +var r3d3 = {} % undefined; // operator - var r4a1 = undefined - a; var r4a2 = undefined - b; @@ -57,12 +51,10 @@ var r4b2 = b - undefined; var r4b3 = c - undefined; var r4c1 = undefined - true; var r4c2 = undefined - ''; -var r4c3 = undefined - { -}; +var r4c3 = undefined - {}; var r4d1 = true - undefined; var r4d2 = '' - undefined; -var r4d3 = { -} - undefined; +var r4d3 = {} - undefined; // operator << var r5a1 = undefined << a; var r5a2 = undefined << b; @@ -72,12 +64,10 @@ var r5b2 = b << undefined; var r5b3 = c << undefined; var r5c1 = undefined << true; var r5c2 = undefined << ''; -var r5c3 = undefined << { -}; +var r5c3 = undefined << {}; var r5d1 = true << undefined; var r5d2 = '' << undefined; -var r5d3 = { -} << undefined; +var r5d3 = {} << undefined; // operator >> var r6a1 = undefined >> a; var r6a2 = undefined >> b; @@ -87,12 +77,10 @@ var r6b2 = b >> undefined; var r6b3 = c >> undefined; var r6c1 = undefined >> true; var r6c2 = undefined >> ''; -var r6c3 = undefined >> { -}; +var r6c3 = undefined >> {}; var r6d1 = true >> undefined; var r6d2 = '' >> undefined; -var r6d3 = { -} >> undefined; +var r6d3 = {} >> undefined; // operator >>> var r7a1 = undefined >>> a; var r7a2 = undefined >>> b; @@ -102,12 +90,10 @@ var r7b2 = b >>> undefined; var r7b3 = c >>> undefined; var r7c1 = undefined >>> true; var r7c2 = undefined >>> ''; -var r7c3 = undefined >>> { -}; +var r7c3 = undefined >>> {}; var r7d1 = true >>> undefined; var r7d2 = '' >>> undefined; -var r7d3 = { -} >>> undefined; +var r7d3 = {} >>> undefined; // operator & var r8a1 = undefined & a; var r8a2 = undefined & b; @@ -117,12 +103,10 @@ var r8b2 = b & undefined; var r8b3 = c & undefined; var r8c1 = undefined & true; var r8c2 = undefined & ''; -var r8c3 = undefined & { -}; +var r8c3 = undefined & {}; var r8d1 = true & undefined; var r8d2 = '' & undefined; -var r8d3 = { -} & undefined; +var r8d3 = {} & undefined; // operator ^ var r9a1 = undefined ^ a; var r9a2 = undefined ^ b; @@ -132,12 +116,10 @@ var r9b2 = b ^ undefined; var r9b3 = c ^ undefined; var r9c1 = undefined ^ true; var r9c2 = undefined ^ ''; -var r9c3 = undefined ^ { -}; +var r9c3 = undefined ^ {}; var r9d1 = true ^ undefined; var r9d2 = '' ^ undefined; -var r9d3 = { -} ^ undefined; +var r9d3 = {} ^ undefined; // operator | var r10a1 = undefined | a; var r10a2 = undefined | b; @@ -147,9 +129,7 @@ var r10b2 = b | undefined; var r10b3 = c | undefined; var r10c1 = undefined | true; var r10c2 = undefined | ''; -var r10c3 = undefined | { -}; +var r10c3 = undefined | {}; var r10d1 = true | undefined; var r10d2 = '' | undefined; -var r10d3 = { -} | undefined; +var r10d3 = {} | undefined; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js index b5f3ff14ba2..f864a9d0883 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator * diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js index 2c00d6e1177..9d5f3360040 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (void 0) * a, (void 0) * b, (void 0) * E.a, (void 0) * E.b, (void 0) / E.a, E.b / void 0, (void 0) % E.a, E.b % void 0, (void 0) - E.a, E.b - void 0, (void 0) << E.a, E.b << void 0, (void 0) >> E.a, E.b >> void 0, (void 0) >>> E.a, E.b >>> void 0, (void 0) & E.a, (void 0) & E.b, (void 0) ^ E.a, (void 0) ^ E.b, (void 0) | E.a, (void 0) | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (void 0) * a, (void 0) * b, (void 0) * E.a, (void 0) * E.b, (void 0) / E.a, E.b / void 0, (void 0) % E.a, E.b % void 0, (void 0) - E.a, E.b - void 0, (void 0) << E.a, E.b << void 0, (void 0) >> E.a, E.b >> void 0, (void 0) >>> E.a, E.b >>> void 0, (void 0) & E.a, (void 0) & E.b, (void 0) ^ E.a, (void 0) ^ E.b, (void 0) | E.a, (void 0) | E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js index b5f3ff14ba2..f864a9d0883 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator * diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js index 2c00d6e1177..9d5f3360040 100644 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (void 0) * a, (void 0) * b, (void 0) * E.a, (void 0) * E.b, (void 0) / E.a, E.b / void 0, (void 0) % E.a, E.b % void 0, (void 0) - E.a, E.b - void 0, (void 0) << E.a, E.b << void 0, (void 0) >> E.a, E.b >> void 0, (void 0) >>> E.a, E.b >>> void 0, (void 0) & E.a, (void 0) & E.b, (void 0) ^ E.a, (void 0) ^ E.b, (void 0) | E.a, (void 0) | E.b; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (void 0) * a, (void 0) * b, (void 0) * E.a, (void 0) * E.b, (void 0) / E.a, E.b / void 0, (void 0) % E.a, E.b % void 0, (void 0) - E.a, E.b - void 0, (void 0) << E.a, E.b << void 0, (void 0) >> E.a, E.b >> void 0, (void 0) >>> E.a, E.b >>> void 0, (void 0) & E.a, (void 0) & E.b, (void 0) ^ E.a, (void 0) ^ E.b, (void 0) | E.a, (void 0) | E.b; diff --git a/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.1.normal.js index 8767b72dc11..cba20236049 100644 --- a/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.1.normal.js @@ -9,8 +9,7 @@ export var AppType; AppType["Composite"] = "Composite"; AppType["ListOnly"] = "ListOnly"; AppType["ModuleSettings"] = "ModuleSettings"; -})(AppType || (AppType = { -})); +})(AppType || (AppType = {})); export var AppStyle; (function(AppStyle) { AppStyle[AppStyle["Tree"] = 0] = "Tree"; @@ -18,8 +17,7 @@ export var AppStyle; AppStyle[AppStyle["Standard"] = 2] = "Standard"; AppStyle[AppStyle["MiniApp"] = 3] = "MiniApp"; AppStyle[AppStyle["PivotTable"] = 4] = "PivotTable"; -})(AppStyle || (AppStyle = { -})); +})(AppStyle || (AppStyle = {})); const appTypeStylesWithError = new Map([ [ AppType.Standard, diff --git a/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.2.minified.js index 2a2426c935a..38af0824012 100644 --- a/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/arrayLiteralInference_es2015.2.minified.js @@ -1,7 +1,5 @@ var AppType, AppStyle, AppType, AppStyle; -(AppType = AppType || (AppType = { -})).HeaderDetail = "HeaderDetail", AppType.HeaderMultiDetail = "HeaderMultiDetail", AppType.AdvancedList = "AdvancedList", AppType.Standard = "Standard", AppType.Relationship = "Relationship", AppType.Report = "Report", AppType.Composite = "Composite", AppType.ListOnly = "ListOnly", AppType.ModuleSettings = "ModuleSettings", (AppStyle = AppStyle || (AppStyle = { -}))[AppStyle.Tree = 0] = "Tree", AppStyle[AppStyle.TreeEntity = 1] = "TreeEntity", AppStyle[AppStyle.Standard = 2] = "Standard", AppStyle[AppStyle.MiniApp = 3] = "MiniApp", AppStyle[AppStyle.PivotTable = 4] = "PivotTable", new Map([ +(AppType = AppType || (AppType = {})).HeaderDetail = "HeaderDetail", AppType.HeaderMultiDetail = "HeaderMultiDetail", AppType.AdvancedList = "AdvancedList", AppType.Standard = "Standard", AppType.Relationship = "Relationship", AppType.Report = "Report", AppType.Composite = "Composite", AppType.ListOnly = "ListOnly", AppType.ModuleSettings = "ModuleSettings", (AppStyle = AppStyle || (AppStyle = {}))[AppStyle.Tree = 0] = "Tree", AppStyle[AppStyle.TreeEntity = 1] = "TreeEntity", AppStyle[AppStyle.Standard = 2] = "Standard", AppStyle[AppStyle.MiniApp = 3] = "MiniApp", AppStyle[AppStyle.PivotTable = 4] = "PivotTable", new Map([ [ AppType.Standard, [ diff --git a/crates/swc/tests/tsc-references/arrayLiteralInference_es5.1.normal.js b/crates/swc/tests/tsc-references/arrayLiteralInference_es5.1.normal.js index b286fe4c24a..676144f0709 100644 --- a/crates/swc/tests/tsc-references/arrayLiteralInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayLiteralInference_es5.1.normal.js @@ -9,8 +9,7 @@ export var AppType; AppType["Composite"] = "Composite"; AppType["ListOnly"] = "ListOnly"; AppType["ModuleSettings"] = "ModuleSettings"; -})(AppType || (AppType = { -})); +})(AppType || (AppType = {})); export var AppStyle; (function(AppStyle) { AppStyle[AppStyle["Tree"] = 0] = "Tree"; @@ -18,8 +17,7 @@ export var AppStyle; AppStyle[AppStyle["Standard"] = 2] = "Standard"; AppStyle[AppStyle["MiniApp"] = 3] = "MiniApp"; AppStyle[AppStyle["PivotTable"] = 4] = "PivotTable"; -})(AppStyle || (AppStyle = { -})); +})(AppStyle || (AppStyle = {})); var appTypeStylesWithError = new Map([ [ AppType.Standard, diff --git a/crates/swc/tests/tsc-references/arrayLiteralInference_es5.2.minified.js b/crates/swc/tests/tsc-references/arrayLiteralInference_es5.2.minified.js index 2a2426c935a..38af0824012 100644 --- a/crates/swc/tests/tsc-references/arrayLiteralInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arrayLiteralInference_es5.2.minified.js @@ -1,7 +1,5 @@ var AppType, AppStyle, AppType, AppStyle; -(AppType = AppType || (AppType = { -})).HeaderDetail = "HeaderDetail", AppType.HeaderMultiDetail = "HeaderMultiDetail", AppType.AdvancedList = "AdvancedList", AppType.Standard = "Standard", AppType.Relationship = "Relationship", AppType.Report = "Report", AppType.Composite = "Composite", AppType.ListOnly = "ListOnly", AppType.ModuleSettings = "ModuleSettings", (AppStyle = AppStyle || (AppStyle = { -}))[AppStyle.Tree = 0] = "Tree", AppStyle[AppStyle.TreeEntity = 1] = "TreeEntity", AppStyle[AppStyle.Standard = 2] = "Standard", AppStyle[AppStyle.MiniApp = 3] = "MiniApp", AppStyle[AppStyle.PivotTable = 4] = "PivotTable", new Map([ +(AppType = AppType || (AppType = {})).HeaderDetail = "HeaderDetail", AppType.HeaderMultiDetail = "HeaderMultiDetail", AppType.AdvancedList = "AdvancedList", AppType.Standard = "Standard", AppType.Relationship = "Relationship", AppType.Report = "Report", AppType.Composite = "Composite", AppType.ListOnly = "ListOnly", AppType.ModuleSettings = "ModuleSettings", (AppStyle = AppStyle || (AppStyle = {}))[AppStyle.Tree = 0] = "Tree", AppStyle[AppStyle.TreeEntity = 1] = "TreeEntity", AppStyle[AppStyle.Standard = 2] = "Standard", AppStyle[AppStyle.MiniApp = 3] = "MiniApp", AppStyle[AppStyle.PivotTable = 4] = "PivotTable", new Map([ [ AppType.Standard, [ diff --git a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.1.normal.js b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.1.normal.js index ab18babe1fd..d5224cf2261 100644 --- a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.2.minified.js b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.2.minified.js index 3e6777a48cf..fbd9e1a61d4 100644 --- a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics_es5.2.minified.js @@ -32,8 +32,7 @@ var List = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/arrayLiterals_es5.1.normal.js b/crates/swc/tests/tsc-references/arrayLiterals_es5.1.normal.js index 6ff9a6cbf29..33cc27bcba9 100644 --- a/crates/swc/tests/tsc-references/arrayLiterals_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayLiterals_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/arrayLiterals_es5.2.minified.js b/crates/swc/tests/tsc-references/arrayLiterals_es5.2.minified.js index a8fbdc5993c..78e648256b3 100644 --- a/crates/swc/tests/tsc-references/arrayLiterals_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arrayLiterals_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es2015.1.normal.js b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es2015.1.normal.js index 4d92bdab33d..e1ccf83210c 100644 --- a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es2015.1.normal.js @@ -2,8 +2,7 @@ var x = [ ()=>1 , - ()=>{ - } + ()=>{} ]; var r2 = x[0](); class C { diff --git a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es5.1.normal.js b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es5.1.normal.js index f70fd279659..6d592e63cc4 100644 --- a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3_es5.1.normal.js @@ -8,8 +8,7 @@ var x = [ function() { return 1; }, - function() { - } + function() {} ]; var r2 = x[0](); var C = function C() { diff --git a/crates/swc/tests/tsc-references/arrowFunctionExpressions_es2015.1.normal.js b/crates/swc/tests/tsc-references/arrowFunctionExpressions_es2015.1.normal.js index 3a4905e9132..e8d18547c75 100644 --- a/crates/swc/tests/tsc-references/arrowFunctionExpressions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/arrowFunctionExpressions_es2015.1.normal.js @@ -19,28 +19,18 @@ var d = (n)=>c = n ; var d; // Binding patterns in arrow functions -var p1 = ([a])=>{ -}; -var p2 = ([...a])=>{ -}; -var p3 = ([, a])=>{ -}; -var p4 = ([, ...a])=>{ -}; -var p5 = ([a = 1])=>{ -}; -var p6 = ({ a })=>{ -}; -var p7 = ({ a: { b } })=>{ -}; -var p8 = ({ a =1 })=>{ -}; +var p1 = ([a])=>{}; +var p2 = ([...a])=>{}; +var p3 = ([, a])=>{}; +var p4 = ([, ...a])=>{}; +var p5 = ([a = 1])=>{}; +var p6 = ({ a })=>{}; +var p7 = ({ a: { b } })=>{}; +var p8 = ({ a =1 })=>{}; var p9 = ({ a: { b =1 } = { b: 1 -} })=>{ -}; -var p10 = ([{ value , done }])=>{ -}; +} })=>{}; +var p10 = ([{ value , done }])=>{}; // Arrow function used in class member initializer // Arrow function used in class member function class MyClass { @@ -77,8 +67,7 @@ function someOtherFn() { // Arrow function used in nested function in function function outerFn() { function innerFn() { - var arrowFn = ()=>{ - }; + var arrowFn = ()=>{}; var p = arrowFn(); var p; } diff --git a/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.1.normal.js b/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.1.normal.js index fd9d89860d8..2ca78840bdb 100644 --- a/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.1.normal.js @@ -186,8 +186,7 @@ function someOtherFn() { // Arrow function used in nested function in function function outerFn() { var innerFn = function innerFn() { - var arrowFn = function() { - }; + var arrowFn = function() {}; var p = arrowFn(); var p; }; diff --git a/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.2.minified.js b/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.2.minified.js index 1a7da5eb3c2..4f0a459e0f4 100644 --- a/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/arrowFunctionExpressions_es5.2.minified.js @@ -20,8 +20,7 @@ var MyClass = function() { return protoProps = [ { key: "fn", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = MyClass).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), MyClass; }(); diff --git a/crates/swc/tests/tsc-references/asOperator4_es2015.1.normal.js b/crates/swc/tests/tsc-references/asOperator4_es2015.1.normal.js index 9365a6d07b1..3b53c29f833 100644 --- a/crates/swc/tests/tsc-references/asOperator4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asOperator4_es2015.1.normal.js @@ -1,6 +1,5 @@ //@module: commonjs //@filename: foo.ts -export function foo() { -} +export function foo() {} foo; foo; diff --git a/crates/swc/tests/tsc-references/asOperator4_es2015.2.minified.js b/crates/swc/tests/tsc-references/asOperator4_es2015.2.minified.js index 0da5001a08e..f99d4277774 100644 --- a/crates/swc/tests/tsc-references/asOperator4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asOperator4_es2015.2.minified.js @@ -1,2 +1 @@ -export function foo() { -} +export function foo() {} diff --git a/crates/swc/tests/tsc-references/asOperator4_es5.1.normal.js b/crates/swc/tests/tsc-references/asOperator4_es5.1.normal.js index 9365a6d07b1..3b53c29f833 100644 --- a/crates/swc/tests/tsc-references/asOperator4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asOperator4_es5.1.normal.js @@ -1,6 +1,5 @@ //@module: commonjs //@filename: foo.ts -export function foo() { -} +export function foo() {} foo; foo; diff --git a/crates/swc/tests/tsc-references/asOperator4_es5.2.minified.js b/crates/swc/tests/tsc-references/asOperator4_es5.2.minified.js index 0da5001a08e..f99d4277774 100644 --- a/crates/swc/tests/tsc-references/asOperator4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asOperator4_es5.2.minified.js @@ -1,2 +1 @@ -export function foo() { -} +export function foo() {} diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es2015.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es2015.1.normal.js index cc0efee319f..d104d8a909a 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es2015.1.normal.js @@ -1,3 +1,2 @@ let module = 10; -module in { -}; +module in {}; diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es5.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es5.1.normal.js index 4ab57205f35..b642fc1df66 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace04_es5.1.normal.js @@ -1,3 +1,2 @@ var module = 10; -module in { -}; +module in {}; diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.1.normal.js index 68e1eadb0e4..13e89760072 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.1.normal.js @@ -4,7 +4,5 @@ var a; let b1; (function(b) { var c = b.c = 20; - })(b1 = a1.b || (a1.b = { - })); -})(a || (a = { -})); + })(b1 = a1.b || (a1.b = {})); +})(a || (a = {})); diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.2.minified.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.2.minified.js index 0c6feb9b76a..989dffca4cb 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es2015.2.minified.js @@ -1,4 +1,2 @@ var a, a1; -((a1 = a || (a = { -})).b || (a1.b = { -})).c = 20; +((a1 = a || (a = {})).b || (a1.b = {})).c = 20; diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.1.normal.js index 382a9782af6..1a7ea69ca3b 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.1.normal.js @@ -4,7 +4,5 @@ var a; var b1; (function(b) { var c = b.c = 20; - })(b1 = a1.b || (a1.b = { - })); -})(a || (a = { -})); + })(b1 = a1.b || (a1.b = {})); +})(a || (a = {})); diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.2.minified.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.2.minified.js index 0c6feb9b76a..989dffca4cb 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace05_es5.2.minified.js @@ -1,4 +1,2 @@ var a, a1; -((a1 = a || (a = { -})).b || (a1.b = { -})).c = 20; +((a1 = a || (a = {})).b || (a1.b = {})).c = 20; diff --git a/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.1.normal.js index 0eb5c5f4a38..e0dc0b1861a 100644 --- a/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.1.normal.js @@ -11,8 +11,7 @@ f = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var g = x; var g2 = E.A; g2 = x; @@ -25,8 +24,7 @@ var j2 = x; var M; (function(M1) { var foo = M1.foo = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function k(a1) { a1 = x; diff --git a/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.2.minified.js index 2c976940bf3..b05de4238e1 100644 --- a/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignAnyToEveryType_es2015.2.minified.js @@ -1,4 +1,2 @@ var x, E, M, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A, (M || (M = { -})).foo = 1, M = x; +(E = E || (E = {}))[E.A = 0] = "A", E.A, (M || (M = {})).foo = 1, M = x; diff --git a/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.1.normal.js index 4835444377e..ffecfff4abc 100644 --- a/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.1.normal.js @@ -16,8 +16,7 @@ f = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var g = x; var g2 = E.A; g2 = x; @@ -32,8 +31,7 @@ var j2 = x; var M; (function(M1) { var foo = M1.foo = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function k(a1) { a1 = x; diff --git a/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.2.minified.js index 43792b36778..b227ca30233 100644 --- a/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignAnyToEveryType_es5.2.minified.js @@ -1,11 +1,9 @@ var x, E, M, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A; +(E = E || (E = {}))[E.A = 0] = "A", E.A; var C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(M || (M = { -})).foo = 1, M = x; +(M || (M = {})).foo = 1, M = x; diff --git a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.1.normal.js index 7461112be3c..c53dd338bb7 100644 --- a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.1.normal.js @@ -18,8 +18,7 @@ x = e2; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E.A; var f = E.A; x = f; diff --git a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.1.normal.js b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.1.normal.js index 01b607da7a6..e49e6ae0b1d 100644 --- a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.1.normal.js @@ -23,8 +23,7 @@ x = e2; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E.A; var f = E.A; x = f; diff --git a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.2.minified.js b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.2.minified.js index d75c50e764f..fc1b97acbb4 100644 --- a/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignEveryTypeToAny_es5.2.minified.js @@ -1,5 +1,4 @@ -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; var E, E, C = function() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es2015.1.normal.js index f68472eb762..f775ca52c09 100644 --- a/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es2015.1.normal.js @@ -1,5 +1,4 @@ -var x = { -}; +var x = {}; var y = { foo: "bar" }; diff --git a/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es5.1.normal.js b/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es5.1.normal.js index f68472eb762..f775ca52c09 100644 --- a/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignObjectToNonPrimitive_es5.1.normal.js @@ -1,5 +1,4 @@ -var x = { -}; +var x = {}; var y = { foo: "bar" }; diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es2015.1.normal.js index f65075915fb..2818ccca253 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es2015.1.normal.js @@ -21,8 +21,7 @@ class C { = this.m1(); this.quanch // should error = this.m3(); - this.m3 = function() { - }; + this.m3 = function() {}; this.quim // should error = this.baz; this.baz // should error diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.1.normal.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.1.normal.js index e3fdc39657c..38b7d71911c 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -100,8 +99,7 @@ var C = // @useDefineForClassFields: true = this.m1(); this.quanch // should error = this.m3(); - this.m3 = function() { - }; + this.m3 = function() {}; this.quim // should error = this.baz; this.baz // should error diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.2.minified.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.2.minified.js index 49e3c7b03c4..23c5f421964 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -55,8 +54,7 @@ var C = function() { "use strict"; var Constructor, protoProps, staticProps; function C(foo) { - _classCallCheck(this, C), this.foo = foo, this.qux = this.bar, this.bar = this.foo, this.quiz = this.bar, this.quench = this.m1(), this.quanch = this.m3(), this.m3 = function() { - }, this.quim = this.baz, this.baz = this.foo, this.quid = this.baz; + _classCallCheck(this, C), this.foo = foo, this.qux = this.bar, this.bar = this.foo, this.quiz = this.bar, this.quench = this.m1(), this.quanch = this.m3(), this.m3 = function() {}, this.quim = this.baz, this.baz = this.foo, this.quid = this.baz; } return protoProps = [ { diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.1.normal.js index c4bb547e7c8..63fb688f590 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.2.minified.js index 1b4a2f93ed7..7c0a23feb28 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.1.normal.js index 3a266be3fa3..4c7d51c520e 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.1.normal.js @@ -52,8 +52,7 @@ var Errors; var b17; a17 = b17; b17 = a17; - })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - })); + })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); let WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { // target type has generic call signature @@ -66,7 +65,5 @@ var Errors; var b3; a3 = b3; b3 = a3; - })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - })); -})(Errors || (Errors = { -})); + })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.2.minified.js index bd7db5ed85f..8732b737fbc 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es2015.2.minified.js @@ -2,10 +2,7 @@ var Errors; !function(Errors) { var b2, b7, b8, b10, b11, b12, b15, b15a, b16, b17, b21, b3; let WithNonGenericSignaturesInBaseType; - WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - }), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17; + WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {}), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17; let WithGenericSignaturesInBaseType; - WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - }), b21 = b21, b3 = b3; -}(Errors || (Errors = { -})); + WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), b21 = b21, b3 = b3; +}(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.1.normal.js index 511eaa67c09..8fbf910a379 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -149,8 +148,7 @@ var Errors; var b17; a17 = b17; b17 = a17; - })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - })); + })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { // target type has generic call signature @@ -163,7 +161,5 @@ var Errors; var b3; a3 = b3; b3 = a3; - })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - })); -})(Errors || (Errors = { -})); + })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.2.minified.js index 11982faeead..350975a63ce 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,8 +74,5 @@ function _createSuper(Derived) { } return OtherDerived; }(Base1); - WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - }), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17, WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - }), b21 = b21, b3 = b3; -}(Errors || (Errors = { -})); + WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {}), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17, WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), b21 = b21, b3 = b3; +}(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.1.normal.js index 269d2ef1d9e..7d3fc651bc7 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.2.minified.js index 0aa67a3e377..bfcea4b7637 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.1.normal.js index 10506d81d04..533df98312e 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.2.minified.js index 3d0495a70a5..9a72cb6cf37 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.1.normal.js index c4bb547e7c8..63fb688f590 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.2.minified.js index 1b4a2f93ed7..7c0a23feb28 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.1.normal.js index 4cd50f9ae00..25d460d9bc0 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.1.normal.js @@ -52,8 +52,7 @@ var Errors; var b17; a17 = b17; // error b17 = a17; // error - })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - })); + })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); let WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { // target type has generic call signature @@ -66,7 +65,5 @@ var Errors; var b3; a3 = b3; // ok b3 = a3; // ok - })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - })); -})(Errors || (Errors = { -})); + })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.2.minified.js index bd7db5ed85f..8732b737fbc 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es2015.2.minified.js @@ -2,10 +2,7 @@ var Errors; !function(Errors) { var b2, b7, b8, b10, b11, b12, b15, b15a, b16, b17, b21, b3; let WithNonGenericSignaturesInBaseType; - WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - }), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17; + WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {}), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17; let WithGenericSignaturesInBaseType; - WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - }), b21 = b21, b3 = b3; -}(Errors || (Errors = { -})); + WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), b21 = b21, b3 = b3; +}(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.1.normal.js index 17d09b2251d..db1c4f6c4b6 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -149,8 +148,7 @@ var Errors; var b17; a17 = b17; // error b17 = a17; // error - })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - })); + })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { // target type has generic call signature @@ -163,7 +161,5 @@ var Errors; var b3; a3 = b3; // ok b3 = a3; // ok - })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - })); -})(Errors || (Errors = { -})); + })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.2.minified.js index 11982faeead..350975a63ce 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,8 +74,5 @@ function _createSuper(Derived) { } return OtherDerived; }(Base1); - WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = { - }), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17, WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { - }), b21 = b21, b3 = b3; -}(Errors || (Errors = { -})); + WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {}), b2 = b2, b7 = b7, b8 = b8, b10 = b10, b11 = b11, b12 = b12, b15 = b15, b15a = b15a, b16 = b16, b17 = b17, WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), b21 = b21, b3 = b3; +}(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.1.normal.js index 0ab54aab509..2e0e64a49b4 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.2.minified.js index 0aa67a3e377..bfcea4b7637 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.1.normal.js index 10506d81d04..533df98312e 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.2.minified.js index 3d0495a70a5..9a72cb6cf37 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.1.normal.js index 3efecbef88c..aa282d4e6f5 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.1.normal.js @@ -5,16 +5,14 @@ var Example1; // S is assignable to T0 when S["done"] is true // S is assignable to T1 when S["done"] is false t = s; -})(Example1 || (Example1 = { -})); +})(Example1 || (Example1 = {})); // Dropping constituents of T var Example2; (function(Example2) { // S is assignable to T0 when S["a"] is 0 // S is assignable to T2 when S["a"] is 2 t = s; -})(Example2 || (Example2 = { -})); +})(Example2 || (Example2 = {})); // Unmatched discriminants var Example3; (function(Example3) { @@ -22,24 +20,21 @@ var Example3; // S is *not* assignable to T1 when S["b"] is 4 // S is *not* assignable to T2 when S["a"] is 2 t = s; -})(Example3 || (Example3 = { -})); +})(Example3 || (Example3 = {})); // Unmatched non-discriminants var Example4; (function(Example4) { // S is assignable to T0 when S["a"] is 0 // S is *not* assignable to T2 when S["a"] is 2 as S is missing "c" t = s; -})(Example4 || (Example4 = { -})); +})(Example4 || (Example4 = {})); // Maximum discriminant combinations var Example5; (function(Example5) { // S *should* be assignable but the number of // combinations is too complex. t = s; -})(Example5 || (Example5 = { -})); +})(Example5 || (Example5 = {})); // https://github.com/Microsoft/TypeScript/issues/14865 var GH14865; (function(GH14865) { @@ -51,20 +46,17 @@ var GH14865; a.type; // "A" | "B" b.type; // "A" | "B" b = a; // should be assignable -})(GH14865 || (GH14865 = { -})); +})(GH14865 || (GH14865 = {})); // https://github.com/Microsoft/TypeScript/issues/30170 var GH30170; (function(GH30170) { - function draw(val) { - } + function draw(val) {} function drawWithColor(currentColor) { return draw({ color: currentColor }); } -})(GH30170 || (GH30170 = { -})); +})(GH30170 || (GH30170 = {})); // https://github.com/Microsoft/TypeScript/issues/12052 var GH12052; (function(GH12052) { @@ -82,8 +74,7 @@ var GH12052; type: undefined }; good.type = getAxisType(); -})(GH12052 || (GH12052 = { -})); +})(GH12052 || (GH12052 = {})); // https://github.com/Microsoft/TypeScript/issues/18421 var GH18421; (function(GH18421) { @@ -92,19 +83,16 @@ var GH18421; type: thingType }; } -})(GH18421 || (GH18421 = { -})); +})(GH18421 || (GH18421 = {})); // https://github.com/Microsoft/TypeScript/issues/15907 var GH15907; (function(GH15907) { - function dispatchAction(action) { - } + function dispatchAction(action) {} const active = true; dispatchAction({ type: active ? 'disactivate' : 'activate' }); -})(GH15907 || (GH15907 = { -})); +})(GH15907 || (GH15907 = {})); // https://github.com/Microsoft/TypeScript/issues/20889 var GH20889; (function(GH20889) { @@ -113,8 +101,7 @@ var GH20889; type: obj1.type }; } -})(GH20889 || (GH20889 = { -})); +})(GH20889 || (GH20889 = {})); // https://github.com/microsoft/TypeScript/issues/39357 var GH39357; (function(GH39357) { @@ -125,5 +112,4 @@ var GH39357; "c", "" ]; -})(GH39357 || (GH39357 = { -})); +})(GH39357 || (GH39357 = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.2.minified.js index 5eab33dd9ac..434e26e5adf 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es2015.2.minified.js @@ -1,17 +1,11 @@ var Example1, Example2, Example3, Example4, Example5, GH14865, GH12052; -Example1 || (Example1 = { -}), t = s, Example2 || (Example2 = { -}), t = s, Example3 || (Example3 = { -}), t = s, Example4 || (Example4 = { -}), t = s, Example5 || (Example5 = { -}), t = s, (function(GH14865) { +Example1 || (Example1 = {}), t = s, Example2 || (Example2 = {}), t = s, Example3 || (Example3 = {}), t = s, Example4 || (Example4 = {}), t = s, Example5 || (Example5 = {}), t = s, (function(GH14865) { let b; b.type, b = { type: "A", data: "whatevs" }; -})(GH14865 || (GH14865 = { -})), (function(GH12052) { +})(GH14865 || (GH14865 = {})), (function(GH12052) { function getAxisType() { return "categorical"; } @@ -20,5 +14,4 @@ Example1 || (Example1 = { type: void 0 }; good.type = getAxisType(); -})(GH12052 || (GH12052 = { -})); +})(GH12052 || (GH12052 = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.1.normal.js index c622826e07f..7e90d9b1bac 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.1.normal.js @@ -5,16 +5,14 @@ var Example1; // S is assignable to T0 when S["done"] is true // S is assignable to T1 when S["done"] is false t = s; -})(Example1 || (Example1 = { -})); +})(Example1 || (Example1 = {})); // Dropping constituents of T var Example2; (function(Example2) { // S is assignable to T0 when S["a"] is 0 // S is assignable to T2 when S["a"] is 2 t = s; -})(Example2 || (Example2 = { -})); +})(Example2 || (Example2 = {})); // Unmatched discriminants var Example3; (function(Example3) { @@ -22,24 +20,21 @@ var Example3; // S is *not* assignable to T1 when S["b"] is 4 // S is *not* assignable to T2 when S["a"] is 2 t = s; -})(Example3 || (Example3 = { -})); +})(Example3 || (Example3 = {})); // Unmatched non-discriminants var Example4; (function(Example4) { // S is assignable to T0 when S["a"] is 0 // S is *not* assignable to T2 when S["a"] is 2 as S is missing "c" t = s; -})(Example4 || (Example4 = { -})); +})(Example4 || (Example4 = {})); // Maximum discriminant combinations var Example5; (function(Example5) { // S *should* be assignable but the number of // combinations is too complex. t = s; -})(Example5 || (Example5 = { -})); +})(Example5 || (Example5 = {})); // https://github.com/Microsoft/TypeScript/issues/14865 var GH14865; (function(GH14865) { @@ -51,20 +46,17 @@ var GH14865; a.type; // "A" | "B" b.type; // "A" | "B" b = a; // should be assignable -})(GH14865 || (GH14865 = { -})); +})(GH14865 || (GH14865 = {})); // https://github.com/Microsoft/TypeScript/issues/30170 var GH30170; (function(GH30170) { - var draw = function draw(val) { - }; + var draw = function draw(val) {}; var drawWithColor = function drawWithColor(currentColor) { return draw({ color: currentColor }); }; -})(GH30170 || (GH30170 = { -})); +})(GH30170 || (GH30170 = {})); // https://github.com/Microsoft/TypeScript/issues/12052 var GH12052; (function(GH12052) { @@ -82,8 +74,7 @@ var GH12052; type: undefined }; good.type = getAxisType(); -})(GH12052 || (GH12052 = { -})); +})(GH12052 || (GH12052 = {})); // https://github.com/Microsoft/TypeScript/issues/18421 var GH18421; (function(GH18421) { @@ -92,19 +83,16 @@ var GH18421; type: thingType }; }; -})(GH18421 || (GH18421 = { -})); +})(GH18421 || (GH18421 = {})); // https://github.com/Microsoft/TypeScript/issues/15907 var GH15907; (function(GH15907) { - var dispatchAction = function dispatchAction(action) { - }; + var dispatchAction = function dispatchAction(action) {}; var active = true; dispatchAction({ type: active ? 'disactivate' : 'activate' }); -})(GH15907 || (GH15907 = { -})); +})(GH15907 || (GH15907 = {})); // https://github.com/Microsoft/TypeScript/issues/20889 var GH20889; (function(GH20889) { @@ -113,8 +101,7 @@ var GH20889; type: obj1.type }; }; -})(GH20889 || (GH20889 = { -})); +})(GH20889 || (GH20889 = {})); // https://github.com/microsoft/TypeScript/issues/39357 var GH39357; (function(GH39357) { @@ -125,5 +112,4 @@ var GH39357; "c", "" ]; -})(GH39357 || (GH39357 = { -})); +})(GH39357 || (GH39357 = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.2.minified.js index 0add1f43cd6..90ee5a232fe 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion_es5.2.minified.js @@ -1,20 +1,13 @@ var Example1, Example2, Example3, Example4, Example5, GH14865, GH12052; -Example1 || (Example1 = { -}), t = s, Example2 || (Example2 = { -}), t = s, Example3 || (Example3 = { -}), t = s, Example4 || (Example4 = { -}), t = s, Example5 || (Example5 = { -}), t = s, (function(GH14865) { +Example1 || (Example1 = {}), t = s, Example2 || (Example2 = {}), t = s, Example3 || (Example3 = {}), t = s, Example4 || (Example4 = {}), t = s, Example5 || (Example5 = {}), t = s, (function(GH14865) { var b; b.type, b = { type: "A", data: "whatevs" }; -})(GH14865 || (GH14865 = { -})), (function(GH12052) { +})(GH14865 || (GH14865 = {})), (function(GH12052) { var getAxisType = function() { return "categorical"; }; getAxisType(), void 0 = getAxisType(); -})(GH12052 || (GH12052 = { -})); +})(GH12052 || (GH12052 = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es2015.1.normal.js index 5d014649512..0198fc5c128 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es2015.1.normal.js @@ -43,8 +43,7 @@ var ClassTypeParam; }; } } -})(ClassTypeParam || (ClassTypeParam = { -})); +})(ClassTypeParam || (ClassTypeParam = {})); var GenericSignaturesInvalid; (function(GenericSignaturesInvalid) { class Base2 { @@ -81,8 +80,7 @@ var GenericSignaturesInvalid; b.a5 = t.a4; b.a5 = t.a5; } -})(GenericSignaturesInvalid || (GenericSignaturesInvalid = { -})); +})(GenericSignaturesInvalid || (GenericSignaturesInvalid = {})); var GenericSignaturesValid; (function(GenericSignaturesValid) { class Base2 { @@ -127,5 +125,4 @@ var GenericSignaturesValid; }; } } -})(GenericSignaturesValid || (GenericSignaturesValid = { -})); +})(GenericSignaturesValid || (GenericSignaturesValid = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.1.normal.js index 74e57e3e081..ae1a4d42d8e 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.1.normal.js @@ -67,8 +67,7 @@ var ClassTypeParam; }; // ok, same number of params }; }; -})(ClassTypeParam || (ClassTypeParam = { -})); +})(ClassTypeParam || (ClassTypeParam = {})); var GenericSignaturesInvalid; (function(GenericSignaturesInvalid) { var foo = function foo() { @@ -109,8 +108,7 @@ var GenericSignaturesInvalid; "use strict"; _classCallCheck(this, Target); }; -})(GenericSignaturesInvalid || (GenericSignaturesInvalid = { -})); +})(GenericSignaturesInvalid || (GenericSignaturesInvalid = {})); var GenericSignaturesValid; (function(GenericSignaturesValid) { var Base2 = function Base2() { @@ -174,5 +172,4 @@ var GenericSignaturesValid; }; // ok, same number of params }; }; -})(GenericSignaturesValid || (GenericSignaturesValid = { -})); +})(GenericSignaturesValid || (GenericSignaturesValid = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.2.minified.js index dedaac91c89..1f59542c898 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignaturesWithOptionalParameters_es5.2.minified.js @@ -46,8 +46,7 @@ function _classCallCheck(instance, Constructor) { }; }; }; -}(ClassTypeParam || (ClassTypeParam = { -})), (function(GenericSignaturesInvalid) { +}(ClassTypeParam || (ClassTypeParam = {})), (function(GenericSignaturesInvalid) { var Base2 = function() { "use strict"; _classCallCheck(this, Base2); @@ -55,8 +54,7 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, Target); }; -})(GenericSignaturesInvalid || (GenericSignaturesInvalid = { -})), (function(GenericSignaturesValid) { +})(GenericSignaturesInvalid || (GenericSignaturesInvalid = {})), (function(GenericSignaturesValid) { var Base2 = function() { "use strict"; var _this = this; @@ -100,5 +98,4 @@ function _classCallCheck(instance, Constructor) { }; }; }; -})(GenericSignaturesValid || (GenericSignaturesValid = { -})); +})(GenericSignaturesValid || (GenericSignaturesValid = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es2015.1.normal.js index 255c3684ea6..6d3af09ba66 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es2015.1.normal.js @@ -19,5 +19,4 @@ var Generics; a1 = b3; // ok b3 = a1; // ok } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es5.1.normal.js index 8ff3fc50603..479211aa2e4 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer2_es5.1.normal.js @@ -19,5 +19,4 @@ var Generics; a1 = b3; // ok b3 = a1; // ok }; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es2015.1.normal.js index 4c1af6767b1..4ca2a98c95a 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es2015.1.normal.js @@ -22,5 +22,4 @@ var Generics; a1 = b21; // ok b21 = a1; // ok } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.1.normal.js index bc9d8987648..90d13e031b0 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,5 +104,4 @@ var Generics; "use strict"; _classCallCheck(this, A); }; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.2.minified.js index 74c987ad52b..a201135b67d 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3_es5.2.minified.js @@ -34,8 +34,7 @@ var B2 = function(A1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,5 +61,4 @@ b2 = b2, (function(Generics) { "use strict"; _classCallCheck(this, A2); }; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es2015.1.normal.js index e338348e8ef..4672c0146d9 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es2015.1.normal.js @@ -25,5 +25,4 @@ var Generics; a1 = b3; // ok b3 = a1; // ok } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.1.normal.js index 2df63c88eca..410e73979b3 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -108,5 +107,4 @@ var Generics; } return B; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.2.minified.js index 322c82b0b03..caabfdf7740 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer_es5.2.minified.js @@ -37,8 +37,7 @@ b = b, b2 = b2, (function(Generics) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -60,5 +59,4 @@ b = b, b2 = b2, (function(Generics) { } return B; }(A1); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.1.normal.js index dcdcd875f7a..a5b73cee4b9 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.1.normal.js @@ -42,8 +42,7 @@ var OnlyDerived; a2 = b; // error a2 = t2; // error a2 = t; // error -})(OnlyDerived || (OnlyDerived = { -})); +})(OnlyDerived || (OnlyDerived = {})); var WithBase; (function(WithBase) { class Base { @@ -87,5 +86,4 @@ var WithBase; a2 = b; // ok a2 = t2; // ok a2 = t; // ok -})(WithBase || (WithBase = { -})); +})(WithBase || (WithBase = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.2.minified.js index d6d5ac371fc..3664d009472 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es2015.2.minified.js @@ -10,8 +10,7 @@ var OnlyDerived, WithBase; }() }; t2 = t2, b = b, b2 = b2, t = t; -}(OnlyDerived || (OnlyDerived = { -})), (function(WithBase) { +}(OnlyDerived || (OnlyDerived = {})), (function(WithBase) { class Base { } var t, t2, b, a2 = { @@ -21,5 +20,4 @@ var OnlyDerived, WithBase; }() }; t2 = t2, b = b, b2 = b2, t = t; -})(WithBase || (WithBase = { -})); +})(WithBase || (WithBase = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.1.normal.js index 37210f52a2a..989e645eeb2 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -135,8 +134,7 @@ var OnlyDerived; a2 = b; // error a2 = t2; // error a2 = t; // error -})(OnlyDerived || (OnlyDerived = { -})); +})(OnlyDerived || (OnlyDerived = {})); var WithBase; (function(WithBase) { var Base = function Base() { @@ -202,5 +200,4 @@ var WithBase; a2 = b; // ok a2 = t2; // ok a2 = t; // ok -})(WithBase || (WithBase = { -})); +})(WithBase || (WithBase = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.2.minified.js index 94cdcec8da4..a03b4efcd12 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -78,8 +77,7 @@ function _createSuper(Derived) { foo: new Derived2() }; t2 = t2, b = b, b2 = b2, t = t; -}(OnlyDerived || (OnlyDerived = { -})), (function(WithBase) { +}(OnlyDerived || (OnlyDerived = {})), (function(WithBase) { var t, t2, b, Base2 = function() { "use strict"; _classCallCheck(this, Base2); @@ -111,5 +109,4 @@ function _createSuper(Derived) { foo: new Derived2() }; t2 = t2, b = b, b2 = b2, t = t; -})(WithBase || (WithBase = { -})); +})(WithBase || (WithBase = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.1.normal.js index bbc6187d759..fa109c21a35 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.1.normal.js @@ -35,8 +35,7 @@ var TargetIsPublic; e = i; // errror e = d; // errror e = e; -})(TargetIsPublic || (TargetIsPublic = { -})); +})(TargetIsPublic || (TargetIsPublic = {})); (function(TargetIsPublic) { // targets class Base { @@ -74,5 +73,4 @@ var TargetIsPublic; e = i; // errror e = d; // errror e = e; -})(TargetIsPublic || (TargetIsPublic = { -})); +})(TargetIsPublic || (TargetIsPublic = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.2.minified.js index 7da624ec6cb..ee8cffaf444 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es2015.2.minified.js @@ -2,9 +2,7 @@ var TargetIsPublic; !function(TargetIsPublic) { var a, b, i, d, e; a = b, a = i, a = d, b = a = e, b = i, b = d, b = e, i = a, i = b, i = d, i = e, d = a, d = b, d = i, d = e, e = a, e = b, e = i, e = e = d; -}(TargetIsPublic || (TargetIsPublic = { -})), (function(TargetIsPublic) { +}(TargetIsPublic || (TargetIsPublic = {})), (function(TargetIsPublic) { var a, b, i, d, e; a = b, a = i, a = d, b = a = e, b = i, b = d, b = b = e, i = a, i = b, i = d, i = i = e, d = a, d = b, d = i, d = e, e = a, e = b, e = i, e = e = d; -})(TargetIsPublic || (TargetIsPublic = { -})); +})(TargetIsPublic || (TargetIsPublic = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.1.normal.js index e022427c61f..ec57909d2cf 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.1.normal.js @@ -44,8 +44,7 @@ var TargetIsPublic; e = i; // errror e = d; // errror e = e; -})(TargetIsPublic || (TargetIsPublic = { -})); +})(TargetIsPublic || (TargetIsPublic = {})); (function(TargetIsPublic) { var Base = function Base() { "use strict"; @@ -87,5 +86,4 @@ var TargetIsPublic; e = i; // errror e = d; // errror e = e; -})(TargetIsPublic || (TargetIsPublic = { -})); +})(TargetIsPublic || (TargetIsPublic = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.2.minified.js index ca35f75e246..27bf465c887 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility_es5.2.minified.js @@ -14,8 +14,7 @@ function _classCallCheck(instance, Constructor) { _classCallCheck(this, E); }; a = b, a = i, a = d, b = a = e, b = i, b = d, b = e, i = a, i = b, i = d, i = e, d = a, d = b, d = i, d = e, e = a, e = b, e = i, e = e = d; -}(TargetIsPublic || (TargetIsPublic = { -})), (function(TargetIsPublic) { +}(TargetIsPublic || (TargetIsPublic = {})), (function(TargetIsPublic) { var a, b, i, d, e, Base = function() { "use strict"; _classCallCheck(this, Base); @@ -27,5 +26,4 @@ function _classCallCheck(instance, Constructor) { _classCallCheck(this, E); }; a = b, a = i, a = d, b = a = e, b = i, b = d, b = b = e, i = a, i = b, i = d, i = i = e, d = a, d = b, d = i, d = e, e = a, e = b, e = i, e = e = d; -})(TargetIsPublic || (TargetIsPublic = { -})); +})(TargetIsPublic || (TargetIsPublic = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.1.normal.js index f7d97258790..28051d10b14 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.1.normal.js @@ -31,8 +31,7 @@ var TargetHasOptional; a = c; b = a; b = c; -})(TargetHasOptional || (TargetHasOptional = { -})); +})(TargetHasOptional || (TargetHasOptional = {})); var SourceHasOptional; (function(SourceHasOptional) { var c; @@ -56,5 +55,4 @@ var SourceHasOptional; b = f; // error b = a; // ok b = c; // ok -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.2.minified.js index 6bedc66d086..678f3b6e7d6 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es2015.2.minified.js @@ -1,9 +1,7 @@ var TargetHasOptional, SourceHasOptional; class Base { } -TargetHasOptional || (TargetHasOptional = { -}), new Base(), (function(SourceHasOptional) { +TargetHasOptional || (TargetHasOptional = {}), new Base(), (function(SourceHasOptional) { var c, a, d, e, f; new Base(), c = d, c = e, c = f, c = a, a = d, a = e, a = f, a = c; -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.1.normal.js index fd10f7aeeba..f2753c843c0 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -118,8 +117,7 @@ var TargetHasOptional; a = c; b = a; b = c; -})(TargetHasOptional || (TargetHasOptional = { -})); +})(TargetHasOptional || (TargetHasOptional = {})); var SourceHasOptional; (function(SourceHasOptional) { var c; @@ -143,5 +141,4 @@ var SourceHasOptional; b = f; // error b = a; // ok b = c; // ok -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.2.minified.js index a4050ed562b..97987ff3546 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,9 +64,7 @@ var TargetHasOptional, SourceHasOptional, Base = function() { } return Derived2; }(Derived); -TargetHasOptional || (TargetHasOptional = { -}), new Base(), (function(SourceHasOptional) { +TargetHasOptional || (TargetHasOptional = {}), new Base(), (function(SourceHasOptional) { var c, a, d, e, f; new Base(), c = d, c = e, c = f, c = a, a = d, a = e, a = f, a = c; -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.1.normal.js index 6a13d0b08f3..4738734131c 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.1.normal.js @@ -29,8 +29,7 @@ var TargetHasOptional; b = f; b = a; b = c; -})(TargetHasOptional || (TargetHasOptional = { -})); +})(TargetHasOptional || (TargetHasOptional = {})); var SourceHasOptional; (function(SourceHasOptional) { var c; @@ -54,5 +53,4 @@ var SourceHasOptional; b = f; // ok b = a; // ok b = c; // ok -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.2.minified.js index 14dba75880b..5abedd5b309 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es2015.2.minified.js @@ -4,9 +4,7 @@ class Base { !function(TargetHasOptional) { var c, a, d, e, f; new Base(), c = d, c = e, c = f, c = a, a = d, a = e, a = f, a = c; -}(TargetHasOptional || (TargetHasOptional = { -})), (function(SourceHasOptional) { +}(TargetHasOptional || (TargetHasOptional = {})), (function(SourceHasOptional) { var c, a, d, e, f; new Base(), c = d, c = e, c = f, c = a, a = d, a = e, a = f, a = c; -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.1.normal.js index e2addd8f537..29bd8978baf 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -117,8 +116,7 @@ var TargetHasOptional; b = f; b = a; b = c; -})(TargetHasOptional || (TargetHasOptional = { -})); +})(TargetHasOptional || (TargetHasOptional = {})); var SourceHasOptional; (function(SourceHasOptional) { var c; @@ -142,5 +140,4 @@ var SourceHasOptional; b = f; // ok b = a; // ok b = c; // ok -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.2.minified.js index 0a5731cac93..af8e4897cf5 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -68,9 +67,7 @@ var TargetHasOptional, SourceHasOptional, Base = function() { !function(TargetHasOptional) { var c, a, d, e, f; new Base(), c = d, c = e, c = f, c = a, a = d, a = e, a = f, a = c; -}(TargetHasOptional || (TargetHasOptional = { -})), (function(SourceHasOptional) { +}(TargetHasOptional || (TargetHasOptional = {})), (function(SourceHasOptional) { var c, a, d, e, f; new Base(), c = d, c = e, c = f, c = a, a = d, a = e, a = f, a = c; -})(SourceHasOptional || (SourceHasOptional = { -})); +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.1.normal.js index 18f33576d45..8075bf4e9c4 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.1.normal.js @@ -37,8 +37,7 @@ var JustStrings; a2 = b; // ok a2 = t2; // ok a2 = t; -})(JustStrings || (JustStrings = { -})); +})(JustStrings || (JustStrings = {})); var NumbersAndStrings; (function(NumbersAndStrings) { class S { @@ -77,5 +76,4 @@ var NumbersAndStrings; a2 = b; // error a2 = t2; // error a2 = t; // error -})(NumbersAndStrings || (NumbersAndStrings = { -})); +})(NumbersAndStrings || (NumbersAndStrings = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.2.minified.js index 3821dbb3460..b0eaca1fa6c 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es2015.2.minified.js @@ -4,11 +4,9 @@ var JustStrings, NumbersAndStrings; "1": "" }; t2 = t2, b = b, b2 = b2, t = t; -}(JustStrings || (JustStrings = { -})), (function(NumbersAndStrings) { +}(JustStrings || (JustStrings = {})), (function(NumbersAndStrings) { var t, t2, b, b2 = { 1: "" }; t2 = t2, b = b, b2 = b2, t = t; -})(NumbersAndStrings || (NumbersAndStrings = { -})); +})(NumbersAndStrings || (NumbersAndStrings = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.1.normal.js index 3a2fe0d662c..b76081066e2 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.1.normal.js @@ -46,8 +46,7 @@ var JustStrings; a2 = b; // ok a2 = t2; // ok a2 = t; -})(JustStrings || (JustStrings = { -})); +})(JustStrings || (JustStrings = {})); var NumbersAndStrings; (function(NumbersAndStrings) { var S = function S() { @@ -90,5 +89,4 @@ var NumbersAndStrings; a2 = b; // error a2 = t2; // error a2 = t; // error -})(NumbersAndStrings || (NumbersAndStrings = { -})); +})(NumbersAndStrings || (NumbersAndStrings = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.2.minified.js index 0daedc6b033..e5ac8a1a3e1 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames_es5.2.minified.js @@ -13,8 +13,7 @@ function _classCallCheck(instance, Constructor) { "1": "" }; t2 = t2, b = b, b2 = b2, t = t; -}(JustStrings || (JustStrings = { -})), (function(NumbersAndStrings) { +}(JustStrings || (JustStrings = {})), (function(NumbersAndStrings) { var t, t2, b, S = function() { "use strict"; _classCallCheck(this, S); @@ -25,5 +24,4 @@ function _classCallCheck(instance, Constructor) { 1: "" }; t2 = t2, b = b, b2 = b2, t = t; -})(NumbersAndStrings || (NumbersAndStrings = { -})); +})(NumbersAndStrings || (NumbersAndStrings = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.1.normal.js index d35822dd53e..2f98117f13a 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.1.normal.js @@ -37,8 +37,7 @@ var SimpleTypes; a2 = b; a2 = t2; a2 = t; -})(SimpleTypes || (SimpleTypes = { -})); +})(SimpleTypes || (SimpleTypes = {})); var ObjectTypes; (function(ObjectTypes) { class S { @@ -76,5 +75,4 @@ var ObjectTypes; a2 = b; a2 = t2; a2 = t; -})(ObjectTypes || (ObjectTypes = { -})); +})(ObjectTypes || (ObjectTypes = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.2.minified.js index 79ac2c11369..e9fd4d8d5b8 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es2015.2.minified.js @@ -4,13 +4,11 @@ var SimpleTypes, ObjectTypes; foo: "" }; t2 = t2, b = b, b2 = b2, t = t; -}(SimpleTypes || (SimpleTypes = { -})), (function(ObjectTypes) { +}(SimpleTypes || (SimpleTypes = {})), (function(ObjectTypes) { var t, t2, b, a2 = { foo: a2 }, b2 = { foo: b2 }; t = t, t2 = t2, b = b, b2 = a2 = b2, a2 = b, a2 = t2, a2 = t; -})(ObjectTypes || (ObjectTypes = { -})); +})(ObjectTypes || (ObjectTypes = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.1.normal.js index f976e2ca2fc..86ca958e5fc 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.1.normal.js @@ -46,8 +46,7 @@ var SimpleTypes; a2 = b; a2 = t2; a2 = t; -})(SimpleTypes || (SimpleTypes = { -})); +})(SimpleTypes || (SimpleTypes = {})); var ObjectTypes; (function(ObjectTypes) { var S = function S() { @@ -89,5 +88,4 @@ var ObjectTypes; a2 = b; a2 = t2; a2 = t; -})(ObjectTypes || (ObjectTypes = { -})); +})(ObjectTypes || (ObjectTypes = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.2.minified.js index 91ed9694cd3..ea6b30072b9 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers_es5.2.minified.js @@ -13,8 +13,7 @@ function _classCallCheck(instance, Constructor) { foo: "" }; t2 = t2, b = b, b2 = b2, t = t; -}(SimpleTypes || (SimpleTypes = { -})), (function(ObjectTypes) { +}(SimpleTypes || (SimpleTypes = {})), (function(ObjectTypes) { var t, t2, b, S = function() { "use strict"; _classCallCheck(this, S); @@ -27,5 +26,4 @@ function _classCallCheck(instance, Constructor) { foo: b2 }; t = t, t2 = t2, b = b, b2 = a2 = b2, a2 = b, a2 = t2, a2 = t; -})(ObjectTypes || (ObjectTypes = { -})); +})(ObjectTypes || (ObjectTypes = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.1.normal.js index f0ff02b5ead..42b345f4a37 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.1.normal.js @@ -23,5 +23,4 @@ var Generics; a3 = b4; // error b4 = a3; // error } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.2.minified.js index 4125cf8ddda..9ba15c0a61d 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es2015.2.minified.js @@ -2,5 +2,4 @@ var b, b2, Generics; b = b, b2 = b2, (function(Generics) { var b1, b21; b1 = b1, b21 = b21; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.1.normal.js index 3494701cb9d..7040fb3f59e 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.1.normal.js @@ -23,5 +23,4 @@ var Generics; var b21; a1 = b21; // ok b21 = a1; // error -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.2.minified.js index 4125cf8ddda..9ba15c0a61d 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer2_es5.2.minified.js @@ -2,5 +2,4 @@ var b, b2, Generics; b = b, b2 = b2, (function(Generics) { var b1, b21; b1 = b1, b21 = b21; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es2015.1.normal.js index a672814c181..0cb62557ba8 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es2015.1.normal.js @@ -12,5 +12,4 @@ var Generics; a1 = b; // error b = a1; // error } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.1.normal.js index d7cd79d1998..73cd9cf4861 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.1.normal.js @@ -19,5 +19,4 @@ var Generics; "use strict"; _classCallCheck(this, A); }; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.2.minified.js index 30c2b197707..a5f224cec99 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer3_es5.2.minified.js @@ -6,5 +6,4 @@ b1 = b1, (function(Generics) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, A); }; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.1.normal.js index c53dc250fd9..4da3880cf01 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.1.normal.js @@ -31,5 +31,4 @@ var Generics; a3 = b4; // error b4 = a3; // error } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.2.minified.js index 4125cf8ddda..9ba15c0a61d 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es2015.2.minified.js @@ -2,5 +2,4 @@ var b, b2, Generics; b = b, b2 = b2, (function(Generics) { var b1, b21; b1 = b1, b21 = b21; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.1.normal.js index e4f0df51c34..e125a0ea924 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -122,5 +121,4 @@ var Generics; var b21; a1 = b21; // ok b21 = a1; // error -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.2.minified.js index b725d1fa07e..1f3da82d9bd 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,5 +72,4 @@ b = b, b2 = b2, (function(Generics) { return B2; }(A1); b21 = b21; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.1.normal.js index 693acf15ad2..5350e386412 100644 --- a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.1.normal.js @@ -7,8 +7,7 @@ var M; (function(M1) { var y; M1.y = y; -})(M || (M = { -})); +})(M || (M = {})); M.y = 3; // OK M.y = 3; // OK M.y = 3; // OK @@ -27,13 +26,11 @@ var M2; (function(M3) { var x1; M3.x = x1; - })(M31 = M21.M3 || (M21.M3 = { - })); + })(M31 = M21.M3 || (M21.M3 = {})); M31 = { x: 3 }; // Error -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); M2.M3 = { x: 3 }; // OK @@ -52,8 +49,7 @@ M2.M3 = { M2.M3 = { x: '' }; // Error -function fn() { -} +function fn() {} fn = ()=>3 ; // Bug 823548: Should be error (fn is not a reference) fn = ()=>3 @@ -77,8 +73,7 @@ function fn2(x2, y) { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E = undefined; // Error E = undefined; // Error class C { diff --git a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.2.minified.js index 6468815fac1..c74809dfea7 100644 --- a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es2015.2.minified.js @@ -1,20 +1,16 @@ var x, M, M2, E, E; -function fn() { -} +function fn() {} x = 3 = "", (function(M1) { var y; M1.y = y; -})(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 } = { y: 3 }, (function(M21) { var x1; - (M21.M3 || (M21.M3 = { - })).x = x1; -})(M2 || (M2 = { -})), M2.M3 = { + (M21.M3 || (M21.M3 = {})).x = x1; +})(M2 || (M2 = {})), M2.M3 = { x: 3 }, M2.M3 = { x: 3 @@ -27,8 +23,7 @@ x = 3 = "", (function(M1) { }, M2.M3 = { x: "" }, fn = ()=>3 -, (E = E || (E = { -}))[E.A = 0] = "A", E = void 0 = void 0; +, (E = E || (E = {}))[E.A = 0] = "A", E = void 0 = void 0; class C { } C = void 0; diff --git a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.1.normal.js index 55287012ad5..319842179f3 100644 --- a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.1.normal.js @@ -12,8 +12,7 @@ var M; (function(M1) { var y; M1.y = y; -})(M || (M = { -})); +})(M || (M = {})); M.y = 3; // OK M.y = 3; // OK M.y = 3; // OK @@ -32,13 +31,11 @@ var M2; (function(M3) { var x1; M3.x = x1; - })(M31 = M21.M3 || (M21.M3 = { - })); + })(M31 = M21.M3 || (M21.M3 = {})); M31 = { x: 3 }; // Error -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); M2.M3 = { x: 3 }; // OK @@ -57,8 +54,7 @@ M2.M3 = { M2.M3 = { x: '' }; // Error -function fn() { -} +function fn() {} fn = function() { return 3; }; // Bug 823548: Should be error (fn is not a reference) @@ -84,8 +80,7 @@ function fn2(x2, y) { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E = undefined; // Error E = undefined; // Error var C = function C() { diff --git a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.2.minified.js index b1e334d40a3..bf10f5cec00 100644 --- a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers_es5.2.minified.js @@ -1,19 +1,15 @@ -function fn() { -} +function fn() {} x = 3 = "", (function(M1) { var y; M1.y = y; -})(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 } = { y: 3 }, (function(M21) { var x1; - (M21.M3 || (M21.M3 = { - })).x = x1; -})(M2 || (M2 = { -})), M2.M3 = { + (M21.M3 || (M21.M3 = {})).x = x1; +})(M2 || (M2 = {})), M2.M3 = { x: 3 }, M2.M3 = { x: 3 @@ -27,8 +23,7 @@ x = 3 = "", (function(M1) { x: "" }, fn = function() { return 3; -}, (E = E || (E = { -}))[E.A = 0] = "A", E = void 0 = void 0; +}, (E = E || (E = {}))[E.A = 0] = "A", E = void 0 = void 0; var E, x, M, M2, E, C = function() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.1.normal.js index 85cf6dee5f5..5fac15662e2 100644 --- a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.1.normal.js @@ -9,8 +9,7 @@ import { j, k } from './assignmentToVoidZero2'; // @noImplicitAny: true exports.j = 1; exports.k = void 0; -var o = { -}; +var o = {}; o.x = 1; o.y = void 0; o.x + o.y; diff --git a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.2.minified.js index f3ec2d5db64..925092e60f6 100644 --- a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es2015.2.minified.js @@ -1,7 +1,6 @@ import { j, k } from "./assignmentToVoidZero2"; exports.j = 1, exports.k = void 0; -var o = { -}; +var o = {}; o.x = 1, o.y = void 0, o.x + o.y; var c = new function() { this.p = 1, this.q = void 0; diff --git a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.1.normal.js b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.1.normal.js index 85cf6dee5f5..5fac15662e2 100644 --- a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.1.normal.js @@ -9,8 +9,7 @@ import { j, k } from './assignmentToVoidZero2'; // @noImplicitAny: true exports.j = 1; exports.k = void 0; -var o = { -}; +var o = {}; o.x = 1; o.y = void 0; o.x + o.y; diff --git a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.2.minified.js b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.2.minified.js index f3ec2d5db64..925092e60f6 100644 --- a/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentToVoidZero2_es5.2.minified.js @@ -1,7 +1,6 @@ import { j, k } from "./assignmentToVoidZero2"; exports.j = 1, exports.k = void 0; -var o = { -}; +var o = {}; o.x = 1, o.y = void 0, o.x + o.y; var c = new function() { this.p = 1, this.q = void 0; diff --git a/crates/swc/tests/tsc-references/assignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/assignments_es2015.1.normal.js index c13274083f9..ba2dab94525 100644 --- a/crates/swc/tests/tsc-references/assignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/assignments_es2015.1.normal.js @@ -5,12 +5,10 @@ C = null; // Error var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E = null; // Error E.A = null; // OK per spec, Error per implementation (509581) -function fn() { -} +function fn() {} fn = null; // Should be error var v; v = null; // OK diff --git a/crates/swc/tests/tsc-references/assignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/assignments_es2015.2.minified.js index 23b9e18b3bd..63fe8377e2d 100644 --- a/crates/swc/tests/tsc-references/assignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/assignments_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -M = null, (E = E || (E = { -}))[E.A = 0] = "A", (E = null).A = null, I = null; +M = null, (E = E || (E = {}))[E.A = 0] = "A", (E = null).A = null, I = null; diff --git a/crates/swc/tests/tsc-references/assignments_es5.1.normal.js b/crates/swc/tests/tsc-references/assignments_es5.1.normal.js index 8f216b0bc12..2497bd0d193 100644 --- a/crates/swc/tests/tsc-references/assignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/assignments_es5.1.normal.js @@ -12,12 +12,10 @@ C = null; // Error var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E = null; // Error E.A = null; // OK per spec, Error per implementation (509581) -function fn() { -} +function fn() {} fn = null; // Should be error var v; v = null; // OK diff --git a/crates/swc/tests/tsc-references/assignments_es5.2.minified.js b/crates/swc/tests/tsc-references/assignments_es5.2.minified.js index 8d0604f38c9..4ce9328df8d 100644 --- a/crates/swc/tests/tsc-references/assignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/assignments_es5.2.minified.js @@ -5,5 +5,4 @@ var E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -C = null, (E = E || (E = { -}))[E.A = 0] = "A", (E = null).A = null, I = null; +C = null, (E = E || (E = {}))[E.A = 0] = "A", (E = null).A = null, I = null; diff --git a/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.1.normal.js index cb2defd8eda..7cc872f427a 100644 --- a/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.1.normal.js @@ -31,7 +31,6 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _asyncToGenerator(function*() { - }); + _f = _asyncToGenerator(function*() {}); return _f.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.2.minified.js index c7a495e0ec4..4bab211f90b 100644 --- a/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function _f() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.1.normal.js index cb2defd8eda..7cc872f427a 100644 --- a/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.1.normal.js @@ -31,7 +31,6 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _asyncToGenerator(function*() { - }); + _f = _asyncToGenerator(function*() {}); return _f.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.2.minified.js index c7a495e0ec4..4bab211f90b 100644 --- a/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function _f() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js index e879b9bc94d..04e40f49695 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js @@ -22,6 +22,5 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { _next(void 0); }); }; - }(function*() { - }); + }(function*() {}); }(); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js index e879b9bc94d..04e40f49695 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { _next(void 0); }); }; - }(function*() { - }); + }(function*() {}); }(); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js index e879b9bc94d..04e40f49695 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { _next(void 0); }); }; - }(function*() { - }); + }(function*() {}); }(); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js index 97085c1ce51..97157285da5 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js @@ -65,8 +65,7 @@ var A = function A() { _ctx.next = 4; return Promise.resolve(); case 4: - obj = _defineProperty({ - }, "a", function() { + obj = _defineProperty({}, "a", function() { return _this; }); // computed property name after `await` triggers case case 5: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.2.minified.js index 70625d92665..272793b9cc0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.2.minified.js @@ -42,8 +42,7 @@ var A = function() { for(_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = _args[_key]; return _this = this, _ctx.next = 4, Promise.resolve(); case 4: - obj = _defineProperty({ - }, "a", function() { + obj = _defineProperty({}, "a", function() { return _this; }); case 5: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.1.normal.js index a94e6a45b8f..2e638ffb583 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.1.normal.js @@ -30,8 +30,7 @@ function _asyncToGenerator(fn) { // @target: es2017 // @noEmitHelpers: true var foo = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function foo() { return _ref.apply(this, arguments); }; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js index e879b9bc94d..04e40f49695 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js @@ -22,6 +22,5 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { _next(void 0); }); }; - }(function*() { - }); + }(function*() {}); }(); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.1.normal.js index 2b7e22dfaa1..099441bb727 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.1.normal.js @@ -31,8 +31,7 @@ function _asyncToGenerator(fn) { // @lib: es5,es2015.promise // @noEmitHelpers: true var foo = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function foo() { return _ref.apply(this, arguments); }; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js index e879b9bc94d..04e40f49695 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { _next(void 0); }); }; - }(function*() { - }); + }(function*() {}); }(); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.1.normal.js index 7a14465488e..050574755d4 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.1.normal.js @@ -30,8 +30,7 @@ function _asyncToGenerator(fn) { // @target: ES6 // @noEmitHelpers: true var foo = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function foo() { return _ref.apply(this, arguments); }; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js index e879b9bc94d..04e40f49695 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { _next(void 0); }); }; - }(function*() { - }); + }(function*() {}); }(); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es2015.1.normal.js index d6d03950e71..643fdbe7f67 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -var f = (_await)=>{ -}; +var f = (_await)=>{}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es5.1.normal.js index 0ea20a98277..21f02f27a90 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction2_es2017_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -var f = function(_await) { -}; +var f = function(_await) {}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es2015.1.normal.js index 6d40902bf9e..a34c9bd78b6 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -var f = (_await)=>{ -}; +var f = (_await)=>{}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es5.1.normal.js index a949ac7a7f8..a6d5968e3df 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction2_es5_es5.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -var f = function(_await) { -}; +var f = function(_await) {}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es2015.1.normal.js index 5374a45dc10..55e209fbf05 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -var f = (_await)=>{ -}; +var f = (_await)=>{}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es5.1.normal.js index 15ed3a2fdfa..18e3a66f98a 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction2_es6_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -var f = function(_await) { -}; +var f = function(_await) {}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction3_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction3_es2017_es2015.1.normal.js index 2448c04a3fe..6a59774f82c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction3_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction3_es2017_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -function f(_await = _await) { -} +function f(_await = _await) {} diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction3_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction3_es5_es2015.1.normal.js index 9e63c7a96fa..d05891abf91 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction3_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction3_es5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -function f(_await = _await) { -} +function f(_await = _await) {} diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction3_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction3_es6_es2015.1.normal.js index 65243240865..70c04b3122d 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction3_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction3_es6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -function f(_await = _await) { -} +function f(_await = _await) {} diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es2015.1.normal.js index 30040930ce3..557c253c6e0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -var _await = ()=>{ -}; +var _await = ()=>{}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es5.1.normal.js index 5882a01995b..1633f9bb124 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction4_es2017_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -var _await = function() { -}; +var _await = function() {}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es2015.1.normal.js index f3b9524c651..16d5688c830 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -var _await = ()=>{ -}; +var _await = ()=>{}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es5.1.normal.js index 6656c3ebbd0..f309b1faa51 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction4_es5_es5.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -var _await = function() { -}; +var _await = function() {}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es2015.1.normal.js index 3b3779f4ae6..e94c875803e 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -var _await = ()=>{ -}; +var _await = ()=>{}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es5.1.normal.js index c3954f7c201..62f153625d3 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction4_es6_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -var _await = function() { -}; +var _await = function() {}; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es2015.1.normal.js index 139b8398857..0092ab8dc7d 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es2015.1.normal.js @@ -31,8 +31,7 @@ function _asyncToGenerator(fn) { // @noEmitHelpers: true class C { method() { - function other() { - } + function other() {} var _this = this; var fn = function() { var _ref = _asyncToGenerator((function*() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js index c94ed86ee01..7ce542b1955 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js @@ -58,8 +58,7 @@ var C = // @target: es2017 { key: "method", value: function method() { - var other = function other() { - }; + var other = function other() {}; var _this = this; var fn = function() { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js index f41d7f57e42..7f2ac9504c0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function() { { key: "method", value: function() { - var other = function() { - }, _this = this; + var other = function() {}, _this = this; (function() { (function(fn) { return function() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es2015.1.normal.js index d8fa05fa2f2..e0e0dbefb83 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es2015.1.normal.js @@ -32,8 +32,7 @@ function _asyncToGenerator(fn) { // @noEmitHelpers: true class C { method() { - function other() { - } + function other() {} var _this = this; var fn = function() { var _ref = _asyncToGenerator((function*() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js index 880b628b052..1090b7c1e4b 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js @@ -59,8 +59,7 @@ var C = // @target: ES5 { key: "method", value: function method() { - var other = function other() { - }; + var other = function other() {}; var _this = this; var fn = function() { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js index f41d7f57e42..7f2ac9504c0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function() { { key: "method", value: function() { - var other = function() { - }, _this = this; + var other = function() {}, _this = this; (function() { (function(fn) { return function() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es2015.1.normal.js index cc9925ca277..a3e0e6fbd29 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es2015.1.normal.js @@ -31,8 +31,7 @@ function _asyncToGenerator(fn) { // @noEmitHelpers: true class C { method() { - function other() { - } + function other() {} var _this = this; var fn = function() { var _ref = _asyncToGenerator((function*() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js index a6c618ef31c..3fc53c3d2d7 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js @@ -58,8 +58,7 @@ var C = // @target: ES6 { key: "method", value: function method() { - var other = function other() { - }; + var other = function other() {}; var _this = this; var fn = function() { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js index f41d7f57e42..7f2ac9504c0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function() { { key: "method", value: function() { - var other = function() { - }, _this = this; + var other = function() {}, _this = this; (function() { (function(fn) { return function() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js index 6cea3453828..8dc6c770011 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js @@ -53,8 +53,7 @@ function _asyncToGenerator(fn) { return _ref.apply(this, arguments); }; }(); -/** @type {function(function(): string): void} */ const f = (p)=>{ -}; +/** @type {function(function(): string): void} */ const f = (p)=>{}; // Error (good) f(_asyncToGenerator(function*() { return 0; diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js index 625b469e45f..5e1365294c3 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js @@ -71,8 +71,7 @@ function _asyncToGenerator(fn) { return _ref.apply(this, arguments); }; }(); -/** @type {function(function(): string): void} */ var f = function(p) { -}; +/** @type {function(function(): string): void} */ var f = function(p) {}; // Error (good) f(_asyncToGenerator(regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.1.normal.js index d34283b872c..e1dee4be7b4 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.1.normal.js @@ -31,64 +31,55 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _asyncToGenerator(function*() { - }); + _f0 = _asyncToGenerator(function*() {}); return _f0.apply(this, arguments); } function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _asyncToGenerator(function*() { - }); + _f1 = _asyncToGenerator(function*() {}); return _f1.apply(this, arguments); } function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _asyncToGenerator(function*() { - }); + _f3 = _asyncToGenerator(function*() {}); return _f3.apply(this, arguments); } let f4 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f4() { return _ref.apply(this, arguments); }; }(); let f5 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f5() { return _ref.apply(this, arguments); }; }(); let f6 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f6() { return _ref.apply(this, arguments); }; }(); let f7 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f7() { return _ref.apply(this, arguments); }; }(); let f8 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f8() { return _ref.apply(this, arguments); }; }(); let f9 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f9() { return _ref.apply(this, arguments); }; @@ -127,42 +118,33 @@ let f13 = function() { }(); let o = { m1 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m2 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m3 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }; class C { m1() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m2() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m3() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m4() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m5() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m6() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } var M; @@ -171,13 +153,11 @@ var M; return _f11.apply(this, arguments); } function _f11() { - _f11 = _asyncToGenerator(function*() { - }); + _f11 = _asyncToGenerator(function*() {}); return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); // @target: es2017 // @isolatedModules: true export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js index bb61765a2f2..985b620e5d3 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js @@ -24,24 +24,15 @@ function _asyncToGenerator(fn) { }; } function _f0() { - return (_f0 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f0 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f1() { - return (_f1 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f3() { - return (_f3 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f3 = _asyncToGenerator(function*() {})).apply(this, arguments); } -_asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { +_asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() { return p; }), _asyncToGenerator(function*() { return mp; @@ -51,12 +42,10 @@ _asyncToGenerator(function*() { return p; }), (function(M1) { function _f11() { - return (_f11 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f11 = _asyncToGenerator(function*() {})).apply(this, arguments); } M1.f1 = function() { return _f11.apply(this, arguments); }; -})(M || (M = { -})); +})(M || (M = {})); export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js index 0b26884d64e..ca48e601409 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js @@ -387,8 +387,7 @@ var M; return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); // @target: es2017 // @isolatedModules: true export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js index aa093f76434..25c0407ece5 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js @@ -262,6 +262,5 @@ var M, C = function() { M1.f1 = function() { return _f11.apply(this, arguments); }; -}(M || (M = { -})); +}(M || (M = {})); export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.1.normal.js index 2f5be44a63f..1bd5f2e77cd 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.1.normal.js @@ -31,64 +31,55 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _asyncToGenerator(function*() { - }); + _f0 = _asyncToGenerator(function*() {}); return _f0.apply(this, arguments); } function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _asyncToGenerator(function*() { - }); + _f1 = _asyncToGenerator(function*() {}); return _f1.apply(this, arguments); } function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _asyncToGenerator(function*() { - }); + _f3 = _asyncToGenerator(function*() {}); return _f3.apply(this, arguments); } let f4 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f4() { return _ref.apply(this, arguments); }; }(); let f5 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f5() { return _ref.apply(this, arguments); }; }(); let f6 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f6() { return _ref.apply(this, arguments); }; }(); let f7 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f7() { return _ref.apply(this, arguments); }; }(); let f8 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f8() { return _ref.apply(this, arguments); }; }(); let f9 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f9() { return _ref.apply(this, arguments); }; @@ -127,42 +118,33 @@ let f13 = function() { }(); let o = { m1 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m2 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m3 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }; class C { m1() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m2() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m3() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m4() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m5() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m6() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } var M; @@ -171,13 +153,11 @@ var M; return _f11.apply(this, arguments); } function _f11() { - _f11 = _asyncToGenerator(function*() { - }); + _f11 = _asyncToGenerator(function*() {}); return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); // @target: ES5 // @lib: es5,es2015.promise // @isolatedModules: true diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js index bb61765a2f2..985b620e5d3 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js @@ -24,24 +24,15 @@ function _asyncToGenerator(fn) { }; } function _f0() { - return (_f0 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f0 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f1() { - return (_f1 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f3() { - return (_f3 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f3 = _asyncToGenerator(function*() {})).apply(this, arguments); } -_asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { +_asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() { return p; }), _asyncToGenerator(function*() { return mp; @@ -51,12 +42,10 @@ _asyncToGenerator(function*() { return p; }), (function(M1) { function _f11() { - return (_f11 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f11 = _asyncToGenerator(function*() {})).apply(this, arguments); } M1.f1 = function() { return _f11.apply(this, arguments); }; -})(M || (M = { -})); +})(M || (M = {})); export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js index 9443f6edf58..fde294d1f36 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js @@ -387,8 +387,7 @@ var M; return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); // @target: ES5 // @lib: es5,es2015.promise // @isolatedModules: true diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js index aa093f76434..25c0407ece5 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js @@ -262,6 +262,5 @@ var M, C = function() { M1.f1 = function() { return _f11.apply(this, arguments); }; -}(M || (M = { -})); +}(M || (M = {})); export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.1.normal.js index e9dbbe5a082..8ee2e373d52 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.1.normal.js @@ -31,64 +31,55 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _asyncToGenerator(function*() { - }); + _f0 = _asyncToGenerator(function*() {}); return _f0.apply(this, arguments); } function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _asyncToGenerator(function*() { - }); + _f1 = _asyncToGenerator(function*() {}); return _f1.apply(this, arguments); } function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _asyncToGenerator(function*() { - }); + _f3 = _asyncToGenerator(function*() {}); return _f3.apply(this, arguments); } let f4 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f4() { return _ref.apply(this, arguments); }; }(); let f5 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f5() { return _ref.apply(this, arguments); }; }(); let f6 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f6() { return _ref.apply(this, arguments); }; }(); let f7 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f7() { return _ref.apply(this, arguments); }; }(); let f8 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f8() { return _ref.apply(this, arguments); }; }(); let f9 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f9() { return _ref.apply(this, arguments); }; @@ -127,42 +118,33 @@ let f13 = function() { }(); let o = { m1 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m2 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m3 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }; class C { m1() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m2() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m3() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m4() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m5() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m6() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } var M; @@ -171,13 +153,11 @@ var M; return _f11.apply(this, arguments); } function _f11() { - _f11 = _asyncToGenerator(function*() { - }); + _f11 = _asyncToGenerator(function*() {}); return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); // @target: ES6 // @isolatedModules: true export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js index bb61765a2f2..985b620e5d3 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js @@ -24,24 +24,15 @@ function _asyncToGenerator(fn) { }; } function _f0() { - return (_f0 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f0 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f1() { - return (_f1 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f3() { - return (_f3 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f3 = _asyncToGenerator(function*() {})).apply(this, arguments); } -_asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { +_asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() { return p; }), _asyncToGenerator(function*() { return mp; @@ -51,12 +42,10 @@ _asyncToGenerator(function*() { return p; }), (function(M1) { function _f11() { - return (_f11 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f11 = _asyncToGenerator(function*() {})).apply(this, arguments); } M1.f1 = function() { return _f11.apply(this, arguments); }; -})(M || (M = { -})); +})(M || (M = {})); export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js index 5d6d40d5601..00c90a63a5e 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js @@ -387,8 +387,7 @@ var M; return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); // @target: ES6 // @isolatedModules: true export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js index aa093f76434..25c0407ece5 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js @@ -262,6 +262,5 @@ var M, C = function() { M1.f1 = function() { return _f11.apply(this, arguments); }; -}(M || (M = { -})); +}(M || (M = {})); export { }; diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.1.normal.js index e16afba43e0..deab93ff5da 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.1.normal.js @@ -31,64 +31,55 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _asyncToGenerator(function*() { - }); + _f0 = _asyncToGenerator(function*() {}); return _f0.apply(this, arguments); } function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _asyncToGenerator(function*() { - }); + _f1 = _asyncToGenerator(function*() {}); return _f1.apply(this, arguments); } function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _asyncToGenerator(function*() { - }); + _f3 = _asyncToGenerator(function*() {}); return _f3.apply(this, arguments); } let f4 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f4() { return _ref.apply(this, arguments); }; }(); let f5 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f5() { return _ref.apply(this, arguments); }; }(); let f6 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f6() { return _ref.apply(this, arguments); }; }(); let f7 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f7() { return _ref.apply(this, arguments); }; }(); let f8 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f8() { return _ref.apply(this, arguments); }; }(); let f9 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f9() { return _ref.apply(this, arguments); }; @@ -127,42 +118,33 @@ let f13 = function() { }(); let o = { m1 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m2 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m3 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }; class C { m1() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m2() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m3() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m4() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m5() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m6() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } var M; @@ -171,13 +153,11 @@ var M; return _f11.apply(this, arguments); } function _f11() { - _f11 = _asyncToGenerator(function*() { - }); + _f11 = _asyncToGenerator(function*() {}); return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); function f14() { return _f14.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js index 0d5d877b7b2..ec6dcff47bd 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js @@ -24,16 +24,13 @@ function _asyncToGenerator(fn) { }; } function _f0() { - return (_f0 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f0 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f1() { - return (_f1 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f3() { - return (_f3 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f3 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f14() { return (_f14 = _asyncToGenerator(function*() { @@ -43,13 +40,7 @@ function _f14() { } })).apply(this, arguments); } -_asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { +_asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() { return p; }), _asyncToGenerator(function*() { return mp; @@ -59,11 +50,9 @@ _asyncToGenerator(function*() { return p; }), (function(M1) { function _f11() { - return (_f11 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f11 = _asyncToGenerator(function*() {})).apply(this, arguments); } M1.f1 = function() { return _f11.apply(this, arguments); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js index 8d5da879142..5af72984bce 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js @@ -387,8 +387,7 @@ var M; return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); function f14() { return _f14.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js index 708177d5156..ab57b982191 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js @@ -277,5 +277,4 @@ function _f14() { M1.f1 = function() { return _f11.apply(this, arguments); }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.1.normal.js index e16afba43e0..deab93ff5da 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.1.normal.js @@ -31,64 +31,55 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _asyncToGenerator(function*() { - }); + _f0 = _asyncToGenerator(function*() {}); return _f0.apply(this, arguments); } function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _asyncToGenerator(function*() { - }); + _f1 = _asyncToGenerator(function*() {}); return _f1.apply(this, arguments); } function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _asyncToGenerator(function*() { - }); + _f3 = _asyncToGenerator(function*() {}); return _f3.apply(this, arguments); } let f4 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f4() { return _ref.apply(this, arguments); }; }(); let f5 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f5() { return _ref.apply(this, arguments); }; }(); let f6 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f6() { return _ref.apply(this, arguments); }; }(); let f7 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f7() { return _ref.apply(this, arguments); }; }(); let f8 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f8() { return _ref.apply(this, arguments); }; }(); let f9 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f9() { return _ref.apply(this, arguments); }; @@ -127,42 +118,33 @@ let f13 = function() { }(); let o = { m1 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m2 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m3 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }; class C { m1() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m2() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m3() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m4() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m5() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m6() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } var M; @@ -171,13 +153,11 @@ var M; return _f11.apply(this, arguments); } function _f11() { - _f11 = _asyncToGenerator(function*() { - }); + _f11 = _asyncToGenerator(function*() {}); return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); function f14() { return _f14.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js index 0d5d877b7b2..ec6dcff47bd 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js @@ -24,16 +24,13 @@ function _asyncToGenerator(fn) { }; } function _f0() { - return (_f0 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f0 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f1() { - return (_f1 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f3() { - return (_f3 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f3 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f14() { return (_f14 = _asyncToGenerator(function*() { @@ -43,13 +40,7 @@ function _f14() { } })).apply(this, arguments); } -_asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { +_asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() { return p; }), _asyncToGenerator(function*() { return mp; @@ -59,11 +50,9 @@ _asyncToGenerator(function*() { return p; }), (function(M1) { function _f11() { - return (_f11 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f11 = _asyncToGenerator(function*() {})).apply(this, arguments); } M1.f1 = function() { return _f11.apply(this, arguments); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js index 8d5da879142..5af72984bce 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js @@ -387,8 +387,7 @@ var M; return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); function f14() { return _f14.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js index 708177d5156..ab57b982191 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js @@ -277,5 +277,4 @@ function _f14() { M1.f1 = function() { return _f11.apply(this, arguments); }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.1.normal.js index e16afba43e0..deab93ff5da 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.1.normal.js @@ -31,64 +31,55 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _asyncToGenerator(function*() { - }); + _f0 = _asyncToGenerator(function*() {}); return _f0.apply(this, arguments); } function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _asyncToGenerator(function*() { - }); + _f1 = _asyncToGenerator(function*() {}); return _f1.apply(this, arguments); } function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _asyncToGenerator(function*() { - }); + _f3 = _asyncToGenerator(function*() {}); return _f3.apply(this, arguments); } let f4 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f4() { return _ref.apply(this, arguments); }; }(); let f5 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f5() { return _ref.apply(this, arguments); }; }(); let f6 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f6() { return _ref.apply(this, arguments); }; }(); let f7 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f7() { return _ref.apply(this, arguments); }; }(); let f8 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f8() { return _ref.apply(this, arguments); }; }(); let f9 = function() { - var _ref = _asyncToGenerator(function*() { - }); + var _ref = _asyncToGenerator(function*() {}); return function f9() { return _ref.apply(this, arguments); }; @@ -127,42 +118,33 @@ let f13 = function() { }(); let o = { m1 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m2 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); }, m3 () { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } }; class C { m1() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m2() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } m3() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m4() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m5() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } static m6() { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } var M; @@ -171,13 +153,11 @@ var M; return _f11.apply(this, arguments); } function _f11() { - _f11 = _asyncToGenerator(function*() { - }); + _f11 = _asyncToGenerator(function*() {}); return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); function f14() { return _f14.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js index 0d5d877b7b2..ec6dcff47bd 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js @@ -24,16 +24,13 @@ function _asyncToGenerator(fn) { }; } function _f0() { - return (_f0 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f0 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f1() { - return (_f1 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f3() { - return (_f3 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f3 = _asyncToGenerator(function*() {})).apply(this, arguments); } function _f14() { return (_f14 = _asyncToGenerator(function*() { @@ -43,13 +40,7 @@ function _f14() { } })).apply(this, arguments); } -_asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { -}), _asyncToGenerator(function*() { +_asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() {}), _asyncToGenerator(function*() { return p; }), _asyncToGenerator(function*() { return mp; @@ -59,11 +50,9 @@ _asyncToGenerator(function*() { return p; }), (function(M1) { function _f11() { - return (_f11 = _asyncToGenerator(function*() { - })).apply(this, arguments); + return (_f11 = _asyncToGenerator(function*() {})).apply(this, arguments); } M1.f1 = function() { return _f11.apply(this, arguments); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js index 8d5da879142..5af72984bce 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js @@ -387,8 +387,7 @@ var M; return _f11.apply(this, arguments); } M1.f1 = f11; -})(M || (M = { -})); +})(M || (M = {})); function f14() { return _f14.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js index 708177d5156..ab57b982191 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js @@ -277,5 +277,4 @@ function _f14() { M1.f1 = function() { return _f11.apply(this, arguments); }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.1.normal.js index 8b7dd1fe318..47e15c4164c 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.1.normal.js @@ -33,7 +33,6 @@ function _await() { function _await1() { _await1 = // @target: es2017 // @noEmitHelpers: true - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _await1.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.2.minified.js index 158180bd1a1..029245e8c23 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es2015.2.minified.js @@ -22,6 +22,5 @@ function _await() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.1.normal.js index 33611fcb94f..fa994322726 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.1.normal.js @@ -34,7 +34,6 @@ function _await1() { _await1 = // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _await1.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.2.minified.js index 158180bd1a1..029245e8c23 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function _await() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.1.normal.js index 20fb12dbd82..5da249c58c5 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.1.normal.js @@ -33,7 +33,6 @@ function _await() { function _await1() { _await1 = // @target: ES6 // @noEmitHelpers: true - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _await1.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.2.minified.js index 158180bd1a1..029245e8c23 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function _await() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.1.normal.js index dc40414e097..3d8ce9834ec 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.1.normal.js @@ -33,7 +33,6 @@ function foo() { function _foo() { _foo = // @target: es2017 // @noEmitHelpers: true - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _foo.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.1.normal.js index 196fe99559e..65dd8ef5bb0 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.1.normal.js @@ -34,7 +34,6 @@ function _foo() { _foo = // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _foo.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.1.normal.js index 84eaaab0aa1..76556515218 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.1.normal.js @@ -33,7 +33,6 @@ function foo() { function _foo() { _foo = // @target: ES6 // @noEmitHelpers: true - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _foo.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.2.minified.js index ac7df754712..7d774c7b2ab 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function _foo() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es2015.1.normal.js index 422775357ea..28794a427b4 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -function f(_await) { -} +function f(_await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es5.1.normal.js index 422775357ea..28794a427b4 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es2017_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -function f(_await) { -} +function f(_await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es2015.1.normal.js index 061d7a50438..6fd4d7e4935 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -function f(_await) { -} +function f(_await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es5.1.normal.js index 061d7a50438..6fd4d7e4935 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es5_es5.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -function f(_await) { -} +function f(_await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es2015.1.normal.js index 350cc28f8d3..5f78cf7db2c 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -function f(_await) { -} +function f(_await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es5.1.normal.js index 350cc28f8d3..5f78cf7db2c 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration2_es6_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -function f(_await) { -} +function f(_await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es2017_es2015.1.normal.js index 2448c04a3fe..6a59774f82c 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es2017_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -function f(_await = _await) { -} +function f(_await = _await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es5_es2015.1.normal.js index 9e63c7a96fa..d05891abf91 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -function f(_await = _await) { -} +function f(_await = _await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es6_es2015.1.normal.js index 65243240865..70c04b3122d 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration3_es6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -function f(_await = _await) { -} +function f(_await = _await) {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es2015.1.normal.js index 1c3585d4b83..8d0e3787250 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -function _await() { -} +function _await() {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es5.1.normal.js index 1c3585d4b83..8d0e3787250 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es2017_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: es2017 // @noEmitHelpers: true -function _await() { -} +function _await() {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es2015.1.normal.js index fa0bdd8d29b..11b15450454 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -function _await() { -} +function _await() {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es5.1.normal.js index fa0bdd8d29b..11b15450454 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es5_es5.1.normal.js @@ -1,5 +1,4 @@ // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -function _await() { -} +function _await() {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es2015.1.normal.js index adcde912da8..82b2201e9e9 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -function _await() { -} +function _await() {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es5.1.normal.js index adcde912da8..82b2201e9e9 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration4_es6_es5.1.normal.js @@ -1,4 +1,3 @@ // @target: ES6 // @noEmitHelpers: true -function _await() { -} +function _await() {} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.1.normal.js index 955722dffb5..84743212d71 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.1.normal.js @@ -13,5 +13,4 @@ function _defineProperty(obj, key, value) { } // @target: es2017 // @noEmitHelpers: true -var v = _defineProperty({ -}, _await, foo); +var v = _defineProperty({}, _await, foo); diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.2.minified.js index d7841d70688..5e72384e6de 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es2017_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key, value; -obj = { -}, key = _await, value = foo, key in obj ? Object.defineProperty(obj, key, { +obj = {}, key = _await, value = foo, key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.1.normal.js index 86a384bb97b..6e22ce9410e 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.1.normal.js @@ -14,5 +14,4 @@ function _defineProperty(obj, key, value) { // @target: ES5 // @lib: es5,es2015.promise // @noEmitHelpers: true -var v = _defineProperty({ -}, _await, foo); +var v = _defineProperty({}, _await, foo); diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.2.minified.js index d7841d70688..5e72384e6de 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es5_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key, value; -obj = { -}, key = _await, value = foo, key in obj ? Object.defineProperty(obj, key, { +obj = {}, key = _await, value = foo, key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.1.normal.js index 3949767d10a..12a814a1621 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.1.normal.js @@ -13,5 +13,4 @@ function _defineProperty(obj, key, value) { } // @target: ES6 // @noEmitHelpers: true -var v = _defineProperty({ -}, _await, foo); +var v = _defineProperty({}, _await, foo); diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.2.minified.js index d7841d70688..5e72384e6de 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration8_es6_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key, value; -obj = { -}, key = _await, value = foo, key in obj ? Object.defineProperty(obj, key, { +obj = {}, key = _await, value = foo, key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es2015.1.normal.js index 81572560b14..d5eec9108b0 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es2015.1.normal.js @@ -32,8 +32,7 @@ function _asyncToGenerator(fn) { // @noEmitHelpers: true class C { method() { - function other() { - } + function other() {} function fn() { return _fn.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js index 6e54521cf30..397f78969f2 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js @@ -59,8 +59,7 @@ var C = // @target: ES5 { key: "method", value: function method() { - var other = function other() { - }; + var other = function other() {}; function fn() { return _fn.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.2.minified.js index d790323ebd4..9f23e5d57e0 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function() { { key: "method", value: function() { - var other = function() { - }; + var other = function() {}; function _fn() { return (_fn = (function(fn) { return function() { diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js index e18074c203f..99188892d71 100644 --- a/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js @@ -44,8 +44,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -151,8 +150,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.2.minified.js index be6c8ca1d83..f153840843f 100644 --- a/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.2.minified.js @@ -17,8 +17,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -88,8 +87,7 @@ export var _typeof, Task = function(Promise) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js index 0bb1afc0319..3b7bf97ea6b 100644 --- a/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js @@ -44,8 +44,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -151,8 +150,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.2.minified.js index be6c8ca1d83..f153840843f 100644 --- a/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.2.minified.js @@ -17,8 +17,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -88,8 +87,7 @@ export var _typeof, Task = function(Promise) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es2015.1.normal.js index 99141527cdf..c89254d9105 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es2015.1.normal.js @@ -29,10 +29,8 @@ function _asyncToGenerator(fn) { } // @target: es6 class A { - x() { - } - y() { - } + x() {} + y() {} } class B extends A { // async method with only call/get on 'super' does not require a binding @@ -74,8 +72,7 @@ class B extends A { return _asyncToGenerator(function*() { const _super = null; const _superIndex = null; - const f = ()=>{ - }; + const f = ()=>{}; // call with property access _super_x(); // call with element access diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js index 1299ab27f93..4854b791e7e 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js @@ -192,8 +192,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -221,13 +220,11 @@ var A = // @target: es6 _createClass(A, [ { key: "x", - value: function x() { - } + value: function x() {} }, { key: "y", - value: function y() { - } + value: function y() {} } ]); return A; @@ -340,8 +337,7 @@ var B = /*#__PURE__*/ function(A) { case 0: _super = null; _superIndex = null; - f = function() { - }; + f = function() {}; _super_x(); _super_method(); a = _super_x2(); diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.2.minified.js index 1d99893ab88..66714495d2c 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.2.minified.js @@ -111,13 +111,11 @@ var A = function() { return _createClass(A, [ { key: "x", - value: function() { - } + value: function() {} }, { key: "y", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -138,8 +136,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -217,8 +214,7 @@ var A = function() { for(;;)switch(_ctx.prev = _ctx.next){ case 0: var _args, _args1; - _super = null, _superIndex = null, f = function() { - }, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { + _super = null, _superIndex = null, f = function() {}, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { f: f }, _super_x1() = ref.f, ref1 = { f: f diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es2015.1.normal.js index 789ea108874..add7d0c311c 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es2015.1.normal.js @@ -30,10 +30,8 @@ function _asyncToGenerator(fn) { // @target: es2017 // @noEmitHelpers: true class A { - x() { - } - y() { - } + x() {} + y() {} } class B extends A { // async method with only call/get on 'super' does not require a binding @@ -71,8 +69,7 @@ class B extends A { , _super_method4 = ()=>super["x"] ; return _asyncToGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; // call with property access _super_x(); // call with element access diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js index 1aa2276daf8..bf5c5b9edc1 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js @@ -192,8 +192,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -222,13 +221,11 @@ var A = // @target: es2017 _createClass(A, [ { key: "x", - value: function x() { - } + value: function x() {} }, { key: "y", - value: function y() { - } + value: function y() {} } ]); return A; @@ -337,8 +334,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - f = function() { - }; + f = function() {}; _super_x(); _super_method(); a = _super_x2(); diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.2.minified.js index 9f039faa370..290d22a1e07 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.2.minified.js @@ -111,13 +111,11 @@ var A = function() { return _createClass(A, [ { key: "x", - value: function() { - } + value: function() {} }, { key: "y", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -138,8 +136,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -217,8 +214,7 @@ var A = function() { for(;;)switch(_ctx.prev = _ctx.next){ case 0: var _args, _args1; - f = function() { - }, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { + f = function() {}, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { f: f }, _super_x1() = ref.f, ref1 = { f: f diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es2015.1.normal.js index f72d5d48da6..f54f445d35f 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es2015.1.normal.js @@ -31,10 +31,8 @@ function _asyncToGenerator(fn) { // @lib: es5,es2015.promise // @noEmitHelpers: true class A { - x() { - } - y() { - } + x() {} + y() {} } class B extends A { // async method with only call/get on 'super' does not require a binding @@ -72,8 +70,7 @@ class B extends A { , _super_method4 = ()=>super["x"] ; return _asyncToGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; // call with property access _super_x(); // call with element access diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js index 8f86169f517..9217f74750d 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js @@ -192,8 +192,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -223,13 +222,11 @@ var A = // @target: ES5 _createClass(A, [ { key: "x", - value: function x() { - } + value: function x() {} }, { key: "y", - value: function y() { - } + value: function y() {} } ]); return A; @@ -338,8 +335,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - f = function() { - }; + f = function() {}; _super_x(); _super_method(); a = _super_x2(); diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.2.minified.js index 9f039faa370..290d22a1e07 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.2.minified.js @@ -111,13 +111,11 @@ var A = function() { return _createClass(A, [ { key: "x", - value: function() { - } + value: function() {} }, { key: "y", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -138,8 +136,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -217,8 +214,7 @@ var A = function() { for(;;)switch(_ctx.prev = _ctx.next){ case 0: var _args, _args1; - f = function() { - }, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { + f = function() {}, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { f: f }, _super_x1() = ref.f, ref1 = { f: f diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js index df8c79c638c..3fc4b4877ec 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js @@ -120,10 +120,8 @@ function _wrapAsyncGenerator(fn) { // @lib: esnext // @noEmitHelpers: true class A { - x() { - } - y() { - } + x() {} + y() {} } class B extends A { // async method with only call/get on 'super' does not require a binding @@ -165,8 +163,7 @@ class B extends A { , _super_method6 = (..._args)=>super["x"](..._args) ; return _asyncToGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; // call with property access _super_x(); // call with element access @@ -229,8 +226,7 @@ class B extends A { , _super_x12 = (_args)=>super.x = _args ; return _asyncToGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; _super_x(f); // destructuring assign with property access ({ f: _super_x10() } = { @@ -273,8 +269,7 @@ class B extends A { , _super_method12 = (_args)=>super["x"] = _args ; return _asyncToGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; _super_method(f); // destructuring assign with element access ({ f: _super_method10() } = { @@ -317,8 +312,7 @@ class B extends A { , _super_x18 = (_args)=>super.x = _args ; return _wrapAsyncGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; _super_x(f); // destructuring assign with property access ({ f: _super_x16() } = { @@ -361,8 +355,7 @@ class B extends A { , _super_method18 = (_args)=>super["x"] = _args ; return _wrapAsyncGenerator(function*() { - const f = ()=>{ - }; + const f = ()=>{}; _super_method(f); // destructuring assign with element access ({ f: _super_method16() } = { diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js index 57bd05069b2..57fab60abf0 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js @@ -281,8 +281,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -312,13 +311,11 @@ var A = // @target: ES6 _createClass(A, [ { key: "x", - value: function x() { - } + value: function x() {} }, { key: "y", - value: function y() { - } + value: function y() {} } ]); return A; @@ -455,8 +452,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx1) { while(1)switch(_ctx1.prev = _ctx1.next){ case 0: - f = function() { - }; + f = function() {}; _super_x(); _super_method(); a = _super_x2(); @@ -593,8 +589,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx3) { while(1)switch(_ctx3.prev = _ctx3.next){ case 0: - f = function() { - }; + f = function() {}; _super_x(f); ; // destructuring assign with property access @@ -705,8 +700,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx5) { while(1)switch(_ctx5.prev = _ctx5.next){ case 0: - f = function() { - }; + f = function() {}; _super_method(f); ; // destructuring assign with element access @@ -817,8 +811,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx7) { while(1)switch(_ctx7.prev = _ctx7.next){ case 0: - f = function() { - }; + f = function() {}; _super_x(f); ; // destructuring assign with property access @@ -929,8 +922,7 @@ var B = /*#__PURE__*/ function(A) { return regeneratorRuntime.wrap(function _callee$(_ctx9) { while(1)switch(_ctx9.prev = _ctx9.next){ case 0: - f = function() { - }; + f = function() {}; _super_method(f); ; // destructuring assign with element access diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js index fe70f86ac51..7a049b5f6b3 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js @@ -179,13 +179,11 @@ var A = function() { return _createClass(A, [ { key: "x", - value: function() { - } + value: function() {} }, { key: "y", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -206,8 +204,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -295,8 +292,7 @@ var A = function() { for(;;)switch(_ctx1.prev = _ctx1.next){ case 0: var _args, _args1; - f = function() { - }, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { + f = function() {}, _super_x(), _super_method(), a = _get(_getPrototypeOf(B.prototype), "x", _this), b = _get(_getPrototypeOf(B.prototype), "x", _this), _args = f, _set(_getPrototypeOf(B.prototype), "x", _args, _this, !0), _args1 = f, _set(_getPrototypeOf(B.prototype), "x", _args1, _this, !0), ref = { f: f }, _super_x1() = ref.f, ref1 = { f: f @@ -379,8 +375,7 @@ var A = function() { for(;;)switch(_ctx3.prev = _ctx3.next){ case 0: var _args2; - _args2 = f = function() { - }, _set(_getPrototypeOf(B.prototype), "x", _args2, _this, !0), ref = { + _args2 = f = function() {}, _set(_getPrototypeOf(B.prototype), "x", _args2, _this, !0), ref = { f: f }, _super_x() = ref.f, _asyncToGenerator(regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { @@ -452,8 +447,7 @@ var A = function() { for(;;)switch(_ctx5.prev = _ctx5.next){ case 0: var _args3; - _args3 = f = function() { - }, _set(_getPrototypeOf(B.prototype), "x", _args3, _this, !0), ref = { + _args3 = f = function() {}, _set(_getPrototypeOf(B.prototype), "x", _args3, _this, !0), ref = { f: f }, _super_method() = ref.f, _asyncToGenerator(regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { @@ -525,8 +519,7 @@ var A = function() { for(;;)switch(_ctx7.prev = _ctx7.next){ case 0: var _args4; - _args4 = f = function() { - }, _set(_getPrototypeOf(B.prototype), "x", _args4, _this, !0), ref = { + _args4 = f = function() {}, _set(_getPrototypeOf(B.prototype), "x", _args4, _this, !0), ref = { f: f }, _super_x() = ref.f, _asyncToGenerator(regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { @@ -598,8 +591,7 @@ var A = function() { for(;;)switch(_ctx9.prev = _ctx9.next){ case 0: var _args5; - _args5 = f = function() { - }, _set(_getPrototypeOf(B.prototype), "x", _args5, _this, !0), ref = { + _args5 = f = function() {}, _set(_getPrototypeOf(B.prototype), "x", _args5, _this, !0), ref = { f: f }, _super_method() = ref.f, _asyncToGenerator(regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.1.normal.js index 2ec2a839dae..07e4356a5df 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.1.normal.js @@ -34,10 +34,8 @@ function _f() { _f = // @target: es5 // @lib: es5,es2015.promise // @filename: a.ts - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _f.apply(this, arguments); } // @filename: b.ts -function g() { -} +function g() {} diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.2.minified.js index c7a495e0ec4..4bab211f90b 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es2015.2.minified.js @@ -22,6 +22,5 @@ function _f() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js index 0bf35355964..192c9bdbef8 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js @@ -47,5 +47,4 @@ function _f() { return _f.apply(this, arguments); } // @filename: b.ts -function g() { -} +function g() {} diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.1.normal.js index 8f3fd9f3af5..d6bced403b3 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.1.normal.js @@ -33,10 +33,8 @@ function f() { function _f() { _f = // @target: es6 // @filename: a.ts - _asyncToGenerator(function*() { - }); + _asyncToGenerator(function*() {}); return _f.apply(this, arguments); } // @filename: b.ts -function g() { -} +function g() {} diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.2.minified.js index c7a495e0ec4..4bab211f90b 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es2015.2.minified.js @@ -22,6 +22,5 @@ function _f() { _next(void 0); }); }; - })(function*() { - })).apply(this, arguments); + })(function*() {})).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js index 0d263aa9936..cd6d4a9e764 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js @@ -46,5 +46,4 @@ function _f() { return _f.apply(this, arguments); } // @filename: b.ts -function g() { -} +function g() {} diff --git a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.1.normal.js index 13edab5bc9f..522c6c9f63b 100644 --- a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.1.normal.js @@ -136,8 +136,7 @@ function fn11(x) { } function _fn11() { _fn11 = _asyncToGenerator(function*(x) { - var x = _extends({ - }, y); + var x = _extends({}, y); }); return _fn11.apply(this, arguments); } @@ -240,8 +239,7 @@ function fn22(x) { } function _fn22() { _fn22 = _asyncToGenerator(function*(x) { - if (y) { - } else { + if (y) {} else { var x; } }); @@ -254,8 +252,7 @@ function _fn23() { _fn23 = _asyncToGenerator(function*(x) { try { var x; - } catch (e) { - } + } catch (e) {} }); return _fn23.apply(this, arguments); } @@ -264,8 +261,7 @@ function fn24(x) { } function _fn24() { _fn24 = _asyncToGenerator(function*(x) { - try { - } catch (e) { + try {} catch (e) { var x; } }); @@ -276,8 +272,7 @@ function fn25(x) { } function _fn25() { _fn25 = _asyncToGenerator(function*(x) { - try { - } catch (x1) { + try {} catch (x1) { var x1; } }); @@ -288,8 +283,7 @@ function fn26(x) { } function _fn26() { _fn26 = _asyncToGenerator(function*(x) { - try { - } catch ({ x: x2 }) { + try {} catch ({ x: x2 }) { var x2; } }); @@ -300,8 +294,7 @@ function fn27(x) { } function _fn27() { _fn27 = _asyncToGenerator(function*(x) { - try { - } finally{ + try {} finally{ var x; } }); @@ -334,8 +327,7 @@ function fn30(x) { } function _fn30() { _fn30 = _asyncToGenerator(function*(x) { - for(var x = y;;){ - } + for(var x = y;;){} }); return _fn30.apply(this, arguments); } @@ -344,8 +336,7 @@ function fn31(x) { } function _fn31() { _fn31 = _asyncToGenerator(function*(x) { - for(var { x } = y;;){ - } + for(var { x } = y;;){} }); return _fn31.apply(this, arguments); } @@ -365,8 +356,7 @@ function fn33(x) { } function _fn33() { _fn33 = _asyncToGenerator(function*(x) { - for(var x in y){ - } + for(var x in y){} }); return _fn33.apply(this, arguments); } @@ -386,8 +376,7 @@ function fn35(x) { } function _fn35() { _fn35 = _asyncToGenerator(function*(x) { - for (var x of y){ - } + for (var x of y){} }); return _fn35.apply(this, arguments); } @@ -396,8 +385,7 @@ function fn36(x) { } function _fn36() { _fn36 = _asyncToGenerator(function*(x) { - for (var { x } of y){ - } + for (var { x } of y){} }); return _fn36.apply(this, arguments); } @@ -441,8 +429,7 @@ function fn40(x) { } function _fn40() { _fn40 = _asyncToGenerator(function*(x) { - try { - } catch (e) { + try {} catch (e) { var x; } }); diff --git a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.2.minified.js index 10a6210d5dd..6ee8bf17062 100644 --- a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es2015.2.minified.js @@ -32,20 +32,16 @@ function _extends() { }).apply(this, arguments); } function _fn1() { - return (_fn1 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn1 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn2() { - return (_fn2 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn2 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn3() { - return (_fn3 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn3 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn4() { - return (_fn4 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn4 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn5() { return (_fn5 = _asyncToGenerator(function*(x) { @@ -79,8 +75,7 @@ function _fn10() { } function _fn11() { return (_fn11 = _asyncToGenerator(function*(x) { - _extends({ - }, y); + _extends({}, y); })).apply(this, arguments); } function _fn12() { @@ -114,58 +109,43 @@ function _fn17() { })).apply(this, arguments); } function _fn18() { - return (_fn18 = _asyncToGenerator(function*({ x }) { - })).apply(this, arguments); + return (_fn18 = _asyncToGenerator(function*({ x }) {})).apply(this, arguments); } function _fn19() { - return (_fn19 = _asyncToGenerator(function*([x]) { - })).apply(this, arguments); + return (_fn19 = _asyncToGenerator(function*([x]) {})).apply(this, arguments); } function _fn20() { - return (_fn20 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn20 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn21() { - return (_fn21 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn21 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn22() { - return (_fn22 = _asyncToGenerator(function*(x) { - })).apply(this, arguments); + return (_fn22 = _asyncToGenerator(function*(x) {})).apply(this, arguments); } function _fn23() { return (_fn23 = _asyncToGenerator(function*(x) { - try { - } catch (e) { - } + try {} catch (e) {} })).apply(this, arguments); } function _fn24() { return (_fn24 = _asyncToGenerator(function*(x) { - try { - } catch (e) { - } + try {} catch (e) {} })).apply(this, arguments); } function _fn25() { return (_fn25 = _asyncToGenerator(function*(x) { - try { - } catch (x1) { - } + try {} catch (x1) {} })).apply(this, arguments); } function _fn26() { return (_fn26 = _asyncToGenerator(function*(x) { - try { - } catch ({ x: x2 }) { - } + try {} catch ({ x: x2 }) {} })).apply(this, arguments); } function _fn27() { return (_fn27 = _asyncToGenerator(function*(x) { - try { - } finally{ - } + try {} finally{} })).apply(this, arguments); } function _fn28() { @@ -233,8 +213,6 @@ function _fn39() { } function _fn40() { return (_fn40 = _asyncToGenerator(function*(x) { - try { - } catch (e) { - } + try {} catch (e) {} })).apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js index 013bcc629b2..e5e8dcad337 100644 --- a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js @@ -283,8 +283,7 @@ function _fn11() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - x = _extends({ - }, y); + x = _extends({}, y); case 1: case "end": return _ctx.stop(); @@ -488,8 +487,7 @@ function _fn22() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - if (y) { - } else { + if (y) {} else { ; } case 1: @@ -511,8 +509,7 @@ function _fn23() { case 0: try { ; - } catch (e) { - } + } catch (e) {} case 1: case "end": return _ctx.stop(); @@ -530,8 +527,7 @@ function _fn24() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (e) { + try {} catch (e) { ; } case 1: @@ -551,8 +547,7 @@ function _fn25() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (x1) { + try {} catch (x1) { ; } case 1: @@ -572,8 +567,7 @@ function _fn26() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (param) { + try {} catch (param) { x2 = param.x; ; } @@ -594,8 +588,7 @@ function _fn27() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - try { - } finally{ + try {} finally{ ; } case 1: @@ -655,8 +648,7 @@ function _fn30() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - for(x = y;;){ - } + for(x = y;;){} case 1: case "end": return _ctx.stop(); @@ -674,8 +666,7 @@ function _fn31() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - for(x = y.x;;){ - } + for(x = y.x;;){} case 1: case "end": return _ctx.stop(); @@ -713,8 +704,7 @@ function _fn33() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - for(x in y){ - } + for(x in y){} case 1: case "end": return _ctx.stop(); @@ -970,8 +960,7 @@ function _fn40() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (e) { + try {} catch (e) { ; } case 1: diff --git a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.2.minified.js index 0736976a733..cf99aeaefb4 100644 --- a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.2.minified.js @@ -216,8 +216,7 @@ function _fn11() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - x = _extends({ - }, y); + x = _extends({}, y); case 1: case "end": return _ctx.stop(); @@ -378,9 +377,7 @@ function _fn23() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (e) { - } + try {} catch (e) {} case 1: case "end": return _ctx.stop(); @@ -393,9 +390,7 @@ function _fn24() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (e) { - } + try {} catch (e) {} case 1: case "end": return _ctx.stop(); @@ -408,9 +403,7 @@ function _fn25() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (x) { - } + try {} catch (x) {} case 1: case "end": return _ctx.stop(); @@ -424,8 +417,7 @@ function _fn26() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (param) { + try {} catch (param) { x1 = param.x; } case 1: @@ -440,9 +432,7 @@ function _fn27() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - try { - } finally{ - } + try {} finally{} case 1: case "end": return _ctx.stop(); @@ -708,9 +698,7 @@ function _fn40() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - try { - } catch (e) { - } + try {} catch (e) {} case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es2015.1.normal.js b/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es2015.1.normal.js index 2604e0b7477..1a75f982c55 100644 --- a/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es2015.1.normal.js @@ -1,6 +1,4 @@ -var o = { -}; -var f = ()=>{ -}; +var o = {}; +var f = ()=>{}; var v1 = o; // Should be allowed var v2 = f; // Should be allowed diff --git a/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es5.1.normal.js index a6ebe2ee871..24d10f967b1 100644 --- a/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/augmentedTypeAssignmentCompatIndexSignature_es5.1.normal.js @@ -1,6 +1,4 @@ -var o = { -}; -var f = function() { -}; +var o = {}; +var f = function() {}; var v1 = o; // Should be allowed var v2 = f; // Should be allowed diff --git a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.1.normal.js b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.1.normal.js index a162b5837f4..60ec7ebdce7 100644 --- a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.1.normal.js @@ -1,4 +1,2 @@ -var a = { -}[0]; // Should be Foo -var b = (()=>{ -})[0]; // Should be Bar +var a = {}[0]; // Should be Foo +var b = (()=>{})[0]; // Should be Bar diff --git a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.2.minified.js b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.2.minified.js index a29c77c9013..df1fc2f5679 100644 --- a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es2015.2.minified.js @@ -1,3 +1 @@ -({ -})[0], (()=>{ -})[0]; +({})[0], (()=>{})[0]; diff --git a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.1.normal.js index 38cc2d0f05a..f0165ad518c 100644 --- a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.1.normal.js @@ -1,4 +1,2 @@ -var a = { -}[0]; // Should be Foo -var b = (function() { -})[0]; // Should be Bar +var a = {}[0]; // Should be Foo +var b = (function() {})[0]; // Should be Bar diff --git a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.2.minified.js index 6c45d88a069..69b5a0cecba 100644 --- a/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/augmentedTypeBracketAccessIndexSignature_es5.2.minified.js @@ -1,3 +1 @@ -({ -})[0], (function() { -})[0]; +({})[0], (function() {})[0]; diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js index 2160243458e..92e0af2e70a 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js @@ -79,8 +79,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.2.minified.js index 236d0a3d017..7e2184946f4 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.2.minified.js @@ -37,8 +37,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js index 2160243458e..92e0af2e70a 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js @@ -79,8 +79,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.2.minified.js index 236d0a3d017..7e2184946f4 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.2.minified.js @@ -37,8 +37,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js index 2160243458e..92e0af2e70a 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js @@ -79,8 +79,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.2.minified.js index 236d0a3d017..7e2184946f4 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.2.minified.js @@ -37,8 +37,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.1.normal.js index 2d45f047f36..9e98c629b99 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.2.minified.js index f543b64dbba..c183ef954ff 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es2015.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es2015.1.normal.js index 78d9a340938..83fec77be1e 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es2015.1.normal.js @@ -12,19 +12,12 @@ var base; var derived; var derived2; var r = true ? 1 : 2; -var r3 = true ? 1 : { -}; +var r3 = true ? 1 : {}; var r4 = true ? a : b; // typeof a var r5 = true ? b : a; // typeof b -var r6 = true ? (x)=>{ -} : (x)=>{ -}; // returns number => void -var r7 = true ? (x)=>{ -} : (x)=>{ -}; -var r8 = true ? (x)=>{ -} : (x)=>{ -}; // returns Object => void +var r6 = true ? (x)=>{} : (x)=>{}; // returns number => void +var r7 = true ? (x)=>{} : (x)=>{}; +var r8 = true ? (x)=>{} : (x)=>{}; // returns Object => void var r10 = true ? derived : derived2; // no error since we use the contextual type in BCT var r11 = true ? base : derived2; function foo5(t, u) { diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.1.normal.js index 1ca393d7f8f..36795d4603e 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,19 +100,12 @@ var base; var derived; var derived2; var r = true ? 1 : 2; -var r3 = true ? 1 : { -}; +var r3 = true ? 1 : {}; var r4 = true ? a : b; // typeof a var r5 = true ? b : a; // typeof b -var r6 = true ? function(x) { -} : function(x) { -}; // returns number => void -var r7 = true ? function(x) { -} : function(x) { -}; -var r8 = true ? function(x) { -} : function(x) { -}; // returns Object => void +var r6 = true ? function(x) {} : function(x) {}; // returns number => void +var r7 = true ? function(x) {} : function(x) {}; +var r8 = true ? function(x) {} : function(x) {}; // returns Object => void var r10 = true ? derived : derived2; // no error since we use the contextual type in BCT var r11 = true ? base : derived2; function foo5(t, u) { diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.2.minified.js index f543b64dbba..c183ef954ff 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.1.normal.js index 3514ecc7d2c..dd4075e7fac 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.2.minified.js index c8f5cece5d0..1a6cd4d4503 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.1.normal.js index a3bc98c01d2..f40c4d783e5 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.1.normal.js @@ -10,13 +10,11 @@ function f3(x) { var E1; (function(E1) { E1[E1["one"] = 0] = "one"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["two"] = 0] = "two"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var t1; var t2; var t3; diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.2.minified.js index 5a0c2351171..21f4c6c2fd6 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es2015.2.minified.js @@ -1,7 +1,5 @@ var E1, E2, E1, E2, t1, t2, t3, t4; -(E1 = E1 || (E1 = { -}))[E1.one = 0] = "one", (E2 = E2 || (E2 = { -}))[E2.two = 0] = "two", t1 = [ +(E1 = E1 || (E1 = {}))[E1.one = 0] = "one", (E2 = E2 || (E2 = {}))[E2.two = 0] = "two", t1 = [ function(x) { return "foo"; }, diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.1.normal.js index a3bc98c01d2..f40c4d783e5 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.1.normal.js @@ -10,13 +10,11 @@ function f3(x) { var E1; (function(E1) { E1[E1["one"] = 0] = "one"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["two"] = 0] = "two"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var t1; var t2; var t3; diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.2.minified.js index 5a0c2351171..21f4c6c2fd6 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple_es5.2.minified.js @@ -1,7 +1,5 @@ var E1, E2, E1, E2, t1, t2, t3, t4; -(E1 = E1 || (E1 = { -}))[E1.one = 0] = "one", (E2 = E2 || (E2 = { -}))[E2.two = 0] = "two", t1 = [ +(E1 = E1 || (E1 = {}))[E1.one = 0] = "one", (E2 = E2 || (E2 = {}))[E2.two = 0] = "two", t1 = [ function(x) { return "foo"; }, diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.1.normal.js index 13de43a8017..2e8d0baa3d7 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.1.normal.js @@ -9,8 +9,7 @@ var ANY2 = [ var obj; var obj1 = { x: "", - y: ()=>{ - } + y: ()=>{} }; function foo() { var a; @@ -26,8 +25,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any other type var var ResultIsNumber = ~ANY1; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.2.minified.js index cb8f5dc04fa..7d50ab58725 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es2015.2.minified.js @@ -3,17 +3,14 @@ var M, ANY2 = [ "" ], obj1 = { x: "", - y: ()=>{ - } + y: ()=>{} }; class A { - static foo() { - } + static foo() {} } !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], obj1.y, objA.a, M.n, obj1.x; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.1.normal.js index 67948aab5a3..603d6a5508c 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.1.normal.js @@ -28,8 +28,7 @@ var ANY2 = [ var obj; var obj1 = { x: "", - y: function() { - } + y: function() {} }; function foo() { var a; @@ -55,8 +54,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any other type var var ResultIsNumber = ~ANY1; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.2.minified.js index 5cc64e9f29d..2ebce065d9c 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType_es5.2.minified.js @@ -3,8 +3,7 @@ var M, ANY2 = [ "" ], obj1 = { x: "", - y: function() { - } + y: function() {} }, A = function() { "use strict"; var Constructor; @@ -21,15 +20,13 @@ var M, ANY2 = [ })(Constructor = A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(); !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], obj1.y, objA.a, M.n, obj1.x; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.1.normal.js index 5f7ab2f3fbe..5c87fea9663 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.1.normal.js @@ -13,8 +13,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsNumber1 = ~BOOLEAN; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.2.minified.js index 65b9f6c5a71..294503578a1 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es2015.2.minified.js @@ -9,7 +9,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var M, objA = new A(); objA.a, foo(), A.foo(), foo(), objA.a; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.1.normal.js index a4d51b93b51..fb379c853dc 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.1.normal.js @@ -42,8 +42,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsNumber1 = ~BOOLEAN; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.2.minified.js index c6311cece82..823b28e436b 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithBooleanType_es5.2.minified.js @@ -26,7 +26,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.1.normal.js index ad5e6d95bb0..84056a4729c 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.1.normal.js @@ -5,8 +5,7 @@ ENUM1; ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.2.minified.js index ac940c04281..4cd29c4974f 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM1.A + ENUM1.B, ENUM1.A + ENUM1.B, ENUM1.A, ENUM1.A, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM1.A + ENUM1.B, ENUM1.A + ENUM1.B, ENUM1.A, ENUM1.A, ENUM1.B; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.1.normal.js index ad5e6d95bb0..84056a4729c 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.1.normal.js @@ -5,8 +5,7 @@ ENUM1; ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.2.minified.js index ac940c04281..4cd29c4974f 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM1.A + ENUM1.B, ENUM1.A + ENUM1.B, ENUM1.A, ENUM1.A, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM1.A + ENUM1.B, ENUM1.A + ENUM1.B, ENUM1.A, ENUM1.A, ENUM1.B; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.1.normal.js index e3e46fe0a0a..4eeef0b5c9e 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = ~NUMBER; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.2.minified.js index e9a7fe8a25d..483281d8468 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es2015.2.minified.js @@ -7,7 +7,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.1.normal.js index 9fca52f6226..efb9131a85c 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.1.normal.js @@ -46,8 +46,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = ~NUMBER; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.2.minified.js index a0266fa2414..5782b25902c 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithNumberType_es5.2.minified.js @@ -23,7 +23,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.1.normal.js index 1a8caddc11e..e2b9ac58e40 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsNumber1 = ~STRING; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.2.minified.js index 582da0d7546..8d3ce9882d7 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es2015.2.minified.js @@ -10,7 +10,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.1.normal.js index 79705082406..a2ab231a343 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.1.normal.js @@ -46,8 +46,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsNumber1 = ~STRING; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.2.minified.js index 9a048b7824d..8e87a47ca9a 100644 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithStringType_es5.2.minified.js @@ -26,7 +26,6 @@ var STRING, M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/callChainWithSuper_es2015.1.normal.js b/crates/swc/tests/tsc-references/callChainWithSuper_es2015.1.normal.js index 33c75fd8675..15db927b572 100644 --- a/crates/swc/tests/tsc-references/callChainWithSuper_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callChainWithSuper_es2015.1.normal.js @@ -3,8 +3,7 @@ // @noTypesAndSymbols: true // GH#34952 class Base { - method() { - } + method() {} } class Derived extends Base { method1() { diff --git a/crates/swc/tests/tsc-references/callChainWithSuper_es5.1.normal.js b/crates/swc/tests/tsc-references/callChainWithSuper_es5.1.normal.js index b340980cbdd..6c3c88fd097 100644 --- a/crates/swc/tests/tsc-references/callChainWithSuper_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callChainWithSuper_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -118,8 +117,7 @@ var Base = // @target: *,-es3 _createClass(Base, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return Base; diff --git a/crates/swc/tests/tsc-references/callChainWithSuper_es5.2.minified.js b/crates/swc/tests/tsc-references/callChainWithSuper_es5.2.minified.js index b5a6af74788..3fa80e5aca7 100644 --- a/crates/swc/tests/tsc-references/callChainWithSuper_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callChainWithSuper_es5.2.minified.js @@ -41,8 +41,7 @@ var Base = function() { return _createClass(Base, [ { key: "method", - value: function() { - } + value: function() {} } ]), Base; }(), Derived1 = function(Base) { @@ -63,8 +62,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es2015.1.normal.js index 33945dce1b9..56ccd5b5c3d 100644 --- a/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es2015.1.normal.js @@ -7,5 +7,4 @@ */ function Dependency(j) { return j; } -Dependency({ -}); +Dependency({}); diff --git a/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es5.1.normal.js index 33945dce1b9..56ccd5b5c3d 100644 --- a/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callOfPropertylessConstructorFunction_es5.1.normal.js @@ -7,5 +7,4 @@ */ function Dependency(j) { return j; } -Dependency({ -}); +Dependency({}); diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es2015.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es2015.1.normal.js index a86d534c161..cd413c6cb2c 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es2015.1.normal.js @@ -10,5 +10,4 @@ var Errors; } class OtherDerived extends Base { } -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.1.normal.js index d98bd20fb6d..d169eda9885 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -107,5 +106,4 @@ var Errors; } return OtherDerived; }(Base); -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.2.minified.js index 77021541b9f..027d2d46b5e 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,5 +74,4 @@ function _createSuper(Derived) { } return OtherDerived; }(Base1); -}(Errors || (Errors = { -})); +}(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es2015.1.normal.js b/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es2015.1.normal.js index 5c496b6f4fd..7c0c78e0732 100644 --- a/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es2015.1.normal.js @@ -1,6 +1,5 @@ // Call signatures without a return type annotation and function body return 'any' -function foo(x) { -} +function foo(x) {} var r = foo(1); // void since there's a body var i; var r2 = i(); diff --git a/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es5.1.normal.js index 5c496b6f4fd..7c0c78e0732 100644 --- a/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureWithoutAnnotationsOrBody_es5.1.normal.js @@ -1,6 +1,5 @@ // Call signatures without a return type annotation and function body return 'any' -function foo(x) { -} +function foo(x) {} var r = foo(1); // void since there's a body var i; var r2 = i(); diff --git a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.1.normal.js index e80ef88dea0..7a3c10f702c 100644 --- a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.1.normal.js @@ -26,8 +26,7 @@ function foo5(x) { } var r5 = foo5(1); function foo6(x) { - try { - } catch (e) { + try {} catch (e) { return []; } finally{ return []; @@ -63,8 +62,7 @@ var M; class C1 { } M1.C = C1; -})(M || (M = { -})); +})(M || (M = {})); function foo11() { return M; } @@ -79,20 +77,17 @@ function m1() { } (function(m11) { var y = m11.y = 2; -})(m1 || (m1 = { -})); +})(m1 || (m1 = {})); function foo13() { return m1; } var r13 = foo13(); class c1 { - constructor(x){ - } + constructor(x){} } (function(c11) { var x = c11.x = 1; -})(c1 || (c1 = { -})); +})(c1 || (c1 = {})); function foo14() { return c1; } @@ -100,12 +95,10 @@ var r14 = foo14(); var e1; (function(e1) { e1[e1["A"] = 0] = "A"; -})(e1 || (e1 = { -})); +})(e1 || (e1 = {})); (function(e1) { var y = e1.y = 1; -})(e1 || (e1 = { -})); +})(e1 || (e1 = {})); function foo15() { return e1; } diff --git a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.2.minified.js index 77359120743..3e6c7d64634 100644 --- a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es2015.2.minified.js @@ -6,20 +6,12 @@ function m1() { return 1; } foo3(), (function(x) { - try { - } catch (e) { + try {} catch (e) { return []; - } finally{ - } -})(1), (M1 = M || (M = { -})).x = 1, M1.C = class { -}, (m1 || (m1 = { -})).y = 2; + } finally{} +})(1), (M1 = M || (M = {})).x = 1, M1.C = class { +}, (m1 || (m1 = {})).y = 2; class c1 { - constructor(x){ - } + constructor(x){} } -(c1 || (c1 = { -})).x = 1, (e1 = e1 || (e1 = { -}))[e1.A = 0] = "A", (e1 || (e1 = { -})).y = 1; +(c1 || (c1 = {})).x = 1, (e1 = e1 || (e1 = {}))[e1.A = 0] = "A", (e1 || (e1 = {})).y = 1; diff --git a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.1.normal.js index 0a241c14891..10baed7bdfb 100644 --- a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.1.normal.js @@ -34,8 +34,7 @@ function foo5(x) { } var r5 = foo5(1); function foo6(x) { - try { - } catch (e) { + try {} catch (e) { return []; } finally{ return []; @@ -75,8 +74,7 @@ var M; _classCallCheck(this, C); }; M1.C = C; -})(M || (M = { -})); +})(M || (M = {})); function foo11() { return M; } @@ -91,8 +89,7 @@ function m1() { } (function(m11) { var y = m11.y = 2; -})(m1 || (m1 = { -})); +})(m1 || (m1 = {})); function foo13() { return m1; } @@ -103,8 +100,7 @@ var c1 = function c1(x) { }; (function(c1) { var x = c1.x = 1; -})(c1 || (c1 = { -})); +})(c1 || (c1 = {})); function foo14() { return c1; } @@ -112,12 +108,10 @@ var r14 = foo14(); var e1; (function(e1) { e1[e1["A"] = 0] = "A"; -})(e1 || (e1 = { -})); +})(e1 || (e1 = {})); (function(e1) { var y = e1.y = 1; -})(e1 || (e1 = { -})); +})(e1 || (e1 = {})); function foo15() { return e1; } diff --git a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.2.minified.js index 1f000927327..916a2b2317d 100644 --- a/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignatureWithoutReturnTypeAnnotationInference_es5.2.minified.js @@ -5,11 +5,9 @@ function foo3() { return foo3(); } foo3(), (function(x) { - try { - } catch (e) { + try {} catch (e) { return []; - } finally{ - } + } finally{} })(1), (function(x) { var obj; void 0 === x || (obj = x) && "undefined" != typeof Symbol && obj.constructor === Symbol; @@ -28,14 +26,9 @@ function m1() { _classCallCheck(this, C1); }; M1.C = C1; -}(M || (M = { -})), (m1 || (m1 = { -})).y = 2; +}(M || (M = {})), (m1 || (m1 = {})).y = 2; var M, e1, c1 = function(x) { "use strict"; _classCallCheck(this, c1); }; -(c1 || (c1 = { -})).x = 1, (e1 = e1 || (e1 = { -}))[e1.A = 0] = "A", (e1 || (e1 = { -})).y = 1; +(c1 || (c1 = {})).x = 1, (e1 = e1 || (e1 = {}))[e1.A = 0] = "A", (e1 || (e1 = {})).y = 1; diff --git a/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es2015.1.normal.js index cb5452d16e8..3d045f74827 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es2015.1.normal.js @@ -1,38 +1,22 @@ // Duplicate parameter names are always an error -function foo(x, x) { -} -var f = function foo(x, x) { -}; -var f2 = function(x, x) { -}; -var f3 = (x, x)=>{ -}; -var f4 = (x, x)=>{ -}; -function foo2(x, x) { -} -var f5 = function foo(x, x) { -}; -var f6 = function(x, x) { -}; -var f7 = (x, x)=>{ -}; -var f8 = (x, y)=>{ -}; +function foo(x, x) {} +var f = function foo(x, x) {}; +var f2 = function(x, x) {}; +var f3 = (x, x)=>{}; +var f4 = (x, x)=>{}; +function foo2(x, x) {} +var f5 = function foo(x, x) {}; +var f6 = function(x, x) {}; +var f7 = (x, x)=>{}; +var f8 = (x, y)=>{}; class C { - foo(x, x) { - } - foo2(x, x) { - } - foo3(x, x) { - } + foo(x, x) {} + foo2(x, x) {} + foo3(x, x) {} } var a; var b = { - foo (x, x) { - }, - a: function foo(x, x) { - }, - b: (x, x)=>{ - } + foo (x, x) {}, + a: function foo(x, x) {}, + b: (x, x)=>{} }; diff --git a/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.1.normal.js index 5edae9506d8..34270b03061 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.1.normal.js @@ -18,26 +18,16 @@ function _createClass(Constructor, protoProps, staticProps) { return Constructor; } // Duplicate parameter names are always an error -function foo(x, x) { -} -var f = function foo(x, x) { -}; -var f2 = function f2(x, x) { -}; -var f3 = function(x, x) { -}; -var f4 = function(x, x) { -}; -function foo2(x, x) { -} -var f5 = function foo(x, x) { -}; -var f6 = function f6(x, x) { -}; -var f7 = function(x, x) { -}; -var f8 = function(x, y) { -}; +function foo(x, x) {} +var f = function foo(x, x) {}; +var f2 = function f2(x, x) {}; +var f3 = function(x, x) {}; +var f4 = function(x, x) {}; +function foo2(x, x) {} +var f5 = function foo(x, x) {}; +var f6 = function f6(x, x) {}; +var f7 = function(x, x) {}; +var f8 = function(x, y) {}; var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -46,28 +36,22 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x, x) { - } + value: function foo(x, x) {} }, { key: "foo2", - value: function foo2(x, x) { - } + value: function foo2(x, x) {} }, { key: "foo3", - value: function foo3(x, x) { - } + value: function foo3(x, x) {} } ]); return C; }(); var a; var b = { - foo: function foo(x, x) { - }, - a: function foo(x, x) { - }, - b: function(x, x) { - } + foo: function foo(x, x) {}, + a: function foo(x, x) {}, + b: function(x, x) {} }; diff --git a/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.2.minified.js index dd1dd2b7cb6..8f8db4bf385 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithDuplicateParameters_es5.2.minified.js @@ -15,18 +15,15 @@ var C = function() { return Constructor = C, protoProps = [ { key: "foo", - value: function(x, x) { - } + value: function(x, x) {} }, { key: "foo2", - value: function(x, x) { - } + value: function(x, x) {} }, { key: "foo3", - value: function(x, x) { - } + value: function(x, x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.1.normal.js index ad91e13b40e..1bb2e76010e 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.1.normal.js @@ -1,16 +1,12 @@ -function foo(x) { -} +function foo(x) {} foo(1); foo(); -function foo2(x, y) { -} +function foo2(x, y) {} foo2(1); foo2(1, 2); class C { - foo(x) { - } - foo2(x, y) { - } + foo(x) {} + foo2(x, y) {} } var c; c.foo(); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.2.minified.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.2.minified.js index c7cc9128ed6..5f881c2fdad 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es2015.2.minified.js @@ -1,6 +1,4 @@ var c, i, a; -function foo(x) { -} -function foo2(x, y) { -} +function foo(x) {} +function foo2(x, y) {} foo(1), foo(), foo2(1), foo2(1, 2), c.foo(), c.foo(1), c.foo2(1), c.foo2(1, 2), i(), i(1), i(1, 2), i.foo(1), i.foo(1, 2), i.foo(1, 2, 3), a(), a(1), a(1, 2), a.foo(1), a.foo(1, 2), a.foo(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.1.normal.js index 336a3e59db4..97525a9b44c 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.1.normal.js @@ -17,12 +17,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function foo(x) { -} +function foo(x) {} foo(1); foo(); -function foo2(x, y) { -} +function foo2(x, y) {} foo2(1); foo2(1, 2); var C = /*#__PURE__*/ function() { @@ -33,13 +31,11 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} }, { key: "foo2", - value: function foo2(x, y) { - } + value: function foo2(x, y) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.2.minified.js index 88f79fdd45e..52bbad244b7 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters2_es5.2.minified.js @@ -4,10 +4,8 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -function foo(x) { -} -function foo2(x, y) { -} +function foo(x) {} +function foo2(x, y) {} foo(1), foo(), foo2(1), foo2(1, 2); var c, i, a, C = function() { "use strict"; @@ -20,13 +18,11 @@ var c, i, a, C = function() { return Constructor = C, protoProps = [ { key: "foo", - value: function(x) { - } + value: function(x) {} }, { key: "foo2", - value: function(x, y) { - } + value: function(x, y) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.1.normal.js index 787c22f3c5f..4c337718d79 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.1.normal.js @@ -1,10 +1,7 @@ // Optional parameters should be valid in all the below casts -function foo(x) { -} -var f = function foo(x) { -}; -var f2 = (x, y)=>{ -}; +function foo(x) {} +var f = function foo(x) {}; +var f2 = (x, y)=>{}; foo(1); foo(); f(1); @@ -12,8 +9,7 @@ f(); f2(1); f2(1, 2); class C { - foo(x) { - } + foo(x) {} } var c; c.foo(); @@ -29,12 +25,9 @@ a(1); a.foo(); a.foo(1); var b = { - foo (x) { - }, - a: function foo(x, y) { - }, - b: (x)=>{ - } + foo (x) {}, + a: function foo(x, y) {}, + b: (x)=>{} }; b.foo(); b.foo(1); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.2.minified.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.2.minified.js index ac98f528d2e..119e8fce80c 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es2015.2.minified.js @@ -1,15 +1,9 @@ -function foo(x) { -} -var c, i, a, f = function(x) { -}, f2 = (x, y)=>{ -}; +function foo(x) {} +var c, i, a, f = function(x) {}, f2 = (x, y)=>{}; foo(1), foo(), f(1), f(), f2(1), f2(1, 2), c.foo(), c.foo(1), i(), i(1), i.foo(1), i.foo(1, 2), a(), a(1), a.foo(), a.foo(1); var b = { - foo (x) { - }, - a: function(x, y) { - }, - b: (x)=>{ - } + foo (x) {}, + a: function(x, y) {}, + b: (x)=>{} }; b.foo(), b.foo(1), b.a(1), b.a(1, 2), b.b(), b.b(1); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.1.normal.js index fcecb7c8ec9..a0169a7e1d7 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.1.normal.js @@ -18,12 +18,9 @@ function _createClass(Constructor, protoProps, staticProps) { return Constructor; } // Optional parameters should be valid in all the below casts -function foo(x) { -} -var f = function foo(x) { -}; -var f2 = function(x, y) { -}; +function foo(x) {} +var f = function foo(x) {}; +var f2 = function(x, y) {}; foo(1); foo(); f(1); @@ -38,8 +35,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; @@ -58,12 +54,9 @@ a(1); a.foo(); a.foo(1); var b = { - foo: function foo(x) { - }, - a: function foo(x, y) { - }, - b: function(x) { - } + foo: function foo(x) {}, + a: function foo(x, y) {}, + b: function(x) {} }; b.foo(); b.foo(1); diff --git a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.2.minified.js b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.2.minified.js index 76a66cd4a3d..71af973e366 100644 --- a/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignaturesWithOptionalParameters_es5.2.minified.js @@ -4,11 +4,8 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -function foo(x) { -} -var c, i, a, f = function(x) { -}, f2 = function(x, y) { -}; +function foo(x) {} +var c, i, a, f = function(x) {}, f2 = function(x, y) {}; foo(1), foo(), f(1), f(), f2(1), f2(1, 2); var C = function() { "use strict"; @@ -21,18 +18,14 @@ var C = function() { return Constructor = C, protoProps = [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); c.foo(), c.foo(1), i(), i(1), i.foo(1), i.foo(1, 2), a(), a(1), a.foo(), a.foo(1); var b = { - foo: function(x) { - }, - a: function(x, y) { - }, - b: function(x) { - } + foo: function(x) {}, + a: function(x, y) {}, + b: function(x) {} }; b.foo(), b.foo(1), b.a(1), b.a(1, 2), b.b(), b.b(1); diff --git a/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.1.normal.js b/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.1.normal.js index fa765fd1106..71b54cdf98b 100644 --- a/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.1.normal.js @@ -21,8 +21,7 @@ xNever.f() // error, never still expects an argument ; // Promise has previously been updated to work without arguments, but to show this fixes the issue too. class MyPromise { - constructor(executor){ - } + constructor(executor){} } new MyPromise((resolve)=>resolve() ); // no error @@ -35,19 +34,16 @@ new MyPromise((resolve)=>resolve() new MyPromise((resolve)=>resolve() ); // error, `never` arguments cannot be omitted // Multiple parameters -function a(x, y, z) { -} +function a(x, y, z) {} a(4, "hello"); // ok a(4, "hello", void 0); // ok a(4); // not ok -function b(x, y, z, what) { -} +function b(x, y, z, what) {} b(4, "hello", void 0, 2); // ok b(4, "hello"); // not ok b(4, "hello", void 0); // not ok b(4); // not ok -function c(x, y, z) { -} +function c(x, y, z) {} c(3, void 0, void 0); // ok c(3, void 0); // ok c(3); // ok diff --git a/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.2.minified.js b/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.2.minified.js index af7e57de427..a8a820b397a 100644 --- a/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithMissingVoid_es2015.2.minified.js @@ -1,14 +1,10 @@ x.f(), xUnion.f(42), xUnion.f(), xAny.f(), xUnknown.f(), xNever.f(); class MyPromise { - constructor(executor){ - } -} -function a(x, y, z) { -} -function b(x, y, z, what) { -} -function c(x, y, z) { + constructor(executor){} } +function a(x, y, z) {} +function b(x, y, z, what) {} +function c(x, y, z) {} new MyPromise((resolve)=>resolve() ), new MyPromise((resolve)=>resolve() ), new MyPromise((resolve)=>resolve() diff --git a/crates/swc/tests/tsc-references/callWithMissingVoid_es5.1.normal.js b/crates/swc/tests/tsc-references/callWithMissingVoid_es5.1.normal.js index d162ea77361..23353eabc14 100644 --- a/crates/swc/tests/tsc-references/callWithMissingVoid_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithMissingVoid_es5.1.normal.js @@ -68,19 +68,16 @@ new MyPromise(function(resolve) { return resolve(); }); // error, `never` arguments cannot be omitted // Multiple parameters -function a(x, y, z) { -} +function a(x, y, z) {} a(4, "hello"); // ok a(4, "hello", void 0); // ok a(4); // not ok -function b(x, y, z, what) { -} +function b(x, y, z, what) {} b(4, "hello", void 0, 2); // ok b(4, "hello"); // not ok b(4, "hello", void 0); // not ok b(4); // not ok -function c(x, y, z) { -} +function c(x, y, z) {} c(3, void 0, void 0); // ok c(3, void 0); // ok c(3); // ok diff --git a/crates/swc/tests/tsc-references/callWithMissingVoid_es5.2.minified.js b/crates/swc/tests/tsc-references/callWithMissingVoid_es5.2.minified.js index 6107029f909..0d8f5917e5b 100644 --- a/crates/swc/tests/tsc-references/callWithMissingVoid_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithMissingVoid_es5.2.minified.js @@ -29,12 +29,9 @@ var MyPromise = function(executor) { "use strict"; _classCallCheck(this, MyPromise); }; -function a(x, y, z) { -} -function b(x, y, z, what) { -} -function c(x, y, z) { -} +function a(x, y, z) {} +function b(x, y, z, what) {} +function c(x, y, z) {} new MyPromise(function(resolve) { return resolve(); }), new MyPromise(function(resolve) { diff --git a/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.1.normal.js index e45eedea16a..b269df2c87a 100644 --- a/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo(x, y, ...z) { -} +function foo(x, y, ...z) {} var a; var z; var obj; @@ -22,8 +21,7 @@ xa[1].foo(...[ "abc" ]); class C { - foo(x, y, ...z) { - } + foo(x, y, ...z) {} constructor(x, y, ...z1){ this.foo(x, y); this.foo(x, y, ...z1); diff --git a/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.2.minified.js index eb354c448ef..1b47d7ddb8a 100644 --- a/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithSpreadES6_es2015.2.minified.js @@ -1,6 +1,5 @@ var a, obj, xa; -function foo(x, y, ...z) { -} +function foo(x, y, ...z) {} foo(1, 2, "abc"), foo(1, 2, ...a), foo(1, 2, ...a, "abc"), obj.foo(1, 2, "abc"), obj.foo(1, 2, ...a), obj.foo(1, 2, ...a, "abc"), obj.foo(1, 2, "abc"), obj.foo(1, 2, ...a), obj.foo(1, 2, ...a, "abc"), xa[1].foo(1, 2, "abc"), xa[1].foo(1, 2, ...a), xa[1].foo(1, 2, ...a, "abc"), xa[1].foo(...[ 1, 2, diff --git a/crates/swc/tests/tsc-references/callWithSpreadES6_es5.1.normal.js b/crates/swc/tests/tsc-references/callWithSpreadES6_es5.1.normal.js index ab483d84c52..9af9f5b22d8 100644 --- a/crates/swc/tests/tsc-references/callWithSpreadES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithSpreadES6_es5.1.normal.js @@ -111,8 +111,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/callWithSpreadES6_es5.2.minified.js b/crates/swc/tests/tsc-references/callWithSpreadES6_es5.2.minified.js index ed4000b8290..4a7f21c06ea 100644 --- a/crates/swc/tests/tsc-references/callWithSpreadES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithSpreadES6_es5.2.minified.js @@ -130,8 +130,7 @@ var _obj, _obj1, _instance, _instance1, a, obj, xa, C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/callWithSpread_es2015.1.normal.js b/crates/swc/tests/tsc-references/callWithSpread_es2015.1.normal.js index 5c334a7e9f0..88121182d51 100644 --- a/crates/swc/tests/tsc-references/callWithSpread_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithSpread_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo(x, y, ...z) { -} +function foo(x, y, ...z) {} var a; var z; var obj; @@ -28,8 +27,7 @@ xa[1].foo(...[ "abc" ]); class C { - foo(x, y, ...z) { - } + foo(x, y, ...z) {} constructor(x, y, ...z1){ this.foo(x, y); this.foo(x, y, ...z1); diff --git a/crates/swc/tests/tsc-references/callWithSpread_es2015.2.minified.js b/crates/swc/tests/tsc-references/callWithSpread_es2015.2.minified.js index e63312f8122..2d87c0e5ff1 100644 --- a/crates/swc/tests/tsc-references/callWithSpread_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithSpread_es2015.2.minified.js @@ -1,6 +1,5 @@ var a, obj, xa; -function foo(x, y, ...z) { -} +function foo(x, y, ...z) {} foo(1, 2, "abc"), foo(1, 2, ...a), foo(1, 2, ...a, "abc"), obj.foo(1, 2, "abc"), obj.foo(1, 2, ...a), obj.foo(1, 2, ...a, "abc"), obj.foo(1, 2, ...a).foo(1, 2, "abc"), obj.foo(1, 2, ...a).foo(1, 2, ...a), obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc"), obj.foo(1, 2, "abc"), obj.foo(1, 2, ...a), obj.foo(1, 2, ...a, "abc"), obj.foo(1, 2, ...a).foo(1, 2, "abc"), obj.foo(1, 2, ...a).foo(1, 2, ...a), obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc"), xa[1].foo(1, 2, "abc"), xa[1].foo(1, 2, ...a), xa[1].foo(1, 2, ...a, "abc"), xa[1].foo(...[ 1, 2, diff --git a/crates/swc/tests/tsc-references/callWithSpread_es5.1.normal.js b/crates/swc/tests/tsc-references/callWithSpread_es5.1.normal.js index cf0b6613375..9ce57df40a2 100644 --- a/crates/swc/tests/tsc-references/callWithSpread_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithSpread_es5.1.normal.js @@ -111,8 +111,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/callWithSpread_es5.2.minified.js b/crates/swc/tests/tsc-references/callWithSpread_es5.2.minified.js index 82aa888465d..9e0bf962848 100644 --- a/crates/swc/tests/tsc-references/callWithSpread_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithSpread_es5.2.minified.js @@ -164,8 +164,7 @@ var _obj, _obj1, _obj2, _obj3, _instance, _obj4, _instance1, _instance2, _instan if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/castingTuple_es2015.1.normal.js b/crates/swc/tests/tsc-references/castingTuple_es2015.1.normal.js index 24c1010e6e8..76e5e1a9776 100644 --- a/crates/swc/tests/tsc-references/castingTuple_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/castingTuple_es2015.1.normal.js @@ -14,13 +14,11 @@ class F extends A { var E1; (function(E1) { E1[E1["one"] = 0] = "one"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["one"] = 0] = "one"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); // no error var numStrTuple = [ 5, diff --git a/crates/swc/tests/tsc-references/castingTuple_es2015.2.minified.js b/crates/swc/tests/tsc-references/castingTuple_es2015.2.minified.js index db6c02a71f6..7143673bfa9 100644 --- a/crates/swc/tests/tsc-references/castingTuple_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/castingTuple_es2015.2.minified.js @@ -2,9 +2,7 @@ class C { } class D { } -(E1 = E1 || (E1 = { -}))[E1.one = 0] = "one", (E2 = E2 || (E2 = { -}))[E2.one = 0] = "one"; +(E1 = E1 || (E1 = {}))[E1.one = 0] = "one", (E2 = E2 || (E2 = {}))[E2.one = 0] = "one"; var E1, E2, E1, E2, classCDATuple = [ new C(), new D() diff --git a/crates/swc/tests/tsc-references/castingTuple_es5.1.normal.js b/crates/swc/tests/tsc-references/castingTuple_es5.1.normal.js index dcfc0273195..82775a2a566 100644 --- a/crates/swc/tests/tsc-references/castingTuple_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/castingTuple_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,13 +104,11 @@ var F = /*#__PURE__*/ function(A) { var E1; (function(E1) { E1[E1["one"] = 0] = "one"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["one"] = 0] = "one"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); // no error var numStrTuple = [ 5, diff --git a/crates/swc/tests/tsc-references/castingTuple_es5.2.minified.js b/crates/swc/tests/tsc-references/castingTuple_es5.2.minified.js index c6a8d9d755e..1a3a90cf1fe 100644 --- a/crates/swc/tests/tsc-references/castingTuple_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/castingTuple_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -71,9 +70,7 @@ var E1, E2, E1, A = function() { } return F; }(A); -(E1 = E1 || (E1 = { -}))[E1.one = 0] = "one", (E2 = E2 || (E2 = { -}))[E2.one = 0] = "one"; +(E1 = E1 || (E1 = {}))[E1.one = 0] = "one", (E2 = E2 || (E2 = {}))[E2.one = 0] = "one"; var E2, classCDATuple = [ new C(), new D() diff --git a/crates/swc/tests/tsc-references/chained2_es2015.1.normal.js b/crates/swc/tests/tsc-references/chained2_es2015.1.normal.js index f0a7d9b7290..96fc9215cf6 100644 --- a/crates/swc/tests/tsc-references/chained2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/chained2_es2015.1.normal.js @@ -9,7 +9,5 @@ export { A }; export { types as default }; new types.A(); new types.B(); -const a = { -}; -const b = { -}; +const a = {}; +const b = {}; diff --git a/crates/swc/tests/tsc-references/chained2_es5.1.normal.js b/crates/swc/tests/tsc-references/chained2_es5.1.normal.js index 152cfd4ed91..910fd93758c 100644 --- a/crates/swc/tests/tsc-references/chained2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/chained2_es5.1.normal.js @@ -15,7 +15,5 @@ export { A }; export { types as default }; new types.A(); new types.B(); -var a = { -}; -var b = { -}; +var a = {}; +var b = {}; diff --git a/crates/swc/tests/tsc-references/chained_es2015.1.normal.js b/crates/swc/tests/tsc-references/chained_es2015.1.normal.js index 3b2806e0006..1cf075f2c44 100644 --- a/crates/swc/tests/tsc-references/chained_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/chained_es2015.1.normal.js @@ -5,5 +5,4 @@ class A { } export { B as C } from './a'; new D(); -const d = { -}; +const d = {}; diff --git a/crates/swc/tests/tsc-references/chained_es5.1.normal.js b/crates/swc/tests/tsc-references/chained_es5.1.normal.js index 38ed988a834..e850fc985aa 100644 --- a/crates/swc/tests/tsc-references/chained_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/chained_es5.1.normal.js @@ -11,5 +11,4 @@ var A = function A() { }; export { B as C } from './a'; new D(); -var d = { -}; +var d = {}; diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.1.normal.js index 2992e43c4d3..867210fb893 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.1.normal.js @@ -17,8 +17,7 @@ Object.defineProperty(exports, "rwAccessors", { get () { return 98122; }, - set (_) { - } + set (_) {} }); Object.defineProperty(exports, "readonlyAccessor", { get () { @@ -43,8 +42,7 @@ Object.defineProperty(module.exports, "rwAccessors", { get () { return 98122; }, - set (_) { - } + set (_) {} }); Object.defineProperty(module.exports, "readonlyAccessor", { get () { diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.2.minified.js index d70806fa256..3668744a06c 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es2015.2.minified.js @@ -9,8 +9,7 @@ Object.defineProperty(exports, "thing", { get () { return 98122; }, - set (_) { - } + set (_) {} }), Object.defineProperty(exports, "readonlyAccessor", { get () { return 21.75; @@ -29,8 +28,7 @@ Object.defineProperty(exports, "thing", { get () { return 98122; }, - set (_) { - } + set (_) {} }), Object.defineProperty(module.exports, "readonlyAccessor", { get () { return 21.75; diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.1.normal.js index 3d056d76962..85ea5ed823e 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.1.normal.js @@ -17,8 +17,7 @@ Object.defineProperty(exports, "rwAccessors", { get: function get() { return 98122; }, - set: function set(_) { - } + set: function set(_) {} }); Object.defineProperty(exports, "readonlyAccessor", { get: function get() { @@ -43,8 +42,7 @@ Object.defineProperty(module.exports, "rwAccessors", { get: function get() { return 98122; }, - set: function set(_) { - } + set: function set(_) {} }); Object.defineProperty(module.exports, "readonlyAccessor", { get: function get() { diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.2.minified.js index 34f22a33e82..e31a0a91a70 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignProperty_es5.2.minified.js @@ -9,8 +9,7 @@ Object.defineProperty(exports, "thing", { get: function() { return 98122; }, - set: function(_) { - } + set: function(_) {} }), Object.defineProperty(exports, "readonlyAccessor", { get: function() { return 21.75; @@ -29,8 +28,7 @@ Object.defineProperty(exports, "thing", { get: function() { return 98122; }, - set: function(_) { - } + set: function(_) {} }), Object.defineProperty(module.exports, "readonlyAccessor", { get: function() { return 21.75; diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.1.normal.js index ae406dea627..0a087c77139 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.1.normal.js @@ -26,8 +26,7 @@ Object.defineProperty(Person.prototype, "rwAccessors", { get () { return 98122; }, - set (_) { - } + set (_) {} }); Object.defineProperty(Person.prototype, "readonlyAccessor", { get () { diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.2.minified.js index a1129987f4e..31abe28414e 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es2015.2.minified.js @@ -14,8 +14,7 @@ Person.prototype.describe = function() { get () { return 98122; }, - set (_) { - } + set (_) {} }), Object.defineProperty(Person.prototype, "readonlyAccessor", { get () { return 21.75; diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.1.normal.js index 125041be3f9..57763f72d0b 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.1.normal.js @@ -26,8 +26,7 @@ Object.defineProperty(Person.prototype, "rwAccessors", { get: function get() { return 98122; }, - set: function set(_) { - } + set: function set(_) {} }); Object.defineProperty(Person.prototype, "readonlyAccessor", { get: function get() { diff --git a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.2.minified.js index d5421bdaf13..1e07d2f7fbf 100644 --- a/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkExportsObjectAssignPrototypeProperty_es5.2.minified.js @@ -14,8 +14,7 @@ Person.prototype.describe = function() { get: function() { return 98122; }, - set: function(_) { - } + set: function(_) {} }), Object.defineProperty(Person.prototype, "readonlyAccessor", { get: function() { return 21.75; diff --git a/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es2015.1.normal.js index d5461d116c7..76f441516c1 100644 --- a/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es2015.1.normal.js @@ -6,5 +6,4 @@ * @param {number} a * @param {number} [b] * @param {number} c - */ function foo(a, b, c) { -} + */ function foo(a, b, c) {} diff --git a/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es5.1.normal.js index d5461d116c7..76f441516c1 100644 --- a/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocOptionalParamOrder_es5.1.normal.js @@ -6,5 +6,4 @@ * @param {number} a * @param {number} [b] * @param {number} c - */ function foo(a, b, c) { -} + */ function foo(a, b, c) {} diff --git a/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es2015.1.normal.js index 4150f3939eb..b3cbf131d85 100644 --- a/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es2015.1.normal.js @@ -5,15 +5,11 @@ /** * @param {number=} n * @param {string} [s] - */ var x = function foo(n, s) { -}; + */ var x = function foo(n, s) {}; var y; /** * @param {boolean!} b - */ y = function bar(b) { -}; + */ y = function bar(b) {}; /** * @param {string} s - */ var one = function(s) { -}, two = function(untyped) { -}; + */ var one = function(s) {}, two = function(untyped) {}; diff --git a/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es5.1.normal.js index e8596d1cc71..4922ed5cc05 100644 --- a/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocParamOnVariableDeclaredFunctionExpression_es5.1.normal.js @@ -5,15 +5,11 @@ /** * @param {number=} n * @param {string} [s] - */ var x = function foo(n, s) { -}; + */ var x = function foo(n, s) {}; var y; /** * @param {boolean!} b - */ y = function bar(b) { -}; + */ y = function bar(b) {}; /** * @param {string} s - */ var one = function one(s) { -}, two = function two(untyped) { -}; + */ var one = function one(s) {}, two = function two(untyped) {}; diff --git a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.1.normal.js index 8f9a2cf0d55..50d802a4bdc 100644 --- a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.1.normal.js @@ -5,8 +5,7 @@ /** * @param {number=} n * @param {string} [s] - */ function foo(n, s) { -} + */ function foo(n, s) {} foo(); foo(1); foo(1, "hi"); diff --git a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.2.minified.js index 3b4ea3cde78..6b9bbb5c923 100644 --- a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es2015.2.minified.js @@ -1,3 +1,2 @@ -function foo(n, s) { -} +function foo(n, s) {} foo(), foo(1), foo(1, "hi"); diff --git a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.1.normal.js index 8f9a2cf0d55..50d802a4bdc 100644 --- a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.1.normal.js @@ -5,8 +5,7 @@ /** * @param {number=} n * @param {string} [s] - */ function foo(n, s) { -} + */ function foo(n, s) {} foo(); foo(1); foo(1, "hi"); diff --git a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.2.minified.js index 3b4ea3cde78..6b9bbb5c923 100644 --- a/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocParamTag1_es5.2.minified.js @@ -1,3 +1,2 @@ -function foo(n, s) { -} +function foo(n, s) {} foo(), foo(1), foo(1, "hi"); diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es2015.1.normal.js index 97a1cc9285f..acc5bee2d49 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es2015.1.normal.js @@ -22,9 +22,7 @@ x1(0); x2(0); /** * @type {object} - */ var props = { -}; + */ var props = {}; /** * @type {Object} - */ var props = { -}; + */ var props = {}; diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es5.1.normal.js index d4991d07d2e..9295e66e3ae 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag1_es5.1.normal.js @@ -26,9 +26,7 @@ x1(0); x2(0); /** * @type {object} - */ var props = { -}; + */ var props = {}; /** * @type {Object} - */ var props = { -}; + */ var props = {}; diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es2015.1.normal.js index 6b1d4301523..fbc1b22ee12 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es2015.1.normal.js @@ -5,8 +5,7 @@ /** @type {number} */ function f() { return 1; } -/** @type {{ prop: string }} */ var g = function(prop) { -}; +/** @type {{ prop: string }} */ var g = function(prop) {}; /** @type {(a: number) => number} */ function add1(a, b) { return a + b; } diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es5.1.normal.js index d37457f6a1e..a2d26f47de4 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag6_es5.1.normal.js @@ -5,8 +5,7 @@ /** @type {number} */ function f() { return 1; } -/** @type {{ prop: string }} */ var g = function g(prop) { -}; +/** @type {{ prop: string }} */ var g = function g(prop) {}; /** @type {(a: number) => number} */ function add1(a, b) { return a + b; } diff --git a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.1.normal.js index 97e37b55f0c..bb854dc1fdd 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.1.normal.js @@ -2,8 +2,7 @@ // @suppressOutputPathCheck: true // @filename: 0.js // @ts-check -var exports = { -}; +var exports = {}; /** * @typedef {string} */ exports.SomeName; diff --git a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.2.minified.js index c1d3085267b..8f2a3a1b322 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es2015.2.minified.js @@ -1,2 +1 @@ -({ -}).SomeName; +({}).SomeName; diff --git a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.1.normal.js index a1ae6ab9243..c411b7d0a6c 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.1.normal.js @@ -2,8 +2,7 @@ // @suppressOutputPathCheck: true // @filename: 0.js // @ts-check -var exports = { -}; +var exports = {}; /** * @typedef {string} */ exports.SomeName; diff --git a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.2.minified.js index c1d3085267b..8f2a3a1b322 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile_es5.2.minified.js @@ -1,2 +1 @@ -({ -}).SomeName; +({}).SomeName; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.1.normal.js index 8154c46b9f6..416e18a3148 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.1.normal.js @@ -54,8 +54,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.2.minified.js index 01c8eddfe69..7a651341464 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleTypex_es5.2.minified.js @@ -27,8 +27,7 @@ var ResizablePanel = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.1.normal.js index aa89f2253fe..54335fd28cf 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.1.normal.js @@ -22,11 +22,9 @@ class Button extends React.Component { render() { let condition; if (condition) { - return(/*#__PURE__*/ React.createElement(InnerButton, _extends({ - }, this.props))); + return(/*#__PURE__*/ React.createElement(InnerButton, _extends({}, this.props))); } else { - return(/*#__PURE__*/ React.createElement(InnerButton, _extends({ - }, this.props), /*#__PURE__*/ React.createElement("div", null, "Hello World"))); + return(/*#__PURE__*/ React.createElement(InnerButton, _extends({}, this.props), /*#__PURE__*/ React.createElement("div", null, "Hello World"))); } } } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.2.minified.js index cc09252cfdf..d436d766228 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es2015.2.minified.js @@ -10,8 +10,7 @@ function _extends() { const React = require("react"); class Button extends React.Component { render() { - return React.createElement(InnerButton, _extends({ - }, this.props), React.createElement("div", null, "Hello World")); + return React.createElement(InnerButton, _extends({}, this.props), React.createElement("div", null, "Hello World")); } } class InnerButton extends React.Component { diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.1.normal.js index 94e2664104c..08cbe684601 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -117,11 +116,9 @@ var Button = /*#__PURE__*/ function(_Component) { value: function render() { var condition; if (condition) { - return(/*#__PURE__*/ React.createElement(InnerButton, _extends({ - }, this.props))); + return(/*#__PURE__*/ React.createElement(InnerButton, _extends({}, this.props))); } else { - return(/*#__PURE__*/ React.createElement(InnerButton, _extends({ - }, this.props), /*#__PURE__*/ React.createElement("div", null, "Hello World"))); + return(/*#__PURE__*/ React.createElement(InnerButton, _extends({}, this.props), /*#__PURE__*/ React.createElement("div", null, "Hello World"))); } } } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.2.minified.js index 2f812177a85..75c4c51bde9 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty12x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -74,8 +73,7 @@ var React = require("react"), Button = function(_Component) { { key: "render", value: function() { - return React.createElement(InnerButton, _extends({ - }, this.props), React.createElement("div", null, "Hello World")); + return React.createElement(InnerButton, _extends({}, this.props), React.createElement("div", null, "Hello World")); } } ]), Button; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.1.normal.js index f057c5b9cac..c3656927c0e 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.1.normal.js @@ -22,8 +22,7 @@ const React = require('react'); class Button extends React.Component { render() { // Error children are specified twice - return(/*#__PURE__*/ React.createElement(InnerButton, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(InnerButton, _extends({}, this.props, { children: "hi" }), /*#__PURE__*/ React.createElement("div", null, "Hello World"))); } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.2.minified.js index b67804c71fd..be0fc752edc 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es2015.2.minified.js @@ -10,8 +10,7 @@ function _extends() { const React = require("react"); class Button extends React.Component { render() { - return React.createElement(InnerButton, _extends({ - }, this.props, { + return React.createElement(InnerButton, _extends({}, this.props, { children: "hi" }), React.createElement("div", null, "Hello World")); } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.1.normal.js index 0abf4046c1a..37208361bdb 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -117,8 +116,7 @@ var Button = /*#__PURE__*/ function(_Component) { key: "render", value: function render() { // Error children are specified twice - return(/*#__PURE__*/ React.createElement(InnerButton, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(InnerButton, _extends({}, this.props, { children: "hi" }), /*#__PURE__*/ React.createElement("div", null, "Hello World"))); } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.2.minified.js index 1e42d6a82c4..6bb717341b6 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty13x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -74,8 +73,7 @@ var React = require("react"), Button = function(_Component) { { key: "render", value: function() { - return React.createElement(InnerButton, _extends({ - }, this.props, { + return React.createElement(InnerButton, _extends({}, this.props, { children: "hi" }), React.createElement("div", null, "Hello World")); } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.1.normal.js index 657248938ef..39cbfc16665 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.2.minified.js index 8bda211fd48..d1ac19a311e 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty14x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Button = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.1.normal.js index b2ba675f038..ad1a75b382d 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.2.minified.js index 0f64b87e4de..3c2107e92e8 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty3x_es5.2.minified.js @@ -32,8 +32,7 @@ var FetchUser = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.1.normal.js index d6d26605f62..652389b579c 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.2.minified.js index 0f64b87e4de..3c2107e92e8 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty4x_es5.2.minified.js @@ -32,8 +32,7 @@ var FetchUser = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.1.normal.js index 8bea5234641..7ea38372243 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.2.minified.js index 9054e482614..6ad661c7dea 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty5x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Button = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.1.normal.js index cf4829ee778..a899ad50601 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.2.minified.js index 7a6f7e8e337..3cde9ac6c9f 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty6x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Button = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.1.normal.js index 950711abef6..a2f9b4ac605 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.2.minified.js index 8b4afed365f..7163f33a7cd 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty7x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Button = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.1.normal.js index 1a23681b5df..bf7d95fcb0b 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.2.minified.js index 8e8f8761002..b7234a566b8 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenProperty8x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Button = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.1.normal.js index 89f3b82a56c..3482c1624e8 100644 --- a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.2.minified.js index 1f36956b51a..9f24fe94820 100644 --- a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsTypex_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function(Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.1.normal.js index 641e8d67c7b..32f607d9753 100644 --- a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.1.normal.js @@ -99,8 +99,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.2.minified.js b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.2.minified.js index 9d61ce83e33..e1bc1104a88 100644 --- a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBugx_es5.2.minified.js @@ -43,8 +43,7 @@ var AsyncLoader = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.1.normal.js index 4febe2a7210..0f307a33b20 100644 --- a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.1.normal.js @@ -3,8 +3,7 @@ // @strict: true // @checkJs: true // @filename: index.js -const x = { -}; +const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true @@ -20,8 +19,7 @@ Object.defineProperty(x, "zip", { get () { return 98122; }, - set (_) { - } + set (_) {} }); Object.defineProperty(x, "houseNumber", { get () { @@ -54,8 +52,7 @@ const expected = /** @type {{name: string, readonly middleInit: string, readonly * * @param {typeof returnExemplar} a * @param {typeof needsExemplar} b - */ function match(a, b) { -} + */ function match(a, b) {} match(()=>expected , (x = expected)=>void 0 ); diff --git a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.2.minified.js index 58ee225d8be..107c07f9fb4 100644 --- a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es2015.2.minified.js @@ -1,5 +1,4 @@ -const x = { -}; +const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: !0 @@ -12,8 +11,7 @@ Object.defineProperty(x, "name", { get () { return 98122; }, - set (_) { - } + set (_) {} }), Object.defineProperty(x, "houseNumber", { get () { return 21.75; diff --git a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.1.normal.js index bc3ae309eee..70140e5e4cd 100644 --- a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.1.normal.js @@ -3,8 +3,7 @@ // @strict: true // @checkJs: true // @filename: index.js -var x = { -}; +var x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true @@ -20,8 +19,7 @@ Object.defineProperty(x, "zip", { get: function get() { return 98122; }, - set: function set(_) { - } + set: function set(_) {} }); Object.defineProperty(x, "houseNumber", { get: function get() { @@ -57,8 +55,7 @@ var expected = /** @type {{name: string, readonly middleInit: string, readonly l * * @param {typeof returnExemplar} a * @param {typeof needsExemplar} b - */ function match(a, b) { -} + */ function match(a, b) {} match(function() { return expected; }, function() { diff --git a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.2.minified.js index 9673ed60959..7524fa170d0 100644 --- a/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkObjectDefineProperty_es5.2.minified.js @@ -1,5 +1,4 @@ -var x = { -}; +var x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: !0 @@ -12,8 +11,7 @@ Object.defineProperty(x, "name", { get: function() { return 98122; }, - set: function(_) { - } + set: function(_) {} }), Object.defineProperty(x, "houseNumber", { get: function() { return 21.75; diff --git a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.1.normal.js index f58ff6290b4..06f71a4c094 100644 --- a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.1.normal.js @@ -20,8 +20,7 @@ Object.defineProperty(exports, propName, { value: 42, writable: true }); -Object.defineProperty(exports, "bad1", { -}); +Object.defineProperty(exports, "bad1", {}); Object.defineProperty(exports, "bad2", { get () { return 12; diff --git a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.2.minified.js index b239d21d797..9a6e0b50413 100644 --- a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es2015.2.minified.js @@ -7,8 +7,7 @@ Object.defineProperty(exports, "thing", { }), Object.defineProperty(exports, "prop", { value: 42, writable: !0 -}), Object.defineProperty(exports, "bad1", { -}), Object.defineProperty(exports, "bad2", { +}), Object.defineProperty(exports, "bad1", {}), Object.defineProperty(exports, "bad2", { get () { return 12; }, diff --git a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.1.normal.js index dbd7b65d761..9cc61556b6b 100644 --- a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.1.normal.js @@ -20,8 +20,7 @@ Object.defineProperty(exports, propName, { value: 42, writable: true }); -Object.defineProperty(exports, "bad1", { -}); +Object.defineProperty(exports, "bad1", {}); Object.defineProperty(exports, "bad2", { get: function get() { return 12; diff --git a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.2.minified.js index 493150c0cce..e91463d9e39 100644 --- a/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkOtherObjectAssignProperty_es5.2.minified.js @@ -7,8 +7,7 @@ Object.defineProperty(exports, "thing", { }), Object.defineProperty(exports, "prop", { value: 42, writable: !0 -}), Object.defineProperty(exports, "bad1", { -}), Object.defineProperty(exports, "bad2", { +}), Object.defineProperty(exports, "bad1", {}), Object.defineProperty(exports, "bad2", { get: function() { return 12; }, diff --git a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.1.normal.js index d9c231de32e..6893412ce77 100644 --- a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.1.normal.js @@ -2,8 +2,7 @@ // @checkJs: true // @allowJs: true // @Filename: bug24252.js -var A = { -}; +var A = {}; A.B = class _class { m() { /** @type {string[]} */ var x = []; diff --git a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.2.minified.js index 375bdfb5038..1fa2fa9c2f1 100644 --- a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es2015.2.minified.js @@ -1,5 +1,3 @@ -({ -}).B = class { - m() { - } +({}).B = class { + m() {} }; diff --git a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.1.normal.js index 3a6fdaa7004..46cc1d49b36 100644 --- a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.1.normal.js @@ -21,8 +21,7 @@ function _createClass(Constructor, protoProps, staticProps) { // @checkJs: true // @allowJs: true // @Filename: bug24252.js -var A = { -}; +var A = {}; A.B = /*#__PURE__*/ (function() { "use strict"; function _class() { diff --git a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.2.minified.js index 0486243bcca..2adef3eacfa 100644 --- a/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/checkSpecialPropertyAssignments_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -({ -}).B = (function() { +({}).B = (function() { "use strict"; var Constructor, protoProps, staticProps; function _class() { @@ -16,8 +15,7 @@ function _defineProperties(target, props) { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = _class).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), _class; })(); diff --git a/crates/swc/tests/tsc-references/circularImportAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/circularImportAlias_es2015.1.normal.js index a05a96c61d8..877f11f1df7 100644 --- a/crates/swc/tests/tsc-references/circularImportAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/circularImportAlias_es2015.1.normal.js @@ -6,8 +6,7 @@ var B; class D extends a.C { } B1.D = D; -})(B || (B = { -})); +})(B || (B = {})); var A; (function(A1) { class C { @@ -15,7 +14,6 @@ var A; A1.C = C; var b = B; A1.b = b; -})(A || (A = { -})); +})(A || (A = {})); var c; var c = new B.a.C(); diff --git a/crates/swc/tests/tsc-references/circularImportAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/circularImportAlias_es2015.2.minified.js index 780660642e7..bed08409189 100644 --- a/crates/swc/tests/tsc-references/circularImportAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/circularImportAlias_es2015.2.minified.js @@ -5,7 +5,5 @@ var B, A, A1; class D extends a.C { } B1.D = D; -}(B || (B = { -})), (A1 = A || (A = { -})).C = class { +}(B || (B = {})), (A1 = A || (A = {})).C = class { }, A1.b = B, new B.a.C(); diff --git a/crates/swc/tests/tsc-references/circularImportAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/circularImportAlias_es5.1.normal.js index f38d837e408..fc237523b8a 100644 --- a/crates/swc/tests/tsc-references/circularImportAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/circularImportAlias_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -85,8 +84,7 @@ var B; return D; }(a.C); B1.D = D; -})(B || (B = { -})); +})(B || (B = {})); var A; (function(A1) { var C = function C() { @@ -96,7 +94,6 @@ var A; A1.C = C; var b = B; A1.b = b; -})(A || (A = { -})); +})(A || (A = {})); var c; var c = new B.a.C(); diff --git a/crates/swc/tests/tsc-references/circularImportAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/circularImportAlias_es5.2.minified.js index 474db42f206..1d4ed1918c9 100644 --- a/crates/swc/tests/tsc-references/circularImportAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/circularImportAlias_es5.2.minified.js @@ -35,8 +35,7 @@ var B, A, _typeof = function(obj) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -59,12 +58,10 @@ var B, A, _typeof = function(obj) { return D; }(a.C); B1.D = D; -}(B || (B = { -})), (function(A1) { +}(B || (B = {})), (function(A1) { var C = function() { "use strict"; _classCallCheck(this, C); }; A1.C = C, A1.b = B; -})(A || (A = { -})), new B.a.C(); +})(A || (A = {})), new B.a.C(); diff --git a/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es2015.1.normal.js index 70947486593..3b7b0bf412f 100644 --- a/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es2015.1.normal.js @@ -3,5 +3,4 @@ class C1 { } class C2 { } -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es5.1.normal.js index 8af93a8a00b..a38b8529bba 100644 --- a/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/circularIndexedAccessErrors_es5.1.normal.js @@ -12,5 +12,4 @@ var C2 = function C2() { "use strict"; _classCallCheck(this, C2); }; -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.1.normal.js index 59d8c94112a..0041c33bb2f 100644 --- a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.1.normal.js @@ -3,8 +3,6 @@ // @checkJs: true // @noEmit: true ns.next = ns.next || { - shared: { - } -}; -ns.next.shared.mymethod = { + shared: {} }; +ns.next.shared.mymethod = {}; diff --git a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.2.minified.js index fb597e587e3..a54ccb4229e 100644 --- a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es2015.2.minified.js @@ -1,5 +1,3 @@ ns.next = ns.next || { - shared: { - } -}, ns.next.shared.mymethod = { -}; + shared: {} +}, ns.next.shared.mymethod = {}; diff --git a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.1.normal.js index 59d8c94112a..0041c33bb2f 100644 --- a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.1.normal.js @@ -3,8 +3,6 @@ // @checkJs: true // @noEmit: true ns.next = ns.next || { - shared: { - } -}; -ns.next.shared.mymethod = { + shared: {} }; +ns.next.shared.mymethod = {}; diff --git a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.2.minified.js index fb597e587e3..a54ccb4229e 100644 --- a/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/circularMultipleAssignmentDeclaration_es5.2.minified.js @@ -1,5 +1,3 @@ ns.next = ns.next || { - shared: { - } -}, ns.next.shared.mymethod = { -}; + shared: {} +}, ns.next.shared.mymethod = {}; diff --git a/crates/swc/tests/tsc-references/circularReference_es2015.1.normal.js b/crates/swc/tests/tsc-references/circularReference_es2015.1.normal.js index 0373a8db382..67522c7c09a 100644 --- a/crates/swc/tests/tsc-references/circularReference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/circularReference_es2015.1.normal.js @@ -10,8 +10,7 @@ export var M1; } } M11.C1 = C1; -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); // @Filename: foo2.ts const foo1 = require('./foo1'); (function(M12) { @@ -26,5 +25,4 @@ const foo1 = require('./foo1'); } } M12.C1 = C1; -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/circularReference_es2015.2.minified.js b/crates/swc/tests/tsc-references/circularReference_es2015.2.minified.js index 3825470bc66..64f525bbd2c 100644 --- a/crates/swc/tests/tsc-references/circularReference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/circularReference_es2015.2.minified.js @@ -1,14 +1,12 @@ var M1; const foo2 = require("./foo2"); -(M1 || (M1 = { -})).C1 = class { +(M1 || (M1 = {})).C1 = class { constructor(){ this.m1 = new foo2.M1.C1(), this.m1.y = 10, this.m1.x = 20; } }; const foo1 = require("./foo1"); -(M1 || (M1 = { -})).C1 = class { +(M1 || (M1 = {})).C1 = class { constructor(){ this.m1 = new foo1.M1.C1(), this.m1.y = 10, this.m1.x = 20; var tmp = new M1.C1(); diff --git a/crates/swc/tests/tsc-references/circularReference_es5.1.normal.js b/crates/swc/tests/tsc-references/circularReference_es5.1.normal.js index 1233d234082..a39fa46b7df 100644 --- a/crates/swc/tests/tsc-references/circularReference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/circularReference_es5.1.normal.js @@ -15,8 +15,7 @@ export var M1; this.m1.x = 20; // Error }; M11.C1 = C1; -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); // @Filename: foo2.ts var foo1 = require('./foo1'); (function(M12) { @@ -31,5 +30,4 @@ var foo1 = require('./foo1'); tmp.x = 20; // Error }; M12.C1 = C1; -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/circularReference_es5.2.minified.js b/crates/swc/tests/tsc-references/circularReference_es5.2.minified.js index ba7502ce6d5..2ce8053eda5 100644 --- a/crates/swc/tests/tsc-references/circularReference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/circularReference_es5.2.minified.js @@ -8,8 +8,7 @@ var M1, foo2 = require("./foo2"); _classCallCheck(this, C1), this.m1 = new foo2.M1.C1(), this.m1.y = 10, this.m1.x = 20; }; M11.C1 = C1; -}(M1 || (M1 = { -})); +}(M1 || (M1 = {})); var foo1 = require("./foo1"); !function(M12) { var C1 = function() { @@ -19,5 +18,4 @@ var foo1 = require("./foo1"); tmp.y = 10, tmp.x = 20; }; M12.C1 = C1; -}(M1 || (M1 = { -})); +}(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.1.normal.js index 9f20fd3cde9..08403442dd0 100644 --- a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.2.minified.js index 2339ebaec9b..2341dced10d 100644 --- a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classAbstractExtends_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAbstractExtends_es2015.1.normal.js index 2ab823b94ab..5fde8b8e324 100644 --- a/crates/swc/tests/tsc-references/classAbstractExtends_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractExtends_es2015.1.normal.js @@ -1,6 +1,5 @@ class A { - foo() { - } + foo() {} } class B extends A { } @@ -9,6 +8,5 @@ class C extends B { class D extends B { } class E extends B { - bar() { - } + bar() {} } diff --git a/crates/swc/tests/tsc-references/classAbstractExtends_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractExtends_es5.1.normal.js index c6fc87d36f2..c81e65d4f74 100644 --- a/crates/swc/tests/tsc-references/classAbstractExtends_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractExtends_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,8 +90,7 @@ var A = /*#__PURE__*/ function() { _createClass(A, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return A; @@ -138,8 +136,7 @@ var E = /*#__PURE__*/ function(B) { _createClass(E, [ { key: "bar", - value: function bar() { - } + value: function bar() {} } ]); return E; diff --git a/crates/swc/tests/tsc-references/classAbstractExtends_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractExtends_es5.2.minified.js index a73a1f4ff25..96456089423 100644 --- a/crates/swc/tests/tsc-references/classAbstractExtends_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractExtends_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var A = function() { return _createClass(A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -100,8 +98,7 @@ var A = function() { return _createClass(E, [ { key: "bar", - value: function() { - } + value: function() {} } ]), E; }(B); diff --git a/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.1.normal.js index 0943a01ce1c..872a2af6231 100644 --- a/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.2.minified.js index a1ea671d30f..b0693bd27f0 100644 --- a/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractFactoryFunction_es5.2.minified.js @@ -32,8 +32,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classAbstractGeneric_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAbstractGeneric_es2015.1.normal.js index 0b3d0592963..37f4fe9f4a5 100644 --- a/crates/swc/tests/tsc-references/classAbstractGeneric_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractGeneric_es2015.1.normal.js @@ -12,13 +12,11 @@ class E extends A { } } class F extends A { - bar(t) { - } + bar(t) {} } class G extends A { foo() { return this.t; } - bar(t) { - } + bar(t) {} } diff --git a/crates/swc/tests/tsc-references/classAbstractGeneric_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractGeneric_es5.1.normal.js index b36a6df0329..2c09b5e9e7b 100644 --- a/crates/swc/tests/tsc-references/classAbstractGeneric_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractGeneric_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -148,8 +147,7 @@ var F = /*#__PURE__*/ function(A) { _createClass(F, [ { key: "bar", - value: function bar(t) { - } + value: function bar(t) {} } ]); return F; @@ -171,8 +169,7 @@ var G = /*#__PURE__*/ function(A) { }, { key: "bar", - value: function bar(t) { - } + value: function bar(t) {} } ]); return G; diff --git a/crates/swc/tests/tsc-references/classAbstractGeneric_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractGeneric_es5.2.minified.js index ccad30d79c1..62cf8e2bd50 100644 --- a/crates/swc/tests/tsc-references/classAbstractGeneric_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractGeneric_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -106,8 +105,7 @@ var A = function() { return _createClass(F, [ { key: "bar", - value: function(t) { - } + value: function(t) {} } ]), F; }(A), G = function(A6) { @@ -126,8 +124,7 @@ var A = function() { }, { key: "bar", - value: function(t) { - } + value: function(t) {} } ]), G; }(A); diff --git a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.1.normal.js index ee4eb5e8c0c..2933ebe9e00 100644 --- a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.1.normal.js @@ -4,8 +4,7 @@ var M; } M1.A = A; new A; -})(M || (M = { -})); +})(M || (M = {})); var myA = M.A; new myA; export { }; diff --git a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.2.minified.js b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.2.minified.js index bf294176a3b..82e2f1eeb50 100644 --- a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es2015.2.minified.js @@ -3,6 +3,5 @@ var M; class A { } M1.A = A, new A; -}(M || (M = { -})), new M.A; +}(M || (M = {})), new M.A; export { }; diff --git a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.1.normal.js index dcc33179542..3cf9bfe4c0e 100644 --- a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.1.normal.js @@ -11,8 +11,7 @@ var M; }; M1.A = A; new A; -})(M || (M = { -})); +})(M || (M = {})); var myA = M.A; new myA; export { }; diff --git a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.2.minified.js index 2cf114eb694..5a7eeeb898c 100644 --- a/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractImportInstantiation_es5.2.minified.js @@ -7,6 +7,5 @@ var M; }(this, A); }; M1.A = A, new A; -}(M || (M = { -})), new M.A; +}(M || (M = {})), new M.A; export { }; diff --git a/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.1.normal.js index b0248731971..cee8c248a9b 100644 --- a/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.1.normal.js @@ -6,7 +6,6 @@ var M; class B extends A { } M1.B = B; -})(M || (M = { -})); +})(M || (M = {})); new M.A; new M.B; diff --git a/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.2.minified.js index e1dfd9f6b49..f3db238271f 100644 --- a/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractInAModule_es2015.2.minified.js @@ -4,5 +4,4 @@ var M; } M1.A = A, M1.B = class extends A { }; -}(M || (M = { -})), new M.A, new M.B; +}(M || (M = {})), new M.A, new M.B; diff --git a/crates/swc/tests/tsc-references/classAbstractInAModule_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInAModule_es5.1.normal.js index c2166a0e2dc..0d725bc9748 100644 --- a/crates/swc/tests/tsc-references/classAbstractInAModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractInAModule_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -87,7 +86,6 @@ var M; return B; }(A); M1.B = B; -})(M || (M = { -})); +})(M || (M = {})); new M.A; new M.B; diff --git a/crates/swc/tests/tsc-references/classAbstractInAModule_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInAModule_es5.2.minified.js index 0684e7f78fd..5844aaeedc7 100644 --- a/crates/swc/tests/tsc-references/classAbstractInAModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractInAModule_es5.2.minified.js @@ -36,8 +36,7 @@ function _setPrototypeOf(o, p) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -60,5 +59,4 @@ function _setPrototypeOf(o, p) { return B; }(A1); M1.B = B; -}(M || (M = { -})), new M.A, new M.B; +}(M || (M = {})), new M.A, new M.B; diff --git a/crates/swc/tests/tsc-references/classAbstractInheritance_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInheritance_es5.1.normal.js index 02bf050182e..73bb6c9c45e 100644 --- a/crates/swc/tests/tsc-references/classAbstractInheritance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractInheritance_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classAbstractInheritance_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInheritance_es5.2.minified.js index 54a3b38b471..e4f289b4e04 100644 --- a/crates/swc/tests/tsc-references/classAbstractInheritance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractInheritance_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.1.normal.js index 571735426a6..22216cc62e1 100644 --- a/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.2.minified.js index 3b188f35203..9c6d03eba7d 100644 --- a/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractInstantiations1_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classAbstractOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAbstractOverloads_es2015.1.normal.js index eb6b81e9be1..708f2813a47 100644 --- a/crates/swc/tests/tsc-references/classAbstractOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractOverloads_es2015.1.normal.js @@ -1,6 +1,5 @@ class A { - baz() { - } + baz() {} } class B { } diff --git a/crates/swc/tests/tsc-references/classAbstractOverloads_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractOverloads_es5.1.normal.js index aec96938acc..b653953921b 100644 --- a/crates/swc/tests/tsc-references/classAbstractOverloads_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractOverloads_es5.1.normal.js @@ -25,8 +25,7 @@ var A = /*#__PURE__*/ function() { _createClass(A, [ { key: "baz", - value: function baz() { - } + value: function baz() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/classAbstractOverloads_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractOverloads_es5.2.minified.js index d8557d7ec7e..dc7d656f475 100644 --- a/crates/swc/tests/tsc-references/classAbstractOverloads_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractOverloads_es5.2.minified.js @@ -16,8 +16,7 @@ var A = function() { return protoProps = [ { key: "baz", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = A).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), A; }(), B = function() { diff --git a/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es2015.1.normal.js index 4214190bccf..9e041fa6d43 100644 --- a/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es2015.1.normal.js @@ -1,20 +1,16 @@ class A { - foo() { - } + foo() {} } class B extends A { } class AA { - foo() { - } + foo() {} } class BB extends AA { - bar() { - } + bar() {} } class CC extends BB { } // error class DD extends BB { - foo() { - } + foo() {} } diff --git a/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.1.normal.js index 1fb3da41cb1..719bf7cfcd0 100644 --- a/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,8 +90,7 @@ var A = /*#__PURE__*/ function() { _createClass(A, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return A; @@ -115,8 +113,7 @@ var AA = /*#__PURE__*/ function() { _createClass(AA, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return AA; @@ -132,8 +129,7 @@ var BB = /*#__PURE__*/ function(AA) { _createClass(BB, [ { key: "bar", - value: function bar() { - } + value: function bar() {} } ]); return BB; @@ -160,8 +156,7 @@ var DD = /*#__PURE__*/ function(BB) { _createClass(DD, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return DD; diff --git a/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.2.minified.js index a7911112f2a..0f120183028 100644 --- a/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractOverrideWithAbstract_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var A = function() { return _createClass(A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(), B = function(A) { @@ -82,8 +80,7 @@ var A = function() { return _createClass(AA, [ { key: "foo", - value: function() { - } + value: function() {} } ]), AA; }(), BB = function(AA) { @@ -96,8 +93,7 @@ var A = function() { return _createClass(BB, [ { key: "bar", - value: function() { - } + value: function() {} } ]), BB; }(AA), CC = function(BB) { @@ -118,8 +114,7 @@ var A = function() { return _createClass(DD, [ { key: "foo", - value: function() { - } + value: function() {} } ]), DD; }(BB); diff --git a/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.1.normal.js index 3380142983e..acbef6e2b44 100644 --- a/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.2.minified.js index 5d3086f587e..7d44964c921 100644 --- a/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractSuperCalls_es5.2.minified.js @@ -49,8 +49,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.1.normal.js b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.1.normal.js index a21bad2b6b4..4acb8208b9d 100644 --- a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.2.minified.js b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.2.minified.js index db55d380cba..c960d3f2b36 100644 --- a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es2015.1.normal.js index 19e255d6915..8ee78953468 100644 --- a/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es2015.1.normal.js @@ -4,5 +4,4 @@ var M; (function(M) { class D { } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.1.normal.js index cd5b31acba5..4cf429dcb80 100644 --- a/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.1.normal.js @@ -13,5 +13,4 @@ var M; "use strict"; _classCallCheck(this, D); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.2.minified.js index 216d279792f..a08515b1510 100644 --- a/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAndInterfaceWithSameName_es5.2.minified.js @@ -10,5 +10,4 @@ var M, C = function() { "use strict"; _classCallCheck(this, D); }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classAndVariableWithSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/classAndVariableWithSameName_es2015.1.normal.js index 8d145bf5507..5a615917b01 100644 --- a/crates/swc/tests/tsc-references/classAndVariableWithSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classAndVariableWithSameName_es2015.1.normal.js @@ -6,5 +6,4 @@ var M; class D { } var D = 1; // error -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.1.normal.js index 22b46aeb479..4e430fc3563 100644 --- a/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.1.normal.js @@ -15,5 +15,4 @@ var M; _classCallCheck(this, D); }; var D = 1; // error -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.2.minified.js index dcd1f1d6811..f461a02aa87 100644 --- a/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classAndVariableWithSameName_es5.2.minified.js @@ -10,5 +10,4 @@ var M, C = function() { "use strict"; _classCallCheck(this, D); }, D = 1; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.1.normal.js index 6530e65d44e..bd21c31beac 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.1.normal.js @@ -11,8 +11,7 @@ /** @param {Wagon[]=} wagons */ Wagon.circle = function(wagons) { return wagons ? wagons.length : 3.14; }; -/** @param {*[]=} supplies - *[]= is my favourite type */ Wagon.prototype.load = function(supplies) { -}; +/** @param {*[]=} supplies - *[]= is my favourite type */ Wagon.prototype.load = function(supplies) {}; /** @param {*[]=} supplies - Yep, still a great type */ Wagon.prototype.weight = (supplies)=>supplies ? supplies.length : -1 ; Wagon.prototype.speed = function() { diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.2.minified.js index b737439b009..e3918d9bc94 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es2015.2.minified.js @@ -3,8 +3,7 @@ function Wagon(numberOxen) { } Wagon.circle = function(wagons) { return wagons ? wagons.length : 3.14; -}, Wagon.prototype.load = function(supplies) { -}, Wagon.prototype.weight = (supplies)=>supplies ? supplies.length : -1 +}, Wagon.prototype.load = function(supplies) {}, Wagon.prototype.weight = (supplies)=>supplies ? supplies.length : -1 , Wagon.prototype.speed = function() { return this.numberOxen / this.weight(); }; diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.1.normal.js index 31fe156c570..7624b73bdd3 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,8 +118,7 @@ function _createSuper(Derived) { /** @param {Wagon[]=} wagons */ Wagon.circle = function(wagons) { return wagons ? wagons.length : 3.14; }; -/** @param {*[]=} supplies - *[]= is my favourite type */ Wagon.prototype.load = function(supplies) { -}; +/** @param {*[]=} supplies - *[]= is my favourite type */ Wagon.prototype.load = function(supplies) {}; /** @param {*[]=} supplies - Yep, still a great type */ Wagon.prototype.weight = function(supplies) { return supplies ? supplies.length : -1; }; diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.2.minified.js index aa10f8890e4..424e78a924c 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction_es5.2.minified.js @@ -49,8 +49,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -72,8 +71,7 @@ function Wagon(numberOxen) { } Wagon.circle = function(wagons) { return wagons ? wagons.length : 3.14; -}, Wagon.prototype.load = function(supplies) { -}, Wagon.prototype.weight = function(supplies) { +}, Wagon.prototype.load = function(supplies) {}, Wagon.prototype.weight = function(supplies) { return supplies ? supplies.length : -1; }, Wagon.prototype.speed = function() { return this.numberOxen / this.weight(); diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.1.normal.js index 749d1e9635d..896c559351f 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.2.minified.js index dfe16cce155..d5dca8e5f3c 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility2_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility4_es2015.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility4_es2015.1.normal.js index 98ac770fd57..d11a20b8b92 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility4_es2015.1.normal.js @@ -9,8 +9,7 @@ class A { class C extends A { } } - constructor(){ - } + constructor(){} } class D { method() { @@ -22,6 +21,5 @@ class D { class F extends D { } } - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.1.normal.js index e614063a20b..569ed527312 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.2.minified.js index 851904e54d8..a8dcac7cbb9 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility4_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility5_es2015.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility5_es2015.1.normal.js index 22d35414f7b..ebc9cd86072 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility5_es2015.1.normal.js @@ -1,6 +1,5 @@ class Base { - constructor(){ - } + constructor(){} } class Derived extends Base { static make() { diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.1.normal.js index 2c2142f67e0..40e12a7798e 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.2.minified.js index 964bc67a369..82dc04f7699 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility5_es5.2.minified.js @@ -41,8 +41,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.1.normal.js index 7907897cea6..67337b6b6e5 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.1.normal.js @@ -37,5 +37,4 @@ var Generic; var c = new C1(1); var d = new D1(1); // error var e = new E1(1); // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.2.minified.js index c4000761821..d9200236593 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility_es2015.2.minified.js @@ -11,8 +11,7 @@ new class { constructor(x){ this.x = x; } -}(1), Generic || (Generic = { -}), new class { +}(1), Generic || (Generic = {}), new class { constructor(x){ this.x = x; } diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.1.normal.js index 4ab612a08f9..b6be4619674 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.1.normal.js @@ -41,5 +41,4 @@ var Generic; var c = new C(1); var d = new D(1); // error var e = new E(1); // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.2.minified.js index c89b087bc7f..bb1ec386ebf 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility_es5.2.minified.js @@ -23,5 +23,4 @@ new C(1), new D(1), new E(1), (function(Generic) { _classCallCheck(this, E1), this.x = x; }; new C1(1), new D1(1), new E1(1); -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/classConstructorOverloadsAccessibility_es2015.1.normal.js b/crates/swc/tests/tsc-references/classConstructorOverloadsAccessibility_es2015.1.normal.js index 5e30d06d74d..476ce2e3020 100644 --- a/crates/swc/tests/tsc-references/classConstructorOverloadsAccessibility_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorOverloadsAccessibility_es2015.1.normal.js @@ -1,17 +1,13 @@ // @declaration: true class A { - constructor(){ - } + constructor(){} } class B { - constructor(){ - } + constructor(){} } class C { - constructor(){ - } + constructor(){} } class D { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.1.normal.js index e32f8612caa..517d2d6350c 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.2.minified.js index 4ce9a052a19..1278231ca46 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2_es5.2.minified.js @@ -44,8 +44,7 @@ var Derived1 = function(C31) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.1.normal.js index 55c1b9c7e97..cf2bd463d33 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.2.minified.js index da8509717c0..bb9808b90ba 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3_es5.2.minified.js @@ -32,8 +32,7 @@ var d, Base = function(p) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.1.normal.js index e32f8612caa..517d2d6350c 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.2.minified.js index 4ce9a052a19..1278231ca46 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility_es5.2.minified.js @@ -44,8 +44,7 @@ var Derived1 = function(C31) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.1.normal.js index 961b9722fac..dd0ac11f425 100644 --- a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.2.minified.js index 0c030be4fb8..ccdda702264 100644 --- a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes_es5.2.minified.js @@ -32,8 +32,7 @@ var x, StringTreeCollectionBase = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExpression2_es5.1.normal.js b/crates/swc/tests/tsc-references/classExpression2_es5.1.normal.js index 07b59b099af..fb085c1df76 100644 --- a/crates/swc/tests/tsc-references/classExpression2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExpression2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExpression2_es5.2.minified.js b/crates/swc/tests/tsc-references/classExpression2_es5.2.minified.js index efc1d4a2ad9..695e3b40925 100644 --- a/crates/swc/tests/tsc-references/classExpression2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExpression2_es5.2.minified.js @@ -33,8 +33,7 @@ var D = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExpression3_es5.1.normal.js b/crates/swc/tests/tsc-references/classExpression3_es5.1.normal.js index 10d6ac4af89..4677db1a631 100644 --- a/crates/swc/tests/tsc-references/classExpression3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExpression3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExpression3_es5.2.minified.js b/crates/swc/tests/tsc-references/classExpression3_es5.2.minified.js index e8588f14e6b..4b191325282 100644 --- a/crates/swc/tests/tsc-references/classExpression3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExpression3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExpressionES62_es5.1.normal.js b/crates/swc/tests/tsc-references/classExpressionES62_es5.1.normal.js index 07b59b099af..fb085c1df76 100644 --- a/crates/swc/tests/tsc-references/classExpressionES62_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExpressionES62_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExpressionES62_es5.2.minified.js b/crates/swc/tests/tsc-references/classExpressionES62_es5.2.minified.js index efc1d4a2ad9..695e3b40925 100644 --- a/crates/swc/tests/tsc-references/classExpressionES62_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExpressionES62_es5.2.minified.js @@ -33,8 +33,7 @@ var D = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExpressionES63_es5.1.normal.js b/crates/swc/tests/tsc-references/classExpressionES63_es5.1.normal.js index ff03530369f..59b107cfac6 100644 --- a/crates/swc/tests/tsc-references/classExpressionES63_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExpressionES63_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExpressionES63_es5.2.minified.js b/crates/swc/tests/tsc-references/classExpressionES63_es5.2.minified.js index e8588f14e6b..4b191325282 100644 --- a/crates/swc/tests/tsc-references/classExpressionES63_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExpressionES63_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.1.normal.js index f9090c16db3..2595556d487 100644 --- a/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.1.normal.js @@ -14,8 +14,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -107,8 +106,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.2.minified.js index 8bbe8b5e830..eb6a03ae77c 100644 --- a/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingBuiltinType_es5.2.minified.js @@ -7,8 +7,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -70,8 +69,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.1.normal.js index 81751cbf9b5..422339b21b5 100644 --- a/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.2.minified.js index f94a5d2e747..c2db0177e14 100644 --- a/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingClassLikeType_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendingClass_es2015.1.normal.js b/crates/swc/tests/tsc-references/classExtendingClass_es2015.1.normal.js index 8862fb23473..e7592c195bc 100644 --- a/crates/swc/tests/tsc-references/classExtendingClass_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingClass_es2015.1.normal.js @@ -1,8 +1,6 @@ class C { - thing() { - } - static other() { - } + thing() {} + static other() {} } class D extends C { } @@ -12,10 +10,8 @@ var r2 = d.bar; var r3 = d.thing(); var r4 = D.other(); class C2 { - thing(x) { - } - static other(x) { - } + thing(x) {} + static other(x) {} } class D2 extends C2 { } diff --git a/crates/swc/tests/tsc-references/classExtendingClass_es2015.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClass_es2015.2.minified.js index f58f8e3fe0f..23f5d38b58f 100644 --- a/crates/swc/tests/tsc-references/classExtendingClass_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingClass_es2015.2.minified.js @@ -1,17 +1,13 @@ var d, d2; class C { - thing() { - } - static other() { - } + thing() {} + static other() {} } d.foo, d.bar, d.thing(), (class extends C { }).other(); class C2 { - thing(x) { - } - static other(x) { - } + thing(x) {} + static other(x) {} } d2.foo, d2.bar, d2.thing(""), (class extends C2 { }).other(1); diff --git a/crates/swc/tests/tsc-references/classExtendingClass_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendingClass_es5.1.normal.js index 7ecea53ba74..c8ca0ddede3 100644 --- a/crates/swc/tests/tsc-references/classExtendingClass_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingClass_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,14 +90,12 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "thing", - value: function thing() { - } + value: function thing() {} } ], [ { key: "other", - value: function other() { - } + value: function other() {} } ]); return C; @@ -126,14 +123,12 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "thing", - value: function thing(x) { - } + value: function thing(x) {} } ], [ { key: "other", - value: function other(x) { - } + value: function other(x) {} } ]); return C2; diff --git a/crates/swc/tests/tsc-references/classExtendingClass_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClass_es5.2.minified.js index d572ca18d28..5edd917bc63 100644 --- a/crates/swc/tests/tsc-references/classExtendingClass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingClass_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,14 +61,12 @@ var d, d2, C = function() { return _createClass(C, [ { key: "thing", - value: function() { - } + value: function() {} } ], [ { key: "other", - value: function() { - } + value: function() {} } ]), C; }(), D = function(C) { @@ -90,14 +87,12 @@ var C2 = function() { return _createClass(C2, [ { key: "thing", - value: function(x) { - } + value: function(x) {} } ], [ { key: "other", - value: function(x) { - } + value: function(x) {} } ]), C2; }(), D2 = function(C2) { diff --git a/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.1.normal.js index 866a81603d4..12029d2701c 100644 --- a/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.2.minified.js index 7fa6168f106..1fb0cdfbd53 100644 --- a/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingNonConstructor_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendingNull_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendingNull_es5.1.normal.js index 354aa198ae0..305ce863833 100644 --- a/crates/swc/tests/tsc-references/classExtendingNull_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingNull_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendingNull_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendingNull_es5.2.minified.js index d2c2e255ab4..e0a1db0577c 100644 --- a/crates/swc/tests/tsc-references/classExtendingNull_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingNull_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.1.normal.js index 17cbb7a22b4..36569d3d2e6 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.1.normal.js @@ -5,15 +5,13 @@ var M; class D extends C { } M1.D = D; -})(M || (M = { -})); +})(M || (M = {})); var N; (function(N1) { class E extends M.D { } N1.E = E; -})(N || (N = { -})); +})(N || (N = {})); var O; (function(O) { class C2 extends Q.E2 { @@ -23,14 +21,11 @@ var O; class D2 extends C2 { } P.D2 = D2; - })(P1 || (P1 = { - })); + })(P1 || (P1 = {})); let Q1; (function(Q) { class E2 extends P1.D2 { } Q.E2 = E2; - })(Q1 || (Q1 = { - })); -})(O || (O = { -})); + })(Q1 || (Q1 = {})); +})(O || (O = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.2.minified.js index 54c7e851507..ff48ca2b423 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es2015.2.minified.js @@ -1,26 +1,21 @@ var M, N, O; class C extends N.E { } -(M || (M = { -})).D = class extends C { +(M || (M = {})).D = class extends C { }, (function(N1) { class E extends M.D { } N1.E = E; -})(N || (N = { -})), (function(O) { +})(N || (N = {})), (function(O) { class C2 extends Q.E2 { } let P; - (P || (P = { - })).D2 = class extends C2 { + (P || (P = {})).D2 = class extends C2 { }; let Q1; !function(Q) { class E2 extends P.D2 { } Q.E2 = E2; - }(Q1 || (Q1 = { - })); -})(O || (O = { -})); + }(Q1 || (Q1 = {})); +})(O || (O = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.1.normal.js index e57b6bb55d3..6c83fb68515 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -93,8 +92,7 @@ var M; return D; }(C); M1.D = D; -})(M || (M = { -})); +})(M || (M = {})); var N; (function(N1) { var E = /*#__PURE__*/ function(_D) { @@ -108,8 +106,7 @@ var N; return E; }(M.D); N1.E = E; -})(N || (N = { -})); +})(N || (N = {})); var O; (function(O) { var C2 = /*#__PURE__*/ function(_E2) { @@ -136,8 +133,7 @@ var O; return D2; }(C2); P.D2 = D2; - })(P1 || (P1 = { - })); + })(P1 || (P1 = {})); var Q1; (function(Q) { var E2 = /*#__PURE__*/ function(_D2) { @@ -151,7 +147,5 @@ var O; return E2; }(P1.D2); Q.E2 = E2; - })(Q1 || (Q1 = { - })); -})(O || (O = { -})); + })(Q1 || (Q1 = {})); +})(O || (O = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.2.minified.js index 212ae6a69d1..4421ecdb94e 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,8 +64,7 @@ var M, N, O, C = function(_E) { return D; }(C); M1.D = D; -}(M || (M = { -})), (function(N1) { +}(M || (M = {})), (function(N1) { var E = function(_D) { "use strict"; _inherits(E, _D); @@ -77,8 +75,7 @@ var M, N, O, C = function(_E) { return E; }(M.D); N1.E = E; -})(N || (N = { -})), (function(O) { +})(N || (N = {})), (function(O) { var P1, Q1, C2 = function(_E2) { "use strict"; _inherits(C2, _E2); @@ -99,8 +96,7 @@ var M, N, O, C = function(_E) { return D2; }(C2); P.D2 = D2; - })(P1 || (P1 = { - })), (function(Q) { + })(P1 || (P1 = {})), (function(Q) { var E2 = function(_D2) { "use strict"; _inherits(E2, _D2); @@ -111,7 +107,5 @@ var M, N, O, C = function(_E) { return E2; }(P1.D2); Q.E2 = E2; - })(Q1 || (Q1 = { - })); -})(O || (O = { -})); + })(Q1 || (Q1 = {})); +})(O || (O = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.1.normal.js index 4ace58916b2..69c3ab8bdbe 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.2.minified.js index 9a2469d71de..909b62a1546 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.1.normal.js index 5ae7993f9a7..3cfb362f704 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.2.minified.js index 9a2469d71de..909b62a1546 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendsItself_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItself_es5.1.normal.js index 8f0ba5f7b5a..4ed6a5bb1b8 100644 --- a/crates/swc/tests/tsc-references/classExtendsItself_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsItself_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classExtendsItself_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItself_es5.2.minified.js index 1037df8601b..f239dfb4432 100644 --- a/crates/swc/tests/tsc-references/classExtendsItself_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItself_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es2015.1.normal.js index 5256e13b714..21609bcf033 100644 --- a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es2015.1.normal.js @@ -5,5 +5,4 @@ var M; var C1 = 1; class D extends C1 { } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.1.normal.js index 9ea65b6d7fe..05737f45b47 100644 --- a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -86,5 +85,4 @@ var M; } return D; }(C1); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.2.minified.js index 8e9c477183e..abec5e05158 100644 --- a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction_es5.2.minified.js @@ -34,8 +34,7 @@ var M, C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -57,5 +56,4 @@ var M, C = function() { } return D; }(1); -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.1.normal.js index 05f3a1986ec..8f3cf6de06a 100644 --- a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo() { -} +function foo() {} var x = new foo(); // can be used as a constructor function class C extends foo { } // error, cannot extend it though diff --git a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.2.minified.js index 82cfcf92f25..f27fd275539 100644 --- a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es2015.2.minified.js @@ -1,2 +1 @@ -new function() { -}(); +new function() {}(); diff --git a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.1.normal.js index 1be460e8366..f57f42de721 100644 --- a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -69,8 +68,7 @@ function _createSuper(Derived) { return _possibleConstructorReturn(this, result); }; } -function foo() { -} +function foo() {} var x = new foo(); // can be used as a constructor function var C = /*#__PURE__*/ function(foo1) { "use strict"; diff --git a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.2.minified.js index 1449ecc9a0f..b9bc69b625d 100644 --- a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction_es5.2.minified.js @@ -8,8 +8,7 @@ function _setPrototypeOf(o, p) { return o.__proto__ = p, o; }, _setPrototypeOf(o, p); } -function foo() { -} +function foo() {} new foo(); var C = function(foo1) { "use strict"; @@ -29,8 +28,7 @@ var C = function(foo1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.1.normal.js b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.1.normal.js index 50f3209758d..f14e36cf78b 100644 --- a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.2.minified.js b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.2.minified.js index f543b64dbba..c183ef954ff 100644 --- a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.1.normal.js b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.1.normal.js index fb69404b62f..814b0e78962 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.1.normal.js @@ -2,17 +2,13 @@ class C { get y() { return null; } - set y(x) { - } - foo() { - } + set y(x) {} + foo() {} static get b() { return null; } - static set b(x) { - } - static foo() { - } + static set b(x) {} + static foo() {} } var c; // all errors diff --git a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.2.minified.js b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.2.minified.js index 2762ea8dfca..f098770aad1 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es2015.2.minified.js @@ -3,16 +3,12 @@ class C { get y() { return null; } - set y(x) { - } - foo() { - } + set y(x) {} + foo() {} static get b() { return null; } - static set b(x) { - } - static foo() { - } + static set b(x) {} + static foo() {} } c.x, c.y, c.y = 1, c.foo(), C.b(), C.b = 1, C.foo(); diff --git a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.1.normal.js b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.1.normal.js index 0a0272a4fbc..eeab819fbb7 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.1.normal.js @@ -28,13 +28,11 @@ var C = /*#__PURE__*/ function() { get: function get() { return null; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "foo", - value: function foo() { - } + value: function foo() {} } ], [ { @@ -42,13 +40,11 @@ var C = /*#__PURE__*/ function() { get: function get() { return null; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.2.minified.js b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.2.minified.js index f736cc47c9b..c9f37b565d0 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classPropertyAsPrivate_es5.2.minified.js @@ -18,13 +18,11 @@ var c, C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], staticProps = [ { @@ -32,13 +30,11 @@ var c, C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.1.normal.js b/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.1.normal.js index fb69404b62f..814b0e78962 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.1.normal.js @@ -2,17 +2,13 @@ class C { get y() { return null; } - set y(x) { - } - foo() { - } + set y(x) {} + foo() {} static get b() { return null; } - static set b(x) { - } - static foo() { - } + static set b(x) {} + static foo() {} } var c; // all errors diff --git a/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.2.minified.js b/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.2.minified.js index 2762ea8dfca..f098770aad1 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classPropertyAsProtected_es2015.2.minified.js @@ -3,16 +3,12 @@ class C { get y() { return null; } - set y(x) { - } - foo() { - } + set y(x) {} + foo() {} static get b() { return null; } - static set b(x) { - } - static foo() { - } + static set b(x) {} + static foo() {} } c.x, c.y, c.y = 1, c.foo(), C.b(), C.b = 1, C.foo(); diff --git a/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.1.normal.js b/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.1.normal.js index 0a0272a4fbc..eeab819fbb7 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.1.normal.js @@ -28,13 +28,11 @@ var C = /*#__PURE__*/ function() { get: function get() { return null; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "foo", - value: function foo() { - } + value: function foo() {} } ], [ { @@ -42,13 +40,11 @@ var C = /*#__PURE__*/ function() { get: function get() { return null; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.2.minified.js b/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.2.minified.js index f736cc47c9b..c9f37b565d0 100644 --- a/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classPropertyAsProtected_es5.2.minified.js @@ -18,13 +18,11 @@ var c, C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], staticProps = [ { @@ -32,13 +30,11 @@ var c, C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.1.normal.js b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.1.normal.js index 8000ac0cc3b..1bab7e695a8 100644 --- a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.1.normal.js @@ -2,17 +2,13 @@ class C { get y() { return null; } - set y(x) { - } - foo() { - } + set y(x) {} + foo() {} static get b() { return null; } - static set b(x) { - } - static foo() { - } + static set b(x) {} + static foo() {} } var c; c.x; diff --git a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.2.minified.js b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.2.minified.js index 2762ea8dfca..f098770aad1 100644 --- a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es2015.2.minified.js @@ -3,16 +3,12 @@ class C { get y() { return null; } - set y(x) { - } - foo() { - } + set y(x) {} + foo() {} static get b() { return null; } - static set b(x) { - } - static foo() { - } + static set b(x) {} + static foo() {} } c.x, c.y, c.y = 1, c.foo(), C.b(), C.b = 1, C.foo(); diff --git a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.1.normal.js b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.1.normal.js index a24cba3b564..1a942490ebe 100644 --- a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.1.normal.js @@ -28,13 +28,11 @@ var C = /*#__PURE__*/ function() { get: function get() { return null; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "foo", - value: function foo() { - } + value: function foo() {} } ], [ { @@ -42,13 +40,11 @@ var C = /*#__PURE__*/ function() { get: function get() { return null; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.2.minified.js b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.2.minified.js index f736cc47c9b..c9f37b565d0 100644 --- a/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classPropertyIsPublicByDefault_es5.2.minified.js @@ -18,13 +18,11 @@ var c, C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], staticProps = [ { @@ -32,13 +30,11 @@ var c, C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.1.normal.js index 31b334d62a3..f9fe77e811c 100644 --- a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.1.normal.js @@ -1,6 +1,5 @@ class Base { - constructor(x){ - } + constructor(x){} } class C extends Base { } @@ -8,8 +7,7 @@ var r = C; var c = new C(); // error var c2 = new C(1); // ok class Base2 { - constructor(x){ - } + constructor(x){} } class D extends Base2 { } diff --git a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.2.minified.js b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.2.minified.js index 49761144f32..0f5b4efc7e3 100644 --- a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es2015.2.minified.js @@ -1,13 +1,11 @@ class Base { - constructor(x){ - } + constructor(x){} } class C extends Base { } new C(), new C(1); class Base2 { - constructor(x){ - } + constructor(x){} } class D extends Base2 { } diff --git a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.1.normal.js index 3149be7e06b..1c37df1e8a3 100644 --- a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.2.minified.js index 1d9c25e6ebb..339e00e0a85 100644 --- a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithConstructors_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithConstructors_es2015.1.normal.js index a2c326a2645..3390a37ded2 100644 --- a/crates/swc/tests/tsc-references/classWithConstructors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithConstructors_es2015.1.normal.js @@ -1,14 +1,12 @@ var NonGeneric; (function(NonGeneric) { class C { - constructor(x){ - } + constructor(x){} } var c = new C(); // error var c2 = new C(''); // ok class C2 { - constructor(x){ - } + constructor(x){} } var c3 = new C2(); // error var c4 = new C2(''); // ok @@ -18,19 +16,16 @@ var NonGeneric; var d = new D(); // error var d2 = new D(1); // ok var d3 = new D(''); // ok -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generics; (function(Generics) { class C { - constructor(x){ - } + constructor(x){} } var c = new C(); // error var c2 = new C(''); // ok class C2 { - constructor(x){ - } + constructor(x){} } var c3 = new C2(); // error var c4 = new C2(''); // ok @@ -40,5 +35,4 @@ var Generics; var d = new D(); // error var d2 = new D(1); // ok var d3 = new D(''); // ok -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/classWithConstructors_es2015.2.minified.js b/crates/swc/tests/tsc-references/classWithConstructors_es2015.2.minified.js index a0c240b19b7..b4f549238ba 100644 --- a/crates/swc/tests/tsc-references/classWithConstructors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithConstructors_es2015.2.minified.js @@ -1,32 +1,26 @@ var NonGeneric, Generics; !function(NonGeneric) { class C { - constructor(x){ - } + constructor(x){} } new C(), new C(""); class C2 { - constructor(x){ - } + constructor(x){} } new C2(), new C2(""), new C2(1); class D extends C2 { } new D(), new D(1), new D(""); -}(NonGeneric || (NonGeneric = { -})), (function(Generics) { +}(NonGeneric || (NonGeneric = {})), (function(Generics) { class C { - constructor(x){ - } + constructor(x){} } new C(), new C(""); class C2 { - constructor(x){ - } + constructor(x){} } new C2(), new C2(""), new C2(1, 2); class D extends C2 { } new D(), new D(1), new D(""); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/classWithConstructors_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithConstructors_es5.1.normal.js index 2d16932fdd4..5a95a6e3a80 100644 --- a/crates/swc/tests/tsc-references/classWithConstructors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithConstructors_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -97,8 +96,7 @@ var NonGeneric; var d = new D(); // error var d2 = new D(1); // ok var d3 = new D(''); // ok -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generics; (function(Generics) { var C = function C(x) { @@ -127,5 +125,4 @@ var Generics; var d = new D(); // error var d2 = new D(1); // ok var d3 = new D(''); // ok -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/classWithConstructors_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithConstructors_es5.2.minified.js index a9571ae18ea..7d04231ffea 100644 --- a/crates/swc/tests/tsc-references/classWithConstructors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithConstructors_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -67,8 +66,7 @@ function _createSuper(Derived) { return D; }(C21); new D(), new D(1), new D(""); -}(NonGeneric || (NonGeneric = { -})), (function(Generics) { +}(NonGeneric || (NonGeneric = {})), (function(Generics) { var C = function(x) { "use strict"; _classCallCheck(this, C); @@ -89,5 +87,4 @@ function _createSuper(Derived) { return D; }(C22); new D(), new D(1), new D(""); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/classWithEmptyBody_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithEmptyBody_es2015.1.normal.js index fd11af94f75..a88473e70d8 100644 --- a/crates/swc/tests/tsc-references/classWithEmptyBody_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithEmptyBody_es2015.1.normal.js @@ -6,8 +6,7 @@ c = 1; c = { foo: '' }; -c = ()=>{ -}; +c = ()=>{}; class D { constructor(){ return 1; @@ -19,5 +18,4 @@ d = 1; d = { foo: '' }; -d = ()=>{ -}; +d = ()=>{}; diff --git a/crates/swc/tests/tsc-references/classWithEmptyBody_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithEmptyBody_es5.1.normal.js index 8d2e61ed8ee..4ea16a0fc05 100644 --- a/crates/swc/tests/tsc-references/classWithEmptyBody_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithEmptyBody_es5.1.normal.js @@ -13,8 +13,7 @@ c = 1; c = { foo: '' }; -c = function() { -}; +c = function() {}; var D = function D() { "use strict"; _classCallCheck(this, D); @@ -26,5 +25,4 @@ d = 1; d = { foo: '' }; -d = function() { -}; +d = function() {}; diff --git a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es2015.1.normal.js index 74a5b1ebdfc..49d1808e203 100644 --- a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es2015.1.normal.js @@ -7,8 +7,7 @@ class C { get z() { return 1; } - set z(v) { - } + set z(v) {} } var c; var i; diff --git a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.1.normal.js index 2c96f8497d3..96d048c3ebb 100644 --- a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.1.normal.js @@ -36,8 +36,7 @@ var C = // @target: es5 get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.2.minified.js index 15a6f06459b..a81615bdcd2 100644 --- a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface2_es5.2.minified.js @@ -24,8 +24,7 @@ var i, C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es2015.1.normal.js index 74a5b1ebdfc..49d1808e203 100644 --- a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es2015.1.normal.js @@ -7,8 +7,7 @@ class C { get z() { return 1; } - set z(v) { - } + set z(v) {} } var c; var i; diff --git a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.1.normal.js index 2c96f8497d3..96d048c3ebb 100644 --- a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.1.normal.js @@ -36,8 +36,7 @@ var C = // @target: es5 get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.2.minified.js index 15a6f06459b..a81615bdcd2 100644 --- a/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithOnlyPublicMembersEquivalentToInterface_es5.2.minified.js @@ -24,8 +24,7 @@ var i, C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/classWithOptionalParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithOptionalParameter_es2015.1.normal.js index a9d1973e784..81761c1dc1f 100644 --- a/crates/swc/tests/tsc-references/classWithOptionalParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithOptionalParameter_es2015.1.normal.js @@ -1,9 +1,7 @@ // classes do not permit optional parameters, these are errors class C { - f() { - } + f() {} } class C2 { - f(x) { - } + f(x) {} } diff --git a/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.1.normal.js index d46c1f08bf8..547ced85efb 100644 --- a/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // classes do not permit optional parameters, these are errors _createClass(C, [ { key: "f", - value: function f() { - } + value: function f() {} } ]); return C; @@ -40,8 +39,7 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "f", - value: function f(x) { - } + value: function f(x) {} } ]); return C2; diff --git a/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.2.minified.js index 0dfa355a51e..ca5edff5cb2 100644 --- a/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithOptionalParameter_es5.2.minified.js @@ -18,8 +18,7 @@ var C = function() { return _createClass(C, [ { key: "f", - value: function() { - } + value: function() {} } ]), C; }(), C2 = function() { @@ -30,8 +29,7 @@ var C = function() { return _createClass(C2, [ { key: "f", - value: function(x) { - } + value: function(x) {} } ]), C2; }(); diff --git a/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.1.normal.js index dc1e8234b28..f9330061a6a 100644 --- a/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.2.minified.js index f73559e551f..4676e52335e 100644 --- a/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithProtectedProperty_es5.2.minified.js @@ -64,8 +64,7 @@ var D = function(C1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.1.normal.js index 92fec64d4c2..c45cad5499a 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.2.minified.js index 859c8357db9..e8e0307ff49 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.1.normal.js index 92fec64d4c2..c45cad5499a 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.2.minified.js index 859c8357db9..e8e0307ff49 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern_es2015.1.normal.js index 824a740b70d..8e1706205b1 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern_es2015.1.normal.js @@ -3,5 +3,4 @@ var _class; // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/36295 (({ [(_class = class { -}, _class.x = 1, _class).x]: b = "" })=>{ -})(); +}, _class.x = 1, _class).x]: b = "" })=>{})(); diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.1.normal.js index 703da976c1a..f207cd7928f 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.2.minified.js index 238d87c39db..0af50a09ffd 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.1.normal.js index 703da976c1a..f207cd7928f 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.2.minified.js index 238d87c39db..0af50a09ffd 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer_es2015.1.normal.js index ca3e5fb7576..be6ce47a665 100644 --- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer_es2015.1.normal.js @@ -3,5 +3,4 @@ var _class; // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/36295 ((b = (_class = class { -}, _class.x = 1, _class))=>{ -})(); +}, _class.x = 1, _class))=>{})(); diff --git a/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.1.normal.js index f78941d9891..1633a47943b 100644 --- a/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.1.normal.js @@ -5,8 +5,7 @@ class C { static get x() { return 1; } - static set x(v) { - } + static set x(v) {} constructor(a, b){ this.a = a; this.b = b; diff --git a/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.2.minified.js index 6b559bac5d4..0eeb726d09b 100644 --- a/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithStaticMembers_es2015.2.minified.js @@ -5,8 +5,7 @@ class C { static get x() { return 1; } - static set x(v) { - } + static set x(v) {} constructor(a, b){ this.a = a, this.b = b; } diff --git a/crates/swc/tests/tsc-references/classWithStaticMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticMembers_es5.1.normal.js index f83782b7922..2247721e862 100644 --- a/crates/swc/tests/tsc-references/classWithStaticMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithStaticMembers_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -102,8 +101,7 @@ var C = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/classWithStaticMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticMembers_es5.2.minified.js index 48945b2846c..4282f7159cc 100644 --- a/crates/swc/tests/tsc-references/classWithStaticMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithStaticMembers_es5.2.minified.js @@ -34,8 +34,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), C; }(), r = C.fn(); @@ -58,8 +57,7 @@ var D = function(C) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/classWithTwoConstructorDefinitions_es2015.1.normal.js b/crates/swc/tests/tsc-references/classWithTwoConstructorDefinitions_es2015.1.normal.js index 135b143e34a..0d8d9cf90cf 100644 --- a/crates/swc/tests/tsc-references/classWithTwoConstructorDefinitions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithTwoConstructorDefinitions_es2015.1.normal.js @@ -1,8 +1,6 @@ class C { - constructor(x){ - } + constructor(x){} } class D { - constructor(x, y){ - } + constructor(x, y){} } diff --git a/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es2015.1.normal.js b/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es2015.1.normal.js index bc91cbf9021..c7f38dd949b 100644 --- a/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es2015.1.normal.js @@ -1,7 +1,6 @@ // @allowUnreachableCode: true //Comma operator in for loop -for(var i = 0, j = 10; i < j; i++, j--){ -} +for(var i = 0, j = 10; i < j; i++, j--){} //Comma operator in function arguments and return function foo(x, y) { return x, y; diff --git a/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es5.1.normal.js b/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es5.1.normal.js index bc91cbf9021..c7f38dd949b 100644 --- a/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/commaOperatorOtherValidOperation_es5.1.normal.js @@ -1,7 +1,6 @@ // @allowUnreachableCode: true //Comma operator in for loop -for(var i = 0, j = 10; i < j; i++, j--){ -} +for(var i = 0, j = 10; i < j; i++, j--){} //Comma operator in function arguments and return function foo(x, y) { return x, y; diff --git a/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es2015.1.normal.js b/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es2015.1.normal.js index 1af7afb5c36..4701c140152 100644 --- a/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es2015.1.normal.js @@ -21,15 +21,13 @@ var resultIsObject5 = (OBJECT, OBJECT); //Literal and expression null, OBJECT; ANY = null, OBJECT; -true, { -}; +true, {}; !BOOLEAN, []; "string", new Date(); STRING.toLowerCase(), new CLASS(); var resultIsObject6 = (null, OBJECT); var resultIsObject7 = (ANY = null, OBJECT); -var resultIsObject8 = (true, { -}); +var resultIsObject8 = (true, {}); var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" diff --git a/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es5.1.normal.js b/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es5.1.normal.js index a8b7896278a..9c0aad2112f 100644 --- a/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/commaOperatorWithSecondOperandObjectType_es5.1.normal.js @@ -28,15 +28,13 @@ var resultIsObject5 = (OBJECT, OBJECT); //Literal and expression null, OBJECT; ANY = null, OBJECT; -true, { -}; +true, {}; !BOOLEAN, []; "string", new Date(); STRING.toLowerCase(), new CLASS(); var resultIsObject6 = (null, OBJECT); var resultIsObject7 = (ANY = null, OBJECT); -var resultIsObject8 = (true, { -}); +var resultIsObject8 = (true, {}); var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" diff --git a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.1.normal.js index c3bbd5e1e98..5f12bfa9b51 100644 --- a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.1.normal.js @@ -10,6 +10,5 @@ const { K } = require("./mod1"); } // @filename: mod1.js exports.K = class K { - values() { - } + values() {} }; diff --git a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.2.minified.js index 815afb5fbfb..cba57ba1140 100644 --- a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es2015.2.minified.js @@ -1,5 +1,4 @@ const { K } = require("./mod1"); exports.K = class { - values() { - } + values() {} }; diff --git a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.1.normal.js index 8a26d31c13d..ef287ae6bab 100644 --- a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.1.normal.js @@ -36,8 +36,7 @@ exports.K = /*#__PURE__*/ (function() { _createClass(K1, [ { key: "values", - value: function values() { - } + value: function values() {} } ]); return K1; diff --git a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.2.minified.js index 963c2ca13f4..0db30b90edd 100644 --- a/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSImportExportedClassExpression_es5.2.minified.js @@ -15,8 +15,7 @@ require("./mod1").K, exports.K = (function() { return protoProps = [ { key: "values", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = K).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), K; })(); diff --git a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.1.normal.js b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.1.normal.js index 82fa4772010..b700cec2e36 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.1.normal.js @@ -9,8 +9,7 @@ const { K } = require("./mod1"); k.values(); } // @filename: mod1.js -var NS = { -}; +var NS = {}; NS.K = class _class { values() { return new NS.K(); diff --git a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.2.minified.js b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.2.minified.js index de8098acd8b..174a4814895 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es2015.2.minified.js @@ -1,6 +1,5 @@ const { K } = require("./mod1"); -var NS = { -}; +var NS = {}; NS.K = class { values() { return new NS.K(); diff --git a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.1.normal.js b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.1.normal.js index a7e820744b3..0b70a64e025 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.1.normal.js @@ -28,8 +28,7 @@ var K = require("./mod1").K; k.values(); } // @filename: mod1.js -var NS = { -}; +var NS = {}; NS.K = /*#__PURE__*/ (function() { "use strict"; function _class() { diff --git a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.2.minified.js b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.2.minified.js index 3adb2e84106..e0b4ee0cd52 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSImportNestedClassTypeReference_es5.2.minified.js @@ -5,8 +5,7 @@ function _defineProperties(target, props) { } } require("./mod1").K; -var NS = { -}; +var NS = {}; NS.K = (function() { "use strict"; var Constructor, protoProps, staticProps; diff --git a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.1.normal.js index ecfd1b0d0ec..228e6e5461d 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.1.normal.js @@ -11,13 +11,11 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); // @Filename: foo_1.ts const foo = require("./foo_0"); var i; -var x = { -}; +var x = {}; var y = false; var z; var e = 0; diff --git a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.2.minified.js index 54585c7e769..d62f0a2dfc9 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es2015.2.minified.js @@ -4,5 +4,4 @@ export class C1 { this.m1 = 42; } } -C1.s1 = !0, (E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); +C1.s1 = !0, (E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.1.normal.js index 8a58ba88084..9961f54523d 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.1.normal.js @@ -16,13 +16,11 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); // @Filename: foo_1.ts var foo = require("./foo_0"); var i; -var x = { -}; +var x = {}; var y = false; var z; var e = 0; diff --git a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.2.minified.js index 06ef9fb1916..1f2f151f729 100644 --- a/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSImportNotAsPrimaryExpression_es5.2.minified.js @@ -4,5 +4,4 @@ export var E1, E1, i, z, C1 = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C1), this.m1 = 42; }; -C1.s1 = !0, (E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); +C1.s1 = !0, (E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.1.normal.js index 028f49b3b31..e93a91a5216 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.2.minified.js index 2173f49717c..10bcd26290b 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.1.normal.js index 86c90c4ecc2..685daa8ebbe 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.1.normal.js index 86c90c4ecc2..685daa8ebbe 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.1.normal.js index 4c5ee90e88d..5e8abdf5cd2 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.2.minified.js index d5814a9acd6..bc716b83449 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.1.normal.js index 4c5ee90e88d..5e8abdf5cd2 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.2.minified.js index d5814a9acd6..bc716b83449 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.1.normal.js index 7308bb1543b..68affd29233 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.2.minified.js index d5814a9acd6..bc716b83449 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.1.normal.js index 6b340ee9f9c..c901103ac00 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.2.minified.js index d5814a9acd6..bc716b83449 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.1.normal.js index 6b340ee9f9c..c901103ac00 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.2.minified.js index d5814a9acd6..bc716b83449 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.1.normal.js index 8de1703d3c8..bef115428fe 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.2.minified.js index 18bda281033..84c041ed603 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, a < c; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, a < c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.1.normal.js index 8de1703d3c8..bef115428fe 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.2.minified.js index 18bda281033..84c041ed603 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipPrimitiveType_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, a < c; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, a < c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.1.normal.js index 3ad0703830e..486628a4156 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.1.normal.js index 3ad0703830e..486628a4156 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipTypeParameter_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.1.normal.js index 5807403f8ac..8b8bd3e9fec 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.1.normal.js @@ -4,8 +4,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t) { var foo_r1 = t < x; var foo_r2 = t > x; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.1.normal.js index 5807403f8ac..8b8bd3e9fec 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.1.normal.js @@ -4,8 +4,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t) { var foo_r1 = t < x; var foo_r2 = t > x; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsAny_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.1.normal.js index 12b84492e46..fc16f1625e1 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t) { var foo_r1 = t < null; var foo_r2 = t > null; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.1.normal.js index 12b84492e46..fc16f1625e1 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t) { var foo_r1 = t < null; var foo_r2 = t > null; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.1.normal.js index 5807403f8ac..8b8bd3e9fec 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.1.normal.js @@ -4,8 +4,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t) { var foo_r1 = t < x; var foo_r2 = t > x; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.1.normal.js index 5807403f8ac..8b8bd3e9fec 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.1.normal.js @@ -4,8 +4,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); function foo(t) { var foo_r1 = t < x; var foo_r2 = t > x; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.2.minified.js index 97698574f44..ceca977f367 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsUndefined_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.1.normal.js index 01b110228f9..dd5d9af1ff6 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator < diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.2.minified.js index 506115d6441..81ba30b80ab 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, b < a, E.a < b, b < E.a, E.a < 0, 0 < E.a, E.a > b, b > E.a, E.a > 0, 0 > E.a, E.a <= b, b <= E.a, E.a <= 0, 0 <= E.a, E.a >= b, b >= E.a, E.a >= 0, 0 >= E.a, E.a == b, b == E.a, 0 == E.a, 0 == E.a, E.a != b, b != E.a, 0 != E.a, 0 != E.a, E.a === b, b === E.a, 0 === E.a, 0 === E.a, E.a !== b, b !== E.a, 0 !== E.a, 0 !== E.a; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, b < a, E.a < b, b < E.a, E.a < 0, 0 < E.a, E.a > b, b > E.a, E.a > 0, 0 > E.a, E.a <= b, b <= E.a, E.a <= 0, 0 <= E.a, E.a >= b, b >= E.a, E.a >= 0, 0 >= E.a, E.a == b, b == E.a, 0 == E.a, 0 == E.a, E.a != b, b != E.a, 0 != E.a, 0 != E.a, E.a === b, b === E.a, 0 === E.a, 0 === E.a, E.a !== b, b !== E.a, 0 !== E.a, 0 !== E.a; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.1.normal.js index 01b110228f9..dd5d9af1ff6 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator < diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.2.minified.js index 506115d6441..81ba30b80ab 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeEnumAndNumber_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, b < a, E.a < b, b < E.a, E.a < 0, 0 < E.a, E.a > b, b > E.a, E.a > 0, 0 > E.a, E.a <= b, b <= E.a, E.a <= 0, 0 <= E.a, E.a >= b, b >= E.a, E.a >= 0, 0 >= E.a, E.a == b, b == E.a, 0 == E.a, 0 == E.a, E.a != b, b != E.a, 0 != E.a, 0 != E.a, E.a === b, b === E.a, 0 === E.a, 0 === E.a, E.a !== b, b !== E.a, 0 !== E.a, 0 !== E.a; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", a < b, b < a, E.a < b, b < E.a, E.a < 0, 0 < E.a, E.a > b, b > E.a, E.a > 0, 0 > E.a, E.a <= b, b <= E.a, E.a <= 0, 0 <= E.a, E.a >= b, b >= E.a, E.a >= 0, 0 >= E.a, E.a == b, b == E.a, 0 == E.a, 0 == E.a, E.a != b, b != E.a, 0 != E.a, 0 != E.a, E.a === b, b === E.a, 0 === E.a, 0 === E.a, E.a !== b, b !== E.a, 0 !== E.a, 0 !== E.a; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.1.normal.js index 50d56234037..245f34bcba7 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.2.minified.js index 66b84cf0a70..b832662b059 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.1.normal.js index 45b5e9fc152..bd70c9f66fb 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.2.minified.js index 66b84cf0a70..b832662b059 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.1.normal.js index 38ecc25eb84..43174a3211f 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.2.minified.js index 66b84cf0a70..b832662b059 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.1.normal.js index b51a22e832e..9dab15c7aba 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.2.minified.js index 66b84cf0a70..b832662b059 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.1.normal.js index d9fcf945d30..33ffa9768cf 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.2.minified.js index 66b84cf0a70..b832662b059 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.1.normal.js index 406c20bbf3b..59be7c3c2fa 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.2.minified.js index 3db51557e22..c8801a144b4 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.1.normal.js index 34af0ef3097..96cc67299f4 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var x1; @@ -13,8 +12,7 @@ x1 += true; x1 += 0; x1 += ''; x1 += E.a; -x1 += { -}; +x1 += {}; x1 += null; x1 += undefined; var x2; @@ -24,8 +22,7 @@ x2 += true; x2 += 0; x2 += ''; x2 += E.a; -x2 += { -}; +x2 += {}; x2 += null; x2 += undefined; var x3; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.2.minified.js index f3e2e5de102..540b495ad26 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es2015.2.minified.js @@ -1,5 +1,2 @@ var E, a, b, x1, x2, x3, x4, x5, x6, x7, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += b, x1 += !0, x1 += 0, x1 += "", x1 += E.a, x1 += { -}, x1 += null, x1 += void 0, x2 += a, x2 += b, x2 += !0, x2 += 0, x2 += "", x2 += E.a, x2 += { -}, x2 += null, x2 += void 0, x3 += a, x3 += 0, x3 += E.a, x3 += null, x3 += void 0, x4 += a, x4 += 0, x4 += E.a, x4 += null, x4 += void 0, x5 += a, x6 += a, x6 += "", x7 += a; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += b, x1 += !0, x1 += 0, x1 += "", x1 += E.a, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += b, x2 += !0, x2 += 0, x2 += "", x2 += E.a, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += 0, x3 += E.a, x3 += null, x3 += void 0, x4 += a, x4 += 0, x4 += E.a, x4 += null, x4 += void 0, x5 += a, x6 += a, x6 += "", x7 += a; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.1.normal.js index 34af0ef3097..96cc67299f4 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var x1; @@ -13,8 +12,7 @@ x1 += true; x1 += 0; x1 += ''; x1 += E.a; -x1 += { -}; +x1 += {}; x1 += null; x1 += undefined; var x2; @@ -24,8 +22,7 @@ x2 += true; x2 += 0; x2 += ''; x2 += E.a; -x2 += { -}; +x2 += {}; x2 += null; x2 += undefined; var x3; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.2.minified.js index f3e2e5de102..540b495ad26 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned_es5.2.minified.js @@ -1,5 +1,2 @@ var E, a, b, x1, x2, x3, x4, x5, x6, x7, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += b, x1 += !0, x1 += 0, x1 += "", x1 += E.a, x1 += { -}, x1 += null, x1 += void 0, x2 += a, x2 += b, x2 += !0, x2 += 0, x2 += "", x2 += E.a, x2 += { -}, x2 += null, x2 += void 0, x3 += a, x3 += 0, x3 += E.a, x3 += null, x3 += void 0, x4 += a, x4 += 0, x4 += E.a, x4 += null, x4 += void 0, x5 += a, x6 += a, x6 += "", x7 += a; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += b, x1 += !0, x1 += 0, x1 += "", x1 += E.a, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += b, x2 += !0, x2 += 0, x2 += "", x2 += E.a, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += 0, x3 += E.a, x3 += null, x3 += void 0, x4 += a, x4 += 0, x4 += E.a, x4 += null, x4 += void 0, x5 += a, x6 += a, x6 += "", x7 += a; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.1.normal.js index 843a3c473a1..2b8b65941ec 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.1.normal.js @@ -4,8 +4,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var x1; x1 += ''; var x2; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.2.minified.js index c7ef61e1146..8bf1a3df061 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, x1, x2, x3, x4, x5, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 += "", x2 += "", x3 += "", x4 += "", x5 += ""; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 += "", x2 += "", x3 += "", x4 += "", x5 += ""; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.1.normal.js index 843a3c473a1..2b8b65941ec 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.1.normal.js @@ -4,8 +4,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var x1; x1 += ''; var x2; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.2.minified.js index c7ef61e1146..8bf1a3df061 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned_es5.2.minified.js @@ -1,3 +1,2 @@ var E, x1, x2, x3, x4, x5, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 += "", x2 += "", x3 += "", x4 += "", x5 += ""; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 += "", x2 += "", x3 += "", x4 += "", x5 += ""; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.1.normal.js index c61571075aa..68af4961f1c 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.1.normal.js @@ -2,16 +2,14 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var x1; x1 += a; x1 += true; x1 += 0; x1 += E.a; -x1 += { -}; +x1 += {}; x1 += null; x1 += undefined; var x2; @@ -19,8 +17,7 @@ x2 += a; x2 += true; x2 += 0; x2 += E.a; -x2 += { -}; +x2 += {}; x2 += null; x2 += undefined; var x3; @@ -28,17 +25,14 @@ x3 += a; x3 += true; x3 += 0; x3 += E.a; -x3 += { -}; +x3 += {}; x3 += null; x3 += undefined; var x4; x4 += a; x4 += true; -x4 += { -}; +x4 += {}; var x5; x5 += a; x5 += true; -x5 += { -}; +x5 += {}; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.2.minified.js index 5e0ffdae831..b51db22d96c 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es2015.2.minified.js @@ -1,8 +1,2 @@ var E, a, x1, x2, x3, x4, x5, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += !0, x1 += 0, x1 += E.a, x1 += { -}, x1 += null, x1 += void 0, x2 += a, x2 += !0, x2 += 0, x2 += E.a, x2 += { -}, x2 += null, x2 += void 0, x3 += a, x3 += !0, x3 += 0, x3 += E.a, x3 += { -}, x3 += null, x3 += void 0, x4 += a, x4 += !0, x4 += { -}, x5 += a, x5 += !0, x5 += { -}; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += !0, x1 += 0, x1 += E.a, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += !0, x2 += 0, x2 += E.a, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += !0, x3 += 0, x3 += E.a, x3 += {}, x3 += null, x3 += void 0, x4 += a, x4 += !0, x4 += {}, x5 += a, x5 += !0, x5 += {}; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.1.normal.js index c61571075aa..68af4961f1c 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.1.normal.js @@ -2,16 +2,14 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var x1; x1 += a; x1 += true; x1 += 0; x1 += E.a; -x1 += { -}; +x1 += {}; x1 += null; x1 += undefined; var x2; @@ -19,8 +17,7 @@ x2 += a; x2 += true; x2 += 0; x2 += E.a; -x2 += { -}; +x2 += {}; x2 += null; x2 += undefined; var x3; @@ -28,17 +25,14 @@ x3 += a; x3 += true; x3 += 0; x3 += E.a; -x3 += { -}; +x3 += {}; x3 += null; x3 += undefined; var x4; x4 += a; x4 += true; -x4 += { -}; +x4 += {}; var x5; x5 += a; x5 += true; -x5 += { -}; +x5 += {}; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.2.minified.js index 5e0ffdae831..b51db22d96c 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentWithInvalidOperands_es5.2.minified.js @@ -1,8 +1,2 @@ var E, a, x1, x2, x3, x4, x5, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += !0, x1 += 0, x1 += E.a, x1 += { -}, x1 += null, x1 += void 0, x2 += a, x2 += !0, x2 += 0, x2 += E.a, x2 += { -}, x2 += null, x2 += void 0, x3 += a, x3 += !0, x3 += 0, x3 += E.a, x3 += { -}, x3 += null, x3 += void 0, x4 += a, x4 += !0, x4 += { -}, x5 += a, x5 += !0, x5 += { -}; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 += a, x1 += !0, x1 += 0, x1 += E.a, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += !0, x2 += 0, x2 += E.a, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += !0, x3 += 0, x3 += E.a, x3 += {}, x3 += null, x3 += void 0, x4 += a, x4 += !0, x4 += {}, x5 += a, x5 += !0, x5 += {}; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.1.normal.js index f41b8357ca4..91dd8943237 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.2.minified.js index fa0cdb45a5a..6e708914033 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, a, b, c, x1, x2, x3, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 *= a, x1 *= b, x1 *= c, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= c, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= c, x3 *= null, x3 *= void 0; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 *= a, x1 *= b, x1 *= c, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= c, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= c, x3 *= null, x3 *= void 0; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.1.normal.js index f41b8357ca4..91dd8943237 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.2.minified.js index fa0cdb45a5a..6e708914033 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned_es5.2.minified.js @@ -1,3 +1,2 @@ var E, a, b, c, x1, x2, x3, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 *= a, x1 *= b, x1 *= c, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= c, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= c, x3 *= null, x3 *= void 0; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 *= a, x1 *= b, x1 *= c, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= c, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= c, x3 *= null, x3 *= void 0; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.1.normal.js index 58f91e84c0b..59a6763a812 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var x1; @@ -13,8 +12,7 @@ x1 *= true; x1 *= 0; x1 *= ''; x1 *= E.a; -x1 *= { -}; +x1 *= {}; x1 *= null; x1 *= undefined; var x2; @@ -24,8 +22,7 @@ x2 *= true; x2 *= 0; x2 *= ''; x2 *= E.a; -x2 *= { -}; +x2 *= {}; x2 *= null; x2 *= undefined; var x3; @@ -35,8 +32,7 @@ x3 *= true; x3 *= 0; x3 *= ''; x3 *= E.a; -x3 *= { -}; +x3 *= {}; x3 *= null; x3 *= undefined; var x4; @@ -46,19 +42,16 @@ x4 *= true; x4 *= 0; x4 *= ''; x4 *= E.a; -x4 *= { -}; +x4 *= {}; x4 *= null; x4 *= undefined; var x5; x5 *= b; x5 *= true; x5 *= ''; -x5 *= { -}; +x5 *= {}; var x6; x6 *= b; x6 *= true; x6 *= ''; -x6 *= { -}; +x6 *= {}; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.2.minified.js index 556c415d8e7..e6799ecc61e 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es2015.2.minified.js @@ -1,9 +1,2 @@ var E, a, b, x1, x2, x3, x4, x5, x6, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 *= a, x1 *= b, x1 *= !0, x1 *= 0, x1 *= "", x1 *= E.a, x1 *= { -}, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= !0, x2 *= 0, x2 *= "", x2 *= E.a, x2 *= { -}, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= !0, x3 *= 0, x3 *= "", x3 *= E.a, x3 *= { -}, x3 *= null, x3 *= void 0, x4 *= a, x4 *= b, x4 *= !0, x4 *= 0, x4 *= "", x4 *= E.a, x4 *= { -}, x4 *= null, x4 *= void 0, x5 *= b, x5 *= !0, x5 *= "", x5 *= { -}, x6 *= b, x6 *= !0, x6 *= "", x6 *= { -}; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 *= a, x1 *= b, x1 *= !0, x1 *= 0, x1 *= "", x1 *= E.a, x1 *= {}, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= !0, x2 *= 0, x2 *= "", x2 *= E.a, x2 *= {}, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= !0, x3 *= 0, x3 *= "", x3 *= E.a, x3 *= {}, x3 *= null, x3 *= void 0, x4 *= a, x4 *= b, x4 *= !0, x4 *= 0, x4 *= "", x4 *= E.a, x4 *= {}, x4 *= null, x4 *= void 0, x5 *= b, x5 *= !0, x5 *= "", x5 *= {}, x6 *= b, x6 *= !0, x6 *= "", x6 *= {}; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.1.normal.js index 58f91e84c0b..59a6763a812 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var x1; @@ -13,8 +12,7 @@ x1 *= true; x1 *= 0; x1 *= ''; x1 *= E.a; -x1 *= { -}; +x1 *= {}; x1 *= null; x1 *= undefined; var x2; @@ -24,8 +22,7 @@ x2 *= true; x2 *= 0; x2 *= ''; x2 *= E.a; -x2 *= { -}; +x2 *= {}; x2 *= null; x2 *= undefined; var x3; @@ -35,8 +32,7 @@ x3 *= true; x3 *= 0; x3 *= ''; x3 *= E.a; -x3 *= { -}; +x3 *= {}; x3 *= null; x3 *= undefined; var x4; @@ -46,19 +42,16 @@ x4 *= true; x4 *= 0; x4 *= ''; x4 *= E.a; -x4 *= { -}; +x4 *= {}; x4 *= null; x4 *= undefined; var x5; x5 *= b; x5 *= true; x5 *= ''; -x5 *= { -}; +x5 *= {}; var x6; x6 *= b; x6 *= true; x6 *= ''; -x6 *= { -}; +x6 *= {}; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.2.minified.js index 556c415d8e7..e6799ecc61e 100644 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands_es5.2.minified.js @@ -1,9 +1,2 @@ var E, a, b, x1, x2, x3, x4, x5, x6, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 *= a, x1 *= b, x1 *= !0, x1 *= 0, x1 *= "", x1 *= E.a, x1 *= { -}, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= !0, x2 *= 0, x2 *= "", x2 *= E.a, x2 *= { -}, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= !0, x3 *= 0, x3 *= "", x3 *= E.a, x3 *= { -}, x3 *= null, x3 *= void 0, x4 *= a, x4 *= b, x4 *= !0, x4 *= 0, x4 *= "", x4 *= E.a, x4 *= { -}, x4 *= null, x4 *= void 0, x5 *= b, x5 *= !0, x5 *= "", x5 *= { -}, x6 *= b, x6 *= !0, x6 *= "", x6 *= { -}; +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 *= a, x1 *= b, x1 *= !0, x1 *= 0, x1 *= "", x1 *= E.a, x1 *= {}, x1 *= null, x1 *= void 0, x2 *= a, x2 *= b, x2 *= !0, x2 *= 0, x2 *= "", x2 *= E.a, x2 *= {}, x2 *= null, x2 *= void 0, x3 *= a, x3 *= b, x3 *= !0, x3 *= 0, x3 *= "", x3 *= E.a, x3 *= {}, x3 *= null, x3 *= void 0, x4 *= a, x4 *= b, x4 *= !0, x4 *= 0, x4 *= "", x4 *= E.a, x4 *= {}, x4 *= null, x4 *= void 0, x5 *= b, x5 *= !0, x5 *= "", x5 *= {}, x6 *= b, x6 *= !0, x6 *= "", x6 *= {}; diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.1.normal.js index 06f91b6d133..0e46467dd7c 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.2.minified.js index 0d89e56da56..2d2e7e6fb57 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, a, b, c, x1, x2, x3, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, c) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, c), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, c), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, c) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, c), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, c), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.1.normal.js index 06f91b6d133..0e46467dd7c 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.2.minified.js index 0d89e56da56..2d2e7e6fb57 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1_es5.2.minified.js @@ -1,3 +1,2 @@ var E, a, b, c, x1, x2, x3, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, c) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, c), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, c), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, c) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, c), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, c), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.1.normal.js index a17ad068022..0a990185f0b 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var x1; @@ -13,8 +12,7 @@ x1 = Math.pow(x1, true); x1 = Math.pow(x1, 0); x1 = Math.pow(x1, ''); x1 = Math.pow(x1, E.a); -x1 = Math.pow(x1, { -}); +x1 = Math.pow(x1, {}); x1 = Math.pow(x1, null); x1 = Math.pow(x1, undefined); var x2; @@ -24,8 +22,7 @@ x2 = Math.pow(x2, true); x2 = Math.pow(x2, 0); x2 = Math.pow(x2, ''); x2 = Math.pow(x2, E.a); -x2 = Math.pow(x2, { -}); +x2 = Math.pow(x2, {}); x2 = Math.pow(x2, null); x2 = Math.pow(x2, undefined); var x3; @@ -35,8 +32,7 @@ x3 = Math.pow(x3, true); x3 = Math.pow(x3, 0); x3 = Math.pow(x3, ''); x3 = Math.pow(x3, E.a); -x3 = Math.pow(x3, { -}); +x3 = Math.pow(x3, {}); x3 = Math.pow(x3, null); x3 = Math.pow(x3, undefined); var x4; @@ -46,19 +42,16 @@ x4 = Math.pow(x4, true); x4 = Math.pow(x4, 0); x4 = Math.pow(x4, ''); x4 = Math.pow(x4, E.a); -x4 = Math.pow(x4, { -}); +x4 = Math.pow(x4, {}); x4 = Math.pow(x4, null); x4 = Math.pow(x4, undefined); var x5; x5 = Math.pow(x5, b); x5 = Math.pow(x5, true); x5 = Math.pow(x5, ''); -x5 = Math.pow(x5, { -}); +x5 = Math.pow(x5, {}); var x6; x6 = Math.pow(x6, b); x6 = Math.pow(x6, true); x6 = Math.pow(x6, ''); -x6 = Math.pow(x6, { -}); +x6 = Math.pow(x6, {}); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.2.minified.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.2.minified.js index f696fcf0d87..c87dce857ac 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es2015.2.minified.js @@ -1,9 +1,2 @@ var E, a, b, x1, x2, x3, x4, x5, x6, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, !0) = Math.pow(x1, 0), x1 = Math.pow(x1, "") = Math.pow(x1, E.a), x1 = Math.pow(x1, { -}) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, !0), x2 = Math.pow(x2, 0), x2 = Math.pow(x2, ""), x2 = Math.pow(x2, E.a), x2 = Math.pow(x2, { -}), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, !0), x3 = Math.pow(x3, 0), x3 = Math.pow(x3, ""), x3 = Math.pow(x3, E.a), x3 = Math.pow(x3, { -}), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0), x4 = Math.pow(x4, a), x4 = Math.pow(x4, b), x4 = Math.pow(x4, !0), x4 = Math.pow(x4, 0), x4 = Math.pow(x4, ""), x4 = Math.pow(x4, E.a), x4 = Math.pow(x4, { -}), x4 = Math.pow(x4, null), x4 = Math.pow(x4, void 0), x5 = Math.pow(x5, b), x5 = Math.pow(x5, !0), x5 = Math.pow(x5, ""), x5 = Math.pow(x5, { -}), x6 = Math.pow(x6, b), x6 = Math.pow(x6, !0), x6 = Math.pow(x6, ""), x6 = Math.pow(x6, { -}); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, !0) = Math.pow(x1, 0), x1 = Math.pow(x1, "") = Math.pow(x1, E.a), x1 = Math.pow(x1, {}) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, !0), x2 = Math.pow(x2, 0), x2 = Math.pow(x2, ""), x2 = Math.pow(x2, E.a), x2 = Math.pow(x2, {}), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, !0), x3 = Math.pow(x3, 0), x3 = Math.pow(x3, ""), x3 = Math.pow(x3, E.a), x3 = Math.pow(x3, {}), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0), x4 = Math.pow(x4, a), x4 = Math.pow(x4, b), x4 = Math.pow(x4, !0), x4 = Math.pow(x4, 0), x4 = Math.pow(x4, ""), x4 = Math.pow(x4, E.a), x4 = Math.pow(x4, {}), x4 = Math.pow(x4, null), x4 = Math.pow(x4, void 0), x5 = Math.pow(x5, b), x5 = Math.pow(x5, !0), x5 = Math.pow(x5, ""), x5 = Math.pow(x5, {}), x6 = Math.pow(x6, b), x6 = Math.pow(x6, !0), x6 = Math.pow(x6, ""), x6 = Math.pow(x6, {}); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.1.normal.js index a17ad068022..0a990185f0b 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var x1; @@ -13,8 +12,7 @@ x1 = Math.pow(x1, true); x1 = Math.pow(x1, 0); x1 = Math.pow(x1, ''); x1 = Math.pow(x1, E.a); -x1 = Math.pow(x1, { -}); +x1 = Math.pow(x1, {}); x1 = Math.pow(x1, null); x1 = Math.pow(x1, undefined); var x2; @@ -24,8 +22,7 @@ x2 = Math.pow(x2, true); x2 = Math.pow(x2, 0); x2 = Math.pow(x2, ''); x2 = Math.pow(x2, E.a); -x2 = Math.pow(x2, { -}); +x2 = Math.pow(x2, {}); x2 = Math.pow(x2, null); x2 = Math.pow(x2, undefined); var x3; @@ -35,8 +32,7 @@ x3 = Math.pow(x3, true); x3 = Math.pow(x3, 0); x3 = Math.pow(x3, ''); x3 = Math.pow(x3, E.a); -x3 = Math.pow(x3, { -}); +x3 = Math.pow(x3, {}); x3 = Math.pow(x3, null); x3 = Math.pow(x3, undefined); var x4; @@ -46,19 +42,16 @@ x4 = Math.pow(x4, true); x4 = Math.pow(x4, 0); x4 = Math.pow(x4, ''); x4 = Math.pow(x4, E.a); -x4 = Math.pow(x4, { -}); +x4 = Math.pow(x4, {}); x4 = Math.pow(x4, null); x4 = Math.pow(x4, undefined); var x5; x5 = Math.pow(x5, b); x5 = Math.pow(x5, true); x5 = Math.pow(x5, ''); -x5 = Math.pow(x5, { -}); +x5 = Math.pow(x5, {}); var x6; x6 = Math.pow(x6, b); x6 = Math.pow(x6, true); x6 = Math.pow(x6, ''); -x6 = Math.pow(x6, { -}); +x6 = Math.pow(x6, {}); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.2.minified.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.2.minified.js index f696fcf0d87..c87dce857ac 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned_es5.2.minified.js @@ -1,9 +1,2 @@ var E, a, b, x1, x2, x3, x4, x5, x6, E; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, !0) = Math.pow(x1, 0), x1 = Math.pow(x1, "") = Math.pow(x1, E.a), x1 = Math.pow(x1, { -}) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, !0), x2 = Math.pow(x2, 0), x2 = Math.pow(x2, ""), x2 = Math.pow(x2, E.a), x2 = Math.pow(x2, { -}), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, !0), x3 = Math.pow(x3, 0), x3 = Math.pow(x3, ""), x3 = Math.pow(x3, E.a), x3 = Math.pow(x3, { -}), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0), x4 = Math.pow(x4, a), x4 = Math.pow(x4, b), x4 = Math.pow(x4, !0), x4 = Math.pow(x4, 0), x4 = Math.pow(x4, ""), x4 = Math.pow(x4, E.a), x4 = Math.pow(x4, { -}), x4 = Math.pow(x4, null), x4 = Math.pow(x4, void 0), x5 = Math.pow(x5, b), x5 = Math.pow(x5, !0), x5 = Math.pow(x5, ""), x5 = Math.pow(x5, { -}), x6 = Math.pow(x6, b), x6 = Math.pow(x6, !0), x6 = Math.pow(x6, ""), x6 = Math.pow(x6, { -}); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", x1 = Math.pow(x1, a) = Math.pow(x1, b), x1 = Math.pow(x1, !0) = Math.pow(x1, 0), x1 = Math.pow(x1, "") = Math.pow(x1, E.a), x1 = Math.pow(x1, {}) = Math.pow(x1, null), x1 = Math.pow(x1, void 0), x2 = Math.pow(x2, a), x2 = Math.pow(x2, b), x2 = Math.pow(x2, !0), x2 = Math.pow(x2, 0), x2 = Math.pow(x2, ""), x2 = Math.pow(x2, E.a), x2 = Math.pow(x2, {}), x2 = Math.pow(x2, null), x2 = Math.pow(x2, void 0), x3 = Math.pow(x3, a), x3 = Math.pow(x3, b), x3 = Math.pow(x3, !0), x3 = Math.pow(x3, 0), x3 = Math.pow(x3, ""), x3 = Math.pow(x3, E.a), x3 = Math.pow(x3, {}), x3 = Math.pow(x3, null), x3 = Math.pow(x3, void 0), x4 = Math.pow(x4, a), x4 = Math.pow(x4, b), x4 = Math.pow(x4, !0), x4 = Math.pow(x4, 0), x4 = Math.pow(x4, ""), x4 = Math.pow(x4, E.a), x4 = Math.pow(x4, {}), x4 = Math.pow(x4, null), x4 = Math.pow(x4, void 0), x5 = Math.pow(x5, b), x5 = Math.pow(x5, !0), x5 = Math.pow(x5, ""), x5 = Math.pow(x5, {}), x6 = Math.pow(x6, b), x6 = Math.pow(x6, !0), x6 = Math.pow(x6, ""), x6 = Math.pow(x6, {}); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es2015.1.normal.js index 0ca80eb9a19..7a0b4207c85 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es2015.1.normal.js @@ -3,26 +3,15 @@ var s; var n; var a; var v = { - [s] () { - }, - [n] () { - }, - [s + s] () { - }, - [s + n] () { - }, - [+s] () { - }, - [""] () { - }, - [0] () { - }, - [a] () { - }, - [true] () { - }, - [`hello bye`] () { - }, - [`hello ${a} bye`] () { - } + [s] () {}, + [n] () {}, + [s + s] () {}, + [s + n] () {}, + [+s] () {}, + [""] () {}, + [0] () {}, + [a] () {}, + [true] () {}, + [`hello bye`] () {}, + [`hello ${a} bye`] () {} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.1.normal.js index 148e0c3aeca..d2f80377205 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.1.normal.js @@ -16,16 +16,4 @@ var s; var n; var a; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, s, function() { -}), _defineProperty(_obj, n, function() { -}), _defineProperty(_obj, s + s, function() { -}), _defineProperty(_obj, s + n, function() { -}), _defineProperty(_obj, +s, function() { -}), _defineProperty(_obj, "", function() { -}), _defineProperty(_obj, 0, function() { -}), _defineProperty(_obj, a, function() { -}), _defineProperty(_obj, true, function() { -}), _defineProperty(_obj, "hello bye", function() { -}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() { -}), _obj); +var v = (_obj = {}, _defineProperty(_obj, s, function() {}), _defineProperty(_obj, n, function() {}), _defineProperty(_obj, s + s, function() {}), _defineProperty(_obj, s + n, function() {}), _defineProperty(_obj, +s, function() {}), _defineProperty(_obj, "", function() {}), _defineProperty(_obj, 0, function() {}), _defineProperty(_obj, a, function() {}), _defineProperty(_obj, true, function() {}), _defineProperty(_obj, "hello bye", function() {}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() {}), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.2.minified.js index 47353e654cc..cf477d064f7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames10_ES5_es5.2.minified.js @@ -7,16 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, s, function() { -}), _defineProperty(_obj, n, function() { -}), _defineProperty(_obj, s + s, function() { -}), _defineProperty(_obj, s + n, function() { -}), _defineProperty(_obj, +s, function() { -}), _defineProperty(_obj, "", function() { -}), _defineProperty(_obj, 0, function() { -}), _defineProperty(_obj, a, function() { -}), _defineProperty(_obj, !0, function() { -}), _defineProperty(_obj, "hello bye", function() { -}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() { -}); +_defineProperty(_obj = {}, s, function() {}), _defineProperty(_obj, n, function() {}), _defineProperty(_obj, s + s, function() {}), _defineProperty(_obj, s + n, function() {}), _defineProperty(_obj, +s, function() {}), _defineProperty(_obj, "", function() {}), _defineProperty(_obj, 0, function() {}), _defineProperty(_obj, a, function() {}), _defineProperty(_obj, !0, function() {}), _defineProperty(_obj, "hello bye", function() {}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() {}); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es2015.1.normal.js index bc622591bde..f95dc74c186 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es2015.1.normal.js @@ -3,26 +3,15 @@ var s; var n; var a; var v = { - [s] () { - }, - [n] () { - }, - [s + s] () { - }, - [s + n] () { - }, - [+s] () { - }, - [""] () { - }, - [0] () { - }, - [a] () { - }, - [true] () { - }, - [`hello bye`] () { - }, - [`hello ${a} bye`] () { - } + [s] () {}, + [n] () {}, + [s + s] () {}, + [s + n] () {}, + [+s] () {}, + [""] () {}, + [0] () {}, + [a] () {}, + [true] () {}, + [`hello bye`] () {}, + [`hello ${a} bye`] () {} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.1.normal.js index abfdf4e3ad4..b99b7d6aa5f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.1.normal.js @@ -16,16 +16,4 @@ var s; var n; var a; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, s, function() { -}), _defineProperty(_obj, n, function() { -}), _defineProperty(_obj, s + s, function() { -}), _defineProperty(_obj, s + n, function() { -}), _defineProperty(_obj, +s, function() { -}), _defineProperty(_obj, "", function() { -}), _defineProperty(_obj, 0, function() { -}), _defineProperty(_obj, a, function() { -}), _defineProperty(_obj, true, function() { -}), _defineProperty(_obj, "hello bye", function() { -}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() { -}), _obj); +var v = (_obj = {}, _defineProperty(_obj, s, function() {}), _defineProperty(_obj, n, function() {}), _defineProperty(_obj, s + s, function() {}), _defineProperty(_obj, s + n, function() {}), _defineProperty(_obj, +s, function() {}), _defineProperty(_obj, "", function() {}), _defineProperty(_obj, 0, function() {}), _defineProperty(_obj, a, function() {}), _defineProperty(_obj, true, function() {}), _defineProperty(_obj, "hello bye", function() {}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() {}), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.2.minified.js index 47353e654cc..cf477d064f7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames10_ES6_es5.2.minified.js @@ -7,16 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, s, function() { -}), _defineProperty(_obj, n, function() { -}), _defineProperty(_obj, s + s, function() { -}), _defineProperty(_obj, s + n, function() { -}), _defineProperty(_obj, +s, function() { -}), _defineProperty(_obj, "", function() { -}), _defineProperty(_obj, 0, function() { -}), _defineProperty(_obj, a, function() { -}), _defineProperty(_obj, !0, function() { -}), _defineProperty(_obj, "hello bye", function() { -}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() { -}); +_defineProperty(_obj = {}, s, function() {}), _defineProperty(_obj, n, function() {}), _defineProperty(_obj, s + s, function() {}), _defineProperty(_obj, s + n, function() {}), _defineProperty(_obj, +s, function() {}), _defineProperty(_obj, "", function() {}), _defineProperty(_obj, 0, function() {}), _defineProperty(_obj, a, function() {}), _defineProperty(_obj, !0, function() {}), _defineProperty(_obj, "hello bye", function() {}), _defineProperty(_obj, "hello ".concat(a, " bye"), function() {}); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es2015.1.normal.js index e7cebf54997..f1d1ab56d38 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es2015.1.normal.js @@ -6,28 +6,23 @@ var v1 = { get [s] () { return 0; }, - set [n] (v){ - }, + set [n] (v){}, get [s + s] () { return 0; }, - set [s + n] (v){ - }, + set [s + n] (v){}, get [+s] () { return 0; }, - set [""] (v){ - }, + set [""] (v){}, get [0] () { return 0; }, - set [a] (v){ - }, + set [a] (v){}, get [true] () { return 0; }, - set [`hello bye`] (v){ - }, + set [`hello bye`] (v){}, get [`hello ${a} bye`] () { return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.1.normal.js index 27778a77ceb..b5091ef24e8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.1.normal.js @@ -21,35 +21,17 @@ function _defineEnumerableProperties(obj, descs) { var s; var n; var a; -var _obj, _mutatorMap = { -}; -var v = (_obj = { -}, _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, _mutatorMap = {}; +var v = (_obj = {}, _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; -}, _mutatorMap[n] = _mutatorMap[n] || { -}, _mutatorMap[n].set = function(v) { -}, _mutatorMap[s + s] = _mutatorMap[s + s] || { -}, _mutatorMap[s + s].get = function() { +}, _mutatorMap[n] = _mutatorMap[n] || {}, _mutatorMap[n].set = function(v) {}, _mutatorMap[s + s] = _mutatorMap[s + s] || {}, _mutatorMap[s + s].get = function() { return 0; -}, _mutatorMap[s + n] = _mutatorMap[s + n] || { -}, _mutatorMap[s + n].set = function(v) { -}, _mutatorMap[+s] = _mutatorMap[+s] || { -}, _mutatorMap[+s].get = function() { +}, _mutatorMap[s + n] = _mutatorMap[s + n] || {}, _mutatorMap[s + n].set = function(v) {}, _mutatorMap[+s] = _mutatorMap[+s] || {}, _mutatorMap[+s].get = function() { return 0; -}, _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].set = function(v) { -}, _mutatorMap[0] = _mutatorMap[0] || { -}, _mutatorMap[0].get = function() { +}, _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].set = function(v) {}, _mutatorMap[0] = _mutatorMap[0] || {}, _mutatorMap[0].get = function() { return 0; -}, _mutatorMap[a] = _mutatorMap[a] || { -}, _mutatorMap[a].set = function(v) { -}, _mutatorMap[true] = _mutatorMap[true] || { -}, _mutatorMap[true].get = function() { +}, _mutatorMap[a] = _mutatorMap[a] || {}, _mutatorMap[a].set = function(v) {}, _mutatorMap[true] = _mutatorMap[true] || {}, _mutatorMap[true].get = function() { return 0; -}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || { -}, _mutatorMap["hello bye"].set = function(v) { -}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || { -}, _mutatorMap["hello ".concat(a, " bye")].get = function() { +}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || {}, _mutatorMap["hello bye"].set = function(v) {}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || {}, _mutatorMap["hello ".concat(a, " bye")].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.2.minified.js index 43641b39696..abb927bbba4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames11_ES5_es5.2.minified.js @@ -1,33 +1,15 @@ -var s, n, a, _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var s, n, a, _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; -}, _mutatorMap[n] = _mutatorMap[n] || { -}, _mutatorMap[n].set = function(v) { -}, _mutatorMap[s + s] = _mutatorMap[s + s] || { -}, _mutatorMap[s + s].get = function() { +}, _mutatorMap[n] = _mutatorMap[n] || {}, _mutatorMap[n].set = function(v) {}, _mutatorMap[s + s] = _mutatorMap[s + s] || {}, _mutatorMap[s + s].get = function() { return 0; -}, _mutatorMap[s + n] = _mutatorMap[s + n] || { -}, _mutatorMap[s + n].set = function(v) { -}, _mutatorMap[+s] = _mutatorMap[+s] || { -}, _mutatorMap[+s].get = function() { +}, _mutatorMap[s + n] = _mutatorMap[s + n] || {}, _mutatorMap[s + n].set = function(v) {}, _mutatorMap[+s] = _mutatorMap[+s] || {}, _mutatorMap[+s].get = function() { return 0; -}, _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].set = function(v) { -}, _mutatorMap[0] = _mutatorMap[0] || { -}, _mutatorMap[0].get = function() { +}, _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].set = function(v) {}, _mutatorMap[0] = _mutatorMap[0] || {}, _mutatorMap[0].get = function() { return 0; -}, _mutatorMap[a] = _mutatorMap[a] || { -}, _mutatorMap[a].set = function(v) { -}, _mutatorMap[!0] = _mutatorMap[!0] || { -}, _mutatorMap[!0].get = function() { +}, _mutatorMap[a] = _mutatorMap[a] || {}, _mutatorMap[a].set = function(v) {}, _mutatorMap[!0] = _mutatorMap[!0] || {}, _mutatorMap[!0].get = function() { return 0; -}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || { -}, _mutatorMap["hello bye"].set = function(v) { -}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || { -}, _mutatorMap["hello ".concat(a, " bye")].get = function() { +}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || {}, _mutatorMap["hello bye"].set = function(v) {}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || {}, _mutatorMap["hello ".concat(a, " bye")].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es2015.1.normal.js index d96956e1cf3..7750458f5c9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es2015.1.normal.js @@ -6,28 +6,23 @@ var v1 = { get [s] () { return 0; }, - set [n] (v){ - }, + set [n] (v){}, get [s + s] () { return 0; }, - set [s + n] (v){ - }, + set [s + n] (v){}, get [+s] () { return 0; }, - set [""] (v){ - }, + set [""] (v){}, get [0] () { return 0; }, - set [a] (v){ - }, + set [a] (v){}, get [true] () { return 0; }, - set [`hello bye`] (v){ - }, + set [`hello bye`] (v){}, get [`hello ${a} bye`] () { return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.1.normal.js index 91e3c6918e0..9d7ee91aef5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.1.normal.js @@ -21,35 +21,17 @@ function _defineEnumerableProperties(obj, descs) { var s; var n; var a; -var _obj, _mutatorMap = { -}; -var v = (_obj = { -}, _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, _mutatorMap = {}; +var v = (_obj = {}, _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; -}, _mutatorMap[n] = _mutatorMap[n] || { -}, _mutatorMap[n].set = function(v) { -}, _mutatorMap[s + s] = _mutatorMap[s + s] || { -}, _mutatorMap[s + s].get = function() { +}, _mutatorMap[n] = _mutatorMap[n] || {}, _mutatorMap[n].set = function(v) {}, _mutatorMap[s + s] = _mutatorMap[s + s] || {}, _mutatorMap[s + s].get = function() { return 0; -}, _mutatorMap[s + n] = _mutatorMap[s + n] || { -}, _mutatorMap[s + n].set = function(v) { -}, _mutatorMap[+s] = _mutatorMap[+s] || { -}, _mutatorMap[+s].get = function() { +}, _mutatorMap[s + n] = _mutatorMap[s + n] || {}, _mutatorMap[s + n].set = function(v) {}, _mutatorMap[+s] = _mutatorMap[+s] || {}, _mutatorMap[+s].get = function() { return 0; -}, _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].set = function(v) { -}, _mutatorMap[0] = _mutatorMap[0] || { -}, _mutatorMap[0].get = function() { +}, _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].set = function(v) {}, _mutatorMap[0] = _mutatorMap[0] || {}, _mutatorMap[0].get = function() { return 0; -}, _mutatorMap[a] = _mutatorMap[a] || { -}, _mutatorMap[a].set = function(v) { -}, _mutatorMap[true] = _mutatorMap[true] || { -}, _mutatorMap[true].get = function() { +}, _mutatorMap[a] = _mutatorMap[a] || {}, _mutatorMap[a].set = function(v) {}, _mutatorMap[true] = _mutatorMap[true] || {}, _mutatorMap[true].get = function() { return 0; -}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || { -}, _mutatorMap["hello bye"].set = function(v) { -}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || { -}, _mutatorMap["hello ".concat(a, " bye")].get = function() { +}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || {}, _mutatorMap["hello bye"].set = function(v) {}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || {}, _mutatorMap["hello ".concat(a, " bye")].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.2.minified.js index 43641b39696..abb927bbba4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames11_ES6_es5.2.minified.js @@ -1,33 +1,15 @@ -var s, n, a, _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var s, n, a, _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; -}, _mutatorMap[n] = _mutatorMap[n] || { -}, _mutatorMap[n].set = function(v) { -}, _mutatorMap[s + s] = _mutatorMap[s + s] || { -}, _mutatorMap[s + s].get = function() { +}, _mutatorMap[n] = _mutatorMap[n] || {}, _mutatorMap[n].set = function(v) {}, _mutatorMap[s + s] = _mutatorMap[s + s] || {}, _mutatorMap[s + s].get = function() { return 0; -}, _mutatorMap[s + n] = _mutatorMap[s + n] || { -}, _mutatorMap[s + n].set = function(v) { -}, _mutatorMap[+s] = _mutatorMap[+s] || { -}, _mutatorMap[+s].get = function() { +}, _mutatorMap[s + n] = _mutatorMap[s + n] || {}, _mutatorMap[s + n].set = function(v) {}, _mutatorMap[+s] = _mutatorMap[+s] || {}, _mutatorMap[+s].get = function() { return 0; -}, _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].set = function(v) { -}, _mutatorMap[0] = _mutatorMap[0] || { -}, _mutatorMap[0].get = function() { +}, _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].set = function(v) {}, _mutatorMap[0] = _mutatorMap[0] || {}, _mutatorMap[0].get = function() { return 0; -}, _mutatorMap[a] = _mutatorMap[a] || { -}, _mutatorMap[a].set = function(v) { -}, _mutatorMap[!0] = _mutatorMap[!0] || { -}, _mutatorMap[!0].get = function() { +}, _mutatorMap[a] = _mutatorMap[a] || {}, _mutatorMap[a].set = function(v) {}, _mutatorMap[!0] = _mutatorMap[!0] || {}, _mutatorMap[!0].get = function() { return 0; -}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || { -}, _mutatorMap["hello bye"].set = function(v) { -}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || { -}, _mutatorMap["hello ".concat(a, " bye")].get = function() { +}, _mutatorMap["hello bye"] = _mutatorMap["hello bye"] || {}, _mutatorMap["hello bye"].set = function(v) {}, _mutatorMap["hello ".concat(a, " bye")] = _mutatorMap["hello ".concat(a, " bye")] || {}, _mutatorMap["hello ".concat(a, " bye")].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es2015.1.normal.js index 37eabbbe4cb..8f0ee17f7b9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es2015.1.normal.js @@ -4,26 +4,15 @@ var n; var a; var tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = "", tmp6 = 0, tmp7 = a, tmp8 = true, tmp9 = `hello bye`, tmp10 = `hello ${a} bye`; class C { - [tmp]() { - } - [tmp1]() { - } - static [tmp2]() { - } - [tmp3]() { - } - [tmp4]() { - } - static [tmp5]() { - } - [tmp6]() { - } - [tmp7]() { - } - static [tmp8]() { - } - [tmp9]() { - } - static [tmp10]() { - } + [tmp]() {} + [tmp1]() {} + static [tmp2]() {} + [tmp3]() {} + [tmp4]() {} + static [tmp5]() {} + [tmp6]() {} + [tmp7]() {} + static [tmp8]() {} + [tmp9]() {} + static [tmp10]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.1.normal.js index a099eeae840..2b56ff8b5d9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.1.normal.js @@ -30,59 +30,48 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp3, - value: function value() { - } + value: function value() {} }, { key: tmp4, - value: function value() { - } + value: function value() {} }, { key: tmp6, - value: function value() { - } + value: function value() {} }, { key: tmp7, - value: function value() { - } + value: function value() {} }, { key: tmp9, - value: function value() { - } + value: function value() {} } ], [ { key: tmp2, - value: function value() { - } + value: function value() {} }, { key: tmp5, - value: function value() { - } + value: function value() {} }, { key: tmp8, - value: function value() { - } + value: function value() {} }, { key: tmp10, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.2.minified.js index 4fdea4b0756..4199ea64634 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames13_ES5_es5.2.minified.js @@ -15,59 +15,48 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp3, - value: function() { - } + value: function() {} }, { key: tmp4, - value: function() { - } + value: function() {} }, { key: 0, - value: function() { - } + value: function() {} }, { key: tmp5, - value: function() { - } + value: function() {} }, { key: "hello bye", - value: function() { - } + value: function() {} } ], staticProps = [ { key: tmp2, - value: function() { - } + value: function() {} }, { key: "", - value: function() { - } + value: function() {} }, { key: !0, - value: function() { - } + value: function() {} }, { key: tmp6, - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es2015.1.normal.js index 1a99a1f69c3..d03527c4de9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es2015.1.normal.js @@ -4,26 +4,15 @@ var n; var a; var tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = "", tmp6 = 0, tmp7 = a, tmp8 = true, tmp9 = `hello bye`, tmp10 = `hello ${a} bye`; class C { - [tmp]() { - } - [tmp1]() { - } - static [tmp2]() { - } - [tmp3]() { - } - [tmp4]() { - } - static [tmp5]() { - } - [tmp6]() { - } - [tmp7]() { - } - static [tmp8]() { - } - [tmp9]() { - } - static [tmp10]() { - } + [tmp]() {} + [tmp1]() {} + static [tmp2]() {} + [tmp3]() {} + [tmp4]() {} + static [tmp5]() {} + [tmp6]() {} + [tmp7]() {} + static [tmp8]() {} + [tmp9]() {} + static [tmp10]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.1.normal.js index d545cc23c47..564f324613d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.1.normal.js @@ -30,59 +30,48 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp3, - value: function value() { - } + value: function value() {} }, { key: tmp4, - value: function value() { - } + value: function value() {} }, { key: tmp6, - value: function value() { - } + value: function value() {} }, { key: tmp7, - value: function value() { - } + value: function value() {} }, { key: tmp9, - value: function value() { - } + value: function value() {} } ], [ { key: tmp2, - value: function value() { - } + value: function value() {} }, { key: tmp5, - value: function value() { - } + value: function value() {} }, { key: tmp8, - value: function value() { - } + value: function value() {} }, { key: tmp10, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.2.minified.js index 4fdea4b0756..4199ea64634 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames13_ES6_es5.2.minified.js @@ -15,59 +15,48 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp3, - value: function() { - } + value: function() {} }, { key: tmp4, - value: function() { - } + value: function() {} }, { key: 0, - value: function() { - } + value: function() {} }, { key: tmp5, - value: function() { - } + value: function() {} }, { key: "hello bye", - value: function() { - } + value: function() {} } ], staticProps = [ { key: tmp2, - value: function() { - } + value: function() {} }, { key: "", - value: function() { - } + value: function() {} }, { key: !0, - value: function() { - } + value: function() {} }, { key: tmp6, - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es2015.1.normal.js index 8bf537eb9ff..5e91b31b1ea 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es2015.1.normal.js @@ -1,18 +1,11 @@ // @target: es5 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; class C { - [tmp]() { - } - static [tmp1]() { - } - [tmp2]() { - } - static [tmp3]() { - } - [tmp4]() { - } - static [tmp5]() { - } + [tmp]() {} + static [tmp1]() {} + [tmp2]() {} + static [tmp3]() {} + [tmp4]() {} + static [tmp5]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.1.normal.js index fe26415c908..c5bfb8fc84d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.1.normal.js @@ -19,8 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { } // @target: es5 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -29,34 +28,28 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp2, - value: function value() { - } + value: function value() {} }, { key: tmp4, - value: function value() { - } + value: function value() {} } ], [ { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp3, - value: function value() { - } + value: function value() {} }, { key: tmp5, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.2.minified.js index 3039df90cbc..5a73a900f4c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames14_ES5_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var tmp = void 0, tmp1 = [], tmp2 = { -}, tmp3 = void 0, C = function() { +var tmp = void 0, tmp1 = [], tmp2 = {}, tmp3 = void 0, C = function() { "use strict"; var Constructor, protoProps, staticProps; function C() { @@ -16,34 +15,28 @@ var tmp = void 0, tmp1 = [], tmp2 = { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp3, - value: function() { - } + value: function() {} } ], staticProps = [ { key: !0, - value: function() { - } + value: function() {} }, { key: tmp2, - value: function() { - } + value: function() {} }, { key: null, - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es2015.1.normal.js index 91723333bcd..829629cfa56 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es2015.1.normal.js @@ -1,18 +1,11 @@ // @target: es6 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; class C { - [tmp]() { - } - static [tmp1]() { - } - [tmp2]() { - } - static [tmp3]() { - } - [tmp4]() { - } - static [tmp5]() { - } + [tmp]() {} + static [tmp1]() {} + [tmp2]() {} + static [tmp3]() {} + [tmp4]() {} + static [tmp5]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.1.normal.js index 86c0b1b3ff1..dcef6dc1b57 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.1.normal.js @@ -19,8 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { } // @target: es6 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -29,34 +28,28 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp2, - value: function value() { - } + value: function value() {} }, { key: tmp4, - value: function value() { - } + value: function value() {} } ], [ { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp3, - value: function value() { - } + value: function value() {} }, { key: tmp5, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.2.minified.js index 3039df90cbc..5a73a900f4c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames14_ES6_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var tmp = void 0, tmp1 = [], tmp2 = { -}, tmp3 = void 0, C = function() { +var tmp = void 0, tmp1 = [], tmp2 = {}, tmp3 = void 0, C = function() { "use strict"; var Constructor, protoProps, staticProps; function C() { @@ -16,34 +15,28 @@ var tmp = void 0, tmp1 = [], tmp2 = { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp3, - value: function() { - } + value: function() {} } ], staticProps = [ { key: !0, - value: function() { - } + value: function() {} }, { key: tmp2, - value: function() { - } + value: function() {} }, { key: null, - value: function() { - } + value: function() {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es2015.1.normal.js index 3e1462d29d4..9d73d7d0f29 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es2015.1.normal.js @@ -4,10 +4,7 @@ var p2; var p3; var tmp = p1, tmp1 = p2, tmp2 = p3; class C { - [tmp]() { - } - [tmp1]() { - } - [tmp2]() { - } + [tmp]() {} + [tmp1]() {} + [tmp2]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.1.normal.js index b3f5883fd29..5f5f7c113d3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.1.normal.js @@ -30,18 +30,15 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp2, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.2.minified.js index 1d98af173dc..4ea1d26b143 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames15_ES5_es5.2.minified.js @@ -15,18 +15,15 @@ var p2, p3, tmp = void 0, tmp1 = p2, tmp2 = p3, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp2, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es2015.1.normal.js index a3d6bed13b9..984a99f1033 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es2015.1.normal.js @@ -4,10 +4,7 @@ var p2; var p3; var tmp = p1, tmp1 = p2, tmp2 = p3; class C { - [tmp]() { - } - [tmp1]() { - } - [tmp2]() { - } + [tmp]() {} + [tmp1]() {} + [tmp2]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.1.normal.js index f4ac2eb695d..737a05b8a92 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.1.normal.js @@ -30,18 +30,15 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp2, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.2.minified.js index 1d98af173dc..4ea1d26b143 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames15_ES6_es5.2.minified.js @@ -15,18 +15,15 @@ var p2, p3, tmp = void 0, tmp1 = p2, tmp2 = p3, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp2, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es2015.1.normal.js index 4fc7edb775d..712ada17945 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es2015.1.normal.js @@ -7,28 +7,23 @@ class C { get [tmp]() { return 0; } - set [tmp1](v) { - } + set [tmp1](v) {} static get [tmp2]() { return 0; } - set [tmp3](v) { - } + set [tmp3](v) {} get [tmp4]() { return 0; } - static set [tmp5](v) { - } + static set [tmp5](v) {} get [tmp6]() { return 0; } - set [tmp7](v) { - } + set [tmp7](v) {} static get [tmp8]() { return 0; } - set [tmp9](v) { - } + set [tmp9](v) {} get [tmp10]() { return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.1.normal.js index a224ad9b49b..4e288c98b5e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.1.normal.js @@ -36,13 +36,11 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp4, @@ -58,13 +56,11 @@ var C = /*#__PURE__*/ function() { }, { key: tmp7, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp9, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp10, @@ -81,8 +77,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp8, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.2.minified.js index 138d94616ed..f0ed3567f51 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames16_ES5_es5.2.minified.js @@ -21,13 +21,11 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, }, { key: tmp1, - set: function(v) { - } + set: function(v) {} }, { key: tmp3, - set: function(v) { - } + set: function(v) {} }, { key: tmp4, @@ -43,13 +41,11 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, }, { key: tmp5, - set: function(v) { - } + set: function(v) {} }, { key: "hello bye", - set: function(v) { - } + set: function(v) {} }, { key: tmp6, @@ -66,8 +62,7 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, }, { key: "", - set: function(v) { - } + set: function(v) {} }, { key: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es2015.1.normal.js index 01a75ddbc7c..54aeb7f6b91 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es2015.1.normal.js @@ -7,28 +7,23 @@ class C { get [tmp]() { return 0; } - set [tmp1](v) { - } + set [tmp1](v) {} static get [tmp2]() { return 0; } - set [tmp3](v) { - } + set [tmp3](v) {} get [tmp4]() { return 0; } - static set [tmp5](v) { - } + static set [tmp5](v) {} get [tmp6]() { return 0; } - set [tmp7](v) { - } + set [tmp7](v) {} static get [tmp8]() { return 0; } - set [tmp9](v) { - } + set [tmp9](v) {} get [tmp10]() { return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.1.normal.js index e586f37cea0..39e94f46cab 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.1.normal.js @@ -36,13 +36,11 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp4, @@ -58,13 +56,11 @@ var C = /*#__PURE__*/ function() { }, { key: tmp7, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp9, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp10, @@ -81,8 +77,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp8, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.2.minified.js index 138d94616ed..f0ed3567f51 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames16_ES6_es5.2.minified.js @@ -21,13 +21,11 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, }, { key: tmp1, - set: function(v) { - } + set: function(v) {} }, { key: tmp3, - set: function(v) { - } + set: function(v) {} }, { key: tmp4, @@ -43,13 +41,11 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, }, { key: tmp5, - set: function(v) { - } + set: function(v) {} }, { key: "hello bye", - set: function(v) { - } + set: function(v) {} }, { key: tmp6, @@ -66,8 +62,7 @@ var s, n, a, tmp = s, tmp1 = n, tmp2 = s + s, tmp3 = s + n, tmp4 = +s, tmp5 = a, }, { key: "", - set: function(v) { - } + set: function(v) {} }, { key: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es2015.1.normal.js index ad3e3e646e6..cd9b1d82774 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es2015.1.normal.js @@ -1,21 +1,17 @@ // @target: es5 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; class C { get [tmp]() { return 0; } - static set [tmp1](v) { - } + static set [tmp1](v) {} get [tmp2]() { return 0; } - set [tmp3](v) { - } + set [tmp3](v) {} static get [tmp4]() { return 0; } - set [tmp5](v) { - } + set [tmp5](v) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.1.normal.js index 4c4271cccff..c6b3594fff3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.1.normal.js @@ -19,8 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { } // @target: es5 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -41,19 +40,16 @@ var C = /*#__PURE__*/ function() { }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: tmp1, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp4, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.2.minified.js index 4bef93d6f7e..964be0da354 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames17_ES5_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var tmp = void 0, tmp1 = [], tmp2 = { -}, tmp3 = void 0, C = function() { +var tmp = void 0, tmp1 = [], tmp2 = {}, tmp3 = void 0, C = function() { "use strict"; var Constructor, protoProps, staticProps; function C() { @@ -28,19 +27,16 @@ var tmp = void 0, tmp1 = [], tmp2 = { }, { key: tmp2, - set: function(v) { - } + set: function(v) {} }, { key: null, - set: function(v) { - } + set: function(v) {} } ], staticProps = [ { key: !0, - set: function(v) { - } + set: function(v) {} }, { key: tmp3, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es2015.1.normal.js index 7e81b31948a..e2d3f1c7bba 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es2015.1.normal.js @@ -1,21 +1,17 @@ // @target: es6 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; class C { get [tmp]() { return 0; } - static set [tmp1](v) { - } + static set [tmp1](v) {} get [tmp2]() { return 0; } - set [tmp3](v) { - } + set [tmp3](v) {} static get [tmp4]() { return 0; } - set [tmp5](v) { - } + set [tmp5](v) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.1.normal.js index 1ded98a5553..7d617093f69 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.1.normal.js @@ -19,8 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { } // @target: es6 var b; -var tmp = b, tmp1 = true, tmp2 = [], tmp3 = { -}, tmp4 = undefined, tmp5 = null; +var tmp = b, tmp1 = true, tmp2 = [], tmp3 = {}, tmp4 = undefined, tmp5 = null; var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -41,19 +40,16 @@ var C = /*#__PURE__*/ function() { }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: tmp1, - set: function set(v) { - } + set: function set(v) {} }, { key: tmp4, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.2.minified.js index 4bef93d6f7e..964be0da354 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames17_ES6_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var tmp = void 0, tmp1 = [], tmp2 = { -}, tmp3 = void 0, C = function() { +var tmp = void 0, tmp1 = [], tmp2 = {}, tmp3 = void 0, C = function() { "use strict"; var Constructor, protoProps, staticProps; function C() { @@ -28,19 +27,16 @@ var tmp = void 0, tmp1 = [], tmp2 = { }, { key: tmp2, - set: function(v) { - } + set: function(v) {} }, { key: null, - set: function(v) { - } + set: function(v) {} } ], staticProps = [ { key: !0, - set: function(v) { - } + set: function(v) {} }, { key: tmp3, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames18_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames18_ES5_es5.1.normal.js index 1ede11090e0..d5c3dd6f9a5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames18_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames18_ES5_es5.1.normal.js @@ -13,6 +13,5 @@ function _defineProperty(obj, key, value) { } // @target: es5 function foo() { - var obj = _defineProperty({ - }, this.bar, 0); + var obj = _defineProperty({}, this.bar, 0); } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames18_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames18_ES6_es5.1.normal.js index 0f82bfab627..e460197f19d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames18_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames18_ES6_es5.1.normal.js @@ -13,6 +13,5 @@ function _defineProperty(obj, key, value) { } // @target: es6 function foo() { - var obj = _defineProperty({ - }, this.bar, 0); + var obj = _defineProperty({}, this.bar, 0); } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.1.normal.js index 24f15cf990c..abd48c86467 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.1.normal.js @@ -4,5 +4,4 @@ var M; var obj = { [this.bar]: 0 }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.2.minified.js index 44417503874..ffb3ead1fc9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es2015.2.minified.js @@ -1,3 +1,2 @@ var M; -M || (M = { -}), this.bar; +M || (M = {}), this.bar; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.1.normal.js index c3aebc590f5..29f5dfb03b5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.1.normal.js @@ -14,7 +14,5 @@ function _defineProperty(obj, key, value) { // @target: es5 var M; (function(M) { - var obj = _defineProperty({ - }, this.bar, 0); -})(M || (M = { -})); + var obj = _defineProperty({}, this.bar, 0); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.2.minified.js index 065996812ec..581211284a6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES5_es5.2.minified.js @@ -1,12 +1,10 @@ var M; !function(M) { var obj, key; - obj = { - }, (key = this.bar) in obj ? Object.defineProperty(obj, key, { + obj = {}, (key = this.bar) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = 0; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.1.normal.js index a5a3d004b5b..11bf8dcf360 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.1.normal.js @@ -4,5 +4,4 @@ var M; var obj = { [this.bar]: 0 }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.2.minified.js index 44417503874..ffb3ead1fc9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es2015.2.minified.js @@ -1,3 +1,2 @@ var M; -M || (M = { -}), this.bar; +M || (M = {}), this.bar; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.1.normal.js index 701af8ca3e5..569ad21148c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.1.normal.js @@ -14,7 +14,5 @@ function _defineProperty(obj, key, value) { // @target: es6 var M; (function(M) { - var obj = _defineProperty({ - }, this.bar, 0); -})(M || (M = { -})); + var obj = _defineProperty({}, this.bar, 0); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.2.minified.js index 065996812ec..581211284a6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames19_ES6_es5.2.minified.js @@ -1,12 +1,10 @@ var M; !function(M) { var obj, key; - obj = { - }, (key = this.bar) in obj ? Object.defineProperty(obj, key, { + obj = {}, (key = this.bar) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = 0; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es2015.1.normal.js index 5de5394aee6..4e72a4af414 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es2015.1.normal.js @@ -3,6 +3,5 @@ var v1 = { get [0 + 1] () { return 0; }, - set [0 + 1] (v){ - } + set [0 + 1] (v){} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.1.normal.js index 333f52c41d8..e3703f97d1a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.1.normal.js @@ -17,14 +17,9 @@ function _defineEnumerableProperties(obj, descs) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; // @target: es5 -var v = (_obj = { -}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || { -}, _mutatorMap[0 + 1].get = function() { +var v = (_obj = {}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || {}, _mutatorMap[0 + 1].get = function() { return 0; -}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || { -} //No error -, _mutatorMap[0 + 1].set = function(v) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || {} //No error +, _mutatorMap[0 + 1].set = function(v) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.2.minified.js index a65d167c3d3..779c18e346d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames1_ES5_es5.2.minified.js @@ -1,12 +1,7 @@ -var _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[1] = _mutatorMap[1] || { -}, _mutatorMap[1].get = function() { +var _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].get = function() { return 0; -}, _mutatorMap[1] = _mutatorMap[1] || { -}, _mutatorMap[1].set = function(v) { -}, (function(obj, descs) { +}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].set = function(v) {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es2015.1.normal.js index abbaf93ab19..60312477689 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es2015.1.normal.js @@ -3,6 +3,5 @@ var v1 = { get [0 + 1] () { return 0; }, - set [0 + 1] (v){ - } + set [0 + 1] (v){} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.1.normal.js index edc0e4ec207..5e9d25e067f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.1.normal.js @@ -17,14 +17,9 @@ function _defineEnumerableProperties(obj, descs) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; // @target: es6 -var v = (_obj = { -}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || { -}, _mutatorMap[0 + 1].get = function() { +var v = (_obj = {}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || {}, _mutatorMap[0 + 1].get = function() { return 0; -}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || { -} //No error -, _mutatorMap[0 + 1].set = function(v) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +}, _mutatorMap[0 + 1] = _mutatorMap[0 + 1] || {} //No error +, _mutatorMap[0 + 1].set = function(v) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.2.minified.js index a65d167c3d3..779c18e346d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames1_ES6_es5.2.minified.js @@ -1,12 +1,7 @@ -var _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[1] = _mutatorMap[1] || { -}, _mutatorMap[1].get = function() { +var _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].get = function() { return 0; -}, _mutatorMap[1] = _mutatorMap[1] || { -}, _mutatorMap[1].set = function(v) { -}, (function(obj, descs) { +}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].set = function(v) {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.1.normal.js index 1f4898cca68..c18c341818f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj1, key, value) { return obj1; } // @target: es5 -var obj = _defineProperty({ -}, this.bar, 0); +var obj = _defineProperty({}, this.bar, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.2.minified.js index ebe201324ce..880336c1c28 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames20_ES5_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = this.bar) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = this.bar) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.1.normal.js index 8689ee84b42..bc012e0af7b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj1, key, value) { return obj1; } // @target: es6 -var obj = _defineProperty({ -}, this.bar, 0); +var obj = _defineProperty({}, this.bar, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.2.minified.js index ebe201324ce..880336c1c28 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames20_ES6_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = this.bar) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = this.bar) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es2015.1.normal.js index 760dd099c6f..d036355231b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es2015.1.normal.js @@ -4,6 +4,5 @@ class C { bar() { return 0; } - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.1.normal.js index 16a08d43d89..92bebff645b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.1.normal.js @@ -33,8 +33,7 @@ var C = // @target: es5 }, { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.2.minified.js index 51203d73a3d..0b08b11df36 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames21_ES5_es5.2.minified.js @@ -21,8 +21,7 @@ var tmp = this.bar(), C = function() { }, { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es2015.1.normal.js index 84f3b42ea19..da2ff21fa59 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es2015.1.normal.js @@ -4,6 +4,5 @@ class C { bar() { return 0; } - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.1.normal.js index 562ac7e03ff..854e62e620e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.1.normal.js @@ -33,8 +33,7 @@ var C = // @target: es6 }, { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.2.minified.js index 51203d73a3d..0b08b11df36 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames21_ES6_es5.2.minified.js @@ -21,8 +21,7 @@ var tmp = this.bar(), C = function() { }, { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es2015.1.normal.js index 92518c26528..2e9303e16b9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es2015.1.normal.js @@ -2,8 +2,7 @@ class C { bar() { var obj = { - [this.bar()] () { - } + [this.bar()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.1.normal.js index 222743893c9..e2451f41524 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.1.normal.js @@ -40,9 +40,7 @@ var C = // @target: es5 { key: "bar", value: function bar() { - var obj = _defineProperty({ - }, this.bar(), function() { - }); + var obj = _defineProperty({}, this.bar(), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.2.minified.js index f91eb85639f..a5adaf07d16 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames22_ES5_es5.2.minified.js @@ -23,9 +23,7 @@ var C = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, this.bar(), function() { - }), 0; + })({}, this.bar(), function() {}), 0; } } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es2015.1.normal.js index 07c75acc4c2..72c4744b133 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es2015.1.normal.js @@ -2,8 +2,7 @@ class C { bar() { var obj = { - [this.bar()] () { - } + [this.bar()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.1.normal.js index fd1bf5c5588..6d135a95185 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.1.normal.js @@ -40,9 +40,7 @@ var C = // @target: es6 { key: "bar", value: function bar() { - var obj = _defineProperty({ - }, this.bar(), function() { - }); + var obj = _defineProperty({}, this.bar(), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.2.minified.js index f91eb85639f..a5adaf07d16 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames22_ES6_es5.2.minified.js @@ -23,9 +23,7 @@ var C = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, this.bar(), function() { - }), 0; + })({}, this.bar(), function() {}), 0; } } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es2015.1.normal.js index 044f1a9bc22..3fdf143d19d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es2015.1.normal.js @@ -6,6 +6,5 @@ class C { bar() { return 0; } - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.1.normal.js index dd589e5784d..789c3db73c6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.1.normal.js @@ -30,8 +30,7 @@ function _defineProperty(obj, key, value) { } return obj; } -var tmp = _defineProperty({ -}, this.bar(), 1)[0]; +var tmp = _defineProperty({}, this.bar(), 1)[0]; var C = // @target: es5 /*#__PURE__*/ function() { "use strict"; @@ -47,8 +46,7 @@ var C = // @target: es5 }, { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.2.minified.js index 9b22703fb5b..b7b44934ce2 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames23_ES5_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var obj, key, tmp = (obj = { -}, (key = this.bar()) in obj ? Object.defineProperty(obj, key, { +var obj, key, tmp = (obj = {}, (key = this.bar()) in obj ? Object.defineProperty(obj, key, { value: 1, enumerable: !0, configurable: !0, @@ -27,8 +26,7 @@ var obj, key, tmp = (obj = { }, { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es2015.1.normal.js index ad779aed70a..4337689b315 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es2015.1.normal.js @@ -6,6 +6,5 @@ class C { bar() { return 0; } - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.1.normal.js index 1f2c34a293b..f1362db095f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.1.normal.js @@ -30,8 +30,7 @@ function _defineProperty(obj, key, value) { } return obj; } -var tmp = _defineProperty({ -}, this.bar(), 1)[0]; +var tmp = _defineProperty({}, this.bar(), 1)[0]; var C = // @target: es6 /*#__PURE__*/ function() { "use strict"; @@ -47,8 +46,7 @@ var C = // @target: es6 }, { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.2.minified.js index 9b22703fb5b..b7b44934ce2 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames23_ES6_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var obj, key, tmp = (obj = { -}, (key = this.bar()) in obj ? Object.defineProperty(obj, key, { +var obj, key, tmp = (obj = {}, (key = this.bar()) in obj ? Object.defineProperty(obj, key, { value: 1, enumerable: !0, configurable: !0, @@ -27,8 +26,7 @@ var obj, key, tmp = (obj = { }, { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es2015.1.normal.js index 0480548d468..4eff3b85cd6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es2015.1.normal.js @@ -6,6 +6,5 @@ class Base { } var tmp = super.bar(); class C extends Base { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.1.normal.js index 72bfeae4168..633f9987ca3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -111,8 +110,7 @@ var C = /*#__PURE__*/ function(Base) { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.2.minified.js index 20fdeddcaf0..dd247fb750a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5_es5.2.minified.js @@ -51,8 +51,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,8 +74,7 @@ var Base = function() { return _createClass(C, [ { key: tmp, - value: function() { - } + value: function() {} } ]), C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es2015.1.normal.js index a1228c4119a..9728425d56c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es2015.1.normal.js @@ -8,6 +8,5 @@ var tmp = super.bar(); class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.1.normal.js index bcd883e25dc..26ceca84445 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -113,8 +112,7 @@ var C = /*#__PURE__*/ function(Base) { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.2.minified.js index 20fdeddcaf0..dd247fb750a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES6_es5.2.minified.js @@ -51,8 +51,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,8 +74,7 @@ var Base = function() { return _createClass(C, [ { key: tmp, - value: function() { - } + value: function() {} } ]), C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es2015.1.normal.js index 3a6d655106d..8ae6e53ade7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es2015.1.normal.js @@ -7,8 +7,7 @@ class Base { class C extends Base { foo() { var obj = { - [super.bar()] () { - } + [super.bar()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.1.normal.js index 9dc74e30d95..d9309c93caf 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.1.normal.js @@ -99,8 +99,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -147,9 +146,7 @@ var C = /*#__PURE__*/ function(Base) { { key: "foo", value: function foo() { - var obj = _defineProperty({ - }, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() { - }); + var obj = _defineProperty({}, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.2.minified.js index a09c94a6f91..3685b6022dc 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5_es5.2.minified.js @@ -64,8 +64,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -96,9 +95,7 @@ var Base = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() { - }), 0; + })({}, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() {}), 0; } } ]), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es2015.1.normal.js index 55e02dc8434..5464741a44e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es2015.1.normal.js @@ -7,8 +7,7 @@ class Base { class C extends Base { foo() { var obj = { - [super.bar()] () { - } + [super.bar()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.1.normal.js index 15c80e2f8dc..07c6a62a4e7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.1.normal.js @@ -99,8 +99,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -147,9 +146,7 @@ var C = /*#__PURE__*/ function(Base) { { key: "foo", value: function foo() { - var obj = _defineProperty({ - }, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() { - }); + var obj = _defineProperty({}, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.2.minified.js index a09c94a6f91..3685b6022dc 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES6_es5.2.minified.js @@ -64,8 +64,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -96,9 +95,7 @@ var Base = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() { - }), 0; + })({}, _get(_getPrototypeOf(C.prototype), "bar", this).call(this), function() {}), 0; } } ]), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es2015.1.normal.js index a383c0bb8e7..24f0efe5b41 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es2015.1.normal.js @@ -8,6 +8,5 @@ var tmp = { [super.bar()]: 1 }[0]; class C extends Base { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.1.normal.js index 8cd1de4437d..f0c0bc5d5d7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.1.normal.js @@ -76,8 +76,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -112,8 +111,7 @@ var Base = // @target: es5 ]); return Base; }(); -var tmp = _defineProperty({ -}, super.bar(), 1)[0]; +var tmp = _defineProperty({}, super.bar(), 1)[0]; var C = /*#__PURE__*/ function(Base) { "use strict"; _inherits(C, Base); @@ -125,8 +123,7 @@ var C = /*#__PURE__*/ function(Base) { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.2.minified.js index 1273fe26f39..97a8dbb2375 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5_es5.2.minified.js @@ -33,8 +33,7 @@ var obj, key, Base = function() { } } ]), Base; -}(), tmp = ((key = super.bar()) in (obj = { -}) ? Object.defineProperty(obj, key, { +}(), tmp = ((key = super.bar()) in (obj = {}) ? Object.defineProperty(obj, key, { value: 1, enumerable: !0, configurable: !0, @@ -57,8 +56,7 @@ var obj, key, Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -81,8 +79,7 @@ var obj, key, Base = function() { return _createClass(C, [ { key: tmp, - value: function() { - } + value: function() {} } ]), C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es2015.1.normal.js index 06736c61da0..56c674476cf 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es2015.1.normal.js @@ -10,6 +10,5 @@ var tmp = { class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.1.normal.js index 0c64d5bae7f..ff5d236b0e4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.1.normal.js @@ -76,8 +76,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -112,8 +111,7 @@ var Base = // @target: es6 ]); return Base; }(); -var tmp = _defineProperty({ -}, super.bar(), 1)[0]; +var tmp = _defineProperty({}, super.bar(), 1)[0]; var C = /*#__PURE__*/ function(Base) { "use strict"; _inherits(C, Base); @@ -127,8 +125,7 @@ var C = /*#__PURE__*/ function(Base) { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.2.minified.js index 1273fe26f39..97a8dbb2375 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES6_es5.2.minified.js @@ -33,8 +33,7 @@ var obj, key, Base = function() { } } ]), Base; -}(), tmp = ((key = super.bar()) in (obj = { -}) ? Object.defineProperty(obj, key, { +}(), tmp = ((key = super.bar()) in (obj = {}) ? Object.defineProperty(obj, key, { value: 1, enumerable: !0, configurable: !0, @@ -57,8 +56,7 @@ var obj, key, Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -81,8 +79,7 @@ var obj, key, Base = function() { return _createClass(C, [ { key: tmp, - value: function() { - } + value: function() {} } ]), C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es2015.1.normal.js index 132103df1f9..1ddbae0c496 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es2015.1.normal.js @@ -3,6 +3,5 @@ class Base { } var tmp = (super(), "prop"); class C extends Base { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.1.normal.js index 94a6bbc4a91..5dc569af22f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -99,8 +98,7 @@ var C = /*#__PURE__*/ function(Base) { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.2.minified.js index ef39e7ddf72..09d54fc9a85 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5_es5.2.minified.js @@ -38,8 +38,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var Base = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es2015.1.normal.js index 284dc0ae9f4..5f736d1795c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es2015.1.normal.js @@ -3,6 +3,5 @@ class Base { } var tmp = (super(), "prop"); class C extends Base { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.1.normal.js index 94a6bbc4a91..5dc569af22f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -99,8 +98,7 @@ var C = /*#__PURE__*/ function(Base) { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.2.minified.js index ef39e7ddf72..09d54fc9a85 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES6_es5.2.minified.js @@ -38,8 +38,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var Base = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es2015.1.normal.js index ccbd6a4c9c5..ff91cc9bf91 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es2015.1.normal.js @@ -5,8 +5,7 @@ class C extends Base { constructor(){ super(); var obj = { - [(super(), "prop")] () { - } + [(super(), "prop")] () {} }; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.1.normal.js index 6fb97ade58e..0f366067b6a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.1.normal.js @@ -62,8 +62,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,9 +93,7 @@ var C = /*#__PURE__*/ function(Base) { _classCallCheck(this, C); var _this; _this = _super.call(this); - var obj = _defineProperty({ - }, (_this = _super.call(this), "prop"), function() { - }); + var obj = _defineProperty({}, (_this = _super.call(this), "prop"), function() {}); return _this; } return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.2.minified.js index c51c3c2e8e6..8fffd9b3eb9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -59,9 +58,7 @@ var Base = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, (_this = _super.call(this), "prop"), function() { - }), _this; + })({}, (_this = _super.call(this), "prop"), function() {}), _this; } return C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es2015.1.normal.js index 18043b896a7..9a06530a612 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es2015.1.normal.js @@ -5,8 +5,7 @@ class C extends Base { constructor(){ super(); var obj = { - [(super(), "prop")] () { - } + [(super(), "prop")] () {} }; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.1.normal.js index 6fb97ade58e..0f366067b6a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.1.normal.js @@ -62,8 +62,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,9 +93,7 @@ var C = /*#__PURE__*/ function(Base) { _classCallCheck(this, C); var _this; _this = _super.call(this); - var obj = _defineProperty({ - }, (_this = _super.call(this), "prop"), function() { - }); + var obj = _defineProperty({}, (_this = _super.call(this), "prop"), function() {}); return _this; } return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.2.minified.js index c51c3c2e8e6..8fffd9b3eb9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES6_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -59,9 +58,7 @@ var Base = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, (_this = _super.call(this), "prop"), function() { - }), _this; + })({}, (_this = _super.call(this), "prop"), function() {}), _this; } return C; }(Base); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es2015.1.normal.js index e8265efc798..379aeebf4fa 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es2015.1.normal.js @@ -3,8 +3,7 @@ class C { bar() { ()=>{ var obj = { - [this.bar()] () { - } + [this.bar()] () {} }; }; return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es5.1.normal.js index 21761c6f7d9..4056300651f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames29_ES5_es5.1.normal.js @@ -42,9 +42,7 @@ var C = // @target: es5 value: function bar() { var _this = this; (function() { - var obj = _defineProperty({ - }, _this.bar(), function() { - } // needs capture + var obj = _defineProperty({}, _this.bar(), function() {} // needs capture ); }); return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es2015.1.normal.js index a80db2d4279..cee67c950a8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es2015.1.normal.js @@ -3,8 +3,7 @@ class C { bar() { ()=>{ var obj = { - [this.bar()] () { - } + [this.bar()] () {} }; }; return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es5.1.normal.js index 8140a61558f..51584ab6e90 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames29_ES6_es5.1.normal.js @@ -42,9 +42,7 @@ var C = // @target: es6 value: function bar() { var _this = this; (function() { - var obj = _defineProperty({ - }, _this.bar(), function() { - } // needs capture + var obj = _defineProperty({}, _this.bar(), function() {} // needs capture ); }); return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es2015.1.normal.js index 4d0cabb0691..f04afca457a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es2015.1.normal.js @@ -3,16 +3,10 @@ var methodName = "method"; var accessorName = "accessor"; var tmp = methodName, tmp1 = methodName, tmp2 = accessorName, tmp3 = accessorName, tmp4 = accessorName, tmp5 = accessorName; class C { - [tmp]() { - } - static [tmp1]() { - } - get [tmp2]() { - } - set [tmp3](v) { - } - static get [tmp4]() { - } - static set [tmp5](v) { - } + [tmp]() {} + static [tmp1]() {} + get [tmp2]() {} + set [tmp3](v) {} + static get [tmp4]() {} + static set [tmp5](v) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.1.normal.js index 5b9d284a196..c0eb74b6f66 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.1.normal.js @@ -29,34 +29,28 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp2, - get: function get() { - } + get: function get() {} }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp4, - get: function get() { - } + get: function get() {} }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.2.minified.js index 46d119f312b..97ff741893f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames2_ES5_es5.2.minified.js @@ -15,34 +15,28 @@ var methodName = "method", accessorName = "accessor", tmp = methodName, tmp1 = m return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp2, - get: function() { - } + get: function() {} }, { key: tmp3, - set: function(v) { - } + set: function(v) {} } ], staticProps = [ { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp4, - get: function() { - } + get: function() {} }, { key: tmp5, - set: function(v) { - } + set: function(v) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es2015.1.normal.js index a2d99e51767..0d3a84a272f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es2015.1.normal.js @@ -3,16 +3,10 @@ var methodName = "method"; var accessorName = "accessor"; var tmp = methodName, tmp1 = methodName, tmp2 = accessorName, tmp3 = accessorName, tmp4 = accessorName, tmp5 = accessorName; class C { - [tmp]() { - } - static [tmp1]() { - } - get [tmp2]() { - } - set [tmp3](v) { - } - static get [tmp4]() { - } - static set [tmp5](v) { - } + [tmp]() {} + static [tmp1]() {} + get [tmp2]() {} + set [tmp3](v) {} + static get [tmp4]() {} + static set [tmp5](v) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.1.normal.js index 0f7d86be25d..c6aaec0dc85 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.1.normal.js @@ -29,34 +29,28 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp2, - get: function get() { - } + get: function get() {} }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: tmp1, - value: function value() { - } + value: function value() {} }, { key: tmp4, - get: function get() { - } + get: function get() {} }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.2.minified.js index 46d119f312b..97ff741893f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames2_ES6_es5.2.minified.js @@ -15,34 +15,28 @@ var methodName = "method", accessorName = "accessor", tmp = methodName, tmp1 = m return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp2, - get: function() { - } + get: function() {} }, { key: tmp3, - set: function(v) { - } + set: function(v) {} } ], staticProps = [ { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp4, - get: function() { - } + get: function() {} }, { key: tmp5, - set: function(v) { - } + set: function(v) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es2015.1.normal.js index f193e726bee..0a6828adcaa 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es2015.1.normal.js @@ -9,8 +9,7 @@ class C extends Base { // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - [(super(), "prop")] () { - } + [(super(), "prop")] () {} }; }; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.1.normal.js index 6b3bce36383..72e8ca3fedb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.1.normal.js @@ -62,8 +62,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -99,9 +98,7 @@ var C = /*#__PURE__*/ function(Base) { var obj = // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - _defineProperty({ - }, (_this1 = _super.call(_this), "prop"), function() { - }); + _defineProperty({}, (_this1 = _super.call(_this), "prop"), function() {}); }); return _this1; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.2.minified.js index 1e93a32f916..2562908487b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es2015.1.normal.js index b68447bec90..20f58c87d1a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es2015.1.normal.js @@ -9,8 +9,7 @@ class C extends Base { // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - [(super(), "prop")] () { - } + [(super(), "prop")] () {} }; }; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.1.normal.js index 6b3bce36383..72e8ca3fedb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.1.normal.js @@ -62,8 +62,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -99,9 +98,7 @@ var C = /*#__PURE__*/ function(Base) { var obj = // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - _defineProperty({ - }, (_this1 = _super.call(_this), "prop"), function() { - }); + _defineProperty({}, (_this1 = _super.call(_this), "prop"), function() {}); }); return _this1; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.2.minified.js index 1e93a32f916..2562908487b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES6_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es2015.1.normal.js index 5ddbecb327e..ff179e6dc47 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es2015.1.normal.js @@ -8,8 +8,7 @@ class C extends Base { foo() { ()=>{ var obj = { - [super.bar()] () { - } + [super.bar()] () {} }; }; return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.1.normal.js index 4430fe11bd9..695df92ed8a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.1.normal.js @@ -99,8 +99,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -149,9 +148,7 @@ var C = /*#__PURE__*/ function(Base) { value: function foo() { var _this = this; (function() { - var obj = _defineProperty({ - }, _get(_getPrototypeOf(C.prototype), "bar", _this).call(_this), function() { - } // needs capture + var obj = _defineProperty({}, _get(_getPrototypeOf(C.prototype), "bar", _this).call(_this), function() {} // needs capture ); }); return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.2.minified.js index 037dc2baa23..3414159c7ff 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5_es5.2.minified.js @@ -64,8 +64,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es2015.1.normal.js index 9e36382a5e1..e08af0317cb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es2015.1.normal.js @@ -8,8 +8,7 @@ class C extends Base { foo() { ()=>{ var obj = { - [super.bar()] () { - } + [super.bar()] () {} }; }; return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.1.normal.js index f1c71c2d106..5a17ee310c0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.1.normal.js @@ -99,8 +99,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -149,9 +148,7 @@ var C = /*#__PURE__*/ function(Base) { value: function foo() { var _this = this; (function() { - var obj = _defineProperty({ - }, _get(_getPrototypeOf(C.prototype), "bar", _this).call(_this), function() { - } // needs capture + var obj = _defineProperty({}, _get(_getPrototypeOf(C.prototype), "bar", _this).call(_this), function() {} // needs capture ); }); return 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.2.minified.js index 037dc2baa23..3414159c7ff 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES6_es5.2.minified.js @@ -64,8 +64,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es2015.1.normal.js index 7cda0d30afb..404c324513c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es2015.1.normal.js @@ -7,6 +7,5 @@ class C { bar() { return 0; } - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.1.normal.js index 87df82e7f48..4e2f61cfb81 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.1.normal.js @@ -36,8 +36,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.2.minified.js index c44dc3e2bcd..fbd99c3ac7c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5_es5.2.minified.js @@ -21,8 +21,7 @@ var C = function() { }, { key: "", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es2015.1.normal.js index e3bb79eb03d..85905e9c5e4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es2015.1.normal.js @@ -7,6 +7,5 @@ class C { bar() { return 0; } - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.1.normal.js index 3854f3a6dc0..6210b21c431 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.1.normal.js @@ -36,8 +36,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.2.minified.js index c44dc3e2bcd..fbd99c3ac7c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES6_es5.2.minified.js @@ -21,8 +21,7 @@ var C = function() { }, { key: "", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es2015.1.normal.js index 694a44e414c..891dead2e95 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es2015.1.normal.js @@ -5,8 +5,7 @@ function foo() { class C { bar() { var obj = { - [foo()] () { - } + [foo()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.1.normal.js index 9d96ec3d325..ca02773cb51 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.1.normal.js @@ -43,9 +43,7 @@ var C = /*#__PURE__*/ function() { { key: "bar", value: function bar() { - var obj = _defineProperty({ - }, foo(), function() { - }); + var obj = _defineProperty({}, foo(), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.2.minified.js index 2acc5392628..43d5e8079d7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5_es5.2.minified.js @@ -23,9 +23,7 @@ var C = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, "", function() { - }), 0; + })({}, "", function() {}), 0; } } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es2015.1.normal.js index 397f3b483b4..533217ae36f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es2015.1.normal.js @@ -5,8 +5,7 @@ function foo() { class C { bar() { var obj = { - [foo()] () { - } + [foo()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.1.normal.js index 9d523fe64ad..ea7ce6fcae6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.1.normal.js @@ -43,9 +43,7 @@ var C = /*#__PURE__*/ function() { { key: "bar", value: function bar() { - var obj = _defineProperty({ - }, foo(), function() { - }); + var obj = _defineProperty({}, foo(), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.2.minified.js index 2acc5392628..43d5e8079d7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES6_es5.2.minified.js @@ -23,9 +23,7 @@ var C = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, "", function() { - }), 0; + })({}, "", function() {}), 0; } } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es2015.1.normal.js index dc246367371..f80d5796533 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es2015.1.normal.js @@ -5,8 +5,7 @@ function foo() { class C { static bar() { var obj = { - [foo()] () { - } + [foo()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.1.normal.js index 259c6e1fd63..e9fd31b3f42 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.1.normal.js @@ -43,9 +43,7 @@ var C = /*#__PURE__*/ function() { { key: "bar", value: function bar() { - var obj = _defineProperty({ - }, foo(), function() { - }); + var obj = _defineProperty({}, foo(), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.2.minified.js index c102d9c0d37..4a5f24f3299 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5_es5.2.minified.js @@ -22,9 +22,7 @@ var C = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, "", function() { - }), 0; + })({}, "", function() {}), 0; } } ]), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es2015.1.normal.js index 62c1636908e..e6d37d87f61 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es2015.1.normal.js @@ -5,8 +5,7 @@ function foo() { class C { static bar() { var obj = { - [foo()] () { - } + [foo()] () {} }; return 0; } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.1.normal.js index f2ab73469ae..42965ed04b4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.1.normal.js @@ -43,9 +43,7 @@ var C = /*#__PURE__*/ function() { { key: "bar", value: function bar() { - var obj = _defineProperty({ - }, foo(), function() { - }); + var obj = _defineProperty({}, foo(), function() {}); return 0; } } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.2.minified.js index c102d9c0d37..4a5f24f3299 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES6_es5.2.minified.js @@ -22,9 +22,7 @@ var C = function() { configurable: !0, writable: !0 }) : obj[key] = value; - })({ - }, "", function() { - }), 0; + })({}, "", function() {}), 0; } } ]), C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es2015.1.normal.js index fc106c26337..d8e111a93b5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.1.normal.js index b442e47b5d5..3929071ed8c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.2.minified.js index 9f3f789b287..cd84dafff02 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames36_ES5_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: "set1", - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es2015.1.normal.js index b716eabe2dd..73f7597618f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.1.normal.js index b442e47b5d5..3929071ed8c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.2.minified.js index 9f3f789b287..cd84dafff02 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames36_ES6_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: "set1", - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es2015.1.normal.js index fc106c26337..d8e111a93b5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.1.normal.js index b442e47b5d5..3929071ed8c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.2.minified.js index 9f3f789b287..cd84dafff02 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames37_ES5_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: "set1", - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es2015.1.normal.js index b716eabe2dd..73f7597618f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.1.normal.js index b442e47b5d5..3929071ed8c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.2.minified.js index 9f3f789b287..cd84dafff02 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames37_ES6_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: "set1", - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es2015.1.normal.js index f8947115ec3..21d6cfaf04e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.1.normal.js index 0c80912e972..989f1ef9e9a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.2.minified.js index 3f250d26bb0..a827509825d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames38_ES5_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: 64, - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es2015.1.normal.js index 3586336000f..58012b82ef6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.1.normal.js index 0c80912e972..989f1ef9e9a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.2.minified.js index 3f250d26bb0..a827509825d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames38_ES6_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: 64, - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es2015.1.normal.js index f8947115ec3..21d6cfaf04e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.1.normal.js index 0c80912e972..989f1ef9e9a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.2.minified.js index 3f250d26bb0..a827509825d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames39_ES5_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: 64, - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es2015.1.normal.js index 3586336000f..58012b82ef6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es2015.1.normal.js @@ -9,6 +9,5 @@ class C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.1.normal.js index 0c80912e972..989f1ef9e9a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.1.normal.js @@ -41,8 +41,7 @@ var C = /*#__PURE__*/ function() { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.2.minified.js index 3f250d26bb0..a827509825d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames39_ES6_es5.2.minified.js @@ -28,8 +28,7 @@ var Foo = function() { }, { key: 64, - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es2015.1.normal.js index 907a91658b7..d18c9e95c52 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es2015.1.normal.js @@ -11,6 +11,5 @@ class D extends C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.1.normal.js index 9d873131a52..7ba25837efe 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -114,8 +113,7 @@ var D = /*#__PURE__*/ function(C) { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.2.minified.js index 89b1fabb510..9ecc066a407 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5_es5.2.minified.js @@ -44,8 +44,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -74,8 +73,7 @@ var Foo = function() { }, { key: "set1", - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), D; }(C); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es2015.1.normal.js index 13dfff5793d..b4b72e731fd 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es2015.1.normal.js @@ -11,6 +11,5 @@ class D extends C { get [tmp]() { return new Foo; } - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.1.normal.js index 9d873131a52..7ba25837efe 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -114,8 +113,7 @@ var D = /*#__PURE__*/ function(C) { }, { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.2.minified.js index 89b1fabb510..9ecc066a407 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES6_es5.2.minified.js @@ -44,8 +44,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -74,8 +73,7 @@ var Foo = function() { }, { key: "set1", - set: function(p) { - } + set: function(p) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), D; }(C); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es2015.1.normal.js index cb266a9d08e..6bfc619cdf5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es2015.1.normal.js @@ -11,6 +11,5 @@ class C { } var tmp1 = "set1"; class D extends C { - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.1.normal.js index cf7ee152ee5..c6409984583 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,8 +118,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.2.minified.js index cb16141d136..8f86a68c171 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5_es5.2.minified.js @@ -57,8 +57,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -81,8 +80,7 @@ var Foo = function() { return _createClass(D, [ { key: "set1", - set: function(p) { - } + set: function(p) {} } ]), D; }(C); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es2015.1.normal.js index 39faedb20cd..fa5fca55aaa 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es2015.1.normal.js @@ -11,6 +11,5 @@ class C { } var tmp1 = "set1"; class D extends C { - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.1.normal.js index cf7ee152ee5..c6409984583 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,8 +118,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.2.minified.js index cb16141d136..8f86a68c171 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES6_es5.2.minified.js @@ -57,8 +57,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -81,8 +80,7 @@ var Foo = function() { return _createClass(D, [ { key: "set1", - set: function(p) { - } + set: function(p) {} } ]), D; }(C); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es2015.1.normal.js index cb266a9d08e..6bfc619cdf5 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es2015.1.normal.js @@ -11,6 +11,5 @@ class C { } var tmp1 = "set1"; class D extends C { - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.1.normal.js index cf7ee152ee5..c6409984583 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,8 +118,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.2.minified.js index cb16141d136..8f86a68c171 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5_es5.2.minified.js @@ -57,8 +57,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -81,8 +80,7 @@ var Foo = function() { return _createClass(D, [ { key: "set1", - set: function(p) { - } + set: function(p) {} } ]), D; }(C); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es2015.1.normal.js index 39faedb20cd..fa5fca55aaa 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es2015.1.normal.js @@ -11,6 +11,5 @@ class C { } var tmp1 = "set1"; class D extends C { - set [tmp1](p) { - } + set [tmp1](p) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.1.normal.js index cf7ee152ee5..c6409984583 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,8 +118,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: tmp1, - set: function set(p) { - } + set: function set(p) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.2.minified.js index cb16141d136..8f86a68c171 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES6_es5.2.minified.js @@ -57,8 +57,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -81,8 +80,7 @@ var Foo = function() { return _createClass(D, [ { key: "set1", - set: function(p) { - } + set: function(p) {} } ]), D; }(C); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.1.normal.js index 8473ba92bda..17019812126 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } // @target: es5 -var o = _defineProperty({ -}, "" || 0, 0); +var o = _defineProperty({}, "" || 0, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.2.minified.js index ff9e5a5a521..90218f51fdf 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames46_ES5_es5.2.minified.js @@ -1,6 +1,5 @@ var obj; -0 in (obj = { -}) ? Object.defineProperty(obj, 0, { +0 in (obj = {}) ? Object.defineProperty(obj, 0, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.1.normal.js index 60677127416..263476a41fe 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } // @target: es6 -var o = _defineProperty({ -}, "" || 0, 0); +var o = _defineProperty({}, "" || 0, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.2.minified.js index ff9e5a5a521..90218f51fdf 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames46_ES6_es5.2.minified.js @@ -1,6 +1,5 @@ var obj; -0 in (obj = { -}) ? Object.defineProperty(obj, 0, { +0 in (obj = {}) ? Object.defineProperty(obj, 0, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.1.normal.js index 68d1944da66..b08eb0aec7f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.1.normal.js @@ -2,13 +2,11 @@ var // @target: es5 E1; (function(E1) { E1[E1["x"] = 0] = "x"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["x"] = 0] = "x"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var o = { [E1.x || E2.x]: 0 }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.2.minified.js index e6bdced7351..a5cab2cb4b8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es2015.2.minified.js @@ -1,4 +1,2 @@ var E1, E2, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.x = 0] = "x", (E2 = E2 || (E2 = { -}))[E2.x = 0] = "x", E1.x || E2.x; +(E1 = E1 || (E1 = {}))[E1.x = 0] = "x", (E2 = E2 || (E2 = {}))[E2.x = 0] = "x", E1.x || E2.x; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.1.normal.js index 6ba2499d0ae..56c3670cded 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.1.normal.js @@ -15,12 +15,9 @@ var // @target: es5 E1; (function(E1) { E1[E1["x"] = 0] = "x"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["x"] = 0] = "x"; -})(E2 || (E2 = { -})); -var o = _defineProperty({ -}, E1.x || E2.x, 0); +})(E2 || (E2 = {})); +var o = _defineProperty({}, E1.x || E2.x, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.2.minified.js index 1f52ee3b48e..f1b071dd074 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES5_es5.2.minified.js @@ -1,8 +1,5 @@ var E1, E2, obj, key, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.x = 0] = "x", (E2 = E2 || (E2 = { -}))[E2.x = 0] = "x", obj = { -}, (key = E1.x || E2.x) in obj ? Object.defineProperty(obj, key, { +(E1 = E1 || (E1 = {}))[E1.x = 0] = "x", (E2 = E2 || (E2 = {}))[E2.x = 0] = "x", obj = {}, (key = E1.x || E2.x) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.1.normal.js index 43fa0c237ab..33a2d7a3b6f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.1.normal.js @@ -2,13 +2,11 @@ var // @target: es6 E1; (function(E1) { E1[E1["x"] = 0] = "x"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["x"] = 0] = "x"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var o = { [E1.x || E2.x]: 0 }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.2.minified.js index e6bdced7351..a5cab2cb4b8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es2015.2.minified.js @@ -1,4 +1,2 @@ var E1, E2, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.x = 0] = "x", (E2 = E2 || (E2 = { -}))[E2.x = 0] = "x", E1.x || E2.x; +(E1 = E1 || (E1 = {}))[E1.x = 0] = "x", (E2 = E2 || (E2 = {}))[E2.x = 0] = "x", E1.x || E2.x; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.1.normal.js index 0b650a3df64..3807c2e1448 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.1.normal.js @@ -15,12 +15,9 @@ var // @target: es6 E1; (function(E1) { E1[E1["x"] = 0] = "x"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["x"] = 0] = "x"; -})(E2 || (E2 = { -})); -var o = _defineProperty({ -}, E1.x || E2.x, 0); +})(E2 || (E2 = {})); +var o = _defineProperty({}, E1.x || E2.x, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.2.minified.js index 1f52ee3b48e..f1b071dd074 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames47_ES6_es5.2.minified.js @@ -1,8 +1,5 @@ var E1, E2, obj, key, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.x = 0] = "x", (E2 = E2 || (E2 = { -}))[E2.x = 0] = "x", obj = { -}, (key = E1.x || E2.x) in obj ? Object.defineProperty(obj, key, { +(E1 = E1 || (E1 = {}))[E1.x = 0] = "x", (E2 = E2 || (E2 = {}))[E2.x = 0] = "x", obj = {}, (key = E1.x || E2.x) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.1.normal.js index bd2300bb59e..7a2873b61d6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.1.normal.js @@ -1,8 +1,7 @@ var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); var a; extractIndexer({ [a]: "" diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.2.minified.js index 72e3201c4d7..40e3046509b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es2015.2.minified.js @@ -1,6 +1,5 @@ var E, a, E; -(E = E || (E = { -}))[E.x = 0] = "x", extractIndexer({ +(E = E || (E = {}))[E.x = 0] = "x", extractIndexer({ [a]: "" }), extractIndexer({ [E.x]: "" diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.1.normal.js index 4a6581c042b..d4086d72812 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.1.normal.js @@ -14,12 +14,8 @@ function _defineProperty(obj, key, value) { var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); var a; -extractIndexer(_defineProperty({ -}, a, "")); // Should return string -extractIndexer(_defineProperty({ -}, E.x, "")); // Should return string -extractIndexer(_defineProperty({ -}, "" || 0, "")); // Should return any (widened form of undefined) +extractIndexer(_defineProperty({}, a, "")); // Should return string +extractIndexer(_defineProperty({}, E.x, "")); // Should return string +extractIndexer(_defineProperty({}, "" || 0, "")); // Should return any (widened form of undefined) diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.2.minified.js index 65d80ead422..daae5291aa4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES5_es5.2.minified.js @@ -7,8 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -(E = E || (E = { -}))[E.x = 0] = "x", extractIndexer(_defineProperty({ -}, a, "")), extractIndexer(_defineProperty({ -}, E.x, "")), extractIndexer(_defineProperty({ -}, 0, "")); +(E = E || (E = {}))[E.x = 0] = "x", extractIndexer(_defineProperty({}, a, "")), extractIndexer(_defineProperty({}, E.x, "")), extractIndexer(_defineProperty({}, 0, "")); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.1.normal.js index bd2300bb59e..7a2873b61d6 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.1.normal.js @@ -1,8 +1,7 @@ var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); var a; extractIndexer({ [a]: "" diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.2.minified.js index 72e3201c4d7..40e3046509b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es2015.2.minified.js @@ -1,6 +1,5 @@ var E, a, E; -(E = E || (E = { -}))[E.x = 0] = "x", extractIndexer({ +(E = E || (E = {}))[E.x = 0] = "x", extractIndexer({ [a]: "" }), extractIndexer({ [E.x]: "" diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.1.normal.js index 4a6581c042b..d4086d72812 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.1.normal.js @@ -14,12 +14,8 @@ function _defineProperty(obj, key, value) { var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); var a; -extractIndexer(_defineProperty({ -}, a, "")); // Should return string -extractIndexer(_defineProperty({ -}, E.x, "")); // Should return string -extractIndexer(_defineProperty({ -}, "" || 0, "")); // Should return any (widened form of undefined) +extractIndexer(_defineProperty({}, a, "")); // Should return string +extractIndexer(_defineProperty({}, E.x, "")); // Should return string +extractIndexer(_defineProperty({}, "" || 0, "")); // Should return any (widened form of undefined) diff --git a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.2.minified.js index 65d80ead422..daae5291aa4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames48_ES6_es5.2.minified.js @@ -7,8 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -(E = E || (E = { -}))[E.x = 0] = "x", extractIndexer(_defineProperty({ -}, a, "")), extractIndexer(_defineProperty({ -}, E.x, "")), extractIndexer(_defineProperty({ -}, 0, "")); +(E = E || (E = {}))[E.x = 0] = "x", extractIndexer(_defineProperty({}, a, "")), extractIndexer(_defineProperty({}, E.x, "")), extractIndexer(_defineProperty({}, 0, "")); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.1.normal.js index c718cb4171d..bc727473d1d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.1.normal.js @@ -16,5 +16,4 @@ var s; var n; var a; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, true, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0), _obj); +var v = (_obj = {}, _defineProperty(_obj, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, true, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.2.minified.js index 9737789447e..608abe8a0c7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames4_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, !0, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0); +_defineProperty(_obj = {}, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, !0, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.1.normal.js index 58785214380..068a7cfa8d3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.1.normal.js @@ -16,5 +16,4 @@ var s; var n; var a; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, true, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0), _obj); +var v = (_obj = {}, _defineProperty(_obj, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, true, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.2.minified.js index 9737789447e..608abe8a0c7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames4_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, !0, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0); +_defineProperty(_obj = {}, s, 0), _defineProperty(_obj, n, n), _defineProperty(_obj, s + s, 1), _defineProperty(_obj, s + n, 2), _defineProperty(_obj, +s, s), _defineProperty(_obj, "", 0), _defineProperty(_obj, 0, 0), _defineProperty(_obj, a, 1), _defineProperty(_obj, !0, 0), _defineProperty(_obj, "hello bye", 0), _defineProperty(_obj, "hello ".concat(a, " bye"), 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames51_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames51_ES5_es5.1.normal.js index 58046df66ea..dd2827e29bb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames51_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames51_ES5_es5.1.normal.js @@ -15,6 +15,5 @@ function f() { var t; var k; var _obj; - var v = (_obj = { - }, _defineProperty(_obj, t, 0), _defineProperty(_obj, k, 1), _obj); + var v = (_obj = {}, _defineProperty(_obj, t, 0), _defineProperty(_obj, k, 1), _obj); } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames51_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames51_ES6_es5.1.normal.js index 07b2c64ad49..86f73bc89e3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames51_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames51_ES6_es5.1.normal.js @@ -16,6 +16,5 @@ function f() { var t; var k; var _obj; - var v = (_obj = { - }, _defineProperty(_obj, t, 0), _defineProperty(_obj, k, 1), _obj); + var v = (_obj = {}, _defineProperty(_obj, t, 0), _defineProperty(_obj, k, 1), _obj); } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es2015.1.normal.js index 1606c69f5a3..baecf1287e0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es2015.1.normal.js @@ -4,8 +4,7 @@ var v = { [b]: 0, [true]: 1, [[]]: 0, - [{ - }]: 0, + [{}]: 0, [undefined]: undefined, [null]: null }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.1.normal.js index d6056948561..3d25b461cd7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.1.normal.js @@ -14,6 +14,4 @@ function _defineProperty(obj, key, value) { // @target: es5 var b; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, b, 0), _defineProperty(_obj, true, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, { -}, 0), _defineProperty(_obj, undefined, undefined), _defineProperty(_obj, null, null), _obj); +var v = (_obj = {}, _defineProperty(_obj, b, 0), _defineProperty(_obj, true, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, {}, 0), _defineProperty(_obj, undefined, undefined), _defineProperty(_obj, null, null), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.2.minified.js index 3ebe3695bd6..2fb9dd65f38 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames5_ES5_es5.2.minified.js @@ -7,6 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, void 0, 0), _defineProperty(_obj, !0, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, { -}, 0), _defineProperty(_obj, void 0, void 0), _defineProperty(_obj, null, null); +_defineProperty(_obj = {}, void 0, 0), _defineProperty(_obj, !0, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, {}, 0), _defineProperty(_obj, void 0, void 0), _defineProperty(_obj, null, null); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es2015.1.normal.js index 6c090057a50..7e919f4e3d3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es2015.1.normal.js @@ -4,8 +4,7 @@ var v = { [b]: 0, [true]: 1, [[]]: 0, - [{ - }]: 0, + [{}]: 0, [undefined]: undefined, [null]: null }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.1.normal.js index 9974e14281b..ed7870e32eb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.1.normal.js @@ -14,6 +14,4 @@ function _defineProperty(obj, key, value) { // @target: es6 var b; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, b, 0), _defineProperty(_obj, true, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, { -}, 0), _defineProperty(_obj, undefined, undefined), _defineProperty(_obj, null, null), _obj); +var v = (_obj = {}, _defineProperty(_obj, b, 0), _defineProperty(_obj, true, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, {}, 0), _defineProperty(_obj, undefined, undefined), _defineProperty(_obj, null, null), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.2.minified.js index 3ebe3695bd6..2fb9dd65f38 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames5_ES6_es5.2.minified.js @@ -7,6 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, void 0, 0), _defineProperty(_obj, !0, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, { -}, 0), _defineProperty(_obj, void 0, void 0), _defineProperty(_obj, null, null); +_defineProperty(_obj = {}, void 0, 0), _defineProperty(_obj, !0, 1), _defineProperty(_obj, [], 0), _defineProperty(_obj, {}, 0), _defineProperty(_obj, void 0, void 0), _defineProperty(_obj, null, null); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.1.normal.js index 391af932195..501abbdf237 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.1.normal.js @@ -16,5 +16,4 @@ var p1; var p2; var p3; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, p1, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2), _obj); +var v = (_obj = {}, _defineProperty(_obj, p1, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.2.minified.js index 960d926c7ab..af782c22b4a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames6_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, void 0, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2); +_defineProperty(_obj = {}, void 0, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.1.normal.js index 0a34cb85a94..51fd1a17274 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.1.normal.js @@ -16,5 +16,4 @@ var p1; var p2; var p3; var _obj; -var v = (_obj = { -}, _defineProperty(_obj, p1, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2), _obj); +var v = (_obj = {}, _defineProperty(_obj, p1, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.2.minified.js index 960d926c7ab..af782c22b4a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames6_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, void 0, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2); +_defineProperty(_obj = {}, void 0, 0), _defineProperty(_obj, p2, 1), _defineProperty(_obj, p3, 2); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.1.normal.js index 7ae07c1a013..519163e4005 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.1.normal.js @@ -2,8 +2,7 @@ var // @target: es5 E; (function(E) { E[E["member"] = 0] = "member"; -})(E || (E = { -})); +})(E || (E = {})); var v = { [E.member]: 0 }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.2.minified.js index 3bd7a9cd67f..b0189329a59 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.member = 0] = "member", E.member; +(E = E || (E = {}))[E.member = 0] = "member", E.member; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.1.normal.js index 9db26319fe1..48697d1c511 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.1.normal.js @@ -15,7 +15,5 @@ var // @target: es5 E; (function(E) { E[E["member"] = 0] = "member"; -})(E || (E = { -})); -var v = _defineProperty({ -}, E.member, 0); +})(E || (E = {})); +var v = _defineProperty({}, E.member, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.2.minified.js index 2d42392864b..6a76215495c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES5_es5.2.minified.js @@ -1,7 +1,5 @@ var E, obj, key, E; -(E = E || (E = { -}))[E.member = 0] = "member", obj = { -}, (key = E.member) in obj ? Object.defineProperty(obj, key, { +(E = E || (E = {}))[E.member = 0] = "member", obj = {}, (key = E.member) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.1.normal.js index 1a5c6787e61..504e197f298 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.1.normal.js @@ -2,8 +2,7 @@ var // @target: es6 E; (function(E) { E[E["member"] = 0] = "member"; -})(E || (E = { -})); +})(E || (E = {})); var v = { [E.member]: 0 }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.2.minified.js index 3bd7a9cd67f..b0189329a59 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.member = 0] = "member", E.member; +(E = E || (E = {}))[E.member = 0] = "member", E.member; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.1.normal.js index 6fd132b925b..d587692202a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.1.normal.js @@ -15,7 +15,5 @@ var // @target: es6 E; (function(E) { E[E["member"] = 0] = "member"; -})(E || (E = { -})); -var v = _defineProperty({ -}, E.member, 0); +})(E || (E = {})); +var v = _defineProperty({}, E.member, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.2.minified.js index 2d42392864b..6a76215495c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames7_ES6_es5.2.minified.js @@ -1,7 +1,5 @@ var E, obj, key, E; -(E = E || (E = { -}))[E.member = 0] = "member", obj = { -}, (key = E.member) in obj ? Object.defineProperty(obj, key, { +(E = E || (E = {}))[E.member = 0] = "member", obj = {}, (key = E.member) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames8_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames8_ES5_es5.1.normal.js index bd96c6f5c14..e0ac05911f9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames8_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames8_ES5_es5.1.normal.js @@ -16,6 +16,5 @@ function f() { var t; var u; var _obj; - var v = (_obj = { - }, _defineProperty(_obj, t, 0), _defineProperty(_obj, u, 1), _obj); + var v = (_obj = {}, _defineProperty(_obj, t, 0), _defineProperty(_obj, u, 1), _obj); } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames8_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames8_ES6_es5.1.normal.js index 6f24ffb9dc8..6cee217af34 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames8_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames8_ES6_es5.1.normal.js @@ -16,6 +16,5 @@ function f() { var t; var u; var _obj; - var v = (_obj = { - }, _defineProperty(_obj, t, 0), _defineProperty(_obj, u, 1), _obj); + var v = (_obj = {}, _defineProperty(_obj, t, 0), _defineProperty(_obj, u, 1), _obj); } diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.1.normal.js index bc35c588b84..746cfa01f7d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.1.normal.js @@ -1,5 +1,4 @@ -function f(x) { -} +function f(x) {} var v = { [f("")]: 0, [f(0)]: 0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.2.minified.js index f85553c5373..270c42d8416 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es2015.2.minified.js @@ -1,3 +1,2 @@ -function f(x) { -} +function f(x) {} f(""), f(0), f(!0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.1.normal.js index ec121c9f184..afe0c766aa3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.1.normal.js @@ -11,8 +11,6 @@ function _defineProperty(obj, key, value) { } return obj; } -function f(x) { -} +function f(x) {} var _obj; -var v = (_obj = { -}, _defineProperty(_obj, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(true), 0), _obj); +var v = (_obj = {}, _defineProperty(_obj, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(true), 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.2.minified.js index 5007c4d2740..0de662816eb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES5_es5.2.minified.js @@ -7,7 +7,5 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -function f(x) { -} -_defineProperty(_obj = { -}, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(!0), 0); +function f(x) {} +_defineProperty(_obj = {}, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(!0), 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.1.normal.js index bc35c588b84..746cfa01f7d 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.1.normal.js @@ -1,5 +1,4 @@ -function f(x) { -} +function f(x) {} var v = { [f("")]: 0, [f(0)]: 0, diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.2.minified.js index f85553c5373..270c42d8416 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es2015.2.minified.js @@ -1,3 +1,2 @@ -function f(x) { -} +function f(x) {} f(""), f(0), f(!0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.1.normal.js index ec121c9f184..afe0c766aa3 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.1.normal.js @@ -11,8 +11,6 @@ function _defineProperty(obj, key, value) { } return obj; } -function f(x) { -} +function f(x) {} var _obj; -var v = (_obj = { -}, _defineProperty(_obj, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(true), 0), _obj); +var v = (_obj = {}, _defineProperty(_obj, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(true), 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.2.minified.js index 5007c4d2740..0de662816eb 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames9_ES6_es5.2.minified.js @@ -7,7 +7,5 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -function f(x) { -} -_defineProperty(_obj = { -}, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(!0), 0); +function f(x) {} +_defineProperty(_obj = {}, f(""), 0), _defineProperty(_obj, f(0), 0), _defineProperty(_obj, f(!0), 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.1.normal.js index 28a7db29ac3..a326ab99a64 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.2.minified.js index dc9fd02b5b3..86138ec108e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, ""), _defineProperty(_obj, NaN, 0); +_defineProperty(_obj = {}, NaN, ""), _defineProperty(_obj, NaN, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.1.normal.js index 28a7db29ac3..a326ab99a64 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.2.minified.js index dc9fd02b5b3..86138ec108e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType10_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, ""), _defineProperty(_obj, NaN, 0); +_defineProperty(_obj = {}, NaN, ""), _defineProperty(_obj, NaN, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.1.normal.js index fb42eccd32d..f464de6d3d9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, "" + 0, function(y) { +var o = (_obj = {}, _defineProperty(_obj, "" + 0, function(y) { return y.length; }), _defineProperty(_obj, "" + 1, function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.2.minified.js index 5944b5156cb..25c7779e3de 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES5_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, "0", function(y) { +_defineProperty(_obj = {}, "0", function(y) { return y.length; }), _defineProperty(_obj, "1", function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.1.normal.js index fb42eccd32d..f464de6d3d9 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, "" + 0, function(y) { +var o = (_obj = {}, _defineProperty(_obj, "" + 0, function(y) { return y.length; }), _defineProperty(_obj, "" + 1, function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.2.minified.js index 5944b5156cb..25c7779e3de 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType1_ES6_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, "0", function(y) { +_defineProperty(_obj = {}, "0", function(y) { return y.length; }), _defineProperty(_obj, "1", function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.1.normal.js index c4aea9ff274..1fadc387351 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", function(y) { +var o = (_obj = {}, _defineProperty(_obj, +"foo", function(y) { return y.length; }), _defineProperty(_obj, +"bar", function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.2.minified.js index 16cd21727fd..4c0bf4e9944 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES5_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, function(y) { +_defineProperty(_obj = {}, NaN, function(y) { return y.length; }), _defineProperty(_obj, NaN, function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.1.normal.js index c4aea9ff274..1fadc387351 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", function(y) { +var o = (_obj = {}, _defineProperty(_obj, +"foo", function(y) { return y.length; }), _defineProperty(_obj, +"bar", function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.2.minified.js index 16cd21727fd..4c0bf4e9944 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType2_ES6_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, function(y) { +_defineProperty(_obj = {}, NaN, function(y) { return y.length; }), _defineProperty(_obj, NaN, function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.1.normal.js index c4aea9ff274..1fadc387351 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", function(y) { +var o = (_obj = {}, _defineProperty(_obj, +"foo", function(y) { return y.length; }), _defineProperty(_obj, +"bar", function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.2.minified.js index 16cd21727fd..4c0bf4e9944 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES5_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, function(y) { +_defineProperty(_obj = {}, NaN, function(y) { return y.length; }), _defineProperty(_obj, NaN, function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.1.normal.js index c4aea9ff274..1fadc387351 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", function(y) { +var o = (_obj = {}, _defineProperty(_obj, +"foo", function(y) { return y.length; }), _defineProperty(_obj, +"bar", function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.2.minified.js index 16cd21727fd..4c0bf4e9944 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType3_ES6_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, function(y) { +_defineProperty(_obj = {}, NaN, function(y) { return y.length; }), _defineProperty(_obj, NaN, function(y) { return y.length; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.1.normal.js index ccfa77fa767..b46d5b3a333 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.2.minified.js index c3695022e95..4ee1204110f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, "foo", ""), _defineProperty(_obj, "bar", 0); +_defineProperty(_obj = {}, "foo", ""), _defineProperty(_obj, "bar", 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.1.normal.js index ccfa77fa767..b46d5b3a333 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.2.minified.js index c3695022e95..4ee1204110f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType4_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, "foo", ""), _defineProperty(_obj, "bar", 0); +_defineProperty(_obj = {}, "foo", ""), _defineProperty(_obj, "bar", 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.1.normal.js index 28a7db29ac3..a326ab99a64 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.2.minified.js index dc9fd02b5b3..86138ec108e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, ""), _defineProperty(_obj, NaN, 0); +_defineProperty(_obj = {}, NaN, ""), _defineProperty(_obj, NaN, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.1.normal.js index 28a7db29ac3..a326ab99a64 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.2.minified.js index dc9fd02b5b3..86138ec108e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType5_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, ""), _defineProperty(_obj, NaN, 0); +_defineProperty(_obj = {}, NaN, ""), _defineProperty(_obj, NaN, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.1.normal.js index 02a60616dee..d4567d787a2 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.1.normal.js @@ -1,7 +1,6 @@ foo({ p: "", - 0: ()=>{ - }, + 0: ()=>{}, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.2.minified.js index 7ddffc20bf9..91129f94e09 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.2.minified.js @@ -1,7 +1,6 @@ foo({ p: "", - 0: ()=>{ - }, + 0: ()=>{}, ["hibye"]: !0, [1]: 0, [NaN]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.1.normal.js index 054e823f5d5..7650bf96708 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.1.normal.js @@ -14,8 +14,7 @@ function _defineProperty(obj, key, value) { var _obj; foo((_obj = { p: "", - 0: function() { - } + 0: function() {} }, _defineProperty(_obj, "hi" + "bye", true), _defineProperty(_obj, 0 + 1, 0), _defineProperty(_obj, +"hi", [ 0 ]), _obj)); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.2.minified.js index 42b71f1066d..a91808c3018 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es5.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { } foo((_defineProperty(_obj = { p: "", - 0: function() { - } + 0: function() {} }, "hibye", !0), _defineProperty(_obj, 1, 0), _defineProperty(_obj, NaN, [ 0 ]), _obj)); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.1.normal.js index 02a60616dee..d4567d787a2 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.1.normal.js @@ -1,7 +1,6 @@ foo({ p: "", - 0: ()=>{ - }, + 0: ()=>{}, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.2.minified.js index 7ddffc20bf9..91129f94e09 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.2.minified.js @@ -1,7 +1,6 @@ foo({ p: "", - 0: ()=>{ - }, + 0: ()=>{}, ["hibye"]: !0, [1]: 0, [NaN]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.1.normal.js index 054e823f5d5..7650bf96708 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.1.normal.js @@ -14,8 +14,7 @@ function _defineProperty(obj, key, value) { var _obj; foo((_obj = { p: "", - 0: function() { - } + 0: function() {} }, _defineProperty(_obj, "hi" + "bye", true), _defineProperty(_obj, 0 + 1, 0), _defineProperty(_obj, +"hi", [ 0 ]), _obj)); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.2.minified.js index 42b71f1066d..a91808c3018 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es5.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { } foo((_defineProperty(_obj = { p: "", - 0: function() { - } + 0: function() {} }, "hibye", !0), _defineProperty(_obj, 1, 0), _defineProperty(_obj, NaN, [ 0 ]), _obj)); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.1.normal.js index 5a6f1def67d..106b33c9009 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.1.normal.js @@ -1,6 +1,5 @@ foo({ - 0: ()=>{ - }, + 0: ()=>{}, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.2.minified.js index ba6d8e7751e..8fee8e4cce0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.2.minified.js @@ -1,6 +1,5 @@ foo({ - 0: ()=>{ - }, + 0: ()=>{}, ["hibye"]: !0, [1]: 0, [NaN]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.1.normal.js index 1452b7a546f..ff401ed0383 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } var _obj; foo((_obj = { - 0: function() { - } + 0: function() {} }, _defineProperty(_obj, "hi" + "bye", true), _defineProperty(_obj, 0 + 1, 0), _defineProperty(_obj, +"hi", [ 0 ]), _obj)); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.2.minified.js index 0b5328d8857..b1b983b6a6a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } foo((_defineProperty(_obj = { - 0: function() { - } + 0: function() {} }, "hibye", !0), _defineProperty(_obj, 1, 0), _defineProperty(_obj, NaN, [ 0 ]), _obj)), g({ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.1.normal.js index 5a6f1def67d..106b33c9009 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.1.normal.js @@ -1,6 +1,5 @@ foo({ - 0: ()=>{ - }, + 0: ()=>{}, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.2.minified.js index ba6d8e7751e..8fee8e4cce0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.2.minified.js @@ -1,6 +1,5 @@ foo({ - 0: ()=>{ - }, + 0: ()=>{}, ["hibye"]: !0, [1]: 0, [NaN]: [ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.1.normal.js index 1452b7a546f..ff401ed0383 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } var _obj; foo((_obj = { - 0: function() { - } + 0: function() {} }, _defineProperty(_obj, "hi" + "bye", true), _defineProperty(_obj, 0 + 1, 0), _defineProperty(_obj, +"hi", [ 0 ]), _obj)); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.2.minified.js index 0b5328d8857..b1b983b6a6a 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } foo((_defineProperty(_obj = { - 0: function() { - } + 0: function() {} }, "hibye", !0), _defineProperty(_obj, 1, 0), _defineProperty(_obj, NaN, [ 0 ]), _obj)), g({ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.1.normal.js index ccfa77fa767..b46d5b3a333 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.2.minified.js index c3695022e95..4ee1204110f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, "foo", ""), _defineProperty(_obj, "bar", 0); +_defineProperty(_obj = {}, "foo", ""), _defineProperty(_obj, "bar", 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.1.normal.js index ccfa77fa767..b46d5b3a333 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, "" + "foo", ""), _defineProperty(_obj, "" + "bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.2.minified.js index c3695022e95..4ee1204110f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType8_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, "foo", ""), _defineProperty(_obj, "bar", 0); +_defineProperty(_obj = {}, "foo", ""), _defineProperty(_obj, "bar", 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.1.normal.js index 28a7db29ac3..a326ab99a64 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.2.minified.js index dc9fd02b5b3..86138ec108e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES5_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, ""), _defineProperty(_obj, NaN, 0); +_defineProperty(_obj = {}, NaN, ""), _defineProperty(_obj, NaN, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.1.normal.js index 28a7db29ac3..a326ab99a64 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var o = (_obj = { -}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); +var o = (_obj = {}, _defineProperty(_obj, +"foo", ""), _defineProperty(_obj, +"bar", 0), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.2.minified.js index dc9fd02b5b3..86138ec108e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesContextualType9_ES6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, NaN, ""), _defineProperty(_obj, NaN, 0); +_defineProperty(_obj = {}, NaN, ""), _defineProperty(_obj, NaN, 0); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es2015.1.normal.js index 772fdced83b..26558ea25bc 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es2015.1.normal.js @@ -2,11 +2,9 @@ var tmp = "" + "", tmp1 = "" + "", tmp2 = "" + ""; // @target: es5 // @declaration: true class C { - [tmp]() { - } + [tmp]() {} get [tmp1]() { return 0; } - set [tmp2](x) { - } + set [tmp2](x) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.1.normal.js index 12fbf8c94b3..5d8f310050e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.1.normal.js @@ -28,8 +28,7 @@ var C = // @target: es5 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, @@ -39,8 +38,7 @@ var C = // @target: es5 }, { key: tmp2, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.2.minified.js index 87f261be59f..c8bddfc07f0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES5_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "", - value: function() { - } + value: function() {} }, { key: "", @@ -26,8 +25,7 @@ var C = function() { }, { key: "", - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es2015.1.normal.js index ec799a5fb29..5eaa96eaeb1 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es2015.1.normal.js @@ -2,11 +2,9 @@ var tmp = "" + "", tmp1 = "" + "", tmp2 = "" + ""; // @target: es6 // @declaration: true class C { - [tmp]() { - } + [tmp]() {} get [tmp1]() { return 0; } - set [tmp2](x) { - } + set [tmp2](x) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.1.normal.js index 65a9c886bea..5a7e68e5120 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.1.normal.js @@ -28,8 +28,7 @@ var C = // @target: es6 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, @@ -39,8 +38,7 @@ var C = // @target: es6 }, { key: tmp2, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.2.minified.js index 87f261be59f..c8bddfc07f0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit1_ES6_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "", - value: function() { - } + value: function() {} }, { key: "", @@ -26,8 +25,7 @@ var C = function() { }, { key: "", - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es2015.1.normal.js index 089c250d6cc..2bd37a2dfb0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es2015.1.normal.js @@ -2,11 +2,9 @@ var tmp = "" + "", tmp1 = "" + "", tmp2 = "" + ""; // @target: es5 // @declaration: true class C { - static [tmp]() { - } + static [tmp]() {} static get [tmp1]() { return 0; } - static set [tmp2](x) { - } + static set [tmp2](x) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.1.normal.js index dcc3349dbd0..b949a8aac7b 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.1.normal.js @@ -28,8 +28,7 @@ var C = // @target: es5 _createClass(C, null, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, @@ -39,8 +38,7 @@ var C = // @target: es5 }, { key: tmp2, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.2.minified.js index 5b2acc04c9c..dccd9f294f1 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES5_es5.2.minified.js @@ -14,8 +14,7 @@ var C = function() { })(Constructor = C, [ { key: "", - value: function() { - } + value: function() {} }, { key: "", @@ -25,8 +24,7 @@ var C = function() { }, { key: "", - set: function(x) { - } + set: function(x) {} } ]), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es2015.1.normal.js index 9c8ca5a1573..8802697429f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es2015.1.normal.js @@ -2,11 +2,9 @@ var tmp = "" + "", tmp1 = "" + "", tmp2 = "" + ""; // @target: es6 // @declaration: true class C { - static [tmp]() { - } + static [tmp]() {} static get [tmp1]() { return 0; } - static set [tmp2](x) { - } + static set [tmp2](x) {} } diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.1.normal.js index 2b4282b1ce5..3050f421a44 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.1.normal.js @@ -28,8 +28,7 @@ var C = // @target: es6 _createClass(C, null, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, @@ -39,8 +38,7 @@ var C = // @target: es6 }, { key: tmp2, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.2.minified.js index 5b2acc04c9c..dccd9f294f1 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit2_ES6_es5.2.minified.js @@ -14,8 +14,7 @@ var C = function() { })(Constructor = C, [ { key: "", - value: function() { - } + value: function() {} }, { key: "", @@ -25,8 +24,7 @@ var C = function() { }, { key: "", - set: function(x) { - } + set: function(x) {} } ]), C; }(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es2015.1.normal.js index acff42d7f38..2fbc10f80d4 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es2015.1.normal.js @@ -2,11 +2,9 @@ // @declaration: true var v = { ["" + ""]: 0, - ["" + ""] () { - }, + ["" + ""] () {}, get ["" + ""] () { return 0; }, - set ["" + ""] (x){ - } + set ["" + ""] (x){} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.1.normal.js index a628871fd18..264945ce261 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.1.normal.js @@ -30,15 +30,9 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; // @target: es5 // @declaration: true -var v = (_obj = { -}, _defineProperty(_obj, "" + "", 0), _defineProperty(_obj, "" + "", function() { -}), _mutatorMap["" + ""] = _mutatorMap["" + ""] || { -}, _mutatorMap["" + ""].get = function() { +var v = (_obj = {}, _defineProperty(_obj, "" + "", 0), _defineProperty(_obj, "" + "", function() {}), _mutatorMap["" + ""] = _mutatorMap["" + ""] || {}, _mutatorMap["" + ""].get = function() { return 0; -}, _mutatorMap["" + ""] = _mutatorMap["" + ""] || { -}, _mutatorMap["" + ""].set = function(x) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +}, _mutatorMap["" + ""] = _mutatorMap["" + ""] || {}, _mutatorMap["" + ""].set = function(x) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.2.minified.js index 62570bc1a6b..1ae9dd452e8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES5_es5.2.minified.js @@ -6,16 +6,10 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, _mutatorMap = { -}; -_defineProperty(_obj = { -}, "", 0), _defineProperty(_obj, "", function() { -}), _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].get = function() { +var _obj, _mutatorMap = {}; +_defineProperty(_obj = {}, "", 0), _defineProperty(_obj, "", function() {}), _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].get = function() { return 0; -}, _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].set = function(x) { -}, (function(obj, descs) { +}, _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].set = function(x) {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es2015.1.normal.js index 3852eff6021..0ecf69ea661 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es2015.1.normal.js @@ -2,11 +2,9 @@ // @declaration: true var v = { ["" + ""]: 0, - ["" + ""] () { - }, + ["" + ""] () {}, get ["" + ""] () { return 0; }, - set ["" + ""] (x){ - } + set ["" + ""] (x){} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.1.normal.js index 2ba57653bb9..3ffe8aee64e 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.1.normal.js @@ -30,15 +30,9 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; // @target: es6 // @declaration: true -var v = (_obj = { -}, _defineProperty(_obj, "" + "", 0), _defineProperty(_obj, "" + "", function() { -}), _mutatorMap["" + ""] = _mutatorMap["" + ""] || { -}, _mutatorMap["" + ""].get = function() { +var v = (_obj = {}, _defineProperty(_obj, "" + "", 0), _defineProperty(_obj, "" + "", function() {}), _mutatorMap["" + ""] = _mutatorMap["" + ""] || {}, _mutatorMap["" + ""].get = function() { return 0; -}, _mutatorMap["" + ""] = _mutatorMap["" + ""] || { -}, _mutatorMap["" + ""].set = function(x) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +}, _mutatorMap["" + ""] = _mutatorMap["" + ""] || {}, _mutatorMap["" + ""].set = function(x) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.2.minified.js index 62570bc1a6b..1ae9dd452e8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit5_ES6_es5.2.minified.js @@ -6,16 +6,10 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, _mutatorMap = { -}; -_defineProperty(_obj = { -}, "", 0), _defineProperty(_obj, "", function() { -}), _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].get = function() { +var _obj, _mutatorMap = {}; +_defineProperty(_obj = {}, "", 0), _defineProperty(_obj, "", function() {}), _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].get = function() { return 0; -}, _mutatorMap[""] = _mutatorMap[""] || { -}, _mutatorMap[""].set = function(x) { -}, (function(obj, descs) { +}, _mutatorMap[""] = _mutatorMap[""] || {}, _mutatorMap[""].set = function(x) {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es2015.1.normal.js index 8723c0e75d6..9360bf8f5d8 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es2015.1.normal.js @@ -1,12 +1,8 @@ // @target: es5 // @declaration: true var v = { - [-1]: { - }, - [+1]: { - }, - [~1]: { - }, - [!1]: { - } + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.1.normal.js index 0845fc3ae76..34e8d1dba6f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.1.normal.js @@ -14,9 +14,4 @@ function _defineProperty(obj, key, value) { var _obj; // @target: es5 // @declaration: true -var v = (_obj = { -}, _defineProperty(_obj, -1, { -}), _defineProperty(_obj, +1, { -}), _defineProperty(_obj, ~1, { -}), _defineProperty(_obj, !1, { -}), _obj); +var v = (_obj = {}, _defineProperty(_obj, -1, {}), _defineProperty(_obj, +1, {}), _defineProperty(_obj, ~1, {}), _defineProperty(_obj, !1, {}), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.2.minified.js index ec5f5225cc3..e6205e4feb0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES5_es5.2.minified.js @@ -7,9 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, -1, { -}), _defineProperty(_obj, 1, { -}), _defineProperty(_obj, -2, { -}), _defineProperty(_obj, !1, { -}); +_defineProperty(_obj = {}, -1, {}), _defineProperty(_obj, 1, {}), _defineProperty(_obj, -2, {}), _defineProperty(_obj, !1, {}); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es2015.1.normal.js index 0d62619030a..9fbe814619c 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es2015.1.normal.js @@ -1,12 +1,8 @@ // @target: es6 // @declaration: true var v = { - [-1]: { - }, - [+1]: { - }, - [~1]: { - }, - [!1]: { - } + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} }; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.1.normal.js index 3f141681ae9..6238ffbd3cc 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.1.normal.js @@ -14,9 +14,4 @@ function _defineProperty(obj, key, value) { var _obj; // @target: es6 // @declaration: true -var v = (_obj = { -}, _defineProperty(_obj, -1, { -}), _defineProperty(_obj, +1, { -}), _defineProperty(_obj, ~1, { -}), _defineProperty(_obj, !1, { -}), _obj); +var v = (_obj = {}, _defineProperty(_obj, -1, {}), _defineProperty(_obj, +1, {}), _defineProperty(_obj, ~1, {}), _defineProperty(_obj, !1, {}), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.2.minified.js index ec5f5225cc3..e6205e4feb0 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit6_ES6_es5.2.minified.js @@ -7,9 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, -1, { -}), _defineProperty(_obj, 1, { -}), _defineProperty(_obj, -2, { -}), _defineProperty(_obj, !1, { -}); +_defineProperty(_obj = {}, -1, {}), _defineProperty(_obj, 1, {}), _defineProperty(_obj, -2, {}), _defineProperty(_obj, !1, {}); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES5_es5.2.minified.js index 8090db5f220..af2afeecc57 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES5_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "hello", - value: function() { - } + value: function() {} }, { key: "goodbye", diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES6_es5.2.minified.js index 8090db5f220..af2afeecc57 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap1_ES6_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "hello", - value: function() { - } + value: function() {} }, { key: "goodbye", diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.1.normal.js index 520c2df1dd4..0539c5e6364 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.1.normal.js @@ -30,14 +30,11 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; // @target: es5 // @sourceMap: true -var v = (_obj = { -}, _defineProperty(_obj, "hello", function() { +var v = (_obj = {}, _defineProperty(_obj, "hello", function() { debugger; -}), _mutatorMap["goodbye"] = _mutatorMap["goodbye"] || { -}, _mutatorMap["goodbye"].get = function() { +}), _mutatorMap["goodbye"] = _mutatorMap["goodbye"] || {}, _mutatorMap["goodbye"].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.2.minified.js index 8acf734e6b9..ac26e5211a7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES5_es5.2.minified.js @@ -1,5 +1,4 @@ -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; (function(obj, key, value) { key in obj ? Object.defineProperty(obj, key, { value: value, @@ -7,10 +6,7 @@ var _obj, _mutatorMap = { configurable: !0, writable: !0 }) : obj[key] = value; -})(_obj = { -}, "hello", function() { -}), _mutatorMap.goodbye = _mutatorMap.goodbye || { -}, _mutatorMap.goodbye.get = function() { +})(_obj = {}, "hello", function() {}), _mutatorMap.goodbye = _mutatorMap.goodbye || {}, _mutatorMap.goodbye.get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.1.normal.js index 523819aa953..5803fc6b71f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.1.normal.js @@ -30,14 +30,11 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; // @target: es6 // @sourceMap: true -var v = (_obj = { -}, _defineProperty(_obj, "hello", function() { +var v = (_obj = {}, _defineProperty(_obj, "hello", function() { debugger; -}), _mutatorMap["goodbye"] = _mutatorMap["goodbye"] || { -}, _mutatorMap["goodbye"].get = function() { +}), _mutatorMap["goodbye"] = _mutatorMap["goodbye"] || {}, _mutatorMap["goodbye"].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.2.minified.js index 8acf734e6b9..ac26e5211a7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesSourceMap2_ES6_es5.2.minified.js @@ -1,5 +1,4 @@ -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; (function(obj, key, value) { key in obj ? Object.defineProperty(obj, key, { value: value, @@ -7,10 +6,7 @@ var _obj, _mutatorMap = { configurable: !0, writable: !0 }) : obj[key] = value; -})(_obj = { -}, "hello", function() { -}), _mutatorMap.goodbye = _mutatorMap.goodbye || { -}, _mutatorMap.goodbye.get = function() { +})(_obj = {}, "hello", function() {}), _mutatorMap.goodbye = _mutatorMap.goodbye || {}, _mutatorMap.goodbye.get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.1.normal.js index 1bd9dcd100f..b62f65e3e23 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.1.normal.js @@ -10,7 +10,6 @@ class C { set [tmp1](x) { var y = x; } - [tmp2]() { - } + [tmp2]() {} } C.staticProp = 10; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.2.minified.js index 7ea58378853..22aa418e770 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es2015.2.minified.js @@ -6,9 +6,7 @@ class C { get [tmp]() { return "hello"; } - set [tmp1](x) { - } - [tmp2]() { - } + set [tmp1](x) {} + [tmp2]() {} } C.staticProp = 10; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.1.normal.js index f90a4493e1b..269b3c980c7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.1.normal.js @@ -42,8 +42,7 @@ var C = // @target: es6 }, { key: tmp2, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.2.minified.js index 31c6886323e..d7b68681830 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/computedPropertyNamesWithStaticProperty_es5.2.minified.js @@ -24,13 +24,11 @@ var tmp = (_classNameTDZError("C"), C).staticProp, tmp1 = (_classNameTDZError("C }, { key: tmp1, - set: function(x) { - } + set: function(x) {} }, { key: tmp2, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es2015.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es2015.1.normal.js index 93cabb81a0c..ad7b9df62fe 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es2015.1.normal.js @@ -13,16 +13,14 @@ var b; true ? x : a; var result1 = true ? x : a; //Expr1 and Expr2 are literals -true ? { -} : 1; +true ? {} : 1; true ? { a: 1 } : { a: 2, b: 'string' }; -var result2 = true ? { -} : 1; +var result2 = true ? {} : 1; var result3 = true ? { a: 1 } : { @@ -39,16 +37,14 @@ var result4 = true ? (m)=>m.propertyX true ? a : x; var result5 = true ? a : x; //Expr1 and Expr2 are literals -true ? 1 : { -}; +true ? 1 : {}; true ? { a: 2, b: 'string' } : { a: 1 }; -var result6 = true ? 1 : { -}; +var result6 = true ? 1 : {}; var result7 = true ? { a: 2, b: 'string' diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.1.normal.js index f8130cd3fa7..460f2fdace9 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,16 +100,14 @@ var b; true ? x : a; var result1 = true ? x : a; //Expr1 and Expr2 are literals -true ? { -} : 1; +true ? {} : 1; true ? { a: 1 } : { a: 2, b: 'string' }; -var result2 = true ? { -} : 1; +var result2 = true ? {} : 1; var result3 = true ? { a: 1 } : { @@ -129,16 +126,14 @@ var result4 = true ? function(m) { true ? a : x; var result5 = true ? a : x; //Expr1 and Expr2 are literals -true ? 1 : { -}; +true ? 1 : {}; true ? { a: 2, b: 'string' } : { a: 1 }; -var result6 = true ? 1 : { -}; +var result6 = true ? 1 : {}; var result7 = true ? { a: 2, b: 'string' diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.2.minified.js b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.2.minified.js index 7fd409ceea2..67775d4e883 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.1.normal.js index 36cf352fd63..f6be404e44c 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.2.minified.js b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.2.minified.js index 7fd409ceea2..67775d4e883 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/conditionalTypes1_es2015.1.normal.js b/crates/swc/tests/tsc-references/conditionalTypes1_es2015.1.normal.js index 2e5887e3d63..687e9924ee0 100644 --- a/crates/swc/tests/tsc-references/conditionalTypes1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalTypes1_es2015.1.normal.js @@ -96,8 +96,7 @@ const f44 = (value)=>value const f45 = (value)=>value ; // Error // Repro from #21863 -function f50() { -} +function f50() {} var a = { o: 1, b: 2, diff --git a/crates/swc/tests/tsc-references/conditionalTypes1_es5.1.normal.js b/crates/swc/tests/tsc-references/conditionalTypes1_es5.1.normal.js index 5bc61199d86..eba71958f7a 100644 --- a/crates/swc/tests/tsc-references/conditionalTypes1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalTypes1_es5.1.normal.js @@ -104,8 +104,7 @@ var f45 = function(value) { return value; }; // Error // Repro from #21863 -function f50() { -} +function f50() {} var a = { o: 1, b: 2, diff --git a/crates/swc/tests/tsc-references/conditionalTypes2_es5.2.minified.js b/crates/swc/tests/tsc-references/conditionalTypes2_es5.2.minified.js index 184910bfded..e7a5887d853 100644 --- a/crates/swc/tests/tsc-references/conditionalTypes2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/conditionalTypes2_es5.2.minified.js @@ -18,8 +18,7 @@ var Opt = function() { return _createClass(Opt, [ { key: "toVector", - value: function() { - } + value: function() {} } ]), Opt; }(), Vector = function() { @@ -30,13 +29,11 @@ var Opt = function() { return _createClass(Vector, [ { key: "tail", - value: function() { - } + value: function() {} }, { key: "partition2", - value: function(predicate) { - } + value: function(predicate) {} } ]), Vector; }(); diff --git a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.1.normal.js b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.1.normal.js index f37e253d3f1..a869ca5bff4 100644 --- a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.1.normal.js @@ -1,35 +1,25 @@ // valid uses of a basic object constraint, no errors expected // Object constraint -function foo(x) { -} -var r = foo({ -}); -var a = { -}; -var r = foo({ -}); +function foo(x) {} +var r = foo({}); +var a = {}; +var r = foo({}); class C { constructor(x){ this.x = x; } } -var r2 = new C({ -}); +var r2 = new C({}); var i; // {} constraint -function foo2(x) { -} -var r = foo2({ -}); -var a = { -}; -var r = foo2({ -}); +function foo2(x) {} +var r = foo2({}); +var a = {}; +var r = foo2({}); class C2 { constructor(x){ this.x = x; } } -var r2 = new C2({ -}); +var r2 = new C2({}); var i2; diff --git a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.2.minified.js b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.2.minified.js index 733762279b7..7e7302efe45 100644 --- a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es2015.2.minified.js @@ -1,19 +1,11 @@ -function foo(x) { -} -function foo2(x) { -} -foo({ -}), foo({ -}), new class { +function foo(x) {} +function foo2(x) {} +foo({}), foo({}), new class { constructor(x){ this.x = x; } -}({ -}), foo2({ -}), foo2({ -}), new class { +}({}), foo2({}), foo2({}), new class { constructor(x){ this.x = x; } -}({ -}); +}({}); diff --git a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.1.normal.js b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.1.normal.js index 6a1b50204b9..5fe3ead210d 100644 --- a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.1.normal.js @@ -5,36 +5,26 @@ function _classCallCheck(instance, Constructor) { } // valid uses of a basic object constraint, no errors expected // Object constraint -function foo(x) { -} -var r = foo({ -}); -var a = { -}; -var r = foo({ -}); +function foo(x) {} +var r = foo({}); +var a = {}; +var r = foo({}); var C = function C(x) { "use strict"; _classCallCheck(this, C); this.x = x; }; -var r2 = new C({ -}); +var r2 = new C({}); var i; // {} constraint -function foo2(x) { -} -var r = foo2({ -}); -var a = { -}; -var r = foo2({ -}); +function foo2(x) {} +var r = foo2({}); +var a = {}; +var r = foo2({}); var C2 = function C2(x) { "use strict"; _classCallCheck(this, C2); this.x = x; }; -var r2 = new C2({ -}); +var r2 = new C2({}); var i2; diff --git a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.2.minified.js b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.2.minified.js index 1b63950cb80..c90b15a4229 100644 --- a/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constraintSatisfactionWithEmptyObject_es5.2.minified.js @@ -1,24 +1,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } -function foo(x) { -} -foo({ -}), foo({ -}); +function foo(x) {} +foo({}), foo({}); var C = function(x) { "use strict"; _classCallCheck(this, C), this.x = x; }; -function foo2(x) { -} -new C({ -}), foo2({ -}), foo2({ -}); +function foo2(x) {} +new C({}), foo2({}), foo2({}); var C2 = function(x) { "use strict"; _classCallCheck(this, C2), this.x = x; }; -new C2({ -}); +new C2({}); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es2015.1.normal.js index a86d534c161..cd413c6cb2c 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es2015.1.normal.js @@ -10,5 +10,4 @@ var Errors; } class OtherDerived extends Base { } -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.1.normal.js index d98bd20fb6d..d169eda9885 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -107,5 +106,4 @@ var Errors; } return OtherDerived; }(Base); -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.2.minified.js index 77021541b9f..027d2d46b5e 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,5 +74,4 @@ function _createSuper(Derived) { } return OtherDerived; }(Base1); -}(Errors || (Errors = { -})); +}(Errors || (Errors = {})); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.1.normal.js index 4a4ab420382..6616e2bf3d8 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.1.normal.js @@ -2,5 +2,4 @@ var MemberWithConstructSignature; (function(MemberWithConstructSignature) { var b; var r = new b.a(1); -})(MemberWithConstructSignature || (MemberWithConstructSignature = { -})); +})(MemberWithConstructSignature || (MemberWithConstructSignature = {})); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.2.minified.js index aa5989e3ce9..f6eefdd5a91 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es2015.2.minified.js @@ -1,3 +1,2 @@ var MemberWithConstructSignature; -MemberWithConstructSignature || (MemberWithConstructSignature = { -}), new (void 0).a(1); +MemberWithConstructSignature || (MemberWithConstructSignature = {}), new (void 0).a(1); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.1.normal.js index 4a4ab420382..6616e2bf3d8 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.1.normal.js @@ -2,5 +2,4 @@ var MemberWithConstructSignature; (function(MemberWithConstructSignature) { var b; var r = new b.a(1); -})(MemberWithConstructSignature || (MemberWithConstructSignature = { -})); +})(MemberWithConstructSignature || (MemberWithConstructSignature = {})); diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.2.minified.js index aa5989e3ce9..f6eefdd5a91 100644 --- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance_es5.2.minified.js @@ -1,3 +1,2 @@ var MemberWithConstructSignature; -MemberWithConstructSignature || (MemberWithConstructSignature = { -}), new (void 0).a(1); +MemberWithConstructSignature || (MemberWithConstructSignature = {}), new (void 0).a(1); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.1.normal.js index 69d68a91829..f658222d5d7 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.1.normal.js @@ -1,12 +1,10 @@ // Duplicate overloads of construct signatures should generate errors class C { - constructor(x){ - } + constructor(x){} } var r1 = new C(1, ''); class C2 { - constructor(x){ - } + constructor(x){} } var r2 = new C2(1, ''); var i; diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.2.minified.js index be236a60966..25fdebe280b 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads_es2015.2.minified.js @@ -1,8 +1,6 @@ var i, i2, a, b; new class { - constructor(x){ - } + constructor(x){} }(1, ""), new class { - constructor(x){ - } + constructor(x){} }(1, ""), new i(1, ""), new i2(1, ""), new a(1, ""), new b(1, ""); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.1.normal.js index 359be79bfc0..d8b553fc4e7 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.1.normal.js @@ -1,22 +1,18 @@ // No errors expected for basic overloads of construct signatures with merged declarations // clodules class C { - constructor(x){ - } + constructor(x){} } (function(C1) { var x = C1.x = 1; -})(C || (C = { -})); +})(C || (C = {})); var r1 = new C(1, ''); class C2 { - constructor(x){ - } + constructor(x){} } (function(C21) { var x = C21.x = 1; -})(C2 || (C2 = { -})); +})(C2 || (C2 = {})); var r2 = new C2(1, ''); var i2; var r4 = new i2(1, ''); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.2.minified.js index 2e4b979f405..28866c43f61 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es2015.2.minified.js @@ -1,13 +1,9 @@ var i2; class C { - constructor(x){ - } + constructor(x){} } -(C || (C = { -})).x = 1, new C(1, ""); +(C || (C = {})).x = 1, new C(1, ""); class C2 { - constructor(x){ - } + constructor(x){} } -(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/constructSignaturesWithOverloads2_es5.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.1.normal.js index 2e91f5cf38e..8df178cd23c 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.1.normal.js @@ -9,8 +9,7 @@ var C = function C(x) { }; (function(C) { var x = C.x = 1; -})(C || (C = { -})); +})(C || (C = {})); var r1 = new C(1, ''); var C2 = function C2(x) { "use strict"; @@ -18,8 +17,7 @@ var C2 = function C2(x) { }; (function(C2) { var x = C2.x = 1; -})(C2 || (C2 = { -})); +})(C2 || (C2 = {})); var r2 = new C2(1, ''); var i2; var r4 = new i2(1, ''); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.2.minified.js index 0d3d5d40abd..3fe8d3226e7 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2_es5.2.minified.js @@ -5,11 +5,9 @@ var i2, C = function(x) { "use strict"; _classCallCheck(this, C); }; -(C || (C = { -})).x = 1, new C(1, ""); +(C || (C = {})).x = 1, new C(1, ""); var C2 = function(x) { "use strict"; _classCallCheck(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/constructSignaturesWithOverloadsThatDifferOnlyByReturnType_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloadsThatDifferOnlyByReturnType_es2015.1.normal.js index 125226df0a7..1ac5e652b05 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloadsThatDifferOnlyByReturnType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloadsThatDifferOnlyByReturnType_es2015.1.normal.js @@ -1,11 +1,9 @@ // Error for construct signature overloads to differ only by return type class C { - constructor(x){ - } + constructor(x){} } class C2 { - constructor(x, y){ - } + constructor(x, y){} } var a; var b; diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.1.normal.js index 0567171974b..691c80120e4 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.1.normal.js @@ -1,12 +1,10 @@ // No errors expected for basic overloads of construct signatures class C { - constructor(x){ - } + constructor(x){} } var r1 = new C(1, ''); class C2 { - constructor(x){ - } + constructor(x){} } var r2 = new C2(1, ''); var i; diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.2.minified.js index be236a60966..25fdebe280b 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads_es2015.2.minified.js @@ -1,8 +1,6 @@ var i, i2, a, b; new class { - constructor(x){ - } + constructor(x){} }(1, ""), new class { - constructor(x){ - } + constructor(x){} }(1, ""), new i(1, ""), new i2(1, ""), new a(1, ""), new b(1, ""); diff --git a/crates/swc/tests/tsc-references/constructorDefaultValuesReferencingThis_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorDefaultValuesReferencingThis_es2015.1.normal.js index 782f43f699f..0488bb19dee 100644 --- a/crates/swc/tests/tsc-references/constructorDefaultValuesReferencingThis_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorDefaultValuesReferencingThis_es2015.1.normal.js @@ -1,10 +1,8 @@ class C { - constructor(x = this){ - } + constructor(x = this){} } class D { - constructor(x = this){ - } + constructor(x = this){} } class E { constructor(x = this){ diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es2015.1.normal.js index efb73f39cf4..b075ddba83a 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es2015.1.normal.js @@ -1,7 +1,6 @@ // the constructor function itself does not need to be a subtype of the base type constructor function class Base { - constructor(x){ - } + constructor(x){} } class Derived extends Base { constructor(x){ diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.1.normal.js index f6a2a31a3a4..c78a7dc22d6 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.2.minified.js index 36b19200920..3cdd12e15d0 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.1.normal.js index 50f3209758d..f14e36cf78b 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.2.minified.js index f543b64dbba..c183ef954ff 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/constructorFunctions_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctions_es2015.1.normal.js index 778f60a3d6a..0f169ae3d5f 100644 --- a/crates/swc/tests/tsc-references/constructorFunctions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctions_es2015.1.normal.js @@ -25,8 +25,7 @@ const c3_v2 = new C3(); const c4_v1 = C4(); // error: @class tag requires 'new' const c4_v2 = new C4(); var c5_v1; -c5_v1 = function f() { -}; +c5_v1 = function f() {}; new c5_v1(); var c5_v2; c5_v2 = class { @@ -45,6 +44,5 @@ var c6_v1 = new C6(); /** * @constructor * @param {number} num - */ function C7(num) { -} + */ function C7(num) {} var c7_v1 = new C7(); diff --git a/crates/swc/tests/tsc-references/constructorFunctions_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctions_es2015.2.minified.js index e7fbe8a4903..6127cb091f6 100644 --- a/crates/swc/tests/tsc-references/constructorFunctions_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorFunctions_es2015.2.minified.js @@ -14,8 +14,7 @@ C2(), new C2(), C3(), new C3(); var C4 = function() { if (!(this instanceof C4)) return new C4(); }; -C4(), new C4(), new function() { -}(), new class { +C4(), new C4(), new function() {}(), new class { }(), new function() { this.functions = [ (x)=>x @@ -24,5 +23,4 @@ C4(), new C4(), new function() { , (x)=>x - 1 ]; -}(), new function(num) { -}(); +}(), new function(num) {}(); diff --git a/crates/swc/tests/tsc-references/constructorFunctions_es5.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctions_es5.1.normal.js index b1fe9dbfb4a..95cecf2ee91 100644 --- a/crates/swc/tests/tsc-references/constructorFunctions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctions_es5.1.normal.js @@ -37,8 +37,7 @@ var c3_v2 = new C3(); var c4_v1 = C4(); // error: @class tag requires 'new' var c4_v2 = new C4(); var c5_v1; -c5_v1 = function f() { -}; +c5_v1 = function f() {}; new c5_v1(); var c5_v2; c5_v2 = function _class() { @@ -63,6 +62,5 @@ var c6_v1 = new C6(); /** * @constructor * @param {number} num - */ function C7(num) { -} + */ function C7(num) {} var c7_v1 = new C7(); diff --git a/crates/swc/tests/tsc-references/constructorFunctions_es5.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctions_es5.2.minified.js index 7a270aa4851..7b96bbf52b1 100644 --- a/crates/swc/tests/tsc-references/constructorFunctions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorFunctions_es5.2.minified.js @@ -17,8 +17,7 @@ C2(), new C2(), C3(), new C3(); var C4 = function() { if (!_instanceof(this, C4)) return new C4(); }; -C4(), new C4(), new function() { -}(), new function _class() { +C4(), new C4(), new function() {}(), new function _class() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); @@ -35,5 +34,4 @@ C4(), new C4(), new function() { return x - 1; } ]; -}(), new function(num) { -}(); +}(), new function(num) {}(); diff --git a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.1.normal.js index 8a9ed3e8815..180649a61b5 100644 --- a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.1.normal.js @@ -8,8 +8,7 @@ var NonGeneric; r.foo; var r2 = D.prototype; r2.bar; -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { class C { @@ -20,5 +19,4 @@ var Generic; var ra = r.foo; // any var r2 = D.prototype; // D var rb = r2.baz; // any -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.2.minified.js index 2b083e669ec..9a80c672ca4 100644 --- a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es2015.2.minified.js @@ -4,11 +4,9 @@ var NonGeneric, Generic; } C.prototype.foo, (class extends C { }).prototype.bar; -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { class C { } C.prototype.foo, (class extends C { }).prototype.baz; -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.1.normal.js index 637de269996..eed1b207397 100644 --- a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -89,8 +88,7 @@ var NonGeneric; r.foo; var r2 = D.prototype; r2.bar; -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { var C = function C() { @@ -111,5 +109,4 @@ var Generic; var ra = r.foo; // any var r2 = D.prototype; // D var rb = r2.baz; // any -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.2.minified.js index 56518d2a76d..cc2beadd73b 100644 --- a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -60,8 +59,7 @@ function _createSuper(Derived) { return D; }(C1); C1.prototype.foo, D.prototype.bar; -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { var C2 = function() { "use strict"; _classCallCheck(this, C2); @@ -75,5 +73,4 @@ function _createSuper(Derived) { return D; }(C2); C2.prototype.foo, D.prototype.baz; -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/constructorOverloadsWithOptionalParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorOverloadsWithOptionalParameters_es2015.1.normal.js index d85920512f3..9502c0c61f9 100644 --- a/crates/swc/tests/tsc-references/constructorOverloadsWithOptionalParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorOverloadsWithOptionalParameters_es2015.1.normal.js @@ -1,8 +1,6 @@ class C { - constructor(){ - } + constructor(){} } class D { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/constructorParameterProperties2_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorParameterProperties2_es2015.1.normal.js index 053d169244f..f2421a14c01 100644 --- a/crates/swc/tests/tsc-references/constructorParameterProperties2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorParameterProperties2_es2015.1.normal.js @@ -1,6 +1,5 @@ class C { - constructor(y){ - } + constructor(y){} } var c; var r = c.y; diff --git a/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.1.normal.js b/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.1.normal.js index 1779b146419..603a5a13a88 100644 --- a/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.1.normal.js @@ -7,8 +7,7 @@ export class Alpha { export class Beta { /** * @constructor - */ constructor(){ - } + */ constructor(){} } const arr = [ Alpha, diff --git a/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.2.minified.js b/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.2.minified.js index f049972acbd..2025ad6fca0 100644 --- a/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorTagOnClassConstructor_es2015.2.minified.js @@ -1,6 +1,5 @@ export class Alpha { } export class Beta { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es2015.1.normal.js index a7a1244a8e6..5e2ba272814 100644 --- a/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es2015.1.normal.js @@ -34,8 +34,7 @@ ]; } class C { - /** @param {Array<[string, {x?:number, y?:number}]>} value */ set x(value) { - } + /** @param {Array<[string, {x?:number, y?:number}]>} value */ set x(value) {} get x() { return [ [ diff --git a/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.1.normal.js b/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.1.normal.js index e53bcf0262b..546da5b17a8 100644 --- a/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.1.normal.js @@ -76,8 +76,7 @@ var C = /*#__PURE__*/ function() { ] ]; }, - set: /** @param {Array<[string, {x?:number, y?:number}]>} value */ function set(value) { - } + set: /** @param {Array<[string, {x?:number, y?:number}]>} value */ function set(value) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.2.minified.js b/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.2.minified.js index aa39823790d..caf9f9505fe 100644 --- a/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/contextualTypeFromJSDoc_es5.2.minified.js @@ -31,8 +31,7 @@ var C = function() { ] ]; }, - set: function(value) { - } + set: function(value) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/contextualTypeWithTuple_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextualTypeWithTuple_es2015.1.normal.js index 64587949cb2..ace43ebcbd0 100644 --- a/crates/swc/tests/tsc-references/contextualTypeWithTuple_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypeWithTuple_es2015.1.normal.js @@ -54,8 +54,7 @@ numStrTuple = numStrTuple2; numStrTuple = numStrBoolTuple; // error objNumTuple = [ - { - }, + {}, 5 ]; numStrBoolTuple = numStrTuple; diff --git a/crates/swc/tests/tsc-references/contextualTypeWithTuple_es5.1.normal.js b/crates/swc/tests/tsc-references/contextualTypeWithTuple_es5.1.normal.js index 50db58ef1c1..e83e79027dc 100644 --- a/crates/swc/tests/tsc-references/contextualTypeWithTuple_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypeWithTuple_es5.1.normal.js @@ -63,8 +63,7 @@ numStrTuple = numStrTuple2; numStrTuple = numStrBoolTuple; // error objNumTuple = [ - { - }, + {}, 5 ]; numStrBoolTuple = numStrTuple; diff --git a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.1.normal.js index 75fb7e55ded..a14003b7985 100644 --- a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.1.normal.js @@ -7,17 +7,14 @@ status: 'done' m(n: number): void }} DoneStatus */ // property assignment -var ns = { -}; +var ns = {}; /** @type {DoneStatus} */ ns.x = { status: 'done', - m (n) { - } + m (n) {} }; ns.x = { status: 'done', - m (n) { - } + m (n) {} }; ns.x; // this-property assignment @@ -25,50 +22,42 @@ class Thing { fail() { this.s = { status: 'done', - m (n) { - } + m (n) {} }; } constructor(){ /** @type {DoneStatus} */ this.s = { status: 'done', - m (n) { - } + m (n) {} }; } } // exports-property assignment /** @type {DoneStatus} */ exports.x = { status: "done", - m (n) { - } + m (n) {} }; exports.x; /** @type {DoneStatus} */ module.exports.y = { status: "done", - m (n) { - } + m (n) {} }; module.exports.y; // prototype-property assignment /** @type {DoneStatus} */ Thing.prototype.x = { status: 'done', - m (n) { - } + m (n) {} }; Thing.prototype.x; // prototype assignment -function F() { -} +function F() {} /** @type {DoneStatus} */ F.prototype = { status: "done", - m (n) { - } + m (n) {} }; // @Filename: mod.js // module.exports assignment /** @type {{ status: 'done', m(n: number): void }} */ module.exports = { status: "done", - m (n) { - } + m (n) {} }; diff --git a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.2.minified.js index 55f8eb93aed..3f12683ca01 100644 --- a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es2015.2.minified.js @@ -1,49 +1,38 @@ -var ns = { -}; +var ns = {}; ns.x = { status: "done", - m (n) { - } + m (n) {} }, ns.x = { status: "done", - m (n) { - } + m (n) {} }, ns.x; class Thing { fail() { this.s = { status: "done", - m (n) { - } + m (n) {} }; } constructor(){ this.s = { status: "done", - m (n) { - } + m (n) {} }; } } exports.x = { status: "done", - m (n) { - } + m (n) {} }, module.exports.y = { status: "done", - m (n) { - } + m (n) {} }, module.exports.y, Thing.prototype.x = { status: "done", - m (n) { - } -}, Thing.prototype.x, (function() { -}).prototype = { + m (n) {} +}, Thing.prototype.x, (function() {}).prototype = { status: "done", - m (n) { - } + m (n) {} }, module.exports = { status: "done", - m (n) { - } + m (n) {} }; diff --git a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.1.normal.js index a4c4508c07b..fe8b29fb456 100644 --- a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.1.normal.js @@ -26,17 +26,14 @@ function _createClass(Constructor, protoProps, staticProps) { status: 'done' m(n: number): void }} DoneStatus */ // property assignment -var ns = { -}; +var ns = {}; /** @type {DoneStatus} */ ns.x = { status: 'done', - m: function m(n) { - } + m: function m(n) {} }; ns.x = { status: 'done', - m: function m(n) { - } + m: function m(n) {} }; ns.x; var Thing = // this-property assignment @@ -46,8 +43,7 @@ var Thing = // this-property assignment _classCallCheck(this, Thing); /** @type {DoneStatus} */ this.s = { status: 'done', - m: function m(n) { - } + m: function m(n) {} }; } _createClass(Thing, [ @@ -56,8 +52,7 @@ var Thing = // this-property assignment value: function fail() { this.s = { status: 'done', - m: function m(n) { - } + m: function m(n) {} }; } } @@ -67,35 +62,29 @@ var Thing = // this-property assignment // exports-property assignment /** @type {DoneStatus} */ exports.x = { status: "done", - m: function m(n) { - } + m: function m(n) {} }; exports.x; /** @type {DoneStatus} */ module.exports.y = { status: "done", - m: function m(n) { - } + m: function m(n) {} }; module.exports.y; // prototype-property assignment /** @type {DoneStatus} */ Thing.prototype.x = { status: 'done', - m: function m(n) { - } + m: function m(n) {} }; Thing.prototype.x; // prototype assignment -function F() { -} +function F() {} /** @type {DoneStatus} */ F.prototype = { status: "done", - m: function m(n) { - } + m: function m(n) {} }; // @Filename: mod.js // module.exports assignment /** @type {{ status: 'done', m(n: number): void }} */ module.exports = { status: "done", - m: function m(n) { - } + m: function m(n) {} }; diff --git a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.2.minified.js index 0040299e188..74195401328 100644 --- a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment_es5.2.minified.js @@ -4,16 +4,13 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var ns = { -}; +var ns = {}; ns.x = { status: "done", - m: function(n) { - } + m: function(n) {} }, ns.x = { status: "done", - m: function(n) { - } + m: function(n) {} }, ns.x; var Thing = function() { "use strict"; @@ -23,8 +20,7 @@ var Thing = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, Thing), this.s = { status: "done", - m: function(n) { - } + m: function(n) {} }; } return Constructor = Thing, protoProps = [ @@ -33,8 +29,7 @@ var Thing = function() { value: function() { this.s = { status: "done", - m: function(n) { - } + m: function(n) {} }; } } @@ -42,23 +37,17 @@ var Thing = function() { }(); exports.x = { status: "done", - m: function(n) { - } + m: function(n) {} }, module.exports.y = { status: "done", - m: function(n) { - } + m: function(n) {} }, module.exports.y, Thing.prototype.x = { status: "done", - m: function(n) { - } -}, Thing.prototype.x, (function() { -}).prototype = { + m: function(n) {} +}, Thing.prototype.x, (function() {}).prototype = { status: "done", - m: function(n) { - } + m: function(n) {} }, module.exports = { status: "done", - m: function(n) { - } + m: function(n) {} }; diff --git a/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializerNegative_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializerNegative_es2015.1.normal.js index 99ff7b7d29d..675f6dae860 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializerNegative_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializerNegative_es2015.1.normal.js @@ -1,16 +1,12 @@ function f({ show: showRename = (v)=>v - }) { -} + }) {} function f2({ "show": showRename = (v)=>v - }) { -} + }) {} function f3({ ["show"]: showRename = (v)=>v - }) { -} + }) {} function ff({ nested: nestedRename = { show: (v)=>v -} }) { -} +} }) {} let { stringIdentity: id = (arg)=>arg.length } = { stringIdentity: (x)=>x @@ -18,7 +14,5 @@ let { stringIdentity: id = (arg)=>arg.length function g({ prop =[ 101, 1234 -] }) { -} -function h({ prop ="baz" }) { -} +] }) {} +function h({ prop ="baz" }) {} diff --git a/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializer_es2015.1.normal.js index 16ae73fd138..d9e98e2c854 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedBindingInitializer_es2015.1.normal.js @@ -1,23 +1,17 @@ function f({ show =(v)=>v.toString() - }) { -} + }) {} function f2({ "show": showRename = (v)=>v.toString() - }) { -} + }) {} function f3({ ["show"]: showRename = (v)=>v.toString() - }) { -} + }) {} function ff({ nested ={ show: (v)=>v.toString() -} }) { -} +} }) {} function g({ prop =[ "hello", 1234 -] }) { -} -function h({ prop ="foo" }) { -} +] }) {} +function h({ prop ="foo" }) {} let { stringIdentity: id = (arg)=>arg } = { stringIdentity: (x)=>x diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es2015.1.normal.js index f2dd8873760..882257f2571 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es2015.1.normal.js @@ -1,18 +1,13 @@ // @strictNullChecks: true // arrow -((jake)=>{ -})("build"); +((jake)=>{})("build"); // function expression -(function(cats) { -})("lol"); +(function(cats) {})("lol"); // Lots of Irritating Superfluous Parentheses -(function(x) { -})("!"); -(function(y) { -})("-"); +(function(x) {})("!"); +(function(y) {})("-"); // multiple arguments -((a, b, c)=>{ -})("foo", 101, false); +((a, b, c)=>{})("foo", 101, false); // default parameters ((m = 10)=>m + 1 )(12); diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es5.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es5.1.normal.js index ef6fc53c45e..a238a048ffe 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict_es5.1.normal.js @@ -1,18 +1,13 @@ // @strictNullChecks: true // arrow -(function(jake) { -})("build"); +(function(jake) {})("build"); // function expression -(function(cats) { -})("lol"); +(function(cats) {})("lol"); // Lots of Irritating Superfluous Parentheses -(function(x) { -})("!"); -(function(y) { -})("-"); +(function(x) {})("!"); +(function(y) {})("-"); // multiple arguments -(function(a, b, c) { -})("foo", 101, false); +(function(a, b, c) {})("foo", 101, false); // default parameters (function() { var m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10; diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIife_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedIife_es2015.1.normal.js index 8f016bc6c3b..cecf6e727ae 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIife_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIife_es2015.1.normal.js @@ -1,17 +1,12 @@ // arrow -((jake)=>{ -})("build"); +((jake)=>{})("build"); // function expression -(function(cats) { -})("lol"); +(function(cats) {})("lol"); // Lots of Irritating Superfluous Parentheses -(function(x) { -})("!"); -(function(y) { -})("-"); +(function(x) {})("!"); +(function(y) {})("-"); // multiple arguments -((a, b, c)=>{ -})("foo", 101, false); +((a, b, c)=>{})("foo", 101, false); // default parameters ((m = 10)=>m + 1 )(12); diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIife_es5.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedIife_es5.1.normal.js index 6811cf933a5..0f957d23d96 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIife_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIife_es5.1.normal.js @@ -1,17 +1,12 @@ // arrow -(function(jake) { -})("build"); +(function(jake) {})("build"); // function expression -(function(cats) { -})("lol"); +(function(cats) {})("lol"); // Lots of Irritating Superfluous Parentheses -(function(x) { -})("!"); -(function(y) { -})("-"); +(function(x) {})("!"); +(function(y) {})("-"); // multiple arguments -(function(a, b, c) { -})("foo", 101, false); +(function(a, b, c) {})("foo", 101, false); // default parameters (function() { var m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10; diff --git a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.1.normal.js index decd73629b1..e6945a01c28 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.1.normal.js @@ -26,8 +26,7 @@ export function MainButton(props) { } return this._buildMainButton(props); } -const b0 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +const b0 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { onClick: (k)=>{ console.log(k); } @@ -40,8 +39,7 @@ const b2 = /*#__PURE__*/ React.createElement(MainButton, { }, extra: true }); // k has type "left" | "right" -const b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +const b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { goTo: "home" }, { extra: true @@ -53,8 +51,7 @@ const b4 = /*#__PURE__*/ React.createElement(MainButton, { export function NoOverload(buttonProps) { return undefined; } -const c1 = /*#__PURE__*/ React.createElement(NoOverload, _extends({ -}, { +const c1 = /*#__PURE__*/ React.createElement(NoOverload, _extends({}, { onClick: (k)=>{ console.log(k); } @@ -64,8 +61,7 @@ const c1 = /*#__PURE__*/ React.createElement(NoOverload, _extends({ export function NoOverload1(linkProps) { return undefined; } -const d1 = /*#__PURE__*/ React.createElement(NoOverload1, _extends({ -}, { +const d1 = /*#__PURE__*/ React.createElement(NoOverload1, _extends({}, { goTo: "home" }, { extra: true diff --git a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.2.minified.js b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.2.minified.js index bca51586179..7d30ec32dc8 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es2015.2.minified.js @@ -11,8 +11,7 @@ const React = require("react"); export function MainButton(props) { return props.goTo ? this._buildMainLink(props) : this._buildMainButton(props); } -React.createElement(MainButton, _extends({ -}, { +React.createElement(MainButton, _extends({}, { onClick: (k)=>{ console.log(k); } @@ -23,8 +22,7 @@ React.createElement(MainButton, _extends({ console.log(k); }, extra: !0 -}), React.createElement(MainButton, _extends({ -}, { +}), React.createElement(MainButton, _extends({}, { goTo: "home" }, { extra: !0 @@ -32,20 +30,16 @@ React.createElement(MainButton, _extends({ goTo: "home", extra: !0 }); -export function NoOverload() { -} -React.createElement(NoOverload, _extends({ -}, { +export function NoOverload() {} +React.createElement(NoOverload, _extends({}, { onClick: (k)=>{ console.log(k); } }, { extra: !0 })); -export function NoOverload1() { -} -React.createElement(NoOverload1, _extends({ -}, { +export function NoOverload1() {} +React.createElement(NoOverload1, _extends({}, { goTo: "home" }, { extra: !0 diff --git a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.1.normal.js index 93f9c957ad3..5dd9e76a06c 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.1.normal.js @@ -26,8 +26,7 @@ export function MainButton(props) { } return this._buildMainButton(props); } -var b0 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +var b0 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { onClick: function(k) { console.log(k); } @@ -40,8 +39,7 @@ var b2 = /*#__PURE__*/ React.createElement(MainButton, { }, extra: true }); // k has type "left" | "right" -var b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +var b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { goTo: "home" }, { extra: true @@ -53,8 +51,7 @@ var b4 = /*#__PURE__*/ React.createElement(MainButton, { export function NoOverload(buttonProps) { return undefined; } -var c1 = /*#__PURE__*/ React.createElement(NoOverload, _extends({ -}, { +var c1 = /*#__PURE__*/ React.createElement(NoOverload, _extends({}, { onClick: function(k) { console.log(k); } @@ -64,8 +61,7 @@ var c1 = /*#__PURE__*/ React.createElement(NoOverload, _extends({ export function NoOverload1(linkProps) { return undefined; } -var d1 = /*#__PURE__*/ React.createElement(NoOverload1, _extends({ -}, { +var d1 = /*#__PURE__*/ React.createElement(NoOverload1, _extends({}, { goTo: "home" }, { extra: true diff --git a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.2.minified.js b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.2.minified.js index b8e055212ca..f459f292d62 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedStringLiteralsInJsxAttributes02x_es5.2.minified.js @@ -11,8 +11,7 @@ var React = require("react"); export function MainButton(props) { return props.goTo ? this._buildMainLink(props) : this._buildMainButton(props); } -React.createElement(MainButton, _extends({ -}, { +React.createElement(MainButton, _extends({}, { onClick: function(k) { console.log(k); } @@ -23,8 +22,7 @@ React.createElement(MainButton, _extends({ console.log(k); }, extra: !0 -}), React.createElement(MainButton, _extends({ -}, { +}), React.createElement(MainButton, _extends({}, { goTo: "home" }, { extra: !0 @@ -32,20 +30,16 @@ React.createElement(MainButton, _extends({ goTo: "home", extra: !0 }); -export function NoOverload() { -} -React.createElement(NoOverload, _extends({ -}, { +export function NoOverload() {} +React.createElement(NoOverload, _extends({}, { onClick: function(k) { console.log(k); } }, { extra: !0 })); -export function NoOverload1() { -} -React.createElement(NoOverload1, _extends({ -}, { +export function NoOverload1() {} +React.createElement(NoOverload1, _extends({}, { goTo: "home" }, { extra: !0 diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.1.normal.js index de6a9e55594..9ccb703779c 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } let buttonProps; // any -let k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps), /*#__PURE__*/ React.createElement("span", { +let k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps), /*#__PURE__*/ React.createElement("span", { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.2.minified.js index 610c4ddd325..15e99f3f680 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es2015.2.minified.js @@ -10,8 +10,7 @@ function _extends() { }).apply(this, arguments); } let buttonProps; -React.createElement("button", _extends({ -}, buttonProps), React.createElement("span", { +React.createElement("button", _extends({}, buttonProps), React.createElement("span", { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.1.normal.js index 033f9dfab96..2f128b36018 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } var buttonProps; // any -var k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps), /*#__PURE__*/ React.createElement("span", { +var k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps), /*#__PURE__*/ React.createElement("span", { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.2.minified.js index 93f09bb72d6..274de678d33 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences1x_es5.2.minified.js @@ -10,8 +10,7 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("button", _extends({ -}, buttonProps), React.createElement("span", { +React.createElement("button", _extends({}, buttonProps), React.createElement("span", { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.1.normal.js index 610b9424858..3a9e466325f 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } let buttonProps; -let k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps), /*#__PURE__*/ React.createElement("span", { +let k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps), /*#__PURE__*/ React.createElement("span", { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.2.minified.js index 610c4ddd325..15e99f3f680 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es2015.2.minified.js @@ -10,8 +10,7 @@ function _extends() { }).apply(this, arguments); } let buttonProps; -React.createElement("button", _extends({ -}, buttonProps), React.createElement("span", { +React.createElement("button", _extends({}, buttonProps), React.createElement("span", { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.1.normal.js index b805f34a8ca..984ba3ac286 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } var buttonProps; -var k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps), /*#__PURE__*/ React.createElement("span", { +var k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps), /*#__PURE__*/ React.createElement("span", { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.2.minified.js index 93f09bb72d6..274de678d33 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences2x_es5.2.minified.js @@ -10,8 +10,7 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("button", _extends({ -}, buttonProps), React.createElement("span", { +React.createElement("button", _extends({}, buttonProps), React.createElement("span", { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.1.normal.js index 610b9424858..3a9e466325f 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } let buttonProps; -let k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps), /*#__PURE__*/ React.createElement("span", { +let k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps), /*#__PURE__*/ React.createElement("span", { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.2.minified.js index 610c4ddd325..15e99f3f680 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es2015.2.minified.js @@ -10,8 +10,7 @@ function _extends() { }).apply(this, arguments); } let buttonProps; -React.createElement("button", _extends({ -}, buttonProps), React.createElement("span", { +React.createElement("button", _extends({}, buttonProps), React.createElement("span", { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.1.normal.js index b805f34a8ca..984ba3ac286 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } var buttonProps; -var k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps), /*#__PURE__*/ React.createElement("span", { +var k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps), /*#__PURE__*/ React.createElement("span", { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.2.minified.js index 93f09bb72d6..274de678d33 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences3x_es5.2.minified.js @@ -10,8 +10,7 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("button", _extends({ -}, buttonProps), React.createElement("span", { +React.createElement("button", _extends({}, buttonProps), React.createElement("span", { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.1.normal.js index ceabe3a79b7..b930d97cd80 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } let buttonProps; -let k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps, { +let k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps, { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.2.minified.js index ea12900dc2d..f15c6ef42b8 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es2015.2.minified.js @@ -10,8 +10,7 @@ function _extends() { }).apply(this, arguments); } let buttonProps; -React.createElement("button", _extends({ -}, buttonProps, { +React.createElement("button", _extends({}, buttonProps, { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.1.normal.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.1.normal.js index a42f9719d87..f76a154cb2d 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.1.normal.js @@ -17,8 +17,7 @@ function _extends() { return _extends.apply(this, arguments); } var buttonProps; -var k = /*#__PURE__*/ React.createElement("button", _extends({ -}, buttonProps, { +var k = /*#__PURE__*/ React.createElement("button", _extends({}, buttonProps, { className: cx('class1', { class2: true }) diff --git a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.2.minified.js b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.2.minified.js index 5d2b7f7795b..3c6ac14cd29 100644 --- a/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/correctlyMarkAliasAsReferences4x_es5.2.minified.js @@ -10,8 +10,7 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("button", _extends({ -}, buttonProps, { +React.createElement("button", _extends({}, buttonProps, { className: cx("class1", { class2: !0 }) diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.1.normal.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.1.normal.js index 6bef6f5c481..cbb86e4c086 100644 --- a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.1.normal.js @@ -70,8 +70,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.2.minified.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.2.minified.js index 1fa64e1a295..4769fcdb636 100644 --- a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01_es5.2.minified.js @@ -51,8 +51,7 @@ export var D = function(C) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.1.normal.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.1.normal.js index 3c5e7909340..72ae1524400 100644 --- a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.1.normal.js @@ -70,8 +70,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.2.minified.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.2.minified.js index 922f2d10b80..89936a39e4d 100644 --- a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01_es5.2.minified.js @@ -51,8 +51,7 @@ var D = function(C) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/declarationFiles_es2015.1.normal.js b/crates/swc/tests/tsc-references/declarationFiles_es2015.1.normal.js index 0520a9fb22c..61bfdf8c4a7 100644 --- a/crates/swc/tests/tsc-references/declarationFiles_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/declarationFiles_es2015.1.normal.js @@ -3,8 +3,7 @@ class C1 { f(x) { return undefined; } - constructor(x){ - } + constructor(x){} } class C2 { } diff --git a/crates/swc/tests/tsc-references/declarationFiles_es5.2.minified.js b/crates/swc/tests/tsc-references/declarationFiles_es5.2.minified.js index 857d5bb4119..8dc0148a1ad 100644 --- a/crates/swc/tests/tsc-references/declarationFiles_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/declarationFiles_es5.2.minified.js @@ -18,8 +18,7 @@ var C1 = function() { return _createClass(C1, [ { key: "f", - value: function(x) { - } + value: function(x) {} } ]), C1; }(), C2 = function() { diff --git a/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.1.normal.js index 9a3d98ca444..b3bfcd23902 100644 --- a/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.1.normal.js @@ -120,8 +120,7 @@ function f8() { ]; // Error, [1] is a tuple } function f9() { - var [a, b] = { - }; // Error, not array type + var [a, b] = {}; // Error, not array type var [c, d] = { 0: 10, 1: 20 @@ -132,8 +131,7 @@ function f9() { ]; } function f10() { - var { a , b } = { - }; // Error + var { a , b } = {}; // Error var { a , b } = []; // Error } function f11() { @@ -233,8 +231,7 @@ var M; 1, 2 ]; -})(M || (M = { -})); +})(M || (M = {})); function f15() { var a = "hello"; var b = 1; @@ -248,10 +245,8 @@ function f15() { function f16() { var { a , b , c } = f15(); } -function f17({ a ="" , b =0 , c =false }) { -} -f17({ -}); +function f17({ a ="" , b =0 , c =false }) {} +f17({}); f17({ a: "hello" }); diff --git a/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.2.minified.js index 13abb9a6b23..42fd1661bc2 100644 --- a/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/declarationsAndAssignments_es2015.2.minified.js @@ -1,8 +1,6 @@ var M, M1; -function f14([a = 1, [b = "hello", { x , y: c = !1 }]]) { -} -function f17({ a ="" , b =0 , c =!1 }) { -} +function f14([a = 1, [b = "hello", { x , y: c = !1 }]]) {} +function f17({ a ="" , b =0 , c =!1 }) {} f14([ 2, [ @@ -28,12 +26,10 @@ f14([ y: !1 } ] -]), M1 = M || (M = { -}), [M1.a, M1.b] = [ +]), M1 = M || (M = {}), [M1.a, M1.b] = [ 1, 2 -], f17({ -}), f17({ +], f17({}), f17({ a: "hello" }), f17({ c: !0 diff --git a/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.1.normal.js index af3bd4a8a7c..8501202620e 100644 --- a/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.1.normal.js @@ -154,8 +154,7 @@ function f8() { ], d = ref7[0], e = ref7[1], f = ref7[2]; // Error, [1] is a tuple } function f9() { - var ref = _slicedToArray({ - }, 2), a = ref[0], b = ref[1]; // Error, not array type + var ref = _slicedToArray({}, 2), a = ref[0], b = ref[1]; // Error, not array type var ref8 = _slicedToArray({ 0: 10, 1: 20 @@ -163,8 +162,7 @@ function f9() { var e = 10, f = 20; } function f10() { - var ref = { - }, a = ref.a, b = ref.b; // Error + var ref = {}, a = ref.a, b = ref.b; // Error var ref9 = [], a = ref9.a, b = ref9.b; // Error } function f11() { @@ -256,8 +254,7 @@ f14([ var M; (function(M1) { M1.a = 1, M1.b = 2; -})(M || (M = { -})); +})(M || (M = {})); function f15() { var a = "hello"; var b = 1; @@ -274,8 +271,7 @@ function f16() { function f17(param) { var _a = param.a, a = _a === void 0 ? "" : _a, _b = param.b, b = _b === void 0 ? 0 : _b, _c = param.c, c = _c === void 0 ? false : _c; } -f17({ -}); +f17({}); f17({ a: "hello" }); diff --git a/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.2.minified.js index 9ca0aada02b..10c2f32c413 100644 --- a/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/declarationsAndAssignments_es5.2.minified.js @@ -68,9 +68,7 @@ f14([ y: !1 } ] -]), (M1 = M || (M = { -})).a = 1, M1.b = 2, f17({ -}), f17({ +]), (M1 = M || (M = {})).a = 1, M1.b = 2, f17({}), f17({ a: "hello" }), f17({ c: !0 diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.1.normal.js index 9d8a9fc856f..a8d7ff9f3a0 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.1.normal.js @@ -15,8 +15,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsNumber1 = --ANY; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.2.minified.js index f936a334d08..747d7a78a2b 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es2015.2.minified.js @@ -8,8 +8,7 @@ var ANY, ANY1, M, ANY2 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new class { }(); --ANY, --ANY1, ANY1--, ANY1--, --ANY2[0], --obj.x, --obj.y, --objA.a, --M.n, ANY2[0]--, obj.x--, obj.y--, objA.a--, M.n--, --ANY, --ANY1, --ANY2[0], --ANY, --ANY1, --objA.a, --M.n, ANY--, ANY1--, ANY2[0]--, ANY--, ANY1--, objA.a--, M.n--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.1.normal.js index a53a3ee2116..91d0b822a2b 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.1.normal.js @@ -22,8 +22,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsNumber1 = --ANY; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.2.minified.js index b5b1e7494f3..ce8524da44b 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherType_es5.2.minified.js @@ -13,7 +13,6 @@ var ANY, ANY1, M, ANY2 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); --ANY, --ANY1, ANY1--, ANY1--, --ANY2[0], --obj.x, --obj.y, --objA.a, --M.n, ANY2[0]--, obj.x--, obj.y--, objA.a--, M.n--, --ANY, --ANY1, --ANY2[0], --ANY, --ANY1, --objA.a, --M.n, ANY--, ANY1--, ANY2[0]--, ANY--, ANY1--, objA.a--, M.n--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js index 615594dd7f4..9fcb86f92c9 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js @@ -1,15 +1,12 @@ var // -- operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = --ENUM; var ResultIsNumber2 = --ENUM1; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js index 1055a5b87ce..6c468164509 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM, --ENUM1, ENUM--, ENUM1--, --ENUM.A + ENUM.B, ENUM.A + ENUM.B--, --ENUM, --ENUM1, ENUM--, ENUM1--; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM, --ENUM1, ENUM--, ENUM1--, --ENUM.A + ENUM.B, ENUM.A + ENUM.B--, --ENUM, --ENUM1, ENUM--, ENUM1--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js index 615594dd7f4..9fcb86f92c9 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js @@ -1,15 +1,12 @@ var // -- operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = --ENUM; var ResultIsNumber2 = --ENUM1; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js index 1055a5b87ce..6c468164509 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM, --ENUM1, ENUM--, ENUM1--, --ENUM.A + ENUM.B, ENUM.A + ENUM.B--, --ENUM, --ENUM1, ENUM--, ENUM1--; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM, --ENUM1, ENUM--, ENUM1--, --ENUM.A + ENUM.B, ENUM.A + ENUM.B--, --ENUM, --ENUM1, ENUM--, ENUM1--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.1.normal.js index f7b417042a0..4f37b796c5a 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.1.normal.js @@ -4,8 +4,7 @@ ENUM1; ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // expression var ResultIsNumber1 = --ENUM1["A"]; var ResultIsNumber2 = ENUM1.A--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.2.minified.js index 08120e8acc4..983046c21e5 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM1.A, ENUM1.A--, --ENUM1.A, ENUM1[A]--; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM1.A, ENUM1.A--, --ENUM1.A, ENUM1[A]--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.1.normal.js index f7b417042a0..4f37b796c5a 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.1.normal.js @@ -4,8 +4,7 @@ ENUM1; ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // expression var ResultIsNumber1 = --ENUM1["A"]; var ResultIsNumber2 = ENUM1.A--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.2.minified.js index 08120e8acc4..983046c21e5 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM1.A, ENUM1.A--, --ENUM1.A, ENUM1[A]--; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", --ENUM1.A, ENUM1.A--, --ENUM1.A, ENUM1[A]--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.1.normal.js index dd3b39c5baa..f0d5ffc0060 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.1.normal.js @@ -10,8 +10,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = --NUMBER; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.2.minified.js index d8a18984848..a9905173634 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es2015.2.minified.js @@ -5,8 +5,7 @@ var NUMBER, M, NUMBER1 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new class { }(); --NUMBER, NUMBER--, --objA.a, --M.n, objA.a--, M.n--, NUMBER1[0]--, --NUMBER, --NUMBER1[0], --objA.a, --M.n, --objA.a, M.n, NUMBER--, NUMBER1[0]--, objA.a--, M.n--, objA.a--, M.n--; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.1.normal.js index 37020cf372f..7afb75ba87a 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = --NUMBER; diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.2.minified.js index 226f2fcdc51..bacaaaba49a 100644 --- a/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/decrementOperatorWithNumberType_es5.2.minified.js @@ -10,7 +10,6 @@ var NUMBER, M, NUMBER1 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); --NUMBER, NUMBER--, --objA.a, --M.n, objA.a--, M.n--, NUMBER1[0]--, --NUMBER, --NUMBER1[0], --objA.a, --M.n, --objA.a, M.n, NUMBER--, NUMBER1[0]--, objA.a--, M.n--, objA.a--, M.n--; diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.1.normal.js index bc873b9e0e7..e363bb520cb 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.1.normal.js @@ -31,8 +31,7 @@ function _asyncToGenerator(fn) { // @module: umd // @filename: a.ts const x = new Promise((resolve, reject)=>{ - resolve({ - }); + resolve({}); }); export default x; _asyncToGenerator(function*() { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.2.minified.js index cb90dc4b80e..5255bd0009d 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es2015.2.minified.js @@ -8,8 +8,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw); } const x = new Promise((resolve, reject)=>{ - resolve({ - }); + resolve({}); }); export default x; (function(fn) { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js index ed1288bec25..dab33ef54e6 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js @@ -32,8 +32,7 @@ function _asyncToGenerator(fn) { // @module: umd // @filename: a.ts var x = new Promise(function(resolve, reject) { - resolve({ - }); + resolve({}); }); export default x; _asyncToGenerator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.2.minified.js index a9ef2f23a19..f685931292f 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.2.minified.js @@ -9,8 +9,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw); } var x = new Promise(function(resolve, reject) { - resolve({ - }); + resolve({}); }); export default x; (function(fn) { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.1.normal.js index ed15065eec9..ca7cfe06648 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.1.normal.js @@ -31,8 +31,7 @@ function _asyncToGenerator(fn) { // @module: commonjs // @filename: a.ts const x = new Promise((resolve, reject)=>{ - resolve({ - }); + resolve({}); }); export default x; _asyncToGenerator(function*() { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.2.minified.js index cb90dc4b80e..5255bd0009d 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es2015.2.minified.js @@ -8,8 +8,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw); } const x = new Promise((resolve, reject)=>{ - resolve({ - }); + resolve({}); }); export default x; (function(fn) { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js index 41229bf5c86..8cd5130e1b1 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js @@ -32,8 +32,7 @@ function _asyncToGenerator(fn) { // @module: commonjs // @filename: a.ts var x = new Promise(function(resolve, reject) { - resolve({ - }); + resolve({}); }); export default x; _asyncToGenerator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.2.minified.js index a9ef2f23a19..f685931292f 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.2.minified.js @@ -9,8 +9,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw); } var x = new Promise(function(resolve, reject) { - resolve({ - }); + resolve({}); }); export default x; (function(fn) { diff --git a/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.1.normal.js index 111fc12840a..1c7234f4244 100644 --- a/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.1.normal.js @@ -1,2 +1 @@ -export default function f(...args) { -}; +export default function f(...args) {}; diff --git a/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.2.minified.js index 111fc12840a..1c7234f4244 100644 --- a/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportWithOverloads01_es2015.2.minified.js @@ -1,2 +1 @@ -export default function f(...args) { -}; +export default function f(...args) {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.1.normal.js index e4df405c6c4..e39ea10441f 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.1.normal.js @@ -10,8 +10,7 @@ export var Decl; (function(Decl1) { var x = Decl1.x = 10; var y = Decl1.y = 20; -})(Decl || (Decl = { -})); +})(Decl || (Decl = {})); Entity(); var x; var y; diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.2.minified.js index 600164c4741..132811488f3 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es2015.2.minified.js @@ -3,5 +3,4 @@ import Entity from "m1"; export default function Decl() { return 0; }; -(Decl1 = Decl || (Decl = { -})).x = 10, Decl1.y = 20, Entity(); +(Decl1 = Decl || (Decl = {})).x = 10, Decl1.y = 20, Entity(); diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.1.normal.js index e4df405c6c4..e39ea10441f 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.1.normal.js @@ -10,8 +10,7 @@ export var Decl; (function(Decl1) { var x = Decl1.x = 10; var y = Decl1.y = 20; -})(Decl || (Decl = { -})); +})(Decl || (Decl = {})); Entity(); var x; var y; diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.2.minified.js index 600164c4741..132811488f3 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge01_es5.2.minified.js @@ -3,5 +3,4 @@ import Entity from "m1"; export default function Decl() { return 0; }; -(Decl1 = Decl || (Decl = { -})).x = 10, Decl1.y = 20, Entity(); +(Decl1 = Decl || (Decl = {})).x = 10, Decl1.y = 20, Entity(); diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.1.normal.js index fef6d89c253..e20a18b8acc 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.1.normal.js @@ -1,10 +1,8 @@ // @module: commonjs // @target: ES5 -export default function Foo() { -}; +export default function Foo() {}; var Foo; (function(Foo1) { var x; Foo1.x = x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.2.minified.js index 245a4f7f389..156f7dac6dd 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es2015.2.minified.js @@ -1,8 +1,6 @@ var Foo; -export default function Foo() { -}; +export default function Foo() {}; !function(Foo) { var x; Foo.x = x; -}(Foo || (Foo = { -})); +}(Foo || (Foo = {})); diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.1.normal.js index fef6d89c253..e20a18b8acc 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.1.normal.js @@ -1,10 +1,8 @@ // @module: commonjs // @target: ES5 -export default function Foo() { -}; +export default function Foo() {}; var Foo; (function(Foo1) { var x; Foo1.x = x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); diff --git a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.2.minified.js index 245a4f7f389..156f7dac6dd 100644 --- a/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsCannotMerge04_es5.2.minified.js @@ -1,8 +1,6 @@ var Foo; -export default function Foo() { -}; +export default function Foo() {}; !function(Foo) { var x; Foo.x = x; -}(Foo || (Foo = { -})); +}(Foo || (Foo = {})); diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.1.normal.js index e236b870463..98b59a8492b 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.1.normal.js @@ -5,5 +5,4 @@ class Foo { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.2.minified.js index 006473d0daf..c01af34028c 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es2015.2.minified.js @@ -1,5 +1,4 @@ class Foo { } export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.1.normal.js index 5de29d574b6..fee454c4c1e 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.1.normal.js @@ -12,5 +12,4 @@ var Foo = function Foo() { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.2.minified.js index 3a27f7f54ed..f09e444d1cd 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedAmd_es5.2.minified.js @@ -5,5 +5,4 @@ var Foo = function() { }(this, Foo); }; export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.1.normal.js index 1d8b948cda3..1e8e537b861 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.1.normal.js @@ -5,5 +5,4 @@ class Foo { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.2.minified.js index 006473d0daf..c01af34028c 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es2015.2.minified.js @@ -1,5 +1,4 @@ class Foo { } export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.1.normal.js index eacef0a94c4..a5aa1e20070 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.1.normal.js @@ -12,5 +12,4 @@ var Foo = function Foo() { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.2.minified.js index 3a27f7f54ed..f09e444d1cd 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedCommonjs_es5.2.minified.js @@ -5,5 +5,4 @@ var Foo = function() { }(this, Foo); }; export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.1.normal.js index b46fea5a5e1..8a01105aeb5 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.1.normal.js @@ -5,5 +5,4 @@ class Foo { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.2.minified.js index 006473d0daf..c01af34028c 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es2015.2.minified.js @@ -1,5 +1,4 @@ class Foo { } export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.1.normal.js index 3097dca0e2f..4179b14e601 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.1.normal.js @@ -12,5 +12,4 @@ var Foo = function Foo() { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.2.minified.js index 3a27f7f54ed..f09e444d1cd 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedSystem_es5.2.minified.js @@ -5,5 +5,4 @@ var Foo = function() { }(this, Foo); }; export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.1.normal.js index 3e0369912e2..ce67b4941a6 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.1.normal.js @@ -5,5 +5,4 @@ class Foo { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.2.minified.js index 006473d0daf..c01af34028c 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es2015.2.minified.js @@ -1,5 +1,4 @@ class Foo { } export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.1.normal.js index 28869b2fd7c..ae2a4134338 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.1.normal.js @@ -12,5 +12,4 @@ var Foo = function Foo() { // @filename: a.ts export { Foo as default }; // @filename: b.ts -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.2.minified.js index 3a27f7f54ed..f09e444d1cd 100644 --- a/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultExportsGetExportedUmd_es5.2.minified.js @@ -5,5 +5,4 @@ var Foo = function() { }(this, Foo); }; export { Foo as default }; -export default function foo() { -}; +export default function foo() {}; diff --git a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.1.normal.js b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.1.normal.js index 5a0d5be3259..08b7a0602a2 100644 --- a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.1.normal.js @@ -2,12 +2,9 @@ // @allowJs: true // @checkJs: true // @Filename: bug39167.js -var test = { -}; -test.K = test.K || function() { -}; +var test = {}; +test.K = test.K || function() {}; test.K.prototype = { - add () { - } + add () {} }; new test.K().add; diff --git a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.2.minified.js b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.2.minified.js index 90584e9a27b..d868f8ba862 100644 --- a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es2015.2.minified.js @@ -1,7 +1,4 @@ -var test = { -}; -test.K = test.K || function() { -}, test.K.prototype = { - add () { - } +var test = {}; +test.K = test.K || function() {}, test.K.prototype = { + add () {} }, new test.K().add; diff --git a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.1.normal.js index 950202791aa..d09292851ca 100644 --- a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.1.normal.js @@ -2,12 +2,9 @@ // @allowJs: true // @checkJs: true // @Filename: bug39167.js -var test = { -}; -test.K = test.K || function() { -}; +var test = {}; +test.K = test.K || function() {}; test.K.prototype = { - add: function add() { - } + add: function add() {} }; new test.K().add; diff --git a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.2.minified.js b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.2.minified.js index 948b385a263..6d983536d4e 100644 --- a/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defaultPropertyAssignedClassWithPrototype_es5.2.minified.js @@ -1,7 +1,4 @@ -var test = { -}; -test.K = test.K || function() { -}, test.K.prototype = { - add: function() { - } +var test = {}; +test.K = test.K || function() {}, test.K.prototype = { + add: function() {} }, new test.K().add; diff --git a/crates/swc/tests/tsc-references/defineProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/defineProperty_es2015.1.normal.js index cc070f4b8ac..cf56ccf70a3 100644 --- a/crates/swc/tests/tsc-references/defineProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/defineProperty_es2015.1.normal.js @@ -3,8 +3,7 @@ var _key, _key1; // @useDefineForClassFields: true var x = "p"; class A { - m() { - } + m() {} constructor(y){ this.y = y; this.a = this.y; diff --git a/crates/swc/tests/tsc-references/defineProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/defineProperty_es5.1.normal.js index 6e573c83e7a..db789ddf5ec 100644 --- a/crates/swc/tests/tsc-references/defineProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defineProperty_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -100,8 +99,7 @@ var A = /*#__PURE__*/ function() { _createClass(A, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/defineProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/defineProperty_es5.2.minified.js index cfd38a3bfa0..8eda2248db0 100644 --- a/crates/swc/tests/tsc-references/defineProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/defineProperty_es5.2.minified.js @@ -26,8 +26,7 @@ var _key, _key1, A = function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = A).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), A; }(); @@ -53,8 +52,7 @@ var B = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es2015.1.normal.js index 2c0606ce872..b948dd749b6 100644 --- a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es2015.1.normal.js @@ -2,8 +2,7 @@ class Base { } class Derived extends Base { - constructor(){ - } + constructor(){} } class Base2 { } diff --git a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.1.normal.js index ee4987f74ba..9be3d0fa4c4 100644 --- a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.2.minified.js index e3fa7fda2ca..e2f232d8336 100644 --- a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es2015.1.normal.js index 62ff25f4b96..827115abb29 100644 --- a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es2015.1.normal.js @@ -2,8 +2,7 @@ class Base { get x() { return 1; } - set x(v) { - } + set x(v) {} } // error class Derived extends Base { diff --git a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.1.normal.js index 7a38b707f3f..769b2f93a7b 100644 --- a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,8 +93,7 @@ var Base = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; diff --git a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.2.minified.js index 35ccc4fd656..514eb9caa9f 100644 --- a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor_es5.2.minified.js @@ -31,8 +31,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -53,8 +52,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.1.normal.js index ecbf2f2d823..45905a7ab2d 100644 --- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.1.normal.js @@ -1,20 +1,15 @@ class Base { - b() { - } + b() {} get c() { return ''; } - set c(v) { - } - static s() { - } + set c(v) {} + static s() {} static get t() { return ''; } - static set t(v) { - } - constructor(x){ - } + static set t(v) {} + constructor(x){} } class Derived extends Base { } diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.2.minified.js index c3149e9dbf9..4d05d092df4 100644 --- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es2015.2.minified.js @@ -1,20 +1,15 @@ class Base { - b() { - } + b() {} get c() { return ""; } - set c(v) { - } - static s() { - } + set c(v) {} + static s() {} static get t() { return ""; } - static set t(v) { - } - constructor(x){ - } + static set t(v) {} + constructor(x){} } class Derived extends Base { } diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.1.normal.js index c7900903a00..2ef63cccb01 100644 --- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,30 +90,26 @@ var Base = /*#__PURE__*/ function() { _createClass(Base, [ { key: "b", - value: function b() { - } + value: function b() {} }, { key: "c", get: function get() { return ''; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s() { - } + value: function s() {} }, { key: "t", get: function get() { return ''; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.2.minified.js index dca0d307163..9ed5bd5b633 100644 --- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -60,30 +59,26 @@ var d2, Base = function() { return Constructor = Base, protoProps = [ { key: "b", - value: function() { - } + value: function() {} }, { key: "c", get: function() { return ""; }, - set: function(v) { - } + set: function(v) {} } ], staticProps = [ { key: "s", - value: function() { - } + value: function() {} }, { key: "t", get: function() { return ""; }, - set: function(v) { - } + set: function(v) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Base; }(), Derived = function(Base) { diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.1.normal.js index 10267b27bad..52726d5e495 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.2.minified.js index 68322582ea3..190ab2ca1b4 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.1.normal.js index 9508b01ca9e..34457167e7f 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.2.minified.js index 68322582ea3..190ab2ca1b4 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.1.normal.js index 4d81d86718b..b31943e9dd6 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.1.normal.js @@ -2,39 +2,30 @@ var x; var y; class Base { - b(a) { - } + b(a) {} get c() { return x; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return x; } - static set t(v) { - } - constructor(a){ - } + static set t(v) {} + constructor(a){} } // Increase visibility of all protected members to public class Derived extends Base { - b(a) { - } + b(a) {} get c() { return y; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return y; } - static set t(a) { - } + static set t(a) {} constructor(a){ super(a); } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.2.minified.js index 9b854948b23..780d152f039 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es2015.2.minified.js @@ -1,36 +1,27 @@ class Base { - b(a) { - } + b(a) {} get c() { return x; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return x; } - static set t(v) { - } - constructor(a){ - } + static set t(v) {} + constructor(a){} } class Derived extends Base { - b(a) { - } + b(a) {} get c() { return y; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return y; } - static set t(a) { - } + static set t(a) {} constructor(a){ super(a); } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.1.normal.js index c04431883c2..599a96f81a3 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,30 +93,26 @@ var Base = /*#__PURE__*/ function() { _createClass(Base, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -134,30 +129,26 @@ var Derived = // Increase visibility of all protected members to public _createClass(Derived, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return y; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return y; }, - set: function set(a) { - } + set: function set(a) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.2.minified.js index 69b3400df63..c5e620b032d 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,30 +61,26 @@ var x, y, d2, Base = function() { return _createClass(Base, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived = function(Base) { @@ -98,30 +93,26 @@ var x, y, d2, Base = function() { return _createClass(Derived, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return y; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return y; }, - set: function(a) { - } + set: function(a) {} } ]), Derived; }(Base), d = new Derived(y); diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es2015.1.normal.js index 0bdfa7d7a52..cd87b77e274 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es2015.1.normal.js @@ -2,22 +2,17 @@ var x; var y; class Base { - b(a) { - } + b(a) {} get c() { return x; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return x; } - static set t(v) { - } - constructor(a){ - } + static set t(v) {} + constructor(a){} } // Errors // decrease visibility of all public members to protected @@ -27,8 +22,7 @@ class Derived1 extends Base { } } class Derived2 extends Base { - b(a) { - } + b(a) {} constructor(a){ super(a); } @@ -42,8 +36,7 @@ class Derived3 extends Base { } } class Derived4 extends Base { - set c(v) { - } + set c(v) {} constructor(a){ super(a); } @@ -59,8 +52,7 @@ class Derived6 extends Base { } } class Derived7 extends Base { - static s(a) { - } + static s(a) {} constructor(a){ super(a); } @@ -74,8 +66,7 @@ class Derived8 extends Base { } } class Derived9 extends Base { - static set t(v) { - } + static set t(v) {} constructor(a){ super(a); } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.1.normal.js index 67e5d4aa046..8b7406cf9e1 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,30 +93,26 @@ var Base = /*#__PURE__*/ function() { _createClass(Base, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -145,8 +140,7 @@ var Derived2 = /*#__PURE__*/ function(Base) { _createClass(Derived2, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} } ]); return Derived2; @@ -180,8 +174,7 @@ var Derived4 = /*#__PURE__*/ function(Base) { _createClass(Derived4, [ { key: "c", - set: function set(v) { - } + set: function set(v) {} } ]); return Derived4; @@ -217,8 +210,7 @@ var Derived7 = /*#__PURE__*/ function(Base) { _createClass(Derived7, null, [ { key: "s", - value: function s(a) { - } + value: function s(a) {} } ]); return Derived7; @@ -252,8 +244,7 @@ var Derived9 = /*#__PURE__*/ function(Base) { _createClass(Derived9, null, [ { key: "t", - set: function set(v) { - } + set: function set(v) {} } ]); return Derived9; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.2.minified.js index 7089d7247c0..acc9ad6f466 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,30 +61,26 @@ var x, Base = function() { return _createClass(Base, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -106,8 +101,7 @@ var x, Base = function() { return _createClass(Derived2, [ { key: "b", - value: function(a) { - } + value: function(a) {} } ]), Derived2; }(Base), Derived3 = function(Base) { @@ -135,8 +129,7 @@ var x, Base = function() { return _createClass(Derived4, [ { key: "c", - set: function(v) { - } + set: function(v) {} } ]), Derived4; }(Base), Derived5 = function(Base) { @@ -165,8 +158,7 @@ var x, Base = function() { return _createClass(Derived7, null, [ { key: "s", - value: function(a) { - } + value: function(a) {} } ]), Derived7; }(Base), Derived8 = function(Base) { @@ -194,8 +186,7 @@ var x, Base = function() { return _createClass(Derived9, null, [ { key: "t", - set: function(v) { - } + set: function(v) {} } ]), Derived9; }(Base), Derived10 = function(Base) { diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.1.normal.js index 574a96f1cc1..f469d06f72c 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.2.minified.js index ee264c11d5a..046940b95a9 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es2015.1.normal.js index aef231f453d..0dbb2a423d4 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es2015.1.normal.js @@ -2,38 +2,29 @@ var x; var y; class Base { - b(a) { - } + b(a) {} get c() { return x; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return x; } - static set t(v) { - } - constructor(a){ - } + static set t(v) {} + constructor(a){} } class Derived extends Base { - b(a) { - } + b(a) {} get c() { return y; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return y; } - static set t(a) { - } + static set t(a) {} constructor(a){ super(x); } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.1.normal.js index 054960c7526..c68e75b4efc 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,30 +93,26 @@ var Base = /*#__PURE__*/ function() { _createClass(Base, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -133,30 +128,26 @@ var Derived = /*#__PURE__*/ function(Base) { _createClass(Derived, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return y; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return y; }, - set: function set(a) { - } + set: function set(a) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.2.minified.js index 0eef3d9cc83..f25c13467d9 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers_es5.2.minified.js @@ -28,30 +28,26 @@ var x, y, Base = function() { return _createClass(Base, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -72,8 +68,7 @@ var x, y, Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -96,30 +91,26 @@ var x, y, Base = function() { return _createClass(Derived1, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return y; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return y; }, - set: function(a) { - } + set: function(a) {} } ]), Derived1; }(Base); diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.1.normal.js index 13171e32e80..030f3d209f6 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.1.normal.js @@ -1,38 +1,29 @@ var x; var y; class Base { - b(a) { - } + b(a) {} get c() { return x; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return x; } - static set t(v) { - } - constructor(a){ - } + static set t(v) {} + constructor(a){} } class Derived extends Base { - b(a) { - } + b(a) {} get c() { return y; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return y; } - static set t(a) { - } + static set t(a) {} constructor(a){ super(x); } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.2.minified.js index 9f6472ef319..a9e857fd83d 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es2015.2.minified.js @@ -1,36 +1,27 @@ class Base { - b(a) { - } + b(a) {} get c() { return x; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return x; } - static set t(v) { - } - constructor(a){ - } + static set t(v) {} + constructor(a){} } class Derived extends Base { - b(a) { - } + b(a) {} get c() { return y; } - set c(v) { - } - static s(a) { - } + set c(v) {} + static s(a) {} static get t() { return y; } - static set t(a) { - } + static set t(a) {} constructor(a){ super(x); } diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.1.normal.js index 1743cf9e456..6674c793126 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -93,30 +92,26 @@ var Base = /*#__PURE__*/ function() { _createClass(Base, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return x; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -132,30 +127,26 @@ var Derived = /*#__PURE__*/ function(Base) { _createClass(Derived, [ { key: "b", - value: function b(a) { - } + value: function b(a) {} }, { key: "c", get: function get() { return y; }, - set: function set(v) { - } + set: function set(v) {} } ], [ { key: "s", - value: function s(a) { - } + value: function s(a) {} }, { key: "t", get: function get() { return y; }, - set: function set(a) { - } + set: function set(a) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.2.minified.js index 527b403a257..54b0911eb7c 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,30 +61,26 @@ var x, y, d2, Base = function() { return _createClass(Base, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return x; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived = function(Base) { @@ -98,30 +93,26 @@ var x, y, d2, Base = function() { return _createClass(Derived, [ { key: "b", - value: function(a) { - } + value: function(a) {} }, { key: "c", get: function() { return y; }, - set: function(v) { - } + set: function(v) {} } ], [ { key: "s", - value: function(a) { - } + value: function(a) {} }, { key: "t", get: function() { return y; }, - set: function(a) { - } + set: function(a) {} } ]), Derived; }(Base), d = new Derived(y); diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.1.normal.js index 9508b01ca9e..34457167e7f 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.2.minified.js index 68322582ea3..190ab2ca1b4 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2_es2015.1.normal.js index 9aaa9c215a5..67973f4aae3 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2_es2015.1.normal.js @@ -1,15 +1,12 @@ // subclassing is not transitive when you can remove required parameters and add optional parameters class C { - foo(x, y) { - } + foo(x, y) {} } class D extends C { - foo(x) { - } + foo(x) {} } class E extends D { - foo(x, y) { - } + foo(x, y) {} } var c; var d; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.1.normal.js index 92187ab6903..12cd9313f5c 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -92,8 +91,7 @@ var C = // subclassing is not transitive when you can remove required parameters _createClass(C, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} } ]); return C; @@ -109,8 +107,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo", - value: function foo(x) { - } // ok to drop parameters + value: function foo(x) {} // ok to drop parameters } ]); return D; @@ -126,8 +123,7 @@ var E = /*#__PURE__*/ function(D) { _createClass(E, [ { key: "foo", - value: function foo(x, y) { - } // ok to add optional parameters + value: function foo(x, y) {} // ok to add optional parameters } ]); return E; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.2.minified.js index b8edf59fe85..4c870dfdc65 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var e, C = function() { return _createClass(C, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} } ]), C; }(), D = function(C) { @@ -76,8 +74,7 @@ var e, C = function() { return _createClass(D, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), D; }(C), E = function(D) { @@ -90,8 +87,7 @@ var e, C = function() { return _createClass(E, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} } ]), E; }(D); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3_es2015.1.normal.js index ddbd379b98f..01b2cad2962 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3_es2015.1.normal.js @@ -1,15 +1,12 @@ // subclassing is not transitive when you can remove required parameters and add optional parameters class C { - foo(x, y) { - } + foo(x, y) {} } class D extends C { - foo(x) { - } + foo(x) {} } class E extends D { - foo(x, y) { - } + foo(x, y) {} } var c; var d; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.1.normal.js index 55010e67b13..1c2da83e6a8 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -92,8 +91,7 @@ var C = // subclassing is not transitive when you can remove required parameters _createClass(C, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} } ]); return C; @@ -109,8 +107,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo", - value: function foo(x) { - } // ok to drop parameters + value: function foo(x) {} // ok to drop parameters } ]); return D; @@ -126,8 +123,7 @@ var E = /*#__PURE__*/ function(D) { _createClass(E, [ { key: "foo", - value: function foo(x, y) { - } // ok to add optional parameters + value: function foo(x, y) {} // ok to add optional parameters } ]); return E; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.2.minified.js index a18308a715a..02c009355c9 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var e, C = function() { return _createClass(C, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} } ]), C; }(), D = function(C) { @@ -76,8 +74,7 @@ var e, C = function() { return _createClass(D, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), D; }(C), E = function(D) { @@ -90,8 +87,7 @@ var e, C = function() { return _createClass(E, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} } ]), E; }(D); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4_es2015.1.normal.js index 816caeb8b57..e83f2ebc37c 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4_es2015.1.normal.js @@ -1,15 +1,12 @@ // subclassing is not transitive when you can remove required parameters and add optional parameters on protected members class C { - foo(x) { - } + foo(x) {} } class D extends C { - foo() { - } + foo() {} } class E extends D { - foo(x) { - } + foo(x) {} } var c; var d; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.1.normal.js index c8dad6b00a1..87dd894a3ab 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -92,8 +91,7 @@ var C = // subclassing is not transitive when you can remove required parameters _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; @@ -109,8 +107,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo", - value: function foo() { - } // ok to drop parameters + value: function foo() {} // ok to drop parameters } ]); return D; @@ -126,8 +123,7 @@ var E = /*#__PURE__*/ function(D) { _createClass(E, [ { key: "foo", - value: function foo(x) { - } // ok to add optional parameters + value: function foo(x) {} // ok to add optional parameters } ]); return E; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.2.minified.js index 0f847f9ddd1..2fd6511093c 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var e, C = function() { return _createClass(C, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C; }(), D = function(C) { @@ -76,8 +74,7 @@ var e, C = function() { return _createClass(D, [ { key: "foo", - value: function() { - } + value: function() {} } ]), D; }(C), E = function(D) { @@ -90,8 +87,7 @@ var e, C = function() { return _createClass(E, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), E; }(D); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity_es2015.1.normal.js index 3063811bd30..c6def6369ef 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity_es2015.1.normal.js @@ -1,15 +1,12 @@ // subclassing is not transitive when you can remove required parameters and add optional parameters class C { - foo(x) { - } + foo(x) {} } class D extends C { - foo() { - } + foo() {} } class E extends D { - foo(x) { - } + foo(x) {} } var c; var d; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.1.normal.js index deb09d58ff9..04ffab98bb6 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -92,8 +91,7 @@ var C = // subclassing is not transitive when you can remove required parameters _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; @@ -109,8 +107,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo", - value: function foo() { - } // ok to drop parameters + value: function foo() {} // ok to drop parameters } ]); return D; @@ -126,8 +123,7 @@ var E = /*#__PURE__*/ function(D) { _createClass(E, [ { key: "foo", - value: function foo(x) { - } // ok to add optional parameters + value: function foo(x) {} // ok to add optional parameters } ]); return E; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.2.minified.js index 0f847f9ddd1..2fd6511093c 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var e, C = function() { return _createClass(C, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C; }(), D = function(C) { @@ -76,8 +74,7 @@ var e, C = function() { return _createClass(D, [ { key: "foo", - value: function() { - } + value: function() {} } ]), D; }(C), E = function(D) { @@ -90,8 +87,7 @@ var e, C = function() { return _createClass(E, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), E; }(D); diff --git a/crates/swc/tests/tsc-references/derivedClassWithAny_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithAny_es5.1.normal.js index 1d9b19b44aa..3dc30ac8322 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithAny_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassWithAny_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithAny_es5.2.minified.js index 60a21d2a069..0721f58a8a5 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithAny_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es2015.1.normal.js index b9868248cd7..f951b01269c 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es2015.1.normal.js @@ -6,8 +6,7 @@ class Base { get a() { return 1; } - set a(v) { - } + set a(v) {} } // error, not a subtype class Derived extends Base { @@ -17,6 +16,5 @@ class Derived extends Base { get a() { return 1; } - set a(v) { - } + set a(v) {} } diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.1.normal.js index 92594fb33f5..5cfc720c28b 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,8 +100,7 @@ var Base = // @target: ES5 get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -128,8 +126,7 @@ var Derived = // error, not a subtype get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.2.minified.js index 3842685ef79..eee6de395d5 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance_es5.2.minified.js @@ -37,8 +37,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -59,8 +58,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -92,8 +90,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Derived1; }(Base); diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.1.normal.js index 112a2663ff8..bdc8838ae7c 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.1.normal.js @@ -5,8 +5,7 @@ class Base { get a() { return 1; } - set a(v) { - } + set a(v) {} } // error, not a subtype class Derived extends Base { @@ -16,8 +15,7 @@ class Derived extends Base { get a() { return 1; } - set a(v) { - } + set a(v) {} } var r = Base.x; // ok var r2 = Derived.x; // error diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.2.minified.js index 2a738c8f346..9046c1183a5 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es2015.2.minified.js @@ -5,8 +5,7 @@ class Base { get a() { return 1; } - set a(v) { - } + set a(v) {} } class Derived extends Base { fn() { @@ -15,7 +14,6 @@ class Derived extends Base { get a() { return 1; } - set a(v) { - } + set a(v) {} } Base.fn(), Derived.fn(), Base.a = 2, Derived.a = 2; diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.1.normal.js index be6a1afc4c7..a50b4188fde 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -100,8 +99,7 @@ var Base = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -127,8 +125,7 @@ var Derived = // error, not a subtype get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.2.minified.js index 320fe327da5..a164f46afaf 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance_es5.2.minified.js @@ -37,8 +37,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -59,8 +58,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -92,8 +90,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Derived1; }(Base); diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es2015.1.normal.js index 4b1c3a0c9d9..9dbb087a3b7 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es2015.1.normal.js @@ -6,8 +6,7 @@ class Base { static get a() { return 1; } - static set a(v) { - } + static set a(v) {} } // should be error class Derived extends Base { @@ -17,6 +16,5 @@ class Derived extends Base { static get a() { return 1; } - static set a(v) { - } + static set a(v) {} } diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.1.normal.js index cd71f6cb2a9..09f095d7f02 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,8 +100,7 @@ var Base = // @target: ES5 get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -128,8 +126,7 @@ var Derived = // should be error get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.2.minified.js index 59d216e2ec6..a99480a817b 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic_es5.2.minified.js @@ -37,8 +37,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -59,8 +58,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -92,8 +90,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Derived1; }(Base); diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.1.normal.js index 3d114323005..d5ddd9b2e62 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.1.normal.js @@ -5,8 +5,7 @@ class Base { static get a() { return 1; } - static set a(v) { - } + static set a(v) {} } // BUG 847404 // should be error @@ -17,8 +16,7 @@ class Derived extends Base { static get a() { return 1; } - static set a(v) { - } + static set a(v) {} } var r = Base.x; // ok var r2 = Derived.x; // error diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.2.minified.js index 07443f37718..9a272cdb979 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es2015.2.minified.js @@ -5,8 +5,7 @@ class Base { static get a() { return 1; } - static set a(v) { - } + static set a(v) {} } class Derived extends Base { static fn() { @@ -15,7 +14,6 @@ class Derived extends Base { static get a() { return 1; } - static set a(v) { - } + static set a(v) {} } Base.fn(), Derived.fn(), Base.a = 2, Derived.a = 2; diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.1.normal.js index 0547837ae20..4682c73cc4f 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -100,8 +99,7 @@ var Base = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Base; @@ -128,8 +126,7 @@ var Derived = // BUG 847404 get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.2.minified.js index 301fe1cd100..9c45c9bead6 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic_es5.2.minified.js @@ -37,8 +37,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Base; }(), Derived1 = function(Base) { @@ -59,8 +58,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -92,8 +90,7 @@ var Base = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), Derived1; }(Base); diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.1.normal.js index 137b0992242..06a2fa55b01 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.2.minified.js index e2ad15e59c1..2f6be3e73e4 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.1.normal.js index da574344c23..6cff226caf4 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.2.minified.js index d5e33c4439f..eff5bee1197 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.1.normal.js index 55bc61de755..0616bb64160 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.2.minified.js index 7ff5e342bf0..8f510a731f6 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.1.normal.js index 913b2259468..d68f2a9fa5a 100644 --- a/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.2.minified.js index 51a4ccf25d8..8ae21d7be62 100644 --- a/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedGenericClassWithAny_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.1.normal.js index 3d52ffcf27e..5766c023af0 100644 --- a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.2.minified.js index 6c10e16704b..f192ba91fb8 100644 --- a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess_es5.2.minified.js @@ -64,8 +64,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.1.normal.js b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.1.normal.js index 16234dc44dc..fbbdd38b0e0 100644 --- a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.2.minified.js b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.2.minified.js index 9b1b0aaf5c6..89ea243e687 100644 --- a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause_es5.2.minified.js @@ -35,8 +35,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment3_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment3_es2015.1.normal.js index 1bc7882f14e..cb424804809 100644 --- a/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment3_es2015.1.normal.js @@ -7,15 +7,12 @@ const [c, d = c, e = e] = [ const [f, g = f, h = i, i = f] = [ 1 ]; // error for h = i -(function([a1, b = a1]) { -})([ +(function([a1, b = a1]) {})([ 1 ]); -(function([c1, d = c1, e1 = e1]) { -})([ +(function([c1, d = c1, e1 = e1]) {})([ 1 ]); -(function([f1, g = f1, h = i, i = f1]) { -})([ +(function([f1, g = f1, h = i, i = f1]) {})([ 1 ]); diff --git a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.1.normal.js index 10a7ba59d8f..7a9879194b9 100644 --- a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.1.normal.js @@ -1,10 +1,8 @@ // @strict: true -const [] = { -}; // should be error +const [] = {}; // should be error const {} = undefined; // error correctly (([])=>0 -)({ -}); // should be error +)({}); // should be error (({})=>0 )(undefined); // should be error function foo({}) { @@ -14,5 +12,4 @@ function bar([]) { return 0; } const {} = 1; -const [] = { -}; +const [] = {}; diff --git a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.2.minified.js index 2801fe2ffab..8796390b34c 100644 --- a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es2015.2.minified.js @@ -1,8 +1,5 @@ -const [] = { -}, {} = void 0; +const [] = {}, {} = void 0; (([])=>0 -)({ -}), (({})=>0 +)({}), (({})=>0 )(void 0); -const {} = 1, [] = { -}; +const {} = 1, [] = {}; diff --git a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.1.normal.js index 7ad584db7c0..d4674eb5dd3 100644 --- a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.1.normal.js @@ -48,14 +48,12 @@ function _unsupportedIterableToArray(o, minLen) { if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } // @strict: true -var ref = _slicedToArray({ -}, 0); // should be error +var ref = _slicedToArray({}, 0); // should be error var undefined = undefined !== null ? undefined : _throw(new TypeError("Cannot destructure undefined")); // error correctly (function(param) { var _param = _slicedToArray(param, 0); return 0; -})({ -}); // should be error +})({}); // should be error (function(param) { var param = param !== null ? param : _throw(new TypeError("Cannot destructure undefined")); return 0; @@ -69,5 +67,4 @@ function bar(param) { return 0; } var ref1 = 1, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); -var ref2 = _slicedToArray({ -}, 0); +var ref2 = _slicedToArray({}, 0); diff --git a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.2.minified.js index 26884d462d5..98c1a32072f 100644 --- a/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringAssignabilityCheck_es5.2.minified.js @@ -38,13 +38,10 @@ function _unsupportedIterableToArray(o, minLen) { if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } } -_slicedToArray({ -}, 0); +_slicedToArray({}, 0); var undefined = undefined; -_slicedToArray({ -}, 0), (function(param) { +_slicedToArray({}, 0), (function(param) { var param = null !== param ? param : _throw(new TypeError("Cannot destructure undefined")); })(undefined); var ref = 1, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")); -_slicedToArray({ -}, 0); +_slicedToArray({}, 0); diff --git a/crates/swc/tests/tsc-references/destructuringCatch_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringCatch_es2015.1.normal.js index 921648fec5f..3ef7c605203 100644 --- a/crates/swc/tests/tsc-references/destructuringCatch_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringCatch_es2015.1.normal.js @@ -28,6 +28,4 @@ try { y + z; } // Test of comment ranges. A fix to GH#11755 should update this. -try { -} catch (/*Test comment ranges*/ [/*a*/ a2]) { -} +try {} catch (/*Test comment ranges*/ [/*a*/ a2]) {} diff --git a/crates/swc/tests/tsc-references/destructuringCatch_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringCatch_es2015.2.minified.js index 18aedd4737b..feb4dc081c2 100644 --- a/crates/swc/tests/tsc-references/destructuringCatch_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringCatch_es2015.2.minified.js @@ -3,15 +3,13 @@ try { 0, 1 ]; -} catch ([a, b]) { -} +} catch ([a, b]) {} try { throw { a: 0, b: 1 }; -} catch ({ a: a1 , b: b1 }) { -} +} catch ({ a: a1 , b: b1 }) {} try { throw [ { @@ -21,8 +19,5 @@ try { z: 1 } ]; -} catch ([{ x: [y] , z }]) { -} -try { -} catch ([a2]) { -} +} catch ([{ x: [y] , z }]) {} +try {} catch ([a2]) {} diff --git a/crates/swc/tests/tsc-references/destructuringCatch_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringCatch_es5.1.normal.js index 4c675bc150f..829c77857b5 100644 --- a/crates/swc/tests/tsc-references/destructuringCatch_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringCatch_es5.1.normal.js @@ -77,7 +77,6 @@ try { y + z; } // Test of comment ranges. A fix to GH#11755 should update this. -try { -} catch (param3) { +try {} catch (param3) { var _param2 = _slicedToArray(param3, 1), /*a*/ a2 = _param2[0]; } diff --git a/crates/swc/tests/tsc-references/destructuringCatch_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringCatch_es5.2.minified.js index 9488f25a97e..4bd89f60e5d 100644 --- a/crates/swc/tests/tsc-references/destructuringCatch_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringCatch_es5.2.minified.js @@ -49,8 +49,7 @@ try { a: 0, b: 1 }; -} catch (param1) { -} +} catch (param1) {} try { throw [ { @@ -64,7 +63,6 @@ try { var ref = _slicedToArray(param2, 1)[0]; _slicedToArray(ref.x, 1)[0], ref.z; } -try { -} catch (param3) { +try {} catch (param3) { _slicedToArray(param3, 1)[0]; } diff --git a/crates/swc/tests/tsc-references/destructuringControlFlow_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringControlFlow_es2015.1.normal.js index c2ca0f4f0d0..522ee6a7bfe 100644 --- a/crates/swc/tests/tsc-references/destructuringControlFlow_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringControlFlow_es2015.1.normal.js @@ -1,8 +1,7 @@ // @strict: true function f1(obj) { if (obj.a) { - obj = { - }; + obj = {}; let a1 = obj["a"]; // string | undefined let a2 = obj.a; // string | undefined } diff --git a/crates/swc/tests/tsc-references/destructuringControlFlow_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringControlFlow_es5.1.normal.js index a10fe4b5d5e..71fb77d7d83 100644 --- a/crates/swc/tests/tsc-references/destructuringControlFlow_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringControlFlow_es5.1.normal.js @@ -47,8 +47,7 @@ function _unsupportedIterableToArray(o, minLen) { // @strict: true function f1(obj) { if (obj.a) { - obj = { - }; + obj = {}; var a1 = obj["a"]; // string | undefined var a2 = obj.a; // string | undefined } diff --git a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.1.normal.js index 076a1d25692..dfce0f6f1f0 100644 --- a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.1.normal.js @@ -13,8 +13,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key2, i; if (Object.getOwnPropertySymbols) { @@ -29,10 +28,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key2, i; for(i = 0; i < sourceKeys.length; i++){ @@ -69,14 +66,12 @@ let order = (n)=>trace.push(n) let [{ [order(1)]: x } = order(0)] = []; // order(0) should not evaluate because the first element is defined let [{ [order(1)]: y } = order(0)] = [ - { - } + {} ]; // order(0) should evaluate first (destructuring of object literal {}) // order(1) should evaluate next (initializer because property is undefined) // order(2) should evaluate last (evaluate object binding pattern from initializer) -let _ref = { -}, key = order(0), key1 = order(2), { [key]: { [key1]: z } = order(1) } = _ref, w = _objectWithoutProperties(_ref, [ +let _ref = {}, key = order(0), key1 = order(2), { [key]: { [key1]: z } = order(1) } = _ref, w = _objectWithoutProperties(_ref, [ key ].map(_toPropertyKey)); // https://github.com/microsoft/TypeScript/issues/39181 @@ -85,5 +80,4 @@ let _ref1 = [ { x: 1 } -], [{}, b = a] = _ref1, a = _extends({ -}, _ref1[0]); +], [{}, b = a] = _ref1, a = _extends({}, _ref1[0]); diff --git a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.2.minified.js index 1676516ef52..403b7e0bba4 100644 --- a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es2015.2.minified.js @@ -12,18 +12,13 @@ var _typeof = function(obj) { }; let trace = [], order = (n)=>trace.push(n) , [{ [order(1)]: x } = order(0)] = [], [{ [order(1)]: y } = order(0)] = [ - { - } -], _ref = { -}, key = order(0), key1 = order(2), { [key]: { [key1]: z } = order(1) } = _ref; + {} +], _ref = {}, key = order(0), key1 = order(2), { [key]: { [key1]: z } = order(1) } = _ref; !function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key2, i, target = function(source, excluded) { - if (null == source) return { - }; - var key2, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key2, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key2 = sourceKeys[i], excluded.indexOf(key2) >= 0 || (target[key2] = source[key2]); return target; }(source, excluded); @@ -51,5 +46,4 @@ let _ref1 = [ { x: 1 } -], [{}, b = a] = _ref1, a = _extends({ -}, _ref1[0]); +], [{}, b = a] = _ref1, a = _extends({}, _ref1[0]); diff --git a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.1.normal.js index b773bd192a7..980da09ab50 100644 --- a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.1.normal.js @@ -48,8 +48,7 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key2, i; if (Object.getOwnPropertySymbols) { @@ -64,10 +63,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key2, i; for(i = 0; i < sourceKeys.length; i++){ @@ -118,13 +115,11 @@ var order = function(n) { // order(0) should evaluate before order(1) because the first element is undefined var ref = [], tmp = ref[0], ref1 = tmp === void 0 ? order(0) : tmp, x = ref1[order(1)]; // order(0) should not evaluate because the first element is defined -var tmp1 = { -}, ref2 = tmp1 === void 0 ? order(0) : tmp1, y = ref2[order(1)]; +var tmp1 = {}, ref2 = tmp1 === void 0 ? order(0) : tmp1, y = ref2[order(1)]; // order(0) should evaluate first (destructuring of object literal {}) // order(1) should evaluate next (initializer because property is undefined) // order(2) should evaluate last (evaluate object binding pattern from initializer) -var _ref = { -}, key = order(0), key1 = order(2), tmp2 = _ref[key], ref3 = tmp2 === void 0 ? order(1) : tmp2, z = ref3[key1], w = _objectWithoutProperties(_ref, [ +var _ref = {}, key = order(0), key1 = order(2), tmp2 = _ref[key], ref3 = tmp2 === void 0 ? order(1) : tmp2, z = ref3[key1], w = _objectWithoutProperties(_ref, [ key ].map(_toPropertyKey)); // https://github.com/microsoft/TypeScript/issues/39181 @@ -133,5 +128,4 @@ var _ref1 = [ { x: 1 } -], __ref = _slicedToArray(_ref1, 2), ref4 = __ref[0], ref4 = ref4 !== null ? ref4 : _throw(new TypeError("Cannot destructure undefined")), tmp3 = __ref[1], b = tmp3 === void 0 ? a : tmp3, a = _extends({ -}, _ref1[0]); +], __ref = _slicedToArray(_ref1, 2), ref4 = __ref[0], ref4 = ref4 !== null ? ref4 : _throw(new TypeError("Cannot destructure undefined")), tmp3 = __ref[1], b = tmp3 === void 0 ? a : tmp3, a = _extends({}, _ref1[0]); diff --git a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.2.minified.js index b7ba5629661..f778ee14681 100644 --- a/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringEvaluationOrder_es5.2.minified.js @@ -18,19 +18,14 @@ var arr, i, _typeof = function(obj) { return trace.push(n); }, tmp = void 0; (void 0 === tmp ? order(0) : tmp)[order(1)]; -var tmp1 = { -}; +var tmp1 = {}; (void 0 === tmp1 ? order(0) : tmp1)[order(1)]; -var _ref = { -}, key = order(0), key1 = order(2), tmp2 = _ref[key]; +var _ref = {}, key = order(0), key1 = order(2), tmp2 = _ref[key]; (void 0 === tmp2 ? order(1) : tmp2)[key1], (function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key2, i, target = function(source, excluded) { - if (null == source) return { - }; - var key2, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key2, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key2 = sourceKeys[i], excluded.indexOf(key2) >= 0 || (target[key2] = source[key2]); return target; }(source, excluded); @@ -88,5 +83,4 @@ var _ref1 = [ }()), ref = __ref[0], ref = null !== ref ? ref : function(e) { throw e; }(new TypeError("Cannot destructure undefined")), tmp3 = __ref[1]; -_extends({ -}, _ref1[0]); +_extends({}, _ref1[0]); diff --git a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.1.normal.js index 514d95ea3a4..47bb4724831 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.2.minified.js index f826a108f16..3a40186c6e0 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es2015.2.minified.js @@ -1,13 +1,10 @@ var _c; let a, d; (function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.1.normal.js index 15c73d30da7..aeac467a692 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.2.minified.js index 8386541113b..db390f76461 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectAssignmentPatternWithNestedSpread_es5.2.minified.js @@ -1,12 +1,9 @@ var _c; (function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.1.normal.js index be4c6f85f6f..1e503f4278b 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.1.normal.js @@ -3,8 +3,7 @@ // V is an object assignment pattern and, for each assignment property P in V, // S is the type Any, or var { a1 } = undefined; -var { a2 } = { -}; +var { a2 } = {}; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.2.minified.js index 06a53d7ffac..c3b07193081 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es2015.2.minified.js @@ -1,5 +1,4 @@ -var { a1 } = void 0, { a2 } = { -}, { b1 , } = { +var { a1 } = void 0, { a2 } = {}, { b1 , } = { b1: 1 }, { b2: { b21 } = { b21: "string" diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.1.normal.js index 32cb6cc7fb3..f5203541f72 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.1.normal.js @@ -3,8 +3,7 @@ // V is an object assignment pattern and, for each assignment property P in V, // S is the type Any, or var a1 = undefined.a1; -var a2 = { -}.a2; +var a2 = {}.a2; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.2.minified.js index ead42a62f0f..46c92b4ce34 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES5_es5.2.minified.js @@ -1,5 +1,4 @@ -(void 0).a1, ({ -}).a2; +(void 0).a1, ({}).a2; var tmp = { b21: "world" }; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.1.normal.js index 006b88873ef..81b8f509a4c 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.1.normal.js @@ -4,8 +4,7 @@ // V is an object assignment pattern and, for each assignment property P in V, // S is the type Any, or var { a1 } = undefined; -var { a2 } = { -}; +var { a2 } = {}; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.2.minified.js index 06a53d7ffac..c3b07193081 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es2015.2.minified.js @@ -1,5 +1,4 @@ -var { a1 } = void 0, { a2 } = { -}, { b1 , } = { +var { a1 } = void 0, { a2 } = {}, { b1 , } = { b1: 1 }, { b2: { b21 } = { b21: "string" diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.1.normal.js index d1afe09ce49..bab9ee9becf 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.1.normal.js @@ -4,8 +4,7 @@ // V is an object assignment pattern and, for each assignment property P in V, // S is the type Any, or var a1 = undefined.a1; -var a2 = { -}.a2; +var a2 = {}.a2; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.2.minified.js index ead42a62f0f..46c92b4ce34 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment1ES6_es5.2.minified.js @@ -1,5 +1,4 @@ -(void 0).a1, ({ -}).a2; +(void 0).a1, ({}).a2; var tmp = { b21: "world" }; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.1.normal.js index f7fc236cc1f..604a2ad0b62 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.1.normal.js @@ -1,3 +1,2 @@ const { a =1 , b =2 , c =b , d =a , e =f , f =f // error - } = { -}; + } = {}; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.2.minified.js index e37b7314c80..4f378778228 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es2015.2.minified.js @@ -1,2 +1 @@ -const { a =1 , b =2 , c =b , d =a , e =f , f =f } = { -}; +const { a =1 , b =2 , c =b , d =a , e =f , f =f } = {}; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.1.normal.js index bd83d2a9f0f..dbe54e7f1d9 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.1.normal.js @@ -1,3 +1,2 @@ -var ref = { -}, _a = ref.a, a = _a === void 0 ? 1 : _a, _b = ref.b, b = _b === void 0 ? 2 : _b, _c = ref.c, c = _c === void 0 ? b : _c, _d = ref.d, d = _d === void 0 ? a : _d, _e = ref.e, e = _e === void 0 ? f : _e, _f = ref.f, f = _f === void 0 ? f // error +var ref = {}, _a = ref.a, a = _a === void 0 ? 1 : _a, _b = ref.b, b = _b === void 0 ? 2 : _b, _c = ref.c, c = _c === void 0 ? b : _c, _d = ref.d, d = _d === void 0 ? a : _d, _e = ref.e, e = _e === void 0 ? f : _e, _f = ref.f, f = _f === void 0 ? f // error : _f; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.2.minified.js index ca1e13fbd32..d8265fc0e63 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment4_es5.2.minified.js @@ -1,3 +1,2 @@ -var ref = { -}; +var ref = {}; ref.a, ref.b, ref.c, ref.d, ref.e, ref.f; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es2015.1.normal.js index 316b951fa5a..8e55971c7eb 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -32,8 +29,7 @@ function a() { let x; let y; var _tmp; - _tmp = { - }, y = _objectWithoutProperties(_tmp, [ + _tmp = {}, y = _objectWithoutProperties(_tmp, [ "x" ]), ({ x } = _tmp), _tmp; } diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es5.1.normal.js index 48a93bef3a2..7b7ba7b97f8 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment5_es5.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -32,8 +29,7 @@ function a() { var x; var y; var _tmp; - _tmp = { - }, y = _objectWithoutProperties(_tmp, [ + _tmp = {}, y = _objectWithoutProperties(_tmp, [ "x" ]), x = _tmp.x, _tmp; } diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.1.normal.js index 4fc4ebb8240..31ac1ec488a 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.1.normal.js @@ -16,7 +16,6 @@ var a = "a"; var b = "b"; var ref = function() { var _obj; - return _obj = { - }, _defineProperty(_obj, a, 1), _defineProperty(_obj, b, 1), _obj; + return _obj = {}, _defineProperty(_obj, a, 1), _defineProperty(_obj, b, 1), _obj; }(), aVal = ref[a], bVal = ref[b]; console.log(aVal, bVal); diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.2.minified.js index 5c5af91d0f3..051c450b34d 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment6_es5.2.minified.js @@ -8,7 +8,6 @@ function _defineProperty(obj, key, value) { } var ref = function() { var _obj; - return _defineProperty(_obj = { - }, "a", 1), _defineProperty(_obj, "b", 1), _obj; + return _defineProperty(_obj = {}, "a", 1), _defineProperty(_obj, "b", 1), _obj; }(), aVal = ref.a, bVal = ref.b; console.log(aVal, bVal); diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.1.normal.js index 7c73a1c7536..b383440dcef 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.1.normal.js @@ -3,8 +3,7 @@ K; (function(K) { K["a"] = "a"; K["b"] = "b"; -})(K || (K = { -})); +})(K || (K = {})); const { [K.a]: aVal , [K.b]: bVal } = (()=>{ return { [K.a]: 1, diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.2.minified.js index 58fa0a3f68c..8aaf0e3b596 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es2015.2.minified.js @@ -1,6 +1,5 @@ var K, K; -(K = K || (K = { -})).a = "a", K.b = "b"; +(K = K || (K = {})).a = "a", K.b = "b"; const { [K.a]: aVal , [K.b]: bVal } = { [K.a]: 1, [K.b]: 1 diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.1.normal.js index cf38fbd43ea..92c5fb9a3ee 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.1.normal.js @@ -16,11 +16,9 @@ K; (function(K) { K["a"] = "a"; K["b"] = "b"; -})(K || (K = { -})); +})(K || (K = {})); var ref = function() { var _obj; - return _obj = { - }, _defineProperty(_obj, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; + return _obj = {}, _defineProperty(_obj, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; }(), aVal = ref[K.a], bVal = ref[K.b]; console.log(aVal, bVal); diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.2.minified.js index 59cc32dbb57..11657dda7dd 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment7_es5.2.minified.js @@ -6,11 +6,9 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -(K = K || (K = { -})).a = "a", K.b = "b"; +(K = K || (K = {})).a = "a", K.b = "b"; var K, K, ref = function() { var _obj; - return _defineProperty(_obj = { - }, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; + return _defineProperty(_obj = {}, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; }(), aVal = ref[K.a], bVal = ref[K.b]; console.log(aVal, bVal); diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.1.normal.js index c1238999c74..e1a3360c73a 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.1.normal.js @@ -18,7 +18,6 @@ var K = { }; var ref = function() { var _obj; - return _obj = { - }, _defineProperty(_obj, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; + return _obj = {}, _defineProperty(_obj, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; }(), aVal = ref[K.a], bVal = ref[K.b]; console.log(aVal, bVal); diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.2.minified.js index fa63f286abb..9d271c49717 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment8_es5.2.minified.js @@ -11,7 +11,6 @@ var K = { b: "b" }, ref = function() { var _obj; - return _defineProperty(_obj = { - }, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; + return _defineProperty(_obj = {}, K.a, 1), _defineProperty(_obj, K.b, 1), _obj; }(), aVal = ref[K.a], bVal = ref[K.b]; console.log(aVal, bVal); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.1.normal.js index 1edb6b30471..37e1d73feaa 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.1.normal.js @@ -2,14 +2,10 @@ // The identifiers specified in parameter declarations and binding patterns // in a parameter list must be unique within that parameter list. // If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]) { -} -function a2(o) { -} -function a3({ j , k , l: { m , n } , q: [a, b, c] }) { -} -function a4({ x , a }) { -} +function a1([a, b, [[c]]]) {} +function a2(o) {} +function a3({ j , k , l: { m , n } , q: [a, b, c] }) {} +function a4({ x , a }) {} a1([ 1, 2, @@ -35,13 +31,11 @@ a1([ function b1(z = [ undefined, null -]) { -} +]) {} function b2(z = null, o = { x: 0, y: undefined -}) { -} +}) {} function b3({ z: { x , y: { j } } } = { z: { x: "hi", @@ -49,14 +43,12 @@ function b3({ z: { x , y: { j } } } = { j: 1 } } -}) { -} +}) {} function b6([a, z, y] = [ undefined, null, undefined -]) { -} +]) {} function b7([[a], b, [[c, d]]] = [ [ undefined @@ -68,8 +60,7 @@ function b7([[a], b, [[c, d]]] = [ undefined ] ] -]) { -} +]) {} b1([ 1, 2, @@ -104,24 +95,17 @@ var // If the declaration specifies a binding pattern, the parameter type is the Foo; (function(Foo) { Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = { -})); -function c0({ z: { x , y: { j } } }) { -} +})(Foo || (Foo = {})); +function c0({ z: { x , y: { j } } }) {} function c1({ z } = { z: 10 -}) { -} -function c2({ z =10 }) { -} +}) {} +function c2({ z =10 }) {} function c3({ b } = { b: "hello" -}) { -} -function c5([a, b, [[c]]]) { -} -function c6([a, b, [[c = 1]]]) { -} +}) {} +function c5([a, b, [[c]]]) {} +function c6([a, b, [[c = 1]]]) {} c0({ z: { x: 1, @@ -143,8 +127,7 @@ c1({ z: 1 }) // Implied type is {z:number}? ; -c2({ -}); // Implied type is {z?: number} +c2({}); // Implied type is {z?: number} c2({ z: 1 }); // Implied type is {z?: number} @@ -173,44 +156,29 @@ c5([ ]); // Implied type is is [any, any, [[any]]] // A parameter can be marked optional by following its name or binding pattern with a question mark (?) // or by including an initializer. -function d0(x) { -} -function d0(x = 10) { -} +function d0(x) {} +function d0(x = 10) {} class C2 { - d3() { - } - d4() { - } - e0([a, b, c]) { - } - constructor(){ - } + d3() {} + d4() {} + e0([a, b, c]) {} + constructor(){} } class C3 { - d3([a, b, c]) { - } - d4({ x , y , z }) { - } - e0([a, b, c]) { - } + d3([a, b, c]) {} + d4({ x , y , z }) {} + e0([a, b, c]) {} } function d5({ x , y } = { x: 1, y: 2 -}) { -} +}) {} d5(); // Parameter is optional as its declaration included an initializer // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, // as such annotations would conflict with the already established meaning of colons in object literals. // Type annotations must instead be written on the top- level parameter declaration -function e1({ x: number }) { -} // x has type any NOT number -function e2({ x }) { -} // x is type number -function e3({ x }) { -} // x is an optional with type number -function e4({ x: [number, string, any] }) { -} // x has type [any, any, any] -function e5({ x: [a, b, c] }) { -} // x has type [any, any, any] +function e1({ x: number }) {} // x has type any NOT number +function e2({ x }) {} // x is type number +function e3({ x }) {} // x is an optional with type number +function e4({ x: [number, string, any] }) {} // x has type [any, any, any] +function e5({ x: [a, b, c] }) {} // x has type [any, any, any] diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.2.minified.js index b9d5ec8aebb..d9ff4b0a348 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es2015.2.minified.js @@ -1,21 +1,15 @@ var Foo, Foo; -function a1([a, b, [[c]]]) { -} +function a1([a, b, [[c]]]) {} function b2(z = null, o = { x: 0, y: void 0 -}) { -} -function c0({ z: { x , y: { j } } }) { -} +}) {} +function c0({ z: { x , y: { j } } }) {} function c1({ z } = { z: 10 -}) { -} -function c2({ z =10 }) { -} -function c5([a, b, [[c]]]) { -} +}) {} +function c2({ z =10 }) {} +function c5([a, b, [[c]]]) {} a1([ 1, 2, @@ -39,8 +33,7 @@ a1([ }), b2("string", { x: 200, y: !0 -}), (Foo = Foo || (Foo = { -}))[Foo.a = 0] = "a", c0({ +}), (Foo = Foo || (Foo = {}))[Foo.a = 0] = "a", c0({ z: { x: 1, y: { @@ -56,8 +49,7 @@ a1([ } }), c1(), c1({ z: 1 -}), c2({ -}), c2({ +}), c2({}), c2({ z: 1 }), c5([ 1, diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.1.normal.js index e5c29d9dd66..134ab72a1e4 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.1.normal.js @@ -70,8 +70,7 @@ function _unsupportedIterableToArray(o, minLen) { function a1(param) { var _param = _slicedToArray(param, 3), a = _param[0], b = _param[1], ref = _slicedToArray(_param[2], 1), ref1 = _slicedToArray(ref[0], 1), c = ref1[0]; } -function a2(o) { -} +function a2(o) {} function a3(param) { var j = param.j, k = param.k, _l = param.l, m = _l.m, n = _l.n, _q = _slicedToArray(param.q, 3), a = _q[0], b = _q[1], c = _q[2]; } @@ -177,8 +176,7 @@ var // If the declaration specifies a binding pattern, the parameter type is the Foo; (function(Foo) { Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); function c0(param) { var _z = param.z, x = _z.x, j = _z.y.j; } @@ -222,8 +220,7 @@ c1({ z: 1 }) // Implied type is {z:number}? ; -c2({ -}); // Implied type is {z?: number} +c2({}); // Implied type is {z?: number} c2({ z: 1 }); // Implied type is {z?: number} @@ -252,8 +249,7 @@ c5([ ]); // Implied type is is [any, any, [[any]]] // A parameter can be marked optional by following its name or binding pattern with a question mark (?) // or by including an initializer. -function d0(x) { -} +function d0(x) {} function d0() { var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10; } @@ -265,13 +261,11 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "d3", - value: function d3() { - } + value: function d3() {} }, { key: "d4", - value: function d4() { - } + value: function d4() {} }, { key: "e0", diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.2.minified.js index 1d52b8ec03e..37fc6a660c9 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5_es5.2.minified.js @@ -135,8 +135,7 @@ a1([ !1 ] ] -]), (Foo = Foo || (Foo = { -}))[Foo.a = 0] = "a", c0({ +]), (Foo = Foo || (Foo = {}))[Foo.a = 0] = "a", c0({ z: { x: 1, y: { @@ -152,8 +151,7 @@ a1([ } }), c1(), c1({ z: 1 -}), c2({ -}), c2({ +}), c2({}), c2({ z: 1 }), (function() { (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { @@ -188,13 +186,11 @@ var Foo, Foo, C2 = function() { return _createClass(C2, [ { key: "d3", - value: function() { - } + value: function() {} }, { key: "d4", - value: function() { - } + value: function() {} }, { key: "e0", diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.1.normal.js index bcd151c3896..017d56d5715 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.1.normal.js @@ -3,14 +3,10 @@ // The identifiers specified in parameter declarations and binding patterns // in a parameter list must be unique within that parameter list. // If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]) { -} -function a2(o) { -} -function a3({ j , k , l: { m , n } , q: [a, b, c] }) { -} -function a4({ x , a }) { -} +function a1([a, b, [[c]]]) {} +function a2(o) {} +function a3({ j , k , l: { m , n } , q: [a, b, c] }) {} +function a4({ x , a }) {} a1([ 1, 2, @@ -36,13 +32,11 @@ a1([ function b1(z = [ undefined, null -]) { -} +]) {} function b2(z = null, o = { x: 0, y: undefined -}) { -} +}) {} function b3({ z: { x , y: { j } } } = { z: { x: "hi", @@ -50,14 +44,12 @@ function b3({ z: { x , y: { j } } } = { j: 1 } } -}) { -} +}) {} function b6([a, z, y] = [ undefined, null, undefined -]) { -} +]) {} function b7([[a], b, [[c, d]]] = [ [ undefined @@ -69,8 +61,7 @@ function b7([[a], b, [[c, d]]] = [ undefined ] ] -]) { -} +]) {} b1([ 1, 2, @@ -105,24 +96,17 @@ var // If the declaration specifies a binding pattern, the parameter type is the Foo; (function(Foo) { Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = { -})); -function c0({ z: { x , y: { j } } }) { -} +})(Foo || (Foo = {})); +function c0({ z: { x , y: { j } } }) {} function c1({ z } = { z: 10 -}) { -} -function c2({ z =10 }) { -} +}) {} +function c2({ z =10 }) {} function c3({ b } = { b: "hello" -}) { -} -function c5([a, b, [[c]]]) { -} -function c6([a, b, [[c = 1]]]) { -} +}) {} +function c5([a, b, [[c]]]) {} +function c6([a, b, [[c = 1]]]) {} c0({ z: { x: 1, @@ -144,8 +128,7 @@ c1({ z: 1 }) // Implied type is {z:number}? ; -c2({ -}); // Implied type is {z?: number} +c2({}); // Implied type is {z?: number} c2({ z: 1 }); // Implied type is {z?: number} @@ -174,44 +157,29 @@ c5([ ]); // Implied type is is [any, any, [[any]]] // A parameter can be marked optional by following its name or binding pattern with a question mark (?) // or by including an initializer. -function d0(x) { -} -function d0(x = 10) { -} +function d0(x) {} +function d0(x = 10) {} class C2 { - d3() { - } - d4() { - } - e0([a, b, c]) { - } - constructor(){ - } + d3() {} + d4() {} + e0([a, b, c]) {} + constructor(){} } class C3 { - d3([a, b, c]) { - } - d4({ x , y , z }) { - } - e0([a, b, c]) { - } + d3([a, b, c]) {} + d4({ x , y , z }) {} + e0([a, b, c]) {} } function d5({ x , y } = { x: 1, y: 2 -}) { -} +}) {} d5(); // Parameter is optional as its declaration included an initializer // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, // as such annotations would conflict with the already established meaning of colons in object literals. // Type annotations must instead be written on the top- level parameter declaration -function e1({ x: number }) { -} // x has type any NOT number -function e2({ x }) { -} // x is type number -function e3({ x }) { -} // x is an optional with type number -function e4({ x: [number, string, any] }) { -} // x has type [any, any, any] -function e5({ x: [a, b, c] }) { -} // x has type [any, any, any] +function e1({ x: number }) {} // x has type any NOT number +function e2({ x }) {} // x is type number +function e3({ x }) {} // x is an optional with type number +function e4({ x: [number, string, any] }) {} // x has type [any, any, any] +function e5({ x: [a, b, c] }) {} // x has type [any, any, any] diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.2.minified.js index b9d5ec8aebb..d9ff4b0a348 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es2015.2.minified.js @@ -1,21 +1,15 @@ var Foo, Foo; -function a1([a, b, [[c]]]) { -} +function a1([a, b, [[c]]]) {} function b2(z = null, o = { x: 0, y: void 0 -}) { -} -function c0({ z: { x , y: { j } } }) { -} +}) {} +function c0({ z: { x , y: { j } } }) {} function c1({ z } = { z: 10 -}) { -} -function c2({ z =10 }) { -} -function c5([a, b, [[c]]]) { -} +}) {} +function c2({ z =10 }) {} +function c5([a, b, [[c]]]) {} a1([ 1, 2, @@ -39,8 +33,7 @@ a1([ }), b2("string", { x: 200, y: !0 -}), (Foo = Foo || (Foo = { -}))[Foo.a = 0] = "a", c0({ +}), (Foo = Foo || (Foo = {}))[Foo.a = 0] = "a", c0({ z: { x: 1, y: { @@ -56,8 +49,7 @@ a1([ } }), c1(), c1({ z: 1 -}), c2({ -}), c2({ +}), c2({}), c2({ z: 1 }), c5([ 1, diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.1.normal.js index 35240e77aac..5e780dd7a85 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.1.normal.js @@ -71,8 +71,7 @@ function _unsupportedIterableToArray(o, minLen) { function a1(param) { var _param = _slicedToArray(param, 3), a = _param[0], b = _param[1], ref = _slicedToArray(_param[2], 1), ref1 = _slicedToArray(ref[0], 1), c = ref1[0]; } -function a2(o) { -} +function a2(o) {} function a3(param) { var j = param.j, k = param.k, _l = param.l, m = _l.m, n = _l.n, _q = _slicedToArray(param.q, 3), a = _q[0], b = _q[1], c = _q[2]; } @@ -178,8 +177,7 @@ var // If the declaration specifies a binding pattern, the parameter type is the Foo; (function(Foo) { Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); function c0(param) { var _z = param.z, x = _z.x, j = _z.y.j; } @@ -223,8 +221,7 @@ c1({ z: 1 }) // Implied type is {z:number}? ; -c2({ -}); // Implied type is {z?: number} +c2({}); // Implied type is {z?: number} c2({ z: 1 }); // Implied type is {z?: number} @@ -253,8 +250,7 @@ c5([ ]); // Implied type is is [any, any, [[any]]] // A parameter can be marked optional by following its name or binding pattern with a question mark (?) // or by including an initializer. -function d0(x) { -} +function d0(x) {} function d0() { var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10; } @@ -266,13 +262,11 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "d3", - value: function d3() { - } + value: function d3() {} }, { key: "d4", - value: function d4() { - } + value: function d4() {} }, { key: "e0", diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.2.minified.js index 1d52b8ec03e..37fc6a660c9 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES5iterable_es5.2.minified.js @@ -135,8 +135,7 @@ a1([ !1 ] ] -]), (Foo = Foo || (Foo = { -}))[Foo.a = 0] = "a", c0({ +]), (Foo = Foo || (Foo = {}))[Foo.a = 0] = "a", c0({ z: { x: 1, y: { @@ -152,8 +151,7 @@ a1([ } }), c1(), c1({ z: 1 -}), c2({ -}), c2({ +}), c2({}), c2({ z: 1 }), (function() { (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { @@ -188,13 +186,11 @@ var Foo, Foo, C2 = function() { return _createClass(C2, [ { key: "d3", - value: function() { - } + value: function() {} }, { key: "d4", - value: function() { - } + value: function() {} }, { key: "e0", diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.1.normal.js index 2c6fdc4d2db..fb88482677b 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.1.normal.js @@ -4,14 +4,10 @@ // The identifiers specified in parameter declarations and binding patterns // in a parameter list must be unique within that parameter list. // If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]) { -} -function a2(o) { -} -function a3({ j , k , l: { m , n } , q: [a, b, c] }) { -} -function a4({ x , a }) { -} +function a1([a, b, [[c]]]) {} +function a2(o) {} +function a3({ j , k , l: { m , n } , q: [a, b, c] }) {} +function a4({ x , a }) {} a1([ 1, 2, @@ -37,13 +33,11 @@ a1([ function b1(z = [ undefined, null -]) { -} +]) {} function b2(z = null, o = { x: 0, y: undefined -}) { -} +}) {} function b3({ z: { x , y: { j } } } = { z: { x: "hi", @@ -51,14 +45,12 @@ function b3({ z: { x , y: { j } } } = { j: 1 } } -}) { -} +}) {} function b6([a, z, y] = [ undefined, null, undefined -]) { -} +]) {} function b7([[a], b, [[c, d]]] = [ [ undefined @@ -70,8 +62,7 @@ function b7([[a], b, [[c, d]]] = [ undefined ] ] -]) { -} +]) {} b1([ 1, 2, @@ -89,24 +80,17 @@ var // If the declaration specifies a binding pattern, the parameter type is the Foo; (function(Foo) { Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = { -})); -function c0({ z: { x , y: { j } } }) { -} +})(Foo || (Foo = {})); +function c0({ z: { x , y: { j } } }) {} function c1({ z } = { z: 10 -}) { -} -function c2({ z =10 }) { -} +}) {} +function c2({ z =10 }) {} function c3({ b } = { b: "hello" -}) { -} -function c5([a, b, [[c]]]) { -} -function c6([a, b, [[c = 1]]]) { -} +}) {} +function c5([a, b, [[c]]]) {} +function c6([a, b, [[c = 1]]]) {} c0({ z: { x: 1, @@ -128,8 +112,7 @@ c1({ z: 1 }) // Implied type is {z:number}? ; -c2({ -}); // Implied type is {z?: number} +c2({}); // Implied type is {z?: number} c2({ z: 1 }); // Implied type is {z?: number} @@ -157,41 +140,27 @@ c5([ true ]); // Implied type is is [any, any, [[any]]] class C2 { - d3() { - } - d4() { - } - e0([a, b, c]) { - } - constructor(){ - } + d3() {} + d4() {} + e0([a, b, c]) {} + constructor(){} } class C3 { - d3([a, b, c]) { - } - d4({ x , y , z }) { - } - e0([a, b, c]) { - } + d3([a, b, c]) {} + d4({ x , y , z }) {} + e0([a, b, c]) {} } function d5({ x , y } = { x: 1, y: 2 -}) { -} +}) {} d5(); // Parameter is optional as its declaration included an initializer // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, // as such annotations would conflict with the already established meaning of colons in object literals. // Type annotations must instead be written on the top- level parameter declaration -function e1({ x: number }) { -} // x has type any NOT number -function e2({ x }) { -} // x is type number -function e3({ x }) { -} // x is an optional with type number -function e4({ x: [number, string, any] }) { -} // x has type [any, any, any] -function e5({ x: [a, b, c] }) { -} // x has type [any, any, any] -function e6({ x: [number, number, number] }) { -} // error, duplicate identifier; +function e1({ x: number }) {} // x has type any NOT number +function e2({ x }) {} // x is type number +function e3({ x }) {} // x is an optional with type number +function e4({ x: [number, string, any] }) {} // x has type [any, any, any] +function e5({ x: [a, b, c] }) {} // x has type [any, any, any] +function e6({ x: [number, number, number] }) {} // error, duplicate identifier; diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.2.minified.js index b9d5ec8aebb..d9ff4b0a348 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es2015.2.minified.js @@ -1,21 +1,15 @@ var Foo, Foo; -function a1([a, b, [[c]]]) { -} +function a1([a, b, [[c]]]) {} function b2(z = null, o = { x: 0, y: void 0 -}) { -} -function c0({ z: { x , y: { j } } }) { -} +}) {} +function c0({ z: { x , y: { j } } }) {} function c1({ z } = { z: 10 -}) { -} -function c2({ z =10 }) { -} -function c5([a, b, [[c]]]) { -} +}) {} +function c2({ z =10 }) {} +function c5([a, b, [[c]]]) {} a1([ 1, 2, @@ -39,8 +33,7 @@ a1([ }), b2("string", { x: 200, y: !0 -}), (Foo = Foo || (Foo = { -}))[Foo.a = 0] = "a", c0({ +}), (Foo = Foo || (Foo = {}))[Foo.a = 0] = "a", c0({ z: { x: 1, y: { @@ -56,8 +49,7 @@ a1([ } }), c1(), c1({ z: 1 -}), c2({ -}), c2({ +}), c2({}), c2({ z: 1 }), c5([ 1, diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.1.normal.js index a623324af7f..b8b75ee5588 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.1.normal.js @@ -72,8 +72,7 @@ function _unsupportedIterableToArray(o, minLen) { function a1(param) { var _param = _slicedToArray(param, 3), a = _param[0], b = _param[1], ref = _slicedToArray(_param[2], 1), ref1 = _slicedToArray(ref[0], 1), c = ref1[0]; } -function a2(o) { -} +function a2(o) {} function a3(param) { var j = param.j, k = param.k, _l = param.l, m = _l.m, n = _l.n, _q = _slicedToArray(param.q, 3), a = _q[0], b = _q[1], c = _q[2]; } @@ -162,8 +161,7 @@ var // If the declaration specifies a binding pattern, the parameter type is the Foo; (function(Foo) { Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); function c0(param) { var _z = param.z, x = _z.x, j = _z.y.j; } @@ -207,8 +205,7 @@ c1({ z: 1 }) // Implied type is {z:number}? ; -c2({ -}); // Implied type is {z?: number} +c2({}); // Implied type is {z?: number} c2({ z: 1 }); // Implied type is {z?: number} @@ -243,13 +240,11 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "d3", - value: function d3() { - } + value: function d3() {} }, { key: "d4", - value: function d4() { - } + value: function d4() {} }, { key: "e0", diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.2.minified.js index 3005b96cff5..247e6c04fca 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration1ES6_es5.2.minified.js @@ -99,8 +99,7 @@ a1([ }), b2("string", { x: 200, y: !0 -}), (Foo = Foo || (Foo = { -}))[Foo.a = 0] = "a", c0({ +}), (Foo = Foo || (Foo = {}))[Foo.a = 0] = "a", c0({ z: { x: 1, y: { @@ -116,8 +115,7 @@ a1([ } }), c1(), c1({ z: 1 -}), c2({ -}), c2({ +}), c2({}), c2({ z: 1 }), (function() { (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { @@ -152,13 +150,11 @@ var Foo, Foo, C2 = function() { return _createClass(C2, [ { key: "d3", - value: function() { - } + value: function() {} }, { key: "d4", - value: function() { - } + value: function() {} }, { key: "e0", diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.1.normal.js index 3c6c584c6b6..94546eeafe3 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.1.normal.js @@ -1,19 +1,11 @@ -function a1(...x) { -} -function a2(...a) { -} -function a3(...a) { -} -function a4(...a) { -} -function a5(...a) { -} -function a9([a, b, [[c]]]) { -} -function a10([a, b, [[c]], ...x]) { -} -function a11([a, b, c, ...x]) { -} +function a1(...x) {} +function a2(...a) {} +function a3(...a) {} +function a4(...a) {} +function a5(...a) {} +function a9([a, b, [[c]]]) {} +function a10([a, b, [[c]], ...x]) {} +function a11([a, b, c, ...x]) {} var array = [ 1, 2, @@ -66,23 +58,19 @@ a11([ 2 ]); // Parameter type is number[] // Rest parameter with generic -function foo(...a) { -} +function foo(...a) {} foo("hello", 1, 2); foo("hello", "world"); var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var E1; (function(E1) { E1[E1["a"] = 0] = "a"; E1[E1["b"] = 1] = "b"; -})(E1 || (E1 = { -})); -function foo1(...a) { -} +})(E1 || (E1 = {})); +function foo1(...a) {} foo1(1, 2, 3, E.a); foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.2.minified.js index f9a257b8adb..3212c5df5bd 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es2015.2.minified.js @@ -1,10 +1,7 @@ var E, E1, E, E1; -function a10([a, b, [[c]], ...x]) { -} -function foo(...a) { -} -function foo1(...a) { -} +function a10([a, b, [[c]], ...x]) {} +function foo(...a) {} +function foo1(...a) {} a10([ 1, 2, @@ -24,6 +21,4 @@ a10([ ]), a10([ 1, 2 -]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = { -}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); +]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.1.normal.js index 8187d9ff4ec..ab8e0ee25f8 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.1.normal.js @@ -154,14 +154,12 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var E1; (function(E1) { E1[E1["a"] = 0] = "a"; E1[E1["b"] = 1] = "b"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); function foo1() { for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++){ a[_key] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.2.minified.js index fa18be105af..14a4e5604fc 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5_es5.2.minified.js @@ -107,6 +107,4 @@ function foo1() { })([ 1, 2 -]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = { -}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); +]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.1.normal.js index 3c6c584c6b6..94546eeafe3 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.1.normal.js @@ -1,19 +1,11 @@ -function a1(...x) { -} -function a2(...a) { -} -function a3(...a) { -} -function a4(...a) { -} -function a5(...a) { -} -function a9([a, b, [[c]]]) { -} -function a10([a, b, [[c]], ...x]) { -} -function a11([a, b, c, ...x]) { -} +function a1(...x) {} +function a2(...a) {} +function a3(...a) {} +function a4(...a) {} +function a5(...a) {} +function a9([a, b, [[c]]]) {} +function a10([a, b, [[c]], ...x]) {} +function a11([a, b, c, ...x]) {} var array = [ 1, 2, @@ -66,23 +58,19 @@ a11([ 2 ]); // Parameter type is number[] // Rest parameter with generic -function foo(...a) { -} +function foo(...a) {} foo("hello", 1, 2); foo("hello", "world"); var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var E1; (function(E1) { E1[E1["a"] = 0] = "a"; E1[E1["b"] = 1] = "b"; -})(E1 || (E1 = { -})); -function foo1(...a) { -} +})(E1 || (E1 = {})); +function foo1(...a) {} foo1(1, 2, 3, E.a); foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.2.minified.js index f9a257b8adb..3212c5df5bd 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es2015.2.minified.js @@ -1,10 +1,7 @@ var E, E1, E, E1; -function a10([a, b, [[c]], ...x]) { -} -function foo(...a) { -} -function foo1(...a) { -} +function a10([a, b, [[c]], ...x]) {} +function foo(...a) {} +function foo1(...a) {} a10([ 1, 2, @@ -24,6 +21,4 @@ a10([ ]), a10([ 1, 2 -]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = { -}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); +]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.1.normal.js index 8187d9ff4ec..ab8e0ee25f8 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.1.normal.js @@ -154,14 +154,12 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var E1; (function(E1) { E1[E1["a"] = 0] = "a"; E1[E1["b"] = 1] = "b"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); function foo1() { for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++){ a[_key] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.2.minified.js index fa18be105af..14a4e5604fc 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES5iterable_es5.2.minified.js @@ -107,6 +107,4 @@ function foo1() { })([ 1, 2 -]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = { -}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); +]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.1.normal.js index 3c6c584c6b6..94546eeafe3 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.1.normal.js @@ -1,19 +1,11 @@ -function a1(...x) { -} -function a2(...a) { -} -function a3(...a) { -} -function a4(...a) { -} -function a5(...a) { -} -function a9([a, b, [[c]]]) { -} -function a10([a, b, [[c]], ...x]) { -} -function a11([a, b, c, ...x]) { -} +function a1(...x) {} +function a2(...a) {} +function a3(...a) {} +function a4(...a) {} +function a5(...a) {} +function a9([a, b, [[c]]]) {} +function a10([a, b, [[c]], ...x]) {} +function a11([a, b, c, ...x]) {} var array = [ 1, 2, @@ -66,23 +58,19 @@ a11([ 2 ]); // Parameter type is number[] // Rest parameter with generic -function foo(...a) { -} +function foo(...a) {} foo("hello", 1, 2); foo("hello", "world"); var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var E1; (function(E1) { E1[E1["a"] = 0] = "a"; E1[E1["b"] = 1] = "b"; -})(E1 || (E1 = { -})); -function foo1(...a) { -} +})(E1 || (E1 = {})); +function foo1(...a) {} foo1(1, 2, 3, E.a); foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.2.minified.js index f9a257b8adb..3212c5df5bd 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es2015.2.minified.js @@ -1,10 +1,7 @@ var E, E1, E, E1; -function a10([a, b, [[c]], ...x]) { -} -function foo(...a) { -} -function foo1(...a) { -} +function a10([a, b, [[c]], ...x]) {} +function foo(...a) {} +function foo1(...a) {} a10([ 1, 2, @@ -24,6 +21,4 @@ a10([ ]), a10([ 1, 2 -]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = { -}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); +]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.1.normal.js index 8187d9ff4ec..ab8e0ee25f8 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.1.normal.js @@ -154,14 +154,12 @@ var E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var E1; (function(E1) { E1[E1["a"] = 0] = "a"; E1[E1["b"] = 1] = "b"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); function foo1() { for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++){ a[_key] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.2.minified.js index fa18be105af..14a4e5604fc 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration3ES6_es5.2.minified.js @@ -107,6 +107,4 @@ function foo1() { })([ 1, 2 -]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = { -}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); +]), foo("hello", 1, 2), foo("hello", "world"), (E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (E1 = E1 || (E1 = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", foo1(1, 2, 3, E.a), foo1(1, 2, 3, E1.a, E.b); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.1.normal.js index a5b96bbf66f..7ad06dddb9a 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.1.normal.js @@ -1,6 +1,5 @@ class Class { - constructor(){ - } + constructor(){} } class SubClass extends Class { constructor(){ @@ -8,8 +7,7 @@ class SubClass extends Class { } } class D { - constructor(){ - } + constructor(){} } class SubD extends D { constructor(){ @@ -18,25 +16,19 @@ class SubD extends D { } function d0({ x } = { x: new Class() -}) { -} -function d1({ x }) { -} -function d2({ x }) { -} -function d3({ y }) { -} +}) {} +function d1({ x }) {} +function d2({ x }) {} +function d3({ y }) {} function d4({ y } = { y: new D() -}) { -} +}) {} var obj = new Class(); d0({ x: 1 }); d0({ - x: { - } + x: {} }); d0({ x: "string" @@ -45,8 +37,7 @@ d1({ x: new Class() }); d1({ - x: { - } + x: {} }); d1({ x: "string" @@ -55,8 +46,7 @@ d2({ x: new SubClass() }); d2({ - x: { - } + x: {} }); d3({ y: new SubD() @@ -68,8 +58,7 @@ d3({ d3({ y: new Class() }); -d3({ -}); +d3({}); d3({ y: 1 }); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.2.minified.js index 16da8500fcf..f12aff98812 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es2015.2.minified.js @@ -1,6 +1,5 @@ class Class { - constructor(){ - } + constructor(){} } class SubClass extends Class { constructor(){ @@ -8,38 +7,30 @@ class SubClass extends Class { } } class D { - constructor(){ - } + constructor(){} } function d0({ x } = { x: new Class() -}) { -} -function d1({ x }) { -} -function d2({ x }) { -} -function d3({ y }) { -} +}) {} +function d1({ x }) {} +function d2({ x }) {} +function d3({ y }) {} new Class(), d0({ x: 1 }), d0({ - x: { - } + x: {} }), d0({ x: "string" }), d1({ x: new Class() }), d1({ - x: { - } + x: {} }), d1({ x: "string" }), d2({ x: new SubClass() }), d2({ - x: { - } + x: {} }), d3({ y: new class extends D { constructor(){ @@ -50,8 +41,7 @@ new Class(), d0({ y: new SubClass() }), d3({ y: new Class() -}), d3({ -}), d3({ +}), d3({}), d3({ y: 1 }), d3({ y: "world" diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.1.normal.js index c2c9487bd1b..56c6ed1d8b8 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -121,8 +120,7 @@ d0({ x: 1 }); d0({ - x: { - } + x: {} }); d0({ x: "string" @@ -131,8 +129,7 @@ d1({ x: new Class() }); d1({ - x: { - } + x: {} }); d1({ x: "string" @@ -141,8 +138,7 @@ d2({ x: new SubClass() }); d2({ - x: { - } + x: {} }); d3({ y: new SubD() @@ -154,8 +150,7 @@ d3({ d3({ y: new Class() }); -d3({ -}); +d3({}); d3({ y: 1 }); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.2.minified.js index 2a6fa9cbf70..6dfdfa78e41 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -85,30 +84,26 @@ function d3(param) { new Class(), d0({ x: 1 }), d0({ - x: { - } + x: {} }), d0({ x: "string" }), d1({ x: new Class() }), d1({ - x: { - } + x: {} }), d1({ x: "string" }), d2({ x: new SubClass() }), d2({ - x: { - } + x: {} }), d3({ y: new SubD() }), d3({ y: new SubClass() }), d3({ y: new Class() -}), d3({ -}), d3({ +}), d3({}), d3({ y: 1 }), d3({ y: "world" diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5_es2015.1.normal.js index c6615d6011f..e0dba4ca514 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5_es2015.1.normal.js @@ -1,8 +1,4 @@ -function foo({}, { foo , bar }) { -} -function baz([], { foo , bar }) { -} -function one([], {}) { -} -function two([], [a, b, c]) { -} +function foo({}, { foo , bar }) {} +function baz([], { foo , bar }) {} +function one([], {}) {} +function two([], [a, b, c]) {} diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5iterable_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5iterable_es2015.1.normal.js index c6615d6011f..e0dba4ca514 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5iterable_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration7ES5iterable_es2015.1.normal.js @@ -1,8 +1,4 @@ -function foo({}, { foo , bar }) { -} -function baz([], { foo , bar }) { -} -function one([], {}) { -} -function two([], [a, b, c]) { -} +function foo({}, { foo , bar }) {} +function baz([], { foo , bar }) {} +function one([], {}) {} +function two([], [a, b, c]) {} diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.1.normal.js index 925f70fb7f1..6b017ce34f1 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.1.normal.js @@ -4,8 +4,7 @@ function test({ method ='z' , nested: { p ='c' } }) { method; p; } -test({ -}); +test({}); test({ method: 'x', nested: { diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.2.minified.js index 0801441510b..335050a6f05 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es2015.2.minified.js @@ -1,7 +1,5 @@ -function test({ method ="z" , nested: { p ="c" } }) { -} -test({ -}), test({ +function test({ method ="z" , nested: { p ="c" } }) {} +test({}), test({ method: "x", nested: { p: "a" diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.1.normal.js index 22766262dcc..479554aff96 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.1.normal.js @@ -5,8 +5,7 @@ function test(param) { method; p; } -test({ -}); +test({}); test({ method: 'x', nested: { diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.2.minified.js index ae211d8258b..22062c630eb 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8_es5.2.minified.js @@ -1,8 +1,7 @@ function test(param) { param.method, param.nested.p; } -test({ -}), test({ +test({}), test({ method: "x", nested: { p: "a" diff --git a/crates/swc/tests/tsc-references/destructuringSpread_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringSpread_es2015.1.normal.js index 449af2b63b1..577ae181663 100644 --- a/crates/swc/tests/tsc-references/destructuringSpread_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringSpread_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -27,25 +26,19 @@ function _objectSpread(target) { } return target; } -const { x } = _objectSpread({ -}, { -}, { +const { x } = _objectSpread({}, {}, { x: 0 }); const { y } = _objectSpread({ y: 0 -}, { -}); +}, {}); const { z , a , b } = _objectSpread({ z: 0 }, { a: 0, b: 0 }); -const { c , d , e , f , g } = _objectSpread({ -}, _objectSpread({ -}, _objectSpread({ -}, { +const { c , d , e , f , g } = _objectSpread({}, _objectSpread({}, _objectSpread({}, { c: 0 }, { d: 0 diff --git a/crates/swc/tests/tsc-references/destructuringSpread_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringSpread_es2015.2.minified.js index 8e0b7133c40..cc4b1cc96ed 100644 --- a/crates/swc/tests/tsc-references/destructuringSpread_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringSpread_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,22 +17,16 @@ function _objectSpread(target) { } return target; } -const { x } = _objectSpread({ -}, { -}, { +const { x } = _objectSpread({}, {}, { x: 0 }), { y } = _objectSpread({ y: 0 -}, { -}), { z , a , b } = _objectSpread({ +}, {}), { z , a , b } = _objectSpread({ z: 0 }, { a: 0, b: 0 -}), { c , d , e , f , g } = _objectSpread({ -}, _objectSpread({ -}, _objectSpread({ -}, { +}), { c , d , e , f , g } = _objectSpread({}, _objectSpread({}, _objectSpread({}, { c: 0 }, { d: 0 diff --git a/crates/swc/tests/tsc-references/destructuringSpread_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringSpread_es5.1.normal.js index 585776dcf62..6591fc27f50 100644 --- a/crates/swc/tests/tsc-references/destructuringSpread_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringSpread_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -27,25 +26,19 @@ function _objectSpread(target) { } return target; } -var x = _objectSpread({ -}, { -}, { +var x = _objectSpread({}, {}, { x: 0 }).x; var y = _objectSpread({ y: 0 -}, { -}).y; +}, {}).y; var ref = _objectSpread({ z: 0 }, { a: 0, b: 0 }), z = ref.z, a = ref.a, b = ref.b; -var ref1 = _objectSpread({ -}, _objectSpread({ -}, _objectSpread({ -}, { +var ref1 = _objectSpread({}, _objectSpread({}, _objectSpread({}, { c: 0 }, { d: 0 diff --git a/crates/swc/tests/tsc-references/destructuringSpread_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringSpread_es5.2.minified.js index 45b31cd1440..3f8e25cbd56 100644 --- a/crates/swc/tests/tsc-references/destructuringSpread_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringSpread_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,14 +17,11 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, { -}, { +_objectSpread({}, {}, { x: 0 }).x, _objectSpread({ y: 0 -}, { -}).y; +}, {}).y; var ref = _objectSpread({ z: 0 }, { @@ -33,10 +29,7 @@ var ref = _objectSpread({ b: 0 }); ref.z, ref.a, ref.b; -var ref1 = _objectSpread({ -}, _objectSpread({ -}, _objectSpread({ -}, { +var ref1 = _objectSpread({}, _objectSpread({}, _objectSpread({}, { c: 0 }, { d: 0 diff --git a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2_es2015.1.normal.js index 97a9191fc8e..1b73a2bf72c 100644 --- a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2_es2015.1.normal.js @@ -1,66 +1,46 @@ // @strict: true -function f00([x, y]) { -} -function f01([x, y] = []) { -} +function f00([x, y]) {} +function f01([x, y] = []) {} function f02([x, y] = [ 1 -]) { -} +]) {} function f03([x, y] = [ 1, 'foo' -]) { -} -function f10([x = 0, y]) { -} -function f11([x = 0, y] = []) { -} +]) {} +function f10([x = 0, y]) {} +function f11([x = 0, y] = []) {} function f12([x = 0, y] = [ 1 -]) { -} +]) {} function f13([x = 0, y] = [ 1, 'foo' -]) { -} -function f20([x = 0, y = 'bar']) { -} -function f21([x = 0, y = 'bar'] = []) { -} +]) {} +function f20([x = 0, y = 'bar']) {} +function f21([x = 0, y = 'bar'] = []) {} function f22([x = 0, y = 'bar'] = [ 1 -]) { -} +]) {} function f23([x = 0, y = 'bar'] = [ 1, 'foo' -]) { -} -function f30([x = 0, y = 'bar']) { -} -function f31([x = 0, y = 'bar'] = []) { -} +]) {} +function f30([x = 0, y = 'bar']) {} +function f31([x = 0, y = 'bar'] = []) {} function f32([x = 0, y = 'bar'] = [ nx -]) { -} +]) {} function f33([x = 0, y = 'bar'] = [ nx, sx -]) { -} -function f40([x = 0, y = 'bar']) { -} -function f41([x = 0, y = 'bar'] = []) { -} +]) {} +function f40([x = 0, y = 'bar']) {} +function f41([x = 0, y = 'bar'] = []) {} function f42([x = 0, y = 'bar'] = [ sx -]) { -} +]) {} function f43([x = 0, y = 'bar'] = [ sx, nx -]) { -} +]) {} diff --git a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.1.normal.js b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.1.normal.js index 3ef7d0dfac8..5e242276b66 100644 --- a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.1.normal.js @@ -1,13 +1,11 @@ // (arg: { x: any, y: any }) => void -function f1({ x , y }) { -} +function f1({ x , y }) {} f1({ x: 1, y: 1 }); // (arg: { x: any, y?: number }) => void -function f2({ x , y =0 }) { -} +function f2({ x , y =0 }) {} f2({ x: 1 }); @@ -16,10 +14,8 @@ f2({ y: 1 }); // (arg: { x?: number, y?: number }) => void -function f3({ x =0 , y =0 }) { -} -f3({ -}); +function f3({ x =0 , y =0 }) {} +f3({}); f3({ x: 1 }); @@ -34,8 +30,7 @@ f3({ function f4({ x , y } = { x: 0, y: 0 -}) { -} +}) {} f4(); f4({ x: 1, @@ -44,8 +39,7 @@ f4({ // (arg?: { x: number, y?: number }) => void function f5({ x , y =0 } = { x: 0 -}) { -} +}) {} f5(); f5({ x: 1 @@ -55,12 +49,9 @@ f5({ y: 1 }); // (arg?: { x?: number, y?: number }) => void -function f6({ x =0 , y =0 } = { -}) { -} +function f6({ x =0 , y =0 } = {}) {} f6(); -f6({ -}); +f6({}); f6({ x: 1 }); @@ -73,14 +64,11 @@ f6({ }); // (arg?: { a: { x?: number, y?: number } }) => void function f7({ a: { x =0 , y =0 } } = { - a: { - } -}) { -} + a: {} +}) {} f7(); f7({ - a: { - } + a: {} }); f7({ a: { @@ -99,15 +87,13 @@ f7({ } }); // (arg: [any, any]) => void -function g1([x, y]) { -} +function g1([x, y]) {} g1([ 1, 1 ]); // (arg: [number, number]) => void -function g2([x = 0, y = 0]) { -} +function g2([x = 0, y = 0]) {} g2([ 1, 1 @@ -116,8 +102,7 @@ g2([ function g3([x, y] = [ 0, 0 -]) { -} +]) {} g3(); g3([ 1, @@ -126,16 +111,14 @@ g3([ // (arg?: [number, number]) => void function g4([x, y = 0] = [ 0 -]) { -} +]) {} g4(); g4([ 1, 1 ]); // (arg?: [number, number]) => void -function g5([x = 0, y = 0] = []) { -} +function g5([x = 0, y = 0] = []) {} g5(); g5([ 1, diff --git a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.2.minified.js b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.2.minified.js index 83f51cc4d6d..d706a8b4804 100644 --- a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es2015.2.minified.js @@ -1,42 +1,30 @@ -function f2({ x , y =0 }) { -} -function f3({ x =0 , y =0 }) { -} +function f2({ x , y =0 }) {} +function f3({ x =0 , y =0 }) {} function f4({ x , y } = { x: 0, y: 0 -}) { -} +}) {} function f5({ x , y =0 } = { x: 0 -}) { -} -function f6({ x =0 , y =0 } = { -}) { -} +}) {} +function f6({ x =0 , y =0 } = {}) {} function f7({ a: { x =0 , y =0 } } = { - a: { - } -}) { -} + a: {} +}) {} function g3([x, y] = [ 0, 0 -]) { -} +]) {} function g4([x, y = 0] = [ 0 -]) { -} -function g5([x = 0, y = 0] = []) { -} +]) {} +function g5([x = 0, y = 0] = []) {} f2({ x: 1 }), f2({ x: 1, y: 1 -}), f3({ -}), f3({ +}), f3({}), f3({ x: 1 }), f3({ y: 1 @@ -51,8 +39,7 @@ f2({ }), f5({ x: 1, y: 1 -}), f6(), f6({ -}), f6({ +}), f6(), f6({}), f6({ x: 1 }), f6({ y: 1 @@ -60,8 +47,7 @@ f2({ x: 1, y: 1 }), f7(), f7({ - a: { - } + a: {} }), f7({ a: { x: 1 diff --git a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.1.normal.js b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.1.normal.js index 6d8d3cd0b4d..4aeba2d8b69 100644 --- a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.1.normal.js @@ -67,8 +67,7 @@ f2({ function f3(param) { var _x = param.x, x = _x === void 0 ? 0 : _x, _y = param.y, y = _y === void 0 ? 0 : _y; } -f3({ -}); +f3({}); f3({ x: 1 }); @@ -107,12 +106,10 @@ f5({ }); // (arg?: { x?: number, y?: number }) => void function f6() { - var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - }, _x = ref.x, x = _x === void 0 ? 0 : _x, _y = ref.y, y = _y === void 0 ? 0 : _y; + var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _x = ref.x, x = _x === void 0 ? 0 : _x, _y = ref.y, y = _y === void 0 ? 0 : _y; } f6(); -f6({ -}); +f6({}); f6({ x: 1 }); @@ -126,14 +123,12 @@ f6({ // (arg?: { a: { x?: number, y?: number } }) => void function f7() { var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - a: { - } + a: {} }, _a = ref.a, _x = _a.x, x = _x === void 0 ? 0 : _x, _y = _a.y, y = _y === void 0 ? 0 : _y; } f7(); f7({ - a: { - } + a: {} }); f7({ a: { diff --git a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.2.minified.js b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.2.minified.js index cd6d41cfa97..94917dded28 100644 --- a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers_es5.2.minified.js @@ -57,14 +57,12 @@ function f5() { ref.x, ref.y; } function f6() { - var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { - }; + var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; ref.x, ref.y; } function f7() { var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { - a: { - } + a: {} }, _a = ref.a; _a.x, _a.y; } @@ -93,8 +91,7 @@ function g5() { }), f2({ x: 1, y: 1 -}), f3({ -}), f3({ +}), f3({}), f3({ x: 1 }), f3({ y: 1 @@ -109,8 +106,7 @@ function g5() { }), f5({ x: 1, y: 1 -}), f6(), f6({ -}), f6({ +}), f6(), f6({}), f6({ x: 1 }), f6({ y: 1 @@ -118,8 +114,7 @@ function g5() { x: 1, y: 1 }), f7(), f7({ - a: { - } + a: {} }), f7({ a: { x: 1 diff --git a/crates/swc/tests/tsc-references/doWhileBreakStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/doWhileBreakStatements_es2015.1.normal.js index ac5e5407ca5..b094ac5a5f6 100644 --- a/crates/swc/tests/tsc-references/doWhileBreakStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/doWhileBreakStatements_es2015.1.normal.js @@ -23,7 +23,6 @@ while (true) while (true) while (true) EIGHT: do { - var fn = function() { - }; + var fn = function() {}; break EIGHT; }while (true) diff --git a/crates/swc/tests/tsc-references/doWhileBreakStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/doWhileBreakStatements_es5.1.normal.js index 48a3af928b9..9f4e57f90b7 100644 --- a/crates/swc/tests/tsc-references/doWhileBreakStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/doWhileBreakStatements_es5.1.normal.js @@ -23,7 +23,6 @@ while (true) while (true) while (true) EIGHT: do { - var fn = function fn() { - }; + var fn = function fn() {}; break EIGHT; }while (true) diff --git a/crates/swc/tests/tsc-references/doWhileContinueStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/doWhileContinueStatements_es2015.1.normal.js index d6de09e3526..c55761f2a0e 100644 --- a/crates/swc/tests/tsc-references/doWhileContinueStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/doWhileContinueStatements_es2015.1.normal.js @@ -22,7 +22,6 @@ while (true) while (true) while (true) EIGHT: do { - var fn = function() { - }; + var fn = function() {}; continue EIGHT; }while (true) diff --git a/crates/swc/tests/tsc-references/doWhileContinueStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/doWhileContinueStatements_es5.1.normal.js index 80c5c072d6d..fb5a75b7e0a 100644 --- a/crates/swc/tests/tsc-references/doWhileContinueStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/doWhileContinueStatements_es5.1.normal.js @@ -22,7 +22,6 @@ while (true) while (true) while (true) EIGHT: do { - var fn = function fn() { - }; + var fn = function fn() {}; continue EIGHT; }while (true) diff --git a/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.1.normal.js index 7705ccf89de..f80c0ead2cf 100644 --- a/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.1.normal.js @@ -11,8 +11,7 @@ module.exports = x; module.exports = y; (function(x2) { var x1 = x2.x = 10; -})(x || (x = { -})); +})(x || (x = {})); class y { } module.exports = x; @@ -29,8 +28,7 @@ module.exports = y; // @Filename: foo5.ts var x = 5; var y = "test"; -var z = { -}; +var z = {}; module.exports = x; module.exports = y; module.exports = z; diff --git a/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.2.minified.js index 3d80a13d42b..ce8e4eb49a3 100644 --- a/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/duplicateExportAssignments_es2015.2.minified.js @@ -3,12 +3,10 @@ module.exports = x, module.exports = y; var x = 10; class y { } -module.exports = x, module.exports = y, (x || (x = { -})).x = 10; +module.exports = x, module.exports = y, (x || (x = {})).x = 10; class y { } module.exports = x, module.exports = y, module.exports = x, module.exports = y; var x = 5, y = "test"; -module.exports = x, module.exports = y, module.exports = { -}; +module.exports = x, module.exports = y, module.exports = {}; export { }; diff --git a/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.1.normal.js index c69cf070284..ac1391b98fa 100644 --- a/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.1.normal.js @@ -18,8 +18,7 @@ module.exports = x; module.exports = y; (function(x2) { var x1 = x2.x = 10; -})(x || (x = { -})); +})(x || (x = {})); var y = function y() { "use strict"; _classCallCheck(this, y); @@ -38,8 +37,7 @@ module.exports = y; // @Filename: foo5.ts var x = 5; var y = "test"; -var z = { -}; +var z = {}; module.exports = x; module.exports = y; module.exports = z; diff --git a/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.2.minified.js index bd3418c3b50..9210542d440 100644 --- a/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/duplicateExportAssignments_es5.2.minified.js @@ -7,8 +7,7 @@ var x = 10, y = function() { "use strict"; _classCallCheck(this, y); }; -module.exports = x, module.exports = y, (x || (x = { -})).x = 10; +module.exports = x, module.exports = y, (x || (x = {})).x = 10; var y = function() { "use strict"; _classCallCheck(this, y); @@ -18,6 +17,5 @@ function y() { } module.exports = x, module.exports = y, module.exports = x, module.exports = y; var x = 5, y = "test"; -module.exports = x, module.exports = y, module.exports = { -}; +module.exports = x, module.exports = y, module.exports = {}; export { }; diff --git a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es2015.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es2015.1.normal.js index 7a99fa59411..1e3fecaa8cb 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es2015.1.normal.js @@ -1,3 +1,2 @@ // @declaration: true -let x = { -}; +let x = {}; diff --git a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es5.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es5.1.normal.js index 1ea1f94dc85..8aeed16cb87 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions01_es5.1.normal.js @@ -1,3 +1,2 @@ // @declaration: true -var x = { -}; +var x = {}; diff --git a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es2015.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es2015.1.normal.js index 7a99fa59411..1e3fecaa8cb 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es2015.1.normal.js @@ -1,3 +1,2 @@ // @declaration: true -let x = { -}; +let x = {}; diff --git a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es5.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es5.1.normal.js index 1ea1f94dc85..8aeed16cb87 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicatePropertiesInTypeAssertions02_es5.1.normal.js @@ -1,3 +1,2 @@ // @declaration: true -var x = { -}; +var x = {}; diff --git a/crates/swc/tests/tsc-references/duplicatePropertyNames_es2015.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertyNames_es2015.1.normal.js index 8a30d1b9157..cb9dd3bdd56 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertyNames_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicatePropertyNames_es2015.1.normal.js @@ -1,21 +1,15 @@ class C { - bar(x) { - } - bar(x) { - } + bar(x) {} + bar(x) {} constructor(){ - this.baz = ()=>{ - }; - this.baz = ()=>{ - }; + this.baz = ()=>{}; + this.baz = ()=>{}; } } var a; var b = { foo: '', foo: '', - bar: ()=>{ - }, - bar: ()=>{ - } + bar: ()=>{}, + bar: ()=>{} }; diff --git a/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.1.normal.js index b3d58102849..1d2cc6e5bcd 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.1.normal.js @@ -34,16 +34,13 @@ var C = /*#__PURE__*/ function() { "use strict"; function C() { _classCallCheck(this, C); - this.baz = function() { - }; - this.baz = function() { - }; + this.baz = function() {}; + this.baz = function() {}; } _createClass(C, [ { key: "bar", - value: function bar(x) { - } + value: function bar(x) {} } ]); return C; @@ -52,6 +49,4 @@ var a; var _obj; var b = (_obj = { foo: '' -}, _defineProperty(_obj, "foo", ''), _defineProperty(_obj, "bar", function() { -}), _defineProperty(_obj, "bar", function() { -}), _obj); +}, _defineProperty(_obj, "foo", ''), _defineProperty(_obj, "bar", function() {}), _defineProperty(_obj, "bar", function() {}), _obj); diff --git a/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.2.minified.js b/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.2.minified.js index 8c74da517da..355e052d201 100644 --- a/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/duplicatePropertyNames_es5.2.minified.js @@ -18,20 +18,15 @@ var _obj, C = function() { function C() { !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, C), this.baz = function() { - }, this.baz = function() { - }; + }(this, C), this.baz = function() {}, this.baz = function() {}; } return Constructor = C, protoProps = [ { key: "bar", - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); _defineProperty(_obj = { foo: "" -}, "foo", ""), _defineProperty(_obj, "bar", function() { -}), _defineProperty(_obj, "bar", function() { -}); +}, "foo", ""), _defineProperty(_obj, "bar", function() {}), _defineProperty(_obj, "bar", function() {}); diff --git a/crates/swc/tests/tsc-references/duplicateStringIndexers_es2015.1.normal.js b/crates/swc/tests/tsc-references/duplicateStringIndexers_es2015.1.normal.js index 186ec4df850..eb8a83c2983 100644 --- a/crates/swc/tests/tsc-references/duplicateStringIndexers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicateStringIndexers_es2015.1.normal.js @@ -4,5 +4,4 @@ var test; class C { } var a; -})(test || (test = { -})); +})(test || (test = {})); diff --git a/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.1.normal.js b/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.1.normal.js index e957d759236..90f9f2a81ed 100644 --- a/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.1.normal.js @@ -11,5 +11,4 @@ var test; _classCallCheck(this, C); }; var a; -})(test || (test = { -})); +})(test || (test = {})); diff --git a/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.2.minified.js b/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.2.minified.js index a7aff3fd145..3fd8f607128 100644 --- a/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/duplicateStringIndexers_es5.2.minified.js @@ -6,5 +6,4 @@ var test; if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -}(test || (test = { -})); +}(test || (test = {})); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es2015.1.normal.js index 62b29cd5615..34d5ae6c40d 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es2015.1.normal.js @@ -1,7 +1,4 @@ // @target:ES6 -var arrow1 = (a)=>{ -}; -var arrow2 = (a)=>{ -}; -var arrow3 = (a, b)=>{ -}; +var arrow1 = (a)=>{}; +var arrow2 = (a)=>{}; +var arrow3 = (a, b)=>{}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es5.1.normal.js index 0b81acfba8a..3990897b0e6 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionAsIsES6_es5.1.normal.js @@ -1,7 +1,4 @@ // @target:ES6 -var arrow1 = function(a) { -}; -var arrow2 = function(a) { -}; -var arrow3 = function(a, b) { -}; +var arrow1 = function(a) {}; +var arrow2 = function(a) {}; +var arrow3 = function(a, b) {}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es2015.1.normal.js index f5ff86852c1..750292796df 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es2015.1.normal.js @@ -1,7 +1,4 @@ // @target:ES5 -var arrow1 = (a)=>{ -}; -var arrow2 = (a)=>{ -}; -var arrow3 = (a, b)=>{ -}; +var arrow1 = (a)=>{}; +var arrow2 = (a)=>{}; +var arrow3 = (a, b)=>{}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es5.1.normal.js index a5e8dc25ae3..fd644498aa3 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionAsIs_es5.1.normal.js @@ -1,7 +1,4 @@ // @target:ES5 -var arrow1 = function(a) { -}; -var arrow2 = function(a) { -}; -var arrow3 = function(a, b) { -}; +var arrow1 = function(a) {}; +var arrow2 = function(a) {}; +var arrow3 = function(a, b) {}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.1.normal.js index 1d7734b1a93..9f0eb1aca7f 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.1.normal.js @@ -1,39 +1,24 @@ // @target:es6 -var f1 = ()=>{ -}; -var f2 = (x, y)=>{ -}; -var f3 = (x, y, ...rest)=>{ -}; -var f4 = (x, y, z = 10)=>{ -}; -function foo(func) { -} +var f1 = ()=>{}; +var f2 = (x, y)=>{}; +var f3 = (x, y, ...rest)=>{}; +var f4 = (x, y, z = 10)=>{}; +function foo(func) {} foo(()=>true ); foo(()=>{ return false; }); // Binding patterns in arrow functions -var p1 = ([a])=>{ -}; -var p2 = ([...a])=>{ -}; -var p3 = ([, a])=>{ -}; -var p4 = ([, ...a])=>{ -}; -var p5 = ([a = 1])=>{ -}; -var p6 = ({ a })=>{ -}; -var p7 = ({ a: { b } })=>{ -}; -var p8 = ({ a =1 })=>{ -}; +var p1 = ([a])=>{}; +var p2 = ([...a])=>{}; +var p3 = ([, a])=>{}; +var p4 = ([, ...a])=>{}; +var p5 = ([a = 1])=>{}; +var p6 = ({ a })=>{}; +var p7 = ({ a: { b } })=>{}; +var p8 = ({ a =1 })=>{}; var p9 = ({ a: { b =1 } = { b: 1 -} })=>{ -}; -var p10 = ([{ value , done }])=>{ -}; +} })=>{}; +var p10 = ([{ value , done }])=>{}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.2.minified.js index a817625cc2d..6df74f86d96 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es2015.2.minified.js @@ -1,6 +1,4 @@ -function foo(func) { -} +function foo(func) {} foo(()=>!0 ), foo(()=>!1 -), ([a])=>{ -}; +), ([a])=>{}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.1.normal.js index d050ae4d900..b88f0200f83 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.1.normal.js @@ -51,10 +51,8 @@ function _unsupportedIterableToArray(o, minLen) { if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } // @target:es6 -var f1 = function() { -}; -var f2 = function(x, y) { -}; +var f1 = function() {}; +var f2 = function(x, y) {}; var f3 = function(x, y) { for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){ rest[_key - 2] = arguments[_key]; @@ -63,8 +61,7 @@ var f3 = function(x, y) { var f4 = function(x, y) { var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 10; }; -function foo(func) { -} +function foo(func) {} foo(function() { return true; }); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.2.minified.js index 6f7f91fa05d..c5a80c700c4 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionES6_es5.2.minified.js @@ -1,5 +1,4 @@ -function foo(func) { -} +function foo(func) {} foo(function() { return !0; }), foo(function() { diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es2015.1.normal.js index 462dc1eab2d..2eb05c71848 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es2015.1.normal.js @@ -5,8 +5,7 @@ var f1 = ()=>{ var f2 = (x)=>{ this.name = x; }; -function foo(func) { -} +function foo(func) {} foo(()=>{ this.age = 100; return true; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es5.1.normal.js index c41da037d22..c999cc37b3b 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturingES6_es5.1.normal.js @@ -6,8 +6,7 @@ var f1 = function() { var f2 = function(x) { _this.name = x; }; -function foo(func) { -} +function foo(func) {} foo(function() { _this.age = 100; return true; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es2015.1.normal.js index 83d9048e945..1ea92e49205 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es2015.1.normal.js @@ -5,8 +5,7 @@ var f1 = ()=>{ var f2 = (x)=>{ this.name = x; }; -function foo(func) { -} +function foo(func) {} foo(()=>{ this.age = 100; return true; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es5.1.normal.js index fa8a2b3164b..6282040a0bd 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionThisCapturing_es5.1.normal.js @@ -6,8 +6,7 @@ var f1 = function() { var f2 = function(x) { _this.name = x; }; -function foo(func) { -} +function foo(func) {} foo(function() { _this.age = 100; return true; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es2015.1.normal.js index e210d6fa17d..4a9c3a39d55 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es2015.1.normal.js @@ -12,8 +12,7 @@ function baz() { var arg = arguments[0]; }; } -function foo(inputFunc) { -} +function foo(inputFunc) {} foo(()=>{ var arg = arguments[0]; // error }); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es5.1.normal.js index 9d15a51df20..b24db9cc7f5 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_ES6_es5.1.normal.js @@ -15,8 +15,7 @@ function baz() { var arg = _arguments2[0]; }); } -function foo(inputFunc) { -} +function foo(inputFunc) {} foo(function() { var arg = _arguments[0]; // error }); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es2015.1.normal.js index 64d456a26e9..9465acaccb7 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es2015.1.normal.js @@ -12,8 +12,7 @@ function baz() { var arg = arguments[0]; }; } -function foo(inputFunc) { -} +function foo(inputFunc) {} foo(()=>{ var arg = arguments[0]; // error }); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es5.1.normal.js index 125862a0cfc..ad76f452cc4 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01_es5.1.normal.js @@ -15,8 +15,7 @@ function baz() { var arg = _arguments2[0]; }); } -function foo(inputFunc) { -} +function foo(inputFunc) {} foo(function() { var arg = _arguments[0]; // error }); diff --git a/crates/swc/tests/tsc-references/emitArrowFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunction_es2015.1.normal.js index 8b002b119d7..47981185eef 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunction_es2015.1.normal.js @@ -1,14 +1,9 @@ // @target:es5 -var f1 = ()=>{ -}; -var f2 = (x, y)=>{ -}; -var f3 = (x, y, ...rest)=>{ -}; -var f4 = (x, y, z = 10)=>{ -}; -function foo(func) { -} +var f1 = ()=>{}; +var f2 = (x, y)=>{}; +var f3 = (x, y, ...rest)=>{}; +var f4 = (x, y, z = 10)=>{}; +function foo(func) {} foo(()=>true ); foo(()=>{ diff --git a/crates/swc/tests/tsc-references/emitArrowFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunction_es2015.2.minified.js index 7058d06b2fa..0631d937c5b 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitArrowFunction_es2015.2.minified.js @@ -1,5 +1,4 @@ -function foo(func) { -} +function foo(func) {} foo(()=>!0 ), foo(()=>!1 ); diff --git a/crates/swc/tests/tsc-references/emitArrowFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunction_es5.1.normal.js index 4c35d48b422..e07e04e36ef 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunction_es5.1.normal.js @@ -1,8 +1,6 @@ // @target:es5 -var f1 = function() { -}; -var f2 = function(x, y) { -}; +var f1 = function() {}; +var f2 = function(x, y) {}; var f3 = function(x, y) { for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){ rest[_key - 2] = arguments[_key]; @@ -11,8 +9,7 @@ var f3 = function(x, y) { var f4 = function(x, y) { var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 10; }; -function foo(func) { -} +function foo(func) {} foo(function() { return true; }); diff --git a/crates/swc/tests/tsc-references/emitArrowFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunction_es5.2.minified.js index 6f7f91fa05d..c5a80c700c4 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitArrowFunction_es5.2.minified.js @@ -1,5 +1,4 @@ -function foo(func) { -} +function foo(func) {} foo(function() { return !0; }), foo(function() { diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es2015.1.normal.js index 62b29cd5615..34d5ae6c40d 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es2015.1.normal.js @@ -1,7 +1,4 @@ // @target:ES6 -var arrow1 = (a)=>{ -}; -var arrow2 = (a)=>{ -}; -var arrow3 = (a, b)=>{ -}; +var arrow1 = (a)=>{}; +var arrow2 = (a)=>{}; +var arrow3 = (a, b)=>{}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es5.1.normal.js index 0b81acfba8a..3990897b0e6 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIsES6_es5.1.normal.js @@ -1,7 +1,4 @@ // @target:ES6 -var arrow1 = function(a) { -}; -var arrow2 = function(a) { -}; -var arrow3 = function(a, b) { -}; +var arrow1 = function(a) {}; +var arrow2 = function(a) {}; +var arrow3 = function(a, b) {}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es2015.1.normal.js index f5ff86852c1..750292796df 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es2015.1.normal.js @@ -1,7 +1,4 @@ // @target:ES5 -var arrow1 = (a)=>{ -}; -var arrow2 = (a)=>{ -}; -var arrow3 = (a, b)=>{ -}; +var arrow1 = (a)=>{}; +var arrow2 = (a)=>{}; +var arrow3 = (a, b)=>{}; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es5.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es5.1.normal.js index a5e8dc25ae3..fd644498aa3 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionsAsIs_es5.1.normal.js @@ -1,7 +1,4 @@ // @target:ES5 -var arrow1 = function(a) { -}; -var arrow2 = function(a) { -}; -var arrow3 = function(a, b) { -}; +var arrow1 = function(a) {}; +var arrow2 = function(a) {}; +var arrow3 = function(a, b) {}; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationOverloadInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationOverloadInES6_es2015.1.normal.js index cd47987f8c7..2d01d82a908 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationOverloadInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationOverloadInES6_es2015.1.normal.js @@ -1,9 +1,7 @@ // @target: es6 class C { - constructor(x){ - } + constructor(x){} } class D { - constructor(x, z = "hello"){ - } + constructor(x, z = "hello"){} } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es2015.1.normal.js index 4218858a625..005971c9a62 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es2015.1.normal.js @@ -1,9 +1,7 @@ // @target: es6 class A { - foo() { - } - constructor(x){ - } + foo() {} + constructor(x){} } class B { baz(z, v) { diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.1.normal.js index 6bb2f503238..c28c1449c45 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.1.normal.js @@ -26,8 +26,7 @@ var A = // @target: es6 _createClass(A, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.2.minified.js index eaa08119ac7..a0eab68efbe 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithConstructorInES6_es5.2.minified.js @@ -18,8 +18,7 @@ var A = function() { return _createClass(A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(), B = function() { diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es2015.1.normal.js index dd65db1367a..4b64cb3761a 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es2015.1.normal.js @@ -1,7 +1,6 @@ // @target: es6 class B { - constructor(a){ - } + constructor(a){} } class C extends B { } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.1.normal.js index a4bd87312c2..33a451b48e4 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.2.minified.js index 1b70e2254ab..e27f64267d1 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionAndTypeArgumentInES6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es2015.1.normal.js index bf5428729f5..b1980dbff3f 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es2015.1.normal.js @@ -1,11 +1,9 @@ // @target: es6 class B { - baz(a, y = 10) { - } + baz(a, y = 10) {} } class C extends B { - foo() { - } + foo() {} baz(a, y) { super.baz(a, y); } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.1.normal.js index b917052ea5d..b88d9fd3f84 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -133,8 +132,7 @@ var C = /*#__PURE__*/ function(B) { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} }, { key: "baz", diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.2.minified.js index 03a6c24cf64..4b3b64969d1 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithExtensionInES6_es5.2.minified.js @@ -49,8 +49,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -90,8 +89,7 @@ var B = function() { return _createClass(C, [ { key: "foo", - value: function() { - } + value: function() {} }, { key: "baz", diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es2015.1.normal.js index 153b45344d6..2279d82718f 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es2015.1.normal.js @@ -16,14 +16,9 @@ class C { get [tmp2]() { return ""; } - set [tmp3](x) { - } - set [tmp4](y) { - } - set foo(a) { - } - static set bar(b) { - } - static set [tmp5](b) { - } + set [tmp3](x) {} + set [tmp4](y) {} + set foo(a) {} + static set bar(b) {} + static set [tmp5](b) {} } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.1.normal.js index e6a6838e40a..cccb09457aa 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.1.normal.js @@ -45,18 +45,15 @@ var C = // @target:es6 }, { key: tmp3, - set: function set(x) { - } + set: function set(x) {} }, { key: tmp4, - set: function set(y) { - } + set: function set(y) {} }, { key: "foo", - set: function set(a) { - } + set: function set(a) {} } ], [ { @@ -73,13 +70,11 @@ var C = // @target:es6 }, { key: "bar", - set: function set(b) { - } + set: function set(b) {} }, { key: tmp5, - set: function set(b) { - } + set: function set(b) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.2.minified.js index 1bf69b3917a..ea4b1f188f5 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithGetterSetterInES6_es5.2.minified.js @@ -33,18 +33,15 @@ var C = function() { }, { key: "computedname3", - set: function(x) { - } + set: function(x) {} }, { key: "computedname4", - set: function(y) { - } + set: function(y) {} }, { key: "foo", - set: function(a) { - } + set: function(a) {} } ], staticProps = [ { @@ -61,13 +58,11 @@ var C = function() { }, { key: "bar", - set: function(b) { - } + set: function(b) {} }, { key: "computedname", - set: function(b) { - } + set: function(b) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.1.normal.js index 06eb843911e..d1d6cc85b8e 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.1.normal.js @@ -1,13 +1,9 @@ // @target: es6 class B { - "foo"() { - } - 14() { - } - 11() { - } - interface() { - } + "foo"() {} + 14() {} + 11() {} + interface() {} constructor(){ this["hello"] = 10; this[6] = "world"; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.2.minified.js index bba10c62318..9d299ff8881 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es2015.2.minified.js @@ -1,12 +1,8 @@ class B { - foo() { - } - 14() { - } - 11() { - } - interface() { - } + foo() {} + 14() {} + 11() {} + interface() {} constructor(){ this.hello = 10, this[6] = "world", this[10076] = "WORLD", this[20] = "twenty"; } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.1.normal.js index fd51539d3f5..6ac3ad17a9b 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.1.normal.js @@ -30,23 +30,19 @@ var B = // @target: es6 _createClass(B, [ { key: "foo", - value: function foo() { - } + value: function foo() {} }, { key: 14, - value: function value() { - } + value: function value() {} }, { key: 11, - value: function value() { - } + value: function value() {} }, { key: "interface", - value: function _interface() { - } + value: function _interface() {} } ]); return B; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.2.minified.js index 14b5de45717..44cc14fc866 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithLiteralPropertyNameInES6_es5.2.minified.js @@ -15,23 +15,19 @@ var B = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} }, { key: 14, - value: function() { - } + value: function() {} }, { key: 11, - value: function() { - } + value: function() {} }, { key: "interface", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = B).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), B; }(); diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es2015.1.normal.js index bdc819b0abf..e73e86c7a30 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es2015.1.normal.js @@ -1,12 +1,9 @@ var tmp = "computedName1", tmp1 = "computedName2", tmp2 = "computedName3", tmp3 = "computedname4", tmp4 = "computedname5", tmp5 = "computedname6"; // @target:es6 class D { - foo() { - } - [tmp]() { - } - [tmp1](a) { - } + foo() {} + [tmp]() {} + [tmp1](a) {} [tmp2](a) { return 1; } @@ -16,10 +13,8 @@ class D { baz(a, x) { return "HELLO"; } - static [tmp3]() { - } - static [tmp4](a) { - } + static [tmp3]() {} + static [tmp4](a) {} static [tmp5](a) { return true; } @@ -27,8 +22,7 @@ class D { var x = 1 + 2; return x; } - static foo(a) { - } + static foo(a) {} static bar(a) { return 1; } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.1.normal.js index 1e3b8256721..9961ccbd6d6 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.1.normal.js @@ -27,18 +27,15 @@ var D = // @target:es6 _createClass(D, [ { key: "foo", - value: function foo() { - } + value: function foo() {} }, { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, - value: function value(a) { - } + value: function value(a) {} }, { key: tmp2, @@ -61,13 +58,11 @@ var D = // @target:es6 ], [ { key: tmp3, - value: function value() { - } + value: function value() {} }, { key: tmp4, - value: function value(a) { - } + value: function value(a) {} }, { key: tmp5, @@ -84,8 +79,7 @@ var D = // @target:es6 }, { key: "foo", - value: function foo(a) { - } + value: function foo(a) {} }, { key: "bar", diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.2.minified.js index d51ea62fa98..1c6a1e4f376 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithMethodInES6_es5.2.minified.js @@ -15,18 +15,15 @@ var D = function() { return Constructor = D, protoProps = [ { key: "foo", - value: function() { - } + value: function() {} }, { key: "computedName1", - value: function() { - } + value: function() {} }, { key: "computedName2", - value: function(a) { - } + value: function(a) {} }, { key: "computedName3", @@ -49,13 +46,11 @@ var D = function() { ], staticProps = [ { key: "computedname4", - value: function() { - } + value: function() {} }, { key: "computedname5", - value: function(a) { - } + value: function(a) {} }, { key: "computedname6", @@ -71,8 +66,7 @@ var D = function() { }, { key: "foo", - value: function(a) { - } + value: function(a) {} }, { key: "bar", diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.1.normal.js index c2f540789d7..4b4b83ddac6 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.2.minified.js index dd63e28e297..b0773fb6847 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1_es5.2.minified.js @@ -32,8 +32,7 @@ var B = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.1.normal.js index ee02255e7ae..20e3780a13e 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.2.minified.js index c6c634a26f0..5acd4761271 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAssignmentInES6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es2015.1.normal.js index 2fdeabbafb6..faf9a55df51 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es2015.1.normal.js @@ -1,7 +1,6 @@ //@target: es6 class Parent { - foo() { - } + foo() {} } class Foo extends Parent { foo() { diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.1.normal.js index 058d49b18bb..f8ab7c3e1dc 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -115,8 +114,7 @@ var Parent = //@target: es6 _createClass(Parent, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return Parent; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.2.minified.js index dac0de21b52..811650c5707 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithSuperMethodCall01_es5.2.minified.js @@ -41,8 +41,7 @@ var Parent = function() { return _createClass(Parent, [ { key: "foo", - value: function() { - } + value: function() {} } ]), Parent; }(), Foo = function(Parent) { @@ -63,8 +62,7 @@ var Parent = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -87,8 +85,7 @@ var Parent = function() { return _createClass(Foo, [ { key: "foo", - value: function() { - } + value: function() {} } ]), Foo; }(Parent); diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.1.normal.js index dd12a6a0d8c..ffe15b98f30 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.1.normal.js @@ -1,7 +1,6 @@ // @target: es6 class B { - static log(a) { - } + static log(a) {} foo() { B.log(this.x); } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.2.minified.js index 48a9527903a..29c1a241cf4 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es2015.2.minified.js @@ -1,6 +1,5 @@ class B { - static log(a) { - } + static log(a) {} foo() { B.log(this.x); } diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.1.normal.js index c348ded0d03..db659728158 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.1.normal.js @@ -47,8 +47,7 @@ var B = // @target: es6 ], [ { key: "log", - value: function log(a) { - } + value: function log(a) {} } ]); return B; diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.2.minified.js index 7c80e75da28..d4c8febfa6d 100644 --- a/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithThisKeywordInES6_es5.2.minified.js @@ -34,8 +34,7 @@ var B = function() { ], staticProps = [ { key: "log", - value: function(a) { - } + value: function(a) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), B; }(); diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionES6_es2015.1.normal.js index af4250c91c8..1676843311d 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionES6_es2015.1.normal.js @@ -1,9 +1,5 @@ // @target:es6 -function foo(x, y = 10) { -} -function baz(x, y = 5, ...rest) { -} -function bar(y = 10) { -} -function bar1(y = 10, ...rest) { -} +function foo(x, y = 10) {} +function baz(x, y = 5, ...rest) {} +function bar(y = 10) {} +function bar1(y = 10, ...rest) {} diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpressionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpressionES6_es2015.1.normal.js index c1aec1a8a67..f4327820140 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpressionES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpressionES6_es2015.1.normal.js @@ -1,15 +1,8 @@ // @target:es6 -var lambda1 = (y = "hello")=>{ -}; -var lambda2 = (x, y = "hello")=>{ -}; -var lambda3 = (x, y = "hello", ...rest)=>{ -}; -var lambda4 = (y = "hello", ...rest)=>{ -}; -var x = function(str = "hello", ...rest) { -}; -var y = function(num = 10, boo = false, ...rest) { -}(); -var z = function(num, boo = false, ...rest) { -}(10); +var lambda1 = (y = "hello")=>{}; +var lambda2 = (x, y = "hello")=>{}; +var lambda3 = (x, y = "hello", ...rest)=>{}; +var lambda4 = (y = "hello", ...rest)=>{}; +var x = function(str = "hello", ...rest) {}; +var y = function(num = 10, boo = false, ...rest) {}(); +var z = function(num, boo = false, ...rest) {}(10); diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpression_es2015.1.normal.js index 0db12586778..87402a3c7e5 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionExpression_es2015.1.normal.js @@ -1,15 +1,8 @@ // @target: es5 -var lambda1 = (y = "hello")=>{ -}; -var lambda2 = (x, y = "hello")=>{ -}; -var lambda3 = (x, y = "hello", ...rest)=>{ -}; -var lambda4 = (y = "hello", ...rest)=>{ -}; -var x = function(str = "hello", ...rest) { -}; -var y = function(num = 10, boo = false, ...rest) { -}(); -var z = function(num, boo = false, ...rest) { -}(10); +var lambda1 = (y = "hello")=>{}; +var lambda2 = (x, y = "hello")=>{}; +var lambda3 = (x, y = "hello", ...rest)=>{}; +var lambda4 = (y = "hello", ...rest)=>{}; +var x = function(str = "hello", ...rest) {}; +var y = function(num = 10, boo = false, ...rest) {}(); +var z = function(num, boo = false, ...rest) {}(10); diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionPropertyES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionPropertyES6_es2015.1.normal.js index d2ea9fc98c3..4b629599c41 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionPropertyES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionPropertyES6_es2015.1.normal.js @@ -1,11 +1,7 @@ // @target:es6 var obj2 = { - func1 (y = 10, ...rest) { - }, - func2 (x = "hello") { - }, - func3 (x, z, y = "hello") { - }, - func4 (x, z, y = "hello", ...rest) { - } + func1 (y = 10, ...rest) {}, + func2 (x = "hello") {}, + func3 (x, z, y = "hello") {}, + func4 (x, z, y = "hello", ...rest) {} }; diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionProperty_es2015.1.normal.js index 33980d2d871..188b8f7c4d4 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersFunctionProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersFunctionProperty_es2015.1.normal.js @@ -1,11 +1,7 @@ // @target: es5 var obj2 = { - func1 (y = 10, ...rest) { - }, - func2 (x = "hello") { - }, - func3 (x, z, y = "hello") { - }, - func4 (x, z, y = "hello", ...rest) { - } + func1 (y = 10, ...rest) {}, + func2 (x = "hello") {}, + func3 (x, z, y = "hello") {}, + func4 (x, z, y = "hello", ...rest) {} }; diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersFunction_es2015.1.normal.js index 02178b6c04b..56bb689b4da 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersFunction_es2015.1.normal.js @@ -1,9 +1,5 @@ // @target: es5 -function foo(x, y = 10) { -} -function baz(x, y = 5, ...rest) { -} -function bar(y = 10) { -} -function bar1(y = 10, ...rest) { -} +function foo(x, y = 10) {} +function baz(x, y = 5, ...rest) {} +function bar(y = 10) {} +function bar1(y = 10, ...rest) {} diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersMethodES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersMethodES6_es2015.1.normal.js index 59a1c5715e5..92a58923e60 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersMethodES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersMethodES6_es2015.1.normal.js @@ -1,21 +1,14 @@ // @target:es6 class C { - foo(x, t = false) { - } - foo1(x, t = false, ...rest) { - } - bar(t = false) { - } - boo(t = false, ...rest) { - } - constructor(t, z, x, y = "hello"){ - } + foo(x, t = false) {} + foo1(x, t = false, ...rest) {} + bar(t = false) {} + boo(t = false, ...rest) {} + constructor(t, z, x, y = "hello"){} } class D { - constructor(y = "hello"){ - } + constructor(y = "hello"){} } class E { - constructor(y = "hello", ...rest){ - } + constructor(y = "hello", ...rest){} } diff --git a/crates/swc/tests/tsc-references/emitDefaultParametersMethod_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitDefaultParametersMethod_es2015.1.normal.js index 0384de94fc0..f5330a7b922 100644 --- a/crates/swc/tests/tsc-references/emitDefaultParametersMethod_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitDefaultParametersMethod_es2015.1.normal.js @@ -1,21 +1,14 @@ // @target: es5 class C { - foo(x, t = false) { - } - foo1(x, t = false, ...rest) { - } - bar(t = false) { - } - boo(t = false, ...rest) { - } - constructor(t, z, x, y = "hello"){ - } + foo(x, t = false) {} + foo1(x, t = false, ...rest) {} + bar(t = false) {} + boo(t = false, ...rest) {} + constructor(t, z, x, y = "hello"){} } class D { - constructor(y = "hello"){ - } + constructor(y = "hello"){} } class E { - constructor(y = "hello", ...rest){ - } + constructor(y = "hello", ...rest){} } diff --git a/crates/swc/tests/tsc-references/emitRestParametersFunctionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersFunctionES6_es2015.1.normal.js index 54ba38347e2..2334b8e4b4c 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersFunctionES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersFunctionES6_es2015.1.normal.js @@ -1,5 +1,3 @@ // @target: es6 -function bar(...rest) { -} -function foo(x, y, ...rest) { -} +function bar(...rest) {} +function foo(x, y, ...rest) {} diff --git a/crates/swc/tests/tsc-references/emitRestParametersFunctionExpressionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersFunctionExpressionES6_es2015.1.normal.js index 9d9c2e1f01f..b18bc87a2e1 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersFunctionExpressionES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersFunctionExpressionES6_es2015.1.normal.js @@ -1,9 +1,5 @@ // @target: es6 -var funcExp = (...rest)=>{ -}; -var funcExp1 = (X, ...rest)=>{ -}; -var funcExp2 = function(...rest) { -}; -var funcExp3 = function(...rest) { -}(); +var funcExp = (...rest)=>{}; +var funcExp1 = (X, ...rest)=>{}; +var funcExp2 = function(...rest) {}; +var funcExp3 = function(...rest) {}(); diff --git a/crates/swc/tests/tsc-references/emitRestParametersFunctionExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersFunctionExpression_es2015.1.normal.js index 793a4027d41..331cd30ef2b 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersFunctionExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersFunctionExpression_es2015.1.normal.js @@ -1,9 +1,5 @@ // @target: es5 -var funcExp = (...rest)=>{ -}; -var funcExp1 = (X, ...rest)=>{ -}; -var funcExp2 = function(...rest) { -}; -var funcExp3 = function(...rest) { -}(); +var funcExp = (...rest)=>{}; +var funcExp1 = (X, ...rest)=>{}; +var funcExp2 = function(...rest) {}; +var funcExp3 = function(...rest) {}(); diff --git a/crates/swc/tests/tsc-references/emitRestParametersFunctionPropertyES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersFunctionPropertyES6_es2015.1.normal.js index c2f7012db32..9ad29ceaee6 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersFunctionPropertyES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersFunctionPropertyES6_es2015.1.normal.js @@ -1,6 +1,5 @@ // @target: es6 var obj; var obj2 = { - func (...rest) { - } + func (...rest) {} }; diff --git a/crates/swc/tests/tsc-references/emitRestParametersFunctionProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersFunctionProperty_es2015.1.normal.js index e490fcd69ed..cc7407d325b 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersFunctionProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersFunctionProperty_es2015.1.normal.js @@ -1,6 +1,5 @@ // @target: es5 var obj; var obj2 = { - func (...rest) { - } + func (...rest) {} }; diff --git a/crates/swc/tests/tsc-references/emitRestParametersFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersFunction_es2015.1.normal.js index 3c383a7a29e..5f3f191d941 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersFunction_es2015.1.normal.js @@ -1,5 +1,3 @@ // @target: es5 -function bar(...rest) { -} -function foo(x, y, ...rest) { -} +function bar(...rest) {} +function foo(x, y, ...rest) {} diff --git a/crates/swc/tests/tsc-references/emitRestParametersMethodES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersMethodES6_es2015.1.normal.js index 5729f2fa3fc..68178a7619b 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersMethodES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersMethodES6_es2015.1.normal.js @@ -1,17 +1,11 @@ // @target: es6 class C { - bar(...rest) { - } - foo(x, ...rest) { - } - constructor(name, ...rest){ - } + bar(...rest) {} + foo(x, ...rest) {} + constructor(name, ...rest){} } class D { - bar(...rest) { - } - foo(x, ...rest) { - } - constructor(...rest){ - } + bar(...rest) {} + foo(x, ...rest) {} + constructor(...rest){} } diff --git a/crates/swc/tests/tsc-references/emitRestParametersMethod_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitRestParametersMethod_es2015.1.normal.js index 0e6b1d3eb92..32ff788e5e6 100644 --- a/crates/swc/tests/tsc-references/emitRestParametersMethod_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitRestParametersMethod_es2015.1.normal.js @@ -1,17 +1,11 @@ // @target: es5 class C { - bar(...rest) { - } - foo(x, ...rest) { - } - constructor(name, ...rest){ - } + bar(...rest) {} + foo(x, ...rest) {} + constructor(name, ...rest){} } class D { - bar(...rest) { - } - foo(x, ...rest) { - } - constructor(...rest){ - } + bar(...rest) {} + foo(x, ...rest) {} + constructor(...rest){} } diff --git a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.1.normal.js b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.1.normal.js index 59d32728a63..4a1da1fb78b 100644 --- a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.2.minified.js b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.2.minified.js index 5f5d555c5de..680a01dafc4 100644 --- a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCallWithDefineFields_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.1.normal.js b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.1.normal.js index 6d4fa3cea92..82044cadbaf 100644 --- a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.2.minified.js b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.2.minified.js index 5f5d555c5de..680a01dafc4 100644 --- a/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitStatementsBeforeSuperCall_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es2015.1.normal.js index 8a968d391c8..de6549f55b3 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es2015.1.normal.js @@ -95,8 +95,7 @@ function _wrapAsyncGenerator(fn) { // @filename: C1.ts class C1 { f() { - return _wrapAsyncGenerator(function*() { - })(); + return _wrapAsyncGenerator(function*() {})(); } } // @filename: C2.ts @@ -153,8 +152,7 @@ class C7 { } // @filename: C8.ts class C8 { - g() { - } + g() {} f() { return _wrapAsyncGenerator((function*() { this.g(); @@ -163,8 +161,7 @@ class C8 { } // @filename: C9.ts class B9 { - g() { - } + g() {} } class C9 extends B9 { f() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js index f11f4367a6d..05cec7aaf48 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js @@ -204,8 +204,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -446,8 +445,7 @@ var C8 = // @filename: C8.ts _createClass(C8, [ { key: "g", - value: function g() { - } + value: function g() {} }, { key: "f", @@ -477,8 +475,7 @@ var B9 = // @filename: C9.ts _createClass(B9, [ { key: "g", - value: function g() { - } + value: function g() {} } ]); return B9; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.2.minified.js index 53f2039137d..25672986778 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.2.minified.js @@ -305,8 +305,7 @@ var C1 = function() { return _createClass(C8, [ { key: "g", - value: function() { - } + value: function() {} }, { key: "f", @@ -333,8 +332,7 @@ var C1 = function() { return _createClass(B9, [ { key: "g", - value: function() { - } + value: function() {} } ]), B9; }(), C9 = function(B9) { @@ -355,8 +353,7 @@ var C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es2015.1.normal.js index 5c3d5cd7567..f2dc05780a0 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es2015.1.normal.js @@ -95,8 +95,7 @@ function _wrapAsyncGenerator(fn) { // @filename: C1.ts class C1 { f() { - return _wrapAsyncGenerator(function*() { - })(); + return _wrapAsyncGenerator(function*() {})(); } } // @filename: C2.ts @@ -153,8 +152,7 @@ class C7 { } // @filename: C8.ts class C8 { - g() { - } + g() {} f() { return _wrapAsyncGenerator((function*() { this.g(); @@ -163,8 +161,7 @@ class C8 { } // @filename: C9.ts class B9 { - g() { - } + g() {} } class C9 extends B9 { f() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js index 39d985468ed..01dccc442b0 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js @@ -204,8 +204,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -446,8 +445,7 @@ var C8 = // @filename: C8.ts _createClass(C8, [ { key: "g", - value: function g() { - } + value: function g() {} }, { key: "f", @@ -477,8 +475,7 @@ var B9 = // @filename: C9.ts _createClass(B9, [ { key: "g", - value: function g() { - } + value: function g() {} } ]); return B9; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.2.minified.js index 53f2039137d..25672986778 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.2.minified.js @@ -305,8 +305,7 @@ var C1 = function() { return _createClass(C8, [ { key: "g", - value: function() { - } + value: function() {} }, { key: "f", @@ -333,8 +332,7 @@ var C1 = function() { return _createClass(B9, [ { key: "g", - value: function() { - } + value: function() {} } ]), B9; }(), C9 = function(B9) { @@ -355,8 +353,7 @@ var C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es2015.1.normal.js index 4375e1b6c8c..fe0c09c08a9 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es2015.1.normal.js @@ -95,8 +95,7 @@ function _wrapAsyncGenerator(fn) { // @filename: C1.ts class C1 { f() { - return _wrapAsyncGenerator(function*() { - })(); + return _wrapAsyncGenerator(function*() {})(); } } // @filename: C2.ts @@ -153,8 +152,7 @@ class C7 { } // @filename: C8.ts class C8 { - g() { - } + g() {} f() { return _wrapAsyncGenerator((function*() { this.g(); @@ -163,8 +161,7 @@ class C8 { } // @filename: C9.ts class B9 { - g() { - } + g() {} } class C9 extends B9 { f() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js index 9b74d6107f4..4adfd225269 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js @@ -204,8 +204,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -446,8 +445,7 @@ var C8 = // @filename: C8.ts _createClass(C8, [ { key: "g", - value: function g() { - } + value: function g() {} }, { key: "f", @@ -477,8 +475,7 @@ var B9 = // @filename: C9.ts _createClass(B9, [ { key: "g", - value: function g() { - } + value: function g() {} } ]); return B9; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.2.minified.js index 53f2039137d..25672986778 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.2.minified.js @@ -305,8 +305,7 @@ var C1 = function() { return _createClass(C8, [ { key: "g", - value: function() { - } + value: function() {} }, { key: "f", @@ -333,8 +332,7 @@ var C1 = function() { return _createClass(B9, [ { key: "g", - value: function() { - } + value: function() {} } ]), B9; }(), C9 = function(B9) { @@ -355,8 +353,7 @@ var C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.1.normal.js index 67fa4e2da23..c27020b3b3b 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.1.normal.js @@ -97,8 +97,7 @@ function _f1() { _f1 = // @target: es2015 // @lib: esnext // @filename: F1.ts - _wrapAsyncGenerator(function*() { - }); + _wrapAsyncGenerator(function*() {}); return _f1.apply(this, arguments); } function f2() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.2.minified.js index d6b9145bf56..29695ead460 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es2015.2.minified.js @@ -58,8 +58,7 @@ function _wrapAsyncGenerator(fn) { }; } function _f1() { - return (_f1 = _wrapAsyncGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _wrapAsyncGenerator(function*() {})).apply(this, arguments); } function _f2() { return (_f2 = _wrapAsyncGenerator(function*() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.1.normal.js index 81a0be0985b..0dfa8bd1819 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.1.normal.js @@ -97,8 +97,7 @@ function _f1() { _f1 = // @target: es2018 // @lib: esnext // @filename: F1.ts - _wrapAsyncGenerator(function*() { - }); + _wrapAsyncGenerator(function*() {}); return _f1.apply(this, arguments); } function f2() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.2.minified.js index d6b9145bf56..29695ead460 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es2015.2.minified.js @@ -58,8 +58,7 @@ function _wrapAsyncGenerator(fn) { }; } function _f1() { - return (_f1 = _wrapAsyncGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _wrapAsyncGenerator(function*() {})).apply(this, arguments); } function _f2() { return (_f2 = _wrapAsyncGenerator(function*() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.1.normal.js index 225afe6193f..14b33149890 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.1.normal.js @@ -97,8 +97,7 @@ function _f1() { _f1 = // @target: es5 // @lib: esnext // @filename: F1.ts - _wrapAsyncGenerator(function*() { - }); + _wrapAsyncGenerator(function*() {}); return _f1.apply(this, arguments); } function f2() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.2.minified.js index d6b9145bf56..29695ead460 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es2015.2.minified.js @@ -58,8 +58,7 @@ function _wrapAsyncGenerator(fn) { }; } function _f1() { - return (_f1 = _wrapAsyncGenerator(function*() { - })).apply(this, arguments); + return (_f1 = _wrapAsyncGenerator(function*() {})).apply(this, arguments); } function _f2() { return (_f2 = _wrapAsyncGenerator(function*() { diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.1.normal.js index 50375c9d61d..a8a9e05cd24 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.1.normal.js @@ -94,8 +94,7 @@ function _wrapAsyncGenerator(fn) { // @lib: esnext // @filename: F1.ts const f1 = function() { - var _ref = _wrapAsyncGenerator(function*() { - }); + var _ref = _wrapAsyncGenerator(function*() {}); return function f1() { return _ref.apply(this, arguments); }; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js index dbd9413ac5e..27740e7d31d 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js @@ -65,8 +65,7 @@ function _wrapAsyncGenerator(fn) { return this._invoke("throw", arg); }, AsyncGenerator.prototype.return = function(arg) { return this._invoke("return", arg); -}, _wrapAsyncGenerator(function*() { -}), _wrapAsyncGenerator(function*() { +}, _wrapAsyncGenerator(function*() {}), _wrapAsyncGenerator(function*() { yield; }), _wrapAsyncGenerator(function*() { yield 1; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.1.normal.js index dc068b2bafa..f75b5fe216e 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.1.normal.js @@ -94,8 +94,7 @@ function _wrapAsyncGenerator(fn) { // @lib: esnext // @filename: F1.ts const f1 = function() { - var _ref = _wrapAsyncGenerator(function*() { - }); + var _ref = _wrapAsyncGenerator(function*() {}); return function f1() { return _ref.apply(this, arguments); }; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js index dbd9413ac5e..27740e7d31d 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js @@ -65,8 +65,7 @@ function _wrapAsyncGenerator(fn) { return this._invoke("throw", arg); }, AsyncGenerator.prototype.return = function(arg) { return this._invoke("return", arg); -}, _wrapAsyncGenerator(function*() { -}), _wrapAsyncGenerator(function*() { +}, _wrapAsyncGenerator(function*() {}), _wrapAsyncGenerator(function*() { yield; }), _wrapAsyncGenerator(function*() { yield 1; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.1.normal.js index 16c4f6daca7..decb5936a65 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.1.normal.js @@ -94,8 +94,7 @@ function _wrapAsyncGenerator(fn) { // @lib: esnext // @filename: F1.ts const f1 = function() { - var _ref = _wrapAsyncGenerator(function*() { - }); + var _ref = _wrapAsyncGenerator(function*() {}); return function f1() { return _ref.apply(this, arguments); }; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js index dbd9413ac5e..27740e7d31d 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js @@ -65,8 +65,7 @@ function _wrapAsyncGenerator(fn) { return this._invoke("throw", arg); }, AsyncGenerator.prototype.return = function(arg) { return this._invoke("return", arg); -}, _wrapAsyncGenerator(function*() { -}), _wrapAsyncGenerator(function*() { +}, _wrapAsyncGenerator(function*() {}), _wrapAsyncGenerator(function*() { yield; }), _wrapAsyncGenerator(function*() { yield 1; diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es2015.1.normal.js index 9273f13f968..a001826c350 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es2015.1.normal.js @@ -95,8 +95,7 @@ function _wrapAsyncGenerator(fn) { // @filename: O1.ts const o1 = { f () { - return _wrapAsyncGenerator(function*() { - })(); + return _wrapAsyncGenerator(function*() {})(); } }; // @filename: O2.ts diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es2015.1.normal.js index 3aff545ab39..a6b87d980de 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es2015.1.normal.js @@ -95,8 +95,7 @@ function _wrapAsyncGenerator(fn) { // @filename: O1.ts const o1 = { f () { - return _wrapAsyncGenerator(function*() { - })(); + return _wrapAsyncGenerator(function*() {})(); } }; // @filename: O2.ts diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es2015.1.normal.js index 4d34e9fe818..7a959cf4a03 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es2015.1.normal.js @@ -95,8 +95,7 @@ function _wrapAsyncGenerator(fn) { // @filename: O1.ts const o1 = { f () { - return _wrapAsyncGenerator(function*() { - })(); + return _wrapAsyncGenerator(function*() {})(); } }; // @filename: O2.ts diff --git a/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es2015.1.normal.js b/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es2015.1.normal.js index 82bb9ac2702..6aa5dcdbd8b 100644 --- a/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es2015.1.normal.js @@ -1,16 +1,8 @@ // @target: es2019 function f() { - try { - } catch (e) { - } - try { - } catch (e1) { - try { - } catch (e) { - } - } - try { - } catch (e2) { - } finally{ + try {} catch (e) {} + try {} catch (e1) { + try {} catch (e) {} } + try {} catch (e2) {} finally{} } diff --git a/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es5.1.normal.js index 82bb9ac2702..6aa5dcdbd8b 100644 --- a/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.noCatchBinding.es2019_es5.1.normal.js @@ -1,16 +1,8 @@ // @target: es2019 function f() { - try { - } catch (e) { - } - try { - } catch (e1) { - try { - } catch (e) { - } - } - try { - } catch (e2) { - } finally{ + try {} catch (e) {} + try {} catch (e1) { + try {} catch (e) {} } + try {} catch (e2) {} finally{} } diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.1.normal.js index 4b034928847..5cb4a071938 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.1.normal.js @@ -13,10 +13,7 @@ var { p1: {} , p2: [] } = a; let { p1: {} , p2: [] } = a; const { p1: {} , p2: [] } = a; - for(var {} = { - }, {} = { - }; false; void 0){ - } + for(var {} = {}, {} = {}; false; void 0){} function f({} = a, [] = a, { p: {} = a } = a) { return ({} = a, [] = a, { p: {} = a } = a)=>a ; @@ -24,16 +21,10 @@ })(); (function() { const ns = []; - for (var {} of ns){ - } - for (let {} of ns){ - } - for (const {} of ns){ - } - for (var [] of ns){ - } - for (let [] of ns){ - } - for (const [] of ns){ - } + for (var {} of ns){} + for (let {} of ns){} + for (const {} of ns){} + for (var [] of ns){} + for (let [] of ns){} + for (const [] of ns){} })(); diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.2.minified.js index b6ffb62ace8..20660bedb92 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es2015.2.minified.js @@ -11,9 +11,7 @@ var { p1: {} , p2: [] } = a; let { p1: {} , p2: [] } = a; const { p1: {} , p2: [] } = a; - var {} = { - }, {} = { - }; + var {} = {}, {} = {}; }(), (function() { const ns = []; for (var {} of ns); diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.1.normal.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.1.normal.js index 46842335313..0378f7536e2 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.1.normal.js @@ -69,10 +69,7 @@ function _unsupportedIterableToArray(o, minLen) { var _p1 = a.p1, _p1 = _p1 !== null ? _p1 : _throw(new TypeError("Cannot destructure undefined")), _p2 = _slicedToArray(a.p2, 0); var _p11 = a.p1, _p11 = _p11 !== null ? _p11 : _throw(new TypeError("Cannot destructure undefined")), _p21 = _slicedToArray(a.p2, 0); var _p12 = a.p1, _p12 = _p12 !== null ? _p12 : _throw(new TypeError("Cannot destructure undefined")), _p22 = _slicedToArray(a.p2, 0); - for(var ref5 = { - }, ref5 = ref5 !== null ? ref5 : _throw(new TypeError("Cannot destructure undefined")), ref1 = { - }, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); false; void 0){ - } + for(var ref5 = {}, ref5 = ref5 !== null ? ref5 : _throw(new TypeError("Cannot destructure undefined")), ref1 = {}, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); false; void 0){} })(); (function() { var ns = []; diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.2.minified.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.2.minified.js index bc1beedf812..48ea32fcb9c 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5_es5.2.minified.js @@ -53,9 +53,7 @@ function _unsupportedIterableToArray(o, minLen) { _slicedToArray(a.p2, 0); var _p12 = a.p1, _p12 = null !== _p12 ? _p12 : _throw(new TypeError("Cannot destructure undefined")); _slicedToArray(a.p2, 0); - var ref = { - }, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")), ref1 = { - }, ref1 = null !== ref1 ? ref1 : _throw(new TypeError("Cannot destructure undefined")); + var ref = {}, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")), ref1 = {}, ref1 = null !== ref1 ? ref1 : _throw(new TypeError("Cannot destructure undefined")); }(), (function() { var ns = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.1.normal.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.1.normal.js index 82f3f8f3f99..9e4190404ca 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.1.normal.js @@ -14,10 +14,7 @@ var { p1: {} , p2: [] } = a; let { p1: {} , p2: [] } = a; const { p1: {} , p2: [] } = a; - for(var {} = { - }, {} = { - }; false; void 0){ - } + for(var {} = {}, {} = {}; false; void 0){} function f({} = a, [] = a, { p: {} = a } = a) { return ({} = a, [] = a, { p: {} = a } = a)=>a ; @@ -25,16 +22,10 @@ })(); (function() { const ns = []; - for (var {} of ns){ - } - for (let {} of ns){ - } - for (const {} of ns){ - } - for (var [] of ns){ - } - for (let [] of ns){ - } - for (const [] of ns){ - } + for (var {} of ns){} + for (let {} of ns){} + for (const {} of ns){} + for (var [] of ns){} + for (let [] of ns){} + for (const [] of ns){} })(); diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.2.minified.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.2.minified.js index b6ffb62ace8..20660bedb92 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es2015.2.minified.js @@ -11,9 +11,7 @@ var { p1: {} , p2: [] } = a; let { p1: {} , p2: [] } = a; const { p1: {} , p2: [] } = a; - var {} = { - }, {} = { - }; + var {} = {}, {} = {}; }(), (function() { const ns = []; for (var {} of ns); diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.1.normal.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.1.normal.js index 8e87b1b2b61..ffab29f4c69 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.1.normal.js @@ -70,10 +70,7 @@ function _unsupportedIterableToArray(o, minLen) { var _p1 = a.p1, _p1 = _p1 !== null ? _p1 : _throw(new TypeError("Cannot destructure undefined")), _p2 = _slicedToArray(a.p2, 0); var _p11 = a.p1, _p11 = _p11 !== null ? _p11 : _throw(new TypeError("Cannot destructure undefined")), _p21 = _slicedToArray(a.p2, 0); var _p12 = a.p1, _p12 = _p12 !== null ? _p12 : _throw(new TypeError("Cannot destructure undefined")), _p22 = _slicedToArray(a.p2, 0); - for(var ref5 = { - }, ref5 = ref5 !== null ? ref5 : _throw(new TypeError("Cannot destructure undefined")), ref1 = { - }, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); false; void 0){ - } + for(var ref5 = {}, ref5 = ref5 !== null ? ref5 : _throw(new TypeError("Cannot destructure undefined")), ref1 = {}, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); false; void 0){} })(); (function() { var ns = []; diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.2.minified.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.2.minified.js index bc1beedf812..48ea32fcb9c 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES5iterable_es5.2.minified.js @@ -53,9 +53,7 @@ function _unsupportedIterableToArray(o, minLen) { _slicedToArray(a.p2, 0); var _p12 = a.p1, _p12 = null !== _p12 ? _p12 : _throw(new TypeError("Cannot destructure undefined")); _slicedToArray(a.p2, 0); - var ref = { - }, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")), ref1 = { - }, ref1 = null !== ref1 ? ref1 : _throw(new TypeError("Cannot destructure undefined")); + var ref = {}, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")), ref1 = {}, ref1 = null !== ref1 ? ref1 : _throw(new TypeError("Cannot destructure undefined")); }(), (function() { var ns = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.1.normal.js index 05cd43af437..a9b9584349a 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.1.normal.js @@ -13,10 +13,7 @@ var { p1: {} , p2: [] } = a; let { p1: {} , p2: [] } = a; const { p1: {} , p2: [] } = a; - for(var {} = { - }, {} = { - }; false; void 0){ - } + for(var {} = {}, {} = {}; false; void 0){} function f({} = a, [] = a, { p: {} = a } = a) { return ({} = a, [] = a, { p: {} = a } = a)=>a ; @@ -24,16 +21,10 @@ })(); (function() { const ns = []; - for (var {} of ns){ - } - for (let {} of ns){ - } - for (const {} of ns){ - } - for (var [] of ns){ - } - for (let [] of ns){ - } - for (const [] of ns){ - } + for (var {} of ns){} + for (let {} of ns){} + for (const {} of ns){} + for (var [] of ns){} + for (let [] of ns){} + for (const [] of ns){} })(); diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.2.minified.js index b6ffb62ace8..20660bedb92 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es2015.2.minified.js @@ -11,9 +11,7 @@ var { p1: {} , p2: [] } = a; let { p1: {} , p2: [] } = a; const { p1: {} , p2: [] } = a; - var {} = { - }, {} = { - }; + var {} = {}, {} = {}; }(), (function() { const ns = []; for (var {} of ns); diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.1.normal.js index 4ed11187325..3d43ac813bb 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.1.normal.js @@ -69,10 +69,7 @@ function _unsupportedIterableToArray(o, minLen) { var _p1 = a.p1, _p1 = _p1 !== null ? _p1 : _throw(new TypeError("Cannot destructure undefined")), _p2 = _slicedToArray(a.p2, 0); var _p11 = a.p1, _p11 = _p11 !== null ? _p11 : _throw(new TypeError("Cannot destructure undefined")), _p21 = _slicedToArray(a.p2, 0); var _p12 = a.p1, _p12 = _p12 !== null ? _p12 : _throw(new TypeError("Cannot destructure undefined")), _p22 = _slicedToArray(a.p2, 0); - for(var ref5 = { - }, ref5 = ref5 !== null ? ref5 : _throw(new TypeError("Cannot destructure undefined")), ref1 = { - }, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); false; void 0){ - } + for(var ref5 = {}, ref5 = ref5 !== null ? ref5 : _throw(new TypeError("Cannot destructure undefined")), ref1 = {}, ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")); false; void 0){} })(); (function() { var ns = []; diff --git a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.2.minified.js index bc1beedf812..48ea32fcb9c 100644 --- a/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emptyVariableDeclarationBindingPatterns01_ES6_es5.2.minified.js @@ -53,9 +53,7 @@ function _unsupportedIterableToArray(o, minLen) { _slicedToArray(a.p2, 0); var _p12 = a.p1, _p12 = null !== _p12 ? _p12 : _throw(new TypeError("Cannot destructure undefined")); _slicedToArray(a.p2, 0); - var ref = { - }, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")), ref1 = { - }, ref1 = null !== ref1 ? ref1 : _throw(new TypeError("Cannot destructure undefined")); + var ref = {}, ref = null !== ref ? ref : _throw(new TypeError("Cannot destructure undefined")), ref1 = {}, ref1 = null !== ref1 ? ref1 : _throw(new TypeError("Cannot destructure undefined")); }(), (function() { var ns = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { diff --git a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.1.normal.js index e07fff83e35..758c1a453b1 100644 --- a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.1.normal.js @@ -2,8 +2,7 @@ var // enum is only a subtype of number, no types are subtypes of enum, all of t E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var r = foo(E.A); // E var r2 = foo(1); // number var r3 = foo(null); // any @@ -25,22 +24,18 @@ var r4 = foo12(E.A); var E2; (function(E2) { E2[E2["A"] = 0] = "A"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var r4 = foo13(E.A); -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var r4 = foo14(E.A); class CC { } (function(CC1) { var bar = CC1.bar = 1; -})(CC || (CC = { -})); +})(CC || (CC = {})); var r4 = foo15(E.A); var r4 = foo16(E.A); var r4 = foo16(E.A); diff --git a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.2.minified.js index 6ae6cfa5f65..cfdb0f1e52e 100644 --- a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es2015.2.minified.js @@ -1,11 +1,6 @@ var E, E, E2, E2; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", foo(E.A), foo(1), foo(null), foo2(E.A), foo3(E.A), foo4(E.A), foo5(E.A), foo6(E.A), foo7(E.A), foo8(E.A), foo9(E.A), foo10(E.A), foo11(E.A), foo12(E.A), (E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", foo13(E.A), (f || (f = { -})).bar = 1, foo14(E.A); +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", foo(E.A), foo(1), foo(null), foo2(E.A), foo3(E.A), foo4(E.A), foo5(E.A), foo6(E.A), foo7(E.A), foo8(E.A), foo9(E.A), foo10(E.A), foo11(E.A), foo12(E.A), (E2 = E2 || (E2 = {}))[E2.A = 0] = "A", foo13(E.A), (f || (f = {})).bar = 1, foo14(E.A); class CC { } -(CC || (CC = { -})).bar = 1, foo15(E.A), foo16(E.A), foo16(E.A); +(CC || (CC = {})).bar = 1, foo15(E.A), foo16(E.A), foo16(E.A); diff --git a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.1.normal.js b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.1.normal.js index eb711efd464..40f29259335 100644 --- a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.1.normal.js @@ -7,8 +7,7 @@ var // enum is only a subtype of number, no types are subtypes of enum, all of t E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var r = foo(E.A); // E var r2 = foo(1); // number var r3 = foo(null); // any @@ -34,15 +33,12 @@ var r4 = foo12(E.A); var E2; (function(E2) { E2[E2["A"] = 0] = "A"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var r4 = foo13(E.A); -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var r4 = foo14(E.A); var CC = function CC() { "use strict"; @@ -50,8 +46,7 @@ var CC = function CC() { }; (function(CC) { var bar = CC.bar = 1; -})(CC || (CC = { -})); +})(CC || (CC = {})); var r4 = foo15(E.A); var r4 = foo16(E.A); var r4 = foo16(E.A); diff --git a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.2.minified.js b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.2.minified.js index 9c8648f5797..75895e08662 100644 --- a/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumAssignabilityInInheritance_es5.2.minified.js @@ -1,8 +1,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } -(E = E || (E = { -}))[E.A = 0] = "A", foo(E.A), foo(1), foo(null), foo2(E.A), foo3(E.A), foo4(E.A), foo5(E.A), foo6(E.A), foo7(E.A), foo8(E.A); +(E = E || (E = {}))[E.A = 0] = "A", foo(E.A), foo(1), foo(null), foo2(E.A), foo3(E.A), foo4(E.A), foo5(E.A), foo6(E.A), foo7(E.A), foo8(E.A); var A = function() { "use strict"; _classCallCheck(this, A); @@ -12,14 +11,10 @@ var A2 = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -foo10(E.A), foo11(E.A), foo12(E.A), (E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", foo13(E.A), (f || (f = { -})).bar = 1, foo14(E.A); +function f() {} +foo10(E.A), foo11(E.A), foo12(E.A), (E2 = E2 || (E2 = {}))[E2.A = 0] = "A", foo13(E.A), (f || (f = {})).bar = 1, foo14(E.A); var E, E, E2, E2, CC = function() { "use strict"; _classCallCheck(this, CC); }; -(CC || (CC = { -})).bar = 1, foo15(E.A), foo16(E.A), foo16(E.A); +(CC || (CC = {})).bar = 1, foo15(E.A), foo16(E.A), foo16(E.A); diff --git a/crates/swc/tests/tsc-references/enumAssignability_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumAssignability_es2015.1.normal.js index 3991f8d3a4a..a40c79e7e6d 100644 --- a/crates/swc/tests/tsc-references/enumAssignability_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumAssignability_es2015.1.normal.js @@ -2,13 +2,11 @@ var // enums assignable to number, any, Object, errors unless otherwise noted E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["B"] = 0] = "B"; -})(F || (F = { -})); +})(F || (F = {})); var e = E.A; var f = F.B; e = f; @@ -49,5 +47,4 @@ var Others; var a = e; var b = e; } -})(Others || (Others = { -})); +})(Others || (Others = {})); diff --git a/crates/swc/tests/tsc-references/enumAssignability_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumAssignability_es2015.2.minified.js index 23983d411eb..f75d63e5acb 100644 --- a/crates/swc/tests/tsc-references/enumAssignability_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumAssignability_es2015.2.minified.js @@ -1,5 +1,3 @@ -(E = E || (E = { -}))[E.A = 0] = "A", (F = F || (F = { -}))[F.B = 0] = "B"; +(E = E || (E = {}))[E.A = 0] = "A", (F = F || (F = {}))[F.B = 0] = "B"; var E, F, E, F, e = E.A, f = F.B; f = f, f = 1; diff --git a/crates/swc/tests/tsc-references/enumAssignability_es5.1.normal.js b/crates/swc/tests/tsc-references/enumAssignability_es5.1.normal.js index 8dceaada618..96f2aa8c994 100644 --- a/crates/swc/tests/tsc-references/enumAssignability_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumAssignability_es5.1.normal.js @@ -7,13 +7,11 @@ var // enums assignable to number, any, Object, errors unless otherwise noted E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["B"] = 0] = "B"; -})(F || (F = { -})); +})(F || (F = {})); var e = E.A; var f = F.B; e = f; @@ -56,5 +54,4 @@ var Others; var o = e; var p = e; var q = e; -})(Others || (Others = { -})); +})(Others || (Others = {})); diff --git a/crates/swc/tests/tsc-references/enumAssignability_es5.2.minified.js b/crates/swc/tests/tsc-references/enumAssignability_es5.2.minified.js index 0ef61e2efba..63472c8a92a 100644 --- a/crates/swc/tests/tsc-references/enumAssignability_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumAssignability_es5.2.minified.js @@ -1,6 +1,4 @@ -(E = E || (E = { -}))[E.A = 0] = "A", (F = F || (F = { -}))[F.B = 0] = "B"; +(E = E || (E = {}))[E.A = 0] = "A", (F = F || (F = {}))[F.B = 0] = "B"; var E, F, E, F, Others, e = E.A, f = F.B; f = f, f = 1, (function(Others) { var C = function() { @@ -9,5 +7,4 @@ f = f, f = 1, (function(Others) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -})(Others || (Others = { -})); +})(Others || (Others = {})); diff --git a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.1.normal.js index 26244fc8ad5..5f377fbf99d 100644 --- a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.1.normal.js @@ -2,8 +2,7 @@ var // enums are only subtypes of number, any and no other types E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); class A { } class A2 { @@ -11,17 +10,13 @@ class A2 { var E2; (function(E2) { E2[E2["A"] = 0] = "A"; -})(E2 || (E2 = { -})); -function f() { -} +})(E2 || (E2 = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.2.minified.js index 52b7e57538e..5a9adcdfe32 100644 --- a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es2015.2.minified.js @@ -1,11 +1,6 @@ var E, E2, E, E2; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (E2 = E2 || (E2 = {}))[E2.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.1.normal.js b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.1.normal.js index 8435b37a8f4..034edc2c9ec 100644 --- a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.1.normal.js @@ -7,8 +7,7 @@ var // enums are only subtypes of number, any and no other types E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var A = function A() { "use strict"; _classCallCheck(this, A); @@ -20,19 +19,15 @@ var A2 = function A2() { var E2; (function(E2) { E2[E2["A"] = 0] = "A"; -})(E2 || (E2 = { -})); -function f() { -} +})(E2 || (E2 = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.2.minified.js b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.2.minified.js index b5c64ffecb3..e23b4ca10d6 100644 --- a/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumIsNotASubtypeOfAnythingButNumber_es5.2.minified.js @@ -1,8 +1,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; var E, E, E2, E2, A = function() { "use strict"; _classCallCheck(this, A); @@ -10,14 +9,10 @@ var E, E, E2, E2, A = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -(E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E2 = E2 || (E2 = {}))[E2.A = 0] = "A", (f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.1.normal.js index 4ecb56a618d..8b125f7faf5 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice[Choice["Unknown"] = 0] = "Unknown"; Choice[Choice["Yes"] = 1] = "Yes"; Choice[Choice["No"] = 2] = "No"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.2.minified.js index eb31f078dc0..cde9d49f11a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes1_es2015.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; +(Choice = Choice || (Choice = {}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.1.normal.js b/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.1.normal.js index 4ecb56a618d..8b125f7faf5 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice[Choice["Unknown"] = 0] = "Unknown"; Choice[Choice["Yes"] = 1] = "Yes"; Choice[Choice["No"] = 2] = "No"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.2.minified.js b/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.2.minified.js index eb31f078dc0..cde9d49f11a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes1_es5.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; +(Choice = Choice || (Choice = {}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.1.normal.js index 05ed7049006..9567b55da6a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.1.normal.js @@ -4,8 +4,7 @@ Choice; Choice[Choice["Unknown"] = 0] = "Unknown"; Choice[Choice["Yes"] = 1] = "Yes"; Choice[Choice["No"] = 2] = "No"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.2.minified.js index eb31f078dc0..cde9d49f11a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes2_es2015.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; +(Choice = Choice || (Choice = {}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.1.normal.js b/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.1.normal.js index 05ed7049006..9567b55da6a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.1.normal.js @@ -4,8 +4,7 @@ Choice; Choice[Choice["Unknown"] = 0] = "Unknown"; Choice[Choice["Yes"] = 1] = "Yes"; Choice[Choice["No"] = 2] = "No"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.2.minified.js b/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.2.minified.js index eb31f078dc0..cde9d49f11a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes2_es5.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; +(Choice = Choice || (Choice = {}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.1.normal.js index 0d55eba5f8a..ec34f71cfed 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice[Choice["Unknown"] = 0] = "Unknown"; Choice[Choice["Yes"] = 1] = "Yes"; Choice[Choice["No"] = 2] = "No"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1(a, b, c, d) { a = a; a = b; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.2.minified.js index eb31f078dc0..cde9d49f11a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes3_es2015.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; +(Choice = Choice || (Choice = {}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.1.normal.js b/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.1.normal.js index 0d55eba5f8a..ec34f71cfed 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice[Choice["Unknown"] = 0] = "Unknown"; Choice[Choice["Yes"] = 1] = "Yes"; Choice[Choice["No"] = 2] = "No"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1(a, b, c, d) { a = a; a = b; diff --git a/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.2.minified.js b/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.2.minified.js index eb31f078dc0..cde9d49f11a 100644 --- a/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumLiteralTypes3_es5.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; +(Choice = Choice || (Choice = {}))[Choice.Unknown = 0] = "Unknown", Choice[Choice.Yes = 1] = "Yes", Choice[Choice.No = 2] = "No"; diff --git a/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.1.normal.js index f4ba215e184..073cd6c5114 100644 --- a/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.1.normal.js @@ -1,5 +1,4 @@ // @Filename: enums.js -lf.Order = { -}; +lf.Order = {}; lf.Order.DESC = 0; lf.Order.ASC = 1; diff --git a/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.2.minified.js index f750d51a6b2..4d2085c2c81 100644 --- a/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumMergeWithExpando_es2015.2.minified.js @@ -1,2 +1 @@ -lf.Order = { -}, lf.Order.DESC = 0, lf.Order.ASC = 1; +lf.Order = {}, lf.Order.DESC = 0, lf.Order.ASC = 1; diff --git a/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.1.normal.js b/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.1.normal.js index f4ba215e184..073cd6c5114 100644 --- a/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.1.normal.js @@ -1,5 +1,4 @@ // @Filename: enums.js -lf.Order = { -}; +lf.Order = {}; lf.Order.DESC = 0; lf.Order.ASC = 1; diff --git a/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.2.minified.js b/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.2.minified.js index f750d51a6b2..4d2085c2c81 100644 --- a/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumMergeWithExpando_es5.2.minified.js @@ -1,2 +1 @@ -lf.Order = { -}, lf.Order.DESC = 0, lf.Order.ASC = 1; +lf.Order = {}, lf.Order.DESC = 0, lf.Order.ASC = 1; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.1.normal.js index fbf688d8deb..f8444896943 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.1.normal.js @@ -2,5 +2,4 @@ // @allowjs: true // @checkjs: true // @noemit: true -/** @enum {string} */ module.exports = { -}; +/** @enum {string} */ module.exports = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.2.minified.js index 7be35b6b6e7..f053ebf7976 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports2_es2015.2.minified.js @@ -1,2 +1 @@ -module.exports = { -}; +module.exports = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports2_es5.1.normal.js b/crates/swc/tests/tsc-references/enumTagOnExports2_es5.1.normal.js index fbf688d8deb..f8444896943 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports2_es5.1.normal.js @@ -2,5 +2,4 @@ // @allowjs: true // @checkjs: true // @noemit: true -/** @enum {string} */ module.exports = { -}; +/** @enum {string} */ module.exports = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports2_es5.2.minified.js b/crates/swc/tests/tsc-references/enumTagOnExports2_es5.2.minified.js index 7be35b6b6e7..f053ebf7976 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports2_es5.2.minified.js @@ -1,2 +1 @@ -module.exports = { -}; +module.exports = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumTagOnExports_es2015.1.normal.js index a77aa7876a1..a816e390e36 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports_es2015.1.normal.js @@ -2,7 +2,5 @@ // @allowjs: true // @checkjs: true // @noemit: true -/** @enum {number} */ exports.a = { -}; -/** @enum {string} */ module.exports.b = { -}; +/** @enum {number} */ exports.a = {}; +/** @enum {string} */ module.exports.b = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports_es2015.2.minified.js b/crates/swc/tests/tsc-references/enumTagOnExports_es2015.2.minified.js index c40e7a515db..530236e8fda 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports_es2015.2.minified.js @@ -1,3 +1 @@ -exports.a = { -}, module.exports.b = { -}; +exports.a = {}, module.exports.b = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports_es5.1.normal.js b/crates/swc/tests/tsc-references/enumTagOnExports_es5.1.normal.js index a77aa7876a1..a816e390e36 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports_es5.1.normal.js @@ -2,7 +2,5 @@ // @allowjs: true // @checkjs: true // @noemit: true -/** @enum {number} */ exports.a = { -}; -/** @enum {string} */ module.exports.b = { -}; +/** @enum {number} */ exports.a = {}; +/** @enum {string} */ module.exports.b = {}; diff --git a/crates/swc/tests/tsc-references/enumTagOnExports_es5.2.minified.js b/crates/swc/tests/tsc-references/enumTagOnExports_es5.2.minified.js index c40e7a515db..530236e8fda 100644 --- a/crates/swc/tests/tsc-references/enumTagOnExports_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/enumTagOnExports_es5.2.minified.js @@ -1,3 +1 @@ -exports.a = { -}, module.exports.b = { -}; +exports.a = {}, module.exports.b = {}; diff --git a/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es2015.1.normal.js b/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es2015.1.normal.js index 0356bcffa75..0976f9315b1 100644 --- a/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es2015.1.normal.js @@ -4,8 +4,7 @@ // @Filename: bug27134.js /** * @enum {number} - */ var foo = { -}; + */ var foo = {}; /** * @type {foo} */ var s; diff --git a/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es5.1.normal.js b/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es5.1.normal.js index 0356bcffa75..0976f9315b1 100644 --- a/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagUseBeforeDefCrash_es5.1.normal.js @@ -4,8 +4,7 @@ // @Filename: bug27134.js /** * @enum {number} - */ var foo = { -}; + */ var foo = {}; /** * @type {foo} */ var s; diff --git a/crates/swc/tests/tsc-references/equalityStrictNulls_es2015.1.normal.js b/crates/swc/tests/tsc-references/equalityStrictNulls_es2015.1.normal.js index 874a9905306..2c191f71831 100644 --- a/crates/swc/tests/tsc-references/equalityStrictNulls_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/equalityStrictNulls_es2015.1.normal.js @@ -1,67 +1,39 @@ // @strictNullChecks: true function f1(x) { - if (x == undefined) { - } - if (x != undefined) { - } - if (x === undefined) { - } - if (x !== undefined) { - } - if (x == null) { - } - if (x != null) { - } - if (x === null) { - } - if (x !== null) { - } - if (undefined == x) { - } - if (undefined != x) { - } - if (undefined === x) { - } - if (undefined !== x) { - } - if (null == x) { - } - if (null != x) { - } - if (null === x) { - } - if (null !== x) { - } + if (x == undefined) {} + if (x != undefined) {} + if (x === undefined) {} + if (x !== undefined) {} + if (x == null) {} + if (x != null) {} + if (x === null) {} + if (x !== null) {} + if (undefined == x) {} + if (undefined != x) {} + if (undefined === x) {} + if (undefined !== x) {} + if (null == x) {} + if (null != x) {} + if (null === x) {} + if (null !== x) {} } function f2() { - if (undefined == undefined) { - } - if (undefined == null) { - } - if (null == undefined) { - } - if (null == null) { - } + if (undefined == undefined) {} + if (undefined == null) {} + if (null == undefined) {} + if (null == null) {} } function f3(a, b, c, d) { - if (a == null) { - } - if (b == null) { - } - if (c == null) { - } - if (d == null) { - } + if (a == null) {} + if (b == null) {} + if (c == null) {} + if (d == null) {} } function f4(x) { - if (x > undefined) { - } - if (x < undefined) { - } - if (x >= undefined) { - } - if (x <= undefined) { - } + if (x > undefined) {} + if (x < undefined) {} + if (x >= undefined) {} + if (x <= undefined) {} } function f5(x) { switch(x){ diff --git a/crates/swc/tests/tsc-references/equalityStrictNulls_es5.1.normal.js b/crates/swc/tests/tsc-references/equalityStrictNulls_es5.1.normal.js index 874a9905306..2c191f71831 100644 --- a/crates/swc/tests/tsc-references/equalityStrictNulls_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/equalityStrictNulls_es5.1.normal.js @@ -1,67 +1,39 @@ // @strictNullChecks: true function f1(x) { - if (x == undefined) { - } - if (x != undefined) { - } - if (x === undefined) { - } - if (x !== undefined) { - } - if (x == null) { - } - if (x != null) { - } - if (x === null) { - } - if (x !== null) { - } - if (undefined == x) { - } - if (undefined != x) { - } - if (undefined === x) { - } - if (undefined !== x) { - } - if (null == x) { - } - if (null != x) { - } - if (null === x) { - } - if (null !== x) { - } + if (x == undefined) {} + if (x != undefined) {} + if (x === undefined) {} + if (x !== undefined) {} + if (x == null) {} + if (x != null) {} + if (x === null) {} + if (x !== null) {} + if (undefined == x) {} + if (undefined != x) {} + if (undefined === x) {} + if (undefined !== x) {} + if (null == x) {} + if (null != x) {} + if (null === x) {} + if (null !== x) {} } function f2() { - if (undefined == undefined) { - } - if (undefined == null) { - } - if (null == undefined) { - } - if (null == null) { - } + if (undefined == undefined) {} + if (undefined == null) {} + if (null == undefined) {} + if (null == null) {} } function f3(a, b, c, d) { - if (a == null) { - } - if (b == null) { - } - if (c == null) { - } - if (d == null) { - } + if (a == null) {} + if (b == null) {} + if (c == null) {} + if (d == null) {} } function f4(x) { - if (x > undefined) { - } - if (x < undefined) { - } - if (x >= undefined) { - } - if (x <= undefined) { - } + if (x > undefined) {} + if (x < undefined) {} + if (x >= undefined) {} + if (x <= undefined) {} } function f5(x) { switch(x){ diff --git a/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es2015.1.normal.js b/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es2015.1.normal.js index 19ea154a1f1..82dc65a1ee1 100644 --- a/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es2015.1.normal.js @@ -5,8 +5,4 @@ var x = { }; var y = x; var z = x; -if (y === z || z === y) { -} else if (y !== z || z !== y) { -} else if (y == z || z == y) { -} else if (y != z || z != y) { -} +if (y === z || z === y) {} else if (y !== z || z !== y) {} else if (y == z || z == y) {} else if (y != z || z != y) {} diff --git a/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es5.1.normal.js b/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es5.1.normal.js index 19ea154a1f1..82dc65a1ee1 100644 --- a/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/equalityWithIntersectionTypes01_es5.1.normal.js @@ -5,8 +5,4 @@ var x = { }; var y = x; var z = x; -if (y === z || z === y) { -} else if (y !== z || z !== y) { -} else if (y == z || z == y) { -} else if (y != z || z != y) { -} +if (y === z || z === y) {} else if (y !== z || z !== y) {} else if (y == z || z == y) {} else if (y != z || z != y) {} diff --git a/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es2015.1.normal.js b/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es2015.1.normal.js index ec6502ab80f..5e33bf4fceb 100644 --- a/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es2015.1.normal.js @@ -4,8 +4,4 @@ var x = { }; var y = x; var z = x; -if (y === z || z === y) { -} else if (y !== z || z !== y) { -} else if (y == z || z == y) { -} else if (y != z || z != y) { -} +if (y === z || z === y) {} else if (y !== z || z !== y) {} else if (y == z || z == y) {} else if (y != z || z != y) {} diff --git a/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es5.1.normal.js b/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es5.1.normal.js index ec6502ab80f..5e33bf4fceb 100644 --- a/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/equalityWithUnionTypes01_es5.1.normal.js @@ -4,8 +4,4 @@ var x = { }; var y = x; var z = x; -if (y === z || z === y) { -} else if (y !== z || z !== y) { -} else if (y == z || z == y) { -} else if (y != z || z != y) { -} +if (y === z || z === y) {} else if (y !== z || z !== y) {} else if (y == z || z == y) {} else if (y != z || z != y) {} diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.1.normal.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.1.normal.js index 520b28f77b9..ff722ce6767 100644 --- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.1.normal.js @@ -26,14 +26,10 @@ class NoBase { } } class SomeBase { - privateFunc() { - } - publicFunc() { - } - static privateStaticFunc() { - } - static publicStaticFunc() { - } + privateFunc() {} + publicFunc() {} + static privateStaticFunc() {} + static publicStaticFunc() {} constructor(){ this.privateMember = 0; this.publicMember = 0; diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.2.minified.js index dbc0e99531d..a0d8d8760c7 100644 --- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es2015.2.minified.js @@ -1,12 +1,8 @@ class SomeBase { - privateFunc() { - } - publicFunc() { - } - static privateStaticFunc() { - } - static publicStaticFunc() { - } + privateFunc() {} + publicFunc() {} + static privateStaticFunc() {} + static publicStaticFunc() {} constructor(){ this.privateMember = 0, this.publicMember = 0; } diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.1.normal.js index b747b9107fc..cc00ff152f6 100644 --- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.1.normal.js @@ -137,8 +137,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -209,24 +208,20 @@ var SomeBase = /*#__PURE__*/ function() { _createClass(SomeBase, [ { key: "privateFunc", - value: function privateFunc() { - } + value: function privateFunc() {} }, { key: "publicFunc", - value: function publicFunc() { - } + value: function publicFunc() {} } ], [ { key: "privateStaticFunc", - value: function privateStaticFunc() { - } + value: function privateStaticFunc() {} }, { key: "publicStaticFunc", - value: function publicStaticFunc() { - } + value: function publicStaticFunc() {} } ]); return SomeBase; diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.2.minified.js index e9bcb5d1432..c81108746ca 100644 --- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess_es5.2.minified.js @@ -76,8 +76,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -128,24 +127,20 @@ var NoBase = function() { return _createClass(SomeBase, [ { key: "privateFunc", - value: function() { - } + value: function() {} }, { key: "publicFunc", - value: function() { - } + value: function() {} } ], [ { key: "privateStaticFunc", - value: function() { - } + value: function() {} }, { key: "publicStaticFunc", - value: function() { - } + value: function() {} } ]), SomeBase; }(); @@ -177,8 +172,7 @@ var SomeDerived1 = function(SomeBase) { }, { key: "fn2", - value: function() { - } + value: function() {} } ]), SomeDerived1; }(SomeBase), SomeDerived2 = function(SomeBase) { diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.1.normal.js index a496f351bbd..ed6bb45d834 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.1.normal.js @@ -2,8 +2,7 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } // @target: es2015 // @sourcemap: false diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.2.minified.js index 1dd168fa437..6d844c9d816 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES2015Target_es2015.2.minified.js @@ -2,7 +2,6 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } export { A as default }; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.1.normal.js index fdcf9d6ce5e..22088586e30 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.1.normal.js @@ -4,32 +4,24 @@ export class C { } (function(C1) { var x = C1.x = 1; -})(C || (C = { -})); +})(C || (C = {})); export var E; (function(E) { E[E["w"] = 1] = "w"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { E[E["x"] = 2] = "x"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var y = E.y = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var z = E.z = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(N) { var x = N.x = 1; -})(N || (N = { -})); -export function F() { -} +})(N || (N = {})); +export function F() {} (function(F1) { var x = F1.x = 1; -})(F || (F = { -})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.2.minified.js index fab18a343c9..d8d42434a55 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es2015.2.minified.js @@ -1,14 +1,6 @@ var E, E, E; export class C { } -(C || (C = { -})).x = 1, (E = E || (E = { -}))[E.w = 1] = "w", (E = E || (E = { -}))[E.x = 2] = "x", (E || (E = { -})).y = 1, (E || (E = { -})).z = 1, (N || (N = { -})).x = 1; -export function F() { -} -(F || (F = { -})).x = 1; +(C || (C = {})).x = 1, (E = E || (E = {}))[E.w = 1] = "w", (E = E || (E = {}))[E.x = 2] = "x", (E || (E = {})).y = 1, (E || (E = {})).z = 1, (N || (N = {})).x = 1; +export function F() {} +(F || (F = {})).x = 1; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.1.normal.js index 1be9696b03d..94a5c6f553b 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.1.normal.js @@ -11,32 +11,24 @@ export var C = function C() { }; (function(C) { var x = C.x = 1; -})(C || (C = { -})); +})(C || (C = {})); export var E; (function(E) { E[E["w"] = 1] = "w"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { E[E["x"] = 2] = "x"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var y = E.y = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var z = E.z = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(N) { var x = N.x = 1; -})(N || (N = { -})); -export function F() { -} +})(N || (N = {})); +export function F() {} (function(F1) { var x = F1.x = 1; -})(F || (F = { -})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.2.minified.js index e3e8e6fb001..ab17ca4acad 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target12_es5.2.minified.js @@ -4,14 +4,6 @@ export var E, E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(C || (C = { -})).x = 1, (E = E || (E = { -}))[E.w = 1] = "w", (E = E || (E = { -}))[E.x = 2] = "x", (E || (E = { -})).y = 1, (E || (E = { -})).z = 1, (N || (N = { -})).x = 1; -export function F() { -} -(F || (F = { -})).x = 1; +(C || (C = {})).x = 1, (E = E || (E = {}))[E.w = 1] = "w", (E = E || (E = {}))[E.x = 2] = "x", (E || (E = {})).y = 1, (E || (E = {})).z = 1, (N || (N = {})).x = 1; +export function F() {} +(F || (F = {})).x = 1; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.1.normal.js index 39c2d2ce092..f66b28f30e7 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.1.normal.js @@ -1,6 +1,5 @@ class C { - method() { - } + method() {} constructor(){ this.p = 1; } diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.2.minified.js index e5a14e62c25..16ad93928ad 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es2015.2.minified.js @@ -1,6 +1,5 @@ class C { - method() { - } + method() {} constructor(){ this.p = 1; } diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.1.normal.js index ab6e6125525..3d9c8eed786 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.1.normal.js @@ -26,8 +26,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.2.minified.js index 47859bc7d34..02594fbaf5d 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target2_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "method", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.1.normal.js index 55833d3eec7..008bfaf005c 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.1.normal.js @@ -1,10 +1,8 @@ export var E1; (function(E1) { E1[E1["value1"] = 0] = "value1"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); export var E2; (function(E2) { E2[E2["value1"] = 0] = "value1"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.2.minified.js index 919f976bb18..3fad8a36aa1 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es2015.2.minified.js @@ -1,4 +1,2 @@ var E1, E2, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = { -}))[E2.value1 = 0] = "value1"; +(E1 = E1 || (E1 = {}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = {}))[E2.value1 = 0] = "value1"; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.1.normal.js index 55833d3eec7..008bfaf005c 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.1.normal.js @@ -1,10 +1,8 @@ export var E1; (function(E1) { E1[E1["value1"] = 0] = "value1"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); export var E2; (function(E2) { E2[E2["value1"] = 0] = "value1"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.2.minified.js index 919f976bb18..3fad8a36aa1 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target5_es5.2.minified.js @@ -1,4 +1,2 @@ var E1, E2, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = { -}))[E2.value1 = 0] = "value1"; +(E1 = E1 || (E1 = {}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = {}))[E2.value1 = 0] = "value1"; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.1.normal.js index 58e00205ca5..2bd4e2eeace 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.1.normal.js @@ -1,8 +1,5 @@ // @target: es5 // @module: es2015 -export function f1(d = 0) { -} -export function f2(...arg) { -} -export default function f3(d = 0) { -}; +export function f1(d = 0) {} +export function f2(...arg) {} +export default function f3(d = 0) {}; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.2.minified.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.2.minified.js index d55a63330b0..979eea65fe2 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target6_es2015.2.minified.js @@ -1,6 +1,3 @@ -export function f1(d = 0) { -} -export function f2(...arg) { -} -export default function f3(d = 0) { -}; +export function f1(d = 0) {} +export function f2(...arg) {} +export default function f3(d = 0) {}; diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es2015.1.normal.js index ce83f9ec935..badc78b77ee 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es2015.1.normal.js @@ -3,5 +3,4 @@ export var N; (function(N) { var x = 0; -})(N || (N = { -})); +})(N || (N = {})); diff --git a/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es5.1.normal.js b/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es5.1.normal.js index ce83f9ec935..badc78b77ee 100644 --- a/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekindWithES5Target7_es5.1.normal.js @@ -3,5 +3,4 @@ export var N; (function(N) { var x = 0; -})(N || (N = { -})); +})(N || (N = {})); diff --git a/crates/swc/tests/tsc-references/es6modulekind_es2015.1.normal.js b/crates/swc/tests/tsc-references/es6modulekind_es2015.1.normal.js index 17015f93e99..2824c821f54 100644 --- a/crates/swc/tests/tsc-references/es6modulekind_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/es6modulekind_es2015.1.normal.js @@ -2,8 +2,7 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } // @target: ES6 // @sourcemap: false diff --git a/crates/swc/tests/tsc-references/es6modulekind_es2015.2.minified.js b/crates/swc/tests/tsc-references/es6modulekind_es2015.2.minified.js index 1dd168fa437..6d844c9d816 100644 --- a/crates/swc/tests/tsc-references/es6modulekind_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/es6modulekind_es2015.2.minified.js @@ -2,7 +2,6 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } export { A as default }; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.1.normal.js index a496f351bbd..ed6bb45d834 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.1.normal.js @@ -2,8 +2,7 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } // @target: es2015 // @sourcemap: false diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.2.minified.js index 1dd168fa437..6d844c9d816 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES2015Target_es2015.2.minified.js @@ -2,7 +2,6 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } export { A as default }; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.1.normal.js index 0e39182216b..4c144be653e 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.1.normal.js @@ -4,32 +4,24 @@ export class C { } (function(C1) { var x = C1.x = 1; -})(C || (C = { -})); +})(C || (C = {})); export var E; (function(E) { E[E["w"] = 1] = "w"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { E[E["x"] = 2] = "x"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var y = E.y = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var z = E.z = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(N) { var x = N.x = 1; -})(N || (N = { -})); -export function F() { -} +})(N || (N = {})); +export function F() {} (function(F1) { var x = F1.x = 1; -})(F || (F = { -})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.2.minified.js index fab18a343c9..d8d42434a55 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es2015.2.minified.js @@ -1,14 +1,6 @@ var E, E, E; export class C { } -(C || (C = { -})).x = 1, (E = E || (E = { -}))[E.w = 1] = "w", (E = E || (E = { -}))[E.x = 2] = "x", (E || (E = { -})).y = 1, (E || (E = { -})).z = 1, (N || (N = { -})).x = 1; -export function F() { -} -(F || (F = { -})).x = 1; +(C || (C = {})).x = 1, (E = E || (E = {}))[E.w = 1] = "w", (E = E || (E = {}))[E.x = 2] = "x", (E || (E = {})).y = 1, (E || (E = {})).z = 1, (N || (N = {})).x = 1; +export function F() {} +(F || (F = {})).x = 1; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.1.normal.js index e4097064a66..8e8f1ec53e4 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.1.normal.js @@ -11,32 +11,24 @@ export var C = function C() { }; (function(C) { var x = C.x = 1; -})(C || (C = { -})); +})(C || (C = {})); export var E; (function(E) { E[E["w"] = 1] = "w"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { E[E["x"] = 2] = "x"; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var y = E.y = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(E) { var z = E.z = 1; -})(E || (E = { -})); +})(E || (E = {})); (function(N) { var x = N.x = 1; -})(N || (N = { -})); -export function F() { -} +})(N || (N = {})); +export function F() {} (function(F1) { var x = F1.x = 1; -})(F || (F = { -})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.2.minified.js index e3e8e6fb001..ab17ca4acad 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target12_es5.2.minified.js @@ -4,14 +4,6 @@ export var E, E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(C || (C = { -})).x = 1, (E = E || (E = { -}))[E.w = 1] = "w", (E = E || (E = { -}))[E.x = 2] = "x", (E || (E = { -})).y = 1, (E || (E = { -})).z = 1, (N || (N = { -})).x = 1; -export function F() { -} -(F || (F = { -})).x = 1; +(C || (C = {})).x = 1, (E = E || (E = {}))[E.w = 1] = "w", (E = E || (E = {}))[E.x = 2] = "x", (E || (E = {})).y = 1, (E || (E = {})).z = 1, (N || (N = {})).x = 1; +export function F() {} +(F || (F = {})).x = 1; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.1.normal.js index 833b57a487b..71008b5a0c1 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.1.normal.js @@ -1,6 +1,5 @@ class C { - method() { - } + method() {} constructor(){ this.p = 1; } diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.2.minified.js index e5a14e62c25..16ad93928ad 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es2015.2.minified.js @@ -1,6 +1,5 @@ class C { - method() { - } + method() {} constructor(){ this.p = 1; } diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.1.normal.js index a859afe2c07..0c4c5b09cca 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.1.normal.js @@ -26,8 +26,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.2.minified.js index 47859bc7d34..02594fbaf5d 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target2_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "method", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.1.normal.js index 55833d3eec7..008bfaf005c 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.1.normal.js @@ -1,10 +1,8 @@ export var E1; (function(E1) { E1[E1["value1"] = 0] = "value1"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); export var E2; (function(E2) { E2[E2["value1"] = 0] = "value1"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.2.minified.js index 919f976bb18..3fad8a36aa1 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es2015.2.minified.js @@ -1,4 +1,2 @@ var E1, E2, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = { -}))[E2.value1 = 0] = "value1"; +(E1 = E1 || (E1 = {}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = {}))[E2.value1 = 0] = "value1"; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.1.normal.js index 55833d3eec7..008bfaf005c 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.1.normal.js @@ -1,10 +1,8 @@ export var E1; (function(E1) { E1[E1["value1"] = 0] = "value1"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); export var E2; (function(E2) { E2[E2["value1"] = 0] = "value1"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.2.minified.js index 919f976bb18..3fad8a36aa1 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target5_es5.2.minified.js @@ -1,4 +1,2 @@ var E1, E2, E1, E2; -(E1 = E1 || (E1 = { -}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = { -}))[E2.value1 = 0] = "value1"; +(E1 = E1 || (E1 = {}))[E1.value1 = 0] = "value1", (E2 = E2 || (E2 = {}))[E2.value1 = 0] = "value1"; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.1.normal.js index e576cb2e9ef..4ca8c8f7844 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.1.normal.js @@ -1,8 +1,5 @@ // @target: es5 // @module: esnext -export function f1(d = 0) { -} -export function f2(...arg) { -} -export default function f3(d = 0) { -}; +export function f1(d = 0) {} +export function f2(...arg) {} +export default function f3(d = 0) {}; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.2.minified.js index d55a63330b0..979eea65fe2 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target6_es2015.2.minified.js @@ -1,6 +1,3 @@ -export function f1(d = 0) { -} -export function f2(...arg) { -} -export default function f3(d = 0) { -}; +export function f1(d = 0) {} +export function f2(...arg) {} +export default function f3(d = 0) {}; diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es2015.1.normal.js index 3a018fe91e4..70c231b0e01 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es2015.1.normal.js @@ -3,5 +3,4 @@ export var N; (function(N) { var x = 0; -})(N || (N = { -})); +})(N || (N = {})); diff --git a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es5.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es5.1.normal.js index 3a018fe91e4..70c231b0e01 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekindWithES5Target7_es5.1.normal.js @@ -3,5 +3,4 @@ export var N; (function(N) { var x = 0; -})(N || (N = { -})); +})(N || (N = {})); diff --git a/crates/swc/tests/tsc-references/esnextmodulekind_es2015.1.normal.js b/crates/swc/tests/tsc-references/esnextmodulekind_es2015.1.normal.js index 4df8a245370..be878df79e3 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekind_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/esnextmodulekind_es2015.1.normal.js @@ -2,8 +2,7 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } // @target: ES6 // @sourcemap: false diff --git a/crates/swc/tests/tsc-references/esnextmodulekind_es2015.2.minified.js b/crates/swc/tests/tsc-references/esnextmodulekind_es2015.2.minified.js index 1dd168fa437..6d844c9d816 100644 --- a/crates/swc/tests/tsc-references/esnextmodulekind_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/esnextmodulekind_es2015.2.minified.js @@ -2,7 +2,6 @@ class A { B() { return 42; } - constructor(){ - } + constructor(){} } export { A as default }; diff --git a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.1.normal.js index e57401fa945..253f69ef4c2 100644 --- a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.1.normal.js @@ -6,8 +6,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b; var c; diff --git a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.2.minified.js b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.1.normal.js b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.1.normal.js index 19c1e167bf5..b23024f8525 100644 --- a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.1.normal.js @@ -13,8 +13,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b; var c; diff --git a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.2.minified.js b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.2.minified.js index b3226de6741..f70e6cc54e8 100644 --- a/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeAssignableToAny_es5.2.minified.js @@ -4,5 +4,4 @@ var E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.1.normal.js index 1c461ce5dfb..1028472e491 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.1.normal.js @@ -14,8 +14,7 @@ var M; return x.toString(); } M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var aNumber = 9.9; var aString = 'this is a string'; var aDate = new Date(12); diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.2.minified.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.2.minified.js index b8e3225c3e0..3eac83e8b24 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es2015.2.minified.js @@ -1,8 +1,7 @@ var M, M1; class C { } -(M = M1 || (M1 = { -})).A = class { +(M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); }, new Date(12), new Object(), new C(), new C(), new class { diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.1.normal.js index cd06532e472..4bf1ed5a41e 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.1.normal.js @@ -25,8 +25,7 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var aNumber = 9.9; var aString = 'this is a string'; var aDate = new Date(12); diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.2.minified.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.2.minified.js index 759c6fa613a..f51d7949e56 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer_es5.2.minified.js @@ -16,5 +16,4 @@ var M, C = function() { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -})), new Date(12), new Object(), new C(), new C(), new D(), new C(), new M.A(); +}(M || (M = {})), new Date(12), new Object(), new C(), new C(), new D(), new C(), new M.A(); diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.1.normal.js index 77d9c8c9850..8ebb582d197 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.1.normal.js @@ -17,8 +17,7 @@ var M; return x.toString(); } M1.F2 = F21; -})(M || (M = { -})); +})(M || (M = {})); var N; (function(N1) { class A { @@ -28,8 +27,7 @@ var N; return x.toString(); } N1.F2 = F22; -})(N || (N = { -})); +})(N || (N = {})); var aNumber = 'this is a string'; var aString = 9.9; var aDate = 9.9; diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.2.minified.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.2.minified.js index b356525d4ed..56b4282993e 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es2015.2.minified.js @@ -3,12 +3,10 @@ class C { } class D { } -(M = M1 || (M1 = { -})).A = class { +(M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); -}, (N = N1 || (N1 = { -})).A = class { +}, (N = N1 || (N1 = {})).A = class { }, N.F2 = function(x) { return x.toString(); }, new D(), new D(), new C(), new C(), new N1.A(); diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.1.normal.js index 1610e81874e..2c8f615c35a 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.1.normal.js @@ -28,8 +28,7 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var N; (function(N1) { var F2 = function F2(x) { @@ -41,8 +40,7 @@ var N; }; N1.A = A; N1.F2 = F2; -})(N || (N = { -})); +})(N || (N = {})); var aNumber = 'this is a string'; var aString = 9.9; var aDate = 9.9; diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.2.minified.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.2.minified.js index c3887d3daeb..a9c8ce944c3 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer_es5.2.minified.js @@ -16,8 +16,7 @@ var M, N, C = function() { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -})(M || (M = { -})), (function(N1) { +})(M || (M = {})), (function(N1) { var A = function() { "use strict"; _classCallCheck(this, A); @@ -25,5 +24,4 @@ var M, N, C = function() { N1.A = A, N1.F2 = function(x) { return x.toString(); }; -})(N || (N = { -})), new D(), new D(), new C(), new C(), new N.A(); +})(N || (N = {})), new D(), new D(), new C(), new C(), new N.A(); diff --git a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.1.normal.js index d8de90cd15e..1ec67996513 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.1.normal.js @@ -14,8 +14,7 @@ var M; return x1.toString(); } M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var aNumber = 9.9; var aString = 'this is a string'; var aDate = new Date(12); diff --git a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.2.minified.js b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.2.minified.js index 8cebba660a3..f7c2f0c6b72 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es2015.2.minified.js @@ -1,8 +1,7 @@ var M, M1; class C { } -(M = M1 || (M1 = { -})).A = class { +(M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); }, new Date(12), new Object(), new C(), new C(), new class { diff --git a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.1.normal.js index 8a39c5f3ec8..7e8ff4edccf 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.1.normal.js @@ -25,8 +25,7 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var aNumber = 9.9; var aString = 'this is a string'; var aDate = new Date(12); diff --git a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.2.minified.js b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.2.minified.js index 2a03646a634..c340d095f19 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/everyTypeWithInitializer_es5.2.minified.js @@ -16,5 +16,4 @@ var M, C = function() { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -})), new Date(12), new Object(), new C(), new C(), new D(), new M.A(), M.F2; +}(M || (M = {})), new Date(12), new Object(), new C(), new C(), new D(), new M.A(), M.F2; diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js index 10b8036aa35..abcef1475b8 100644 --- a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js @@ -9,14 +9,12 @@ export const config = { x: 0 }; // Expando declarations aren't allowed on aliases. -Vue.config = { -}; +Vue.config = {}; new Vue(); // This is not an expando declaration; it's just a plain property assignment. config.x = 1; // This is not an expando declaration; it works because non-strict JS allows // loosey goosey assignment on objects. -config.y = { -}; +config.y = {}; config.x; config.y; diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js index 5b780d53e69..6f788f1a117 100644 --- a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js @@ -3,6 +3,4 @@ export class Vue { export const config = { x: 0 }; -Vue.config = { -}, new Vue(), config.x = 1, config.y = { -}, config.x, config.y; +Vue.config = {}, new Vue(), config.x = 1, config.y = {}, config.x, config.y; diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js index 441d7afe29b..2cb1ec5ebf8 100644 --- a/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js @@ -16,14 +16,12 @@ export var config = { x: 0 }; // Expando declarations aren't allowed on aliases. -Vue.config = { -}; +Vue.config = {}; new Vue(); // This is not an expando declaration; it's just a plain property assignment. config.x = 1; // This is not an expando declaration; it works because non-strict JS allows // loosey goosey assignment on objects. -config.y = { -}; +config.y = {}; config.x; config.y; diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js index 15413b79a48..61298ea2b8d 100644 --- a/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js @@ -7,6 +7,4 @@ export var Vue = function() { export var config = { x: 0 }; -Vue.config = { -}, new Vue(), config.x = 1, config.y = { -}, config.x, config.y; +Vue.config = {}, new Vue(), config.x = 1, config.y = {}, config.x, config.y; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.1.normal.js index 4fd24a61af3..57a4d6449e3 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.1.normal.js @@ -3,14 +3,12 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["c"] = 0] = "c"; F[F["d"] = 1] = "d"; -})(F || (F = { -})); +})(F || (F = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.2.minified.js index 673f35ceec5..88111fa90ae 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es2015.2.minified.js @@ -1,4 +1,2 @@ var E, F, E, F, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = { -}))[F.c = 0] = "c", F[F.d = 1] = "d", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = {}))[F.c = 0] = "c", F[F.d = 1] = "d", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.1.normal.js index 4fd24a61af3..57a4d6449e3 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.1.normal.js @@ -3,14 +3,12 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["c"] = 0] = "c"; F[F["d"] = 1] = "d"; -})(F || (F = { -})); +})(F || (F = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.2.minified.js index 673f35ceec5..88111fa90ae 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnumUnion_es5.2.minified.js @@ -1,4 +1,2 @@ var E, F, E, F, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = { -}))[F.c = 0] = "c", F[F.d = 1] = "d", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", (F = F || (F = {}))[F.c = 0] = "c", F[F.d = 1] = "d", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.1.normal.js index ca1ce3acf2b..2ae72937e90 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.1.normal.js @@ -3,8 +3,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.2.minified.js index 2df93e78279..47878c9d508 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.1.normal.js index ca1ce3acf2b..2ae72937e90 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.1.normal.js @@ -3,8 +3,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.2.minified.js index 2df93e78279..47878c9d508 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithEnum_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(c, a), Math.pow(c, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, E.b), Math.pow(E.a, 1), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(1, E.b); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.1.normal.js index da21a7b1afd..a8b853d4374 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.1.normal.js @@ -5,8 +5,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.2.minified.js index fbde11f508c..07ffad55093 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c, d, e, f; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", Math.pow(a, a), Math.pow(a, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, c), Math.pow(E.a, d), Math.pow(E.a, e), Math.pow(E.a, f), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(c, E.b), Math.pow(d, E.b), Math.pow(e, E.b), Math.pow(f, E.b); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", Math.pow(a, a), Math.pow(a, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, c), Math.pow(E.a, d), Math.pow(E.a, e), Math.pow(E.a, f), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(c, E.b), Math.pow(d, E.b), Math.pow(e, E.b), Math.pow(f, E.b); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.1.normal.js index da21a7b1afd..a8b853d4374 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.1.normal.js @@ -5,8 +5,7 @@ E; E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; E[E["c"] = 2] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; var c; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.2.minified.js index fbde11f508c..07ffad55093 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidOperands_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b, c, d, e, f; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", Math.pow(a, a), Math.pow(a, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, c), Math.pow(E.a, d), Math.pow(E.a, e), Math.pow(E.a, f), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(c, E.b), Math.pow(d, E.b), Math.pow(e, E.b), Math.pow(f, E.b); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c", Math.pow(a, a), Math.pow(a, b), Math.pow(E.a, a), Math.pow(E.a, b), Math.pow(E.a, c), Math.pow(E.a, d), Math.pow(E.a, e), Math.pow(E.a, f), Math.pow(a, E.b), Math.pow(b, E.b), Math.pow(c, E.b), Math.pow(d, E.b), Math.pow(e, E.b), Math.pow(f, E.b); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js index 32ff543b99a..189653bae94 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es2015.1.normal.js @@ -12,9 +12,7 @@ var r1b2 = Math.pow(b, null); var r1b3 = Math.pow(c, null); var r1c1 = Math.pow(null, true); var r1c2 = Math.pow(null, ''); -var r1c3 = Math.pow(null, { -}); +var r1c3 = Math.pow(null, {}); var r1d1 = Math.pow(true, null); var r1d2 = Math.pow('', null); -var r1d3 = Math.pow({ -}, null); +var r1d3 = Math.pow({}, null); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es5.1.normal.js index 32ff543b99a..189653bae94 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands_es5.1.normal.js @@ -12,9 +12,7 @@ var r1b2 = Math.pow(b, null); var r1b3 = Math.pow(c, null); var r1c1 = Math.pow(null, true); var r1c2 = Math.pow(null, ''); -var r1c3 = Math.pow(null, { -}); +var r1c3 = Math.pow(null, {}); var r1d1 = Math.pow(true, null); var r1d2 = Math.pow('', null); -var r1d3 = Math.pow({ -}, null); +var r1d3 = Math.pow({}, null); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.1.normal.js index f9da523358f..5463986b77a 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator ** diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.2.minified.js index 400154f735a..9fd18c0574f 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(null, a), Math.pow(null, b), Math.pow(null, E.a), Math.pow(E.b, null); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(null, a), Math.pow(null, b), Math.pow(null, E.a), Math.pow(E.b, null); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.1.normal.js index f9da523358f..5463986b77a 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator ** diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.2.minified.js index 400154f735a..9fd18c0574f 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(null, a), Math.pow(null, b), Math.pow(null, E.a), Math.pow(E.b, null); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(null, a), Math.pow(null, b), Math.pow(null, E.a), Math.pow(E.b, null); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js index 2e4b4a5e9f2..6c74221a109 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es2015.1.normal.js @@ -12,9 +12,7 @@ var r1b2 = Math.pow(b, undefined); var r1b3 = Math.pow(c, undefined); var r1c1 = Math.pow(undefined, true); var r1c2 = Math.pow(undefined, ''); -var r1c3 = Math.pow(undefined, { -}); +var r1c3 = Math.pow(undefined, {}); var r1d1 = Math.pow(true, undefined); var r1d2 = Math.pow('', undefined); -var r1d3 = Math.pow({ -}, undefined); +var r1d3 = Math.pow({}, undefined); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js index 2e4b4a5e9f2..6c74221a109 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands_es5.1.normal.js @@ -12,9 +12,7 @@ var r1b2 = Math.pow(b, undefined); var r1b3 = Math.pow(c, undefined); var r1c1 = Math.pow(undefined, true); var r1c2 = Math.pow(undefined, ''); -var r1c3 = Math.pow(undefined, { -}); +var r1c3 = Math.pow(undefined, {}); var r1d1 = Math.pow(true, undefined); var r1d2 = Math.pow('', undefined); -var r1d3 = Math.pow({ -}, undefined); +var r1d3 = Math.pow({}, undefined); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js index 240e0d837ad..143e3a1725a 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator * diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js index d5fbb944fec..4c8e189f4b3 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(void 0, a), Math.pow(void 0, b), Math.pow(void 0, E.a), Math.pow(E.b, void 0); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(void 0, a), Math.pow(void 0, b), Math.pow(void 0, E.a), Math.pow(E.b, void 0); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js index 240e0d837ad..143e3a1725a 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; -})(E || (E = { -})); +})(E || (E = {})); var a; var b; // operator * diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js index d5fbb944fec..4c8e189f4b3 100644 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E, a, b; -(E = E || (E = { -}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(void 0, a), Math.pow(void 0, b), Math.pow(void 0, E.a), Math.pow(E.b, void 0); +(E = E || (E = {}))[E.a = 0] = "a", E[E.b = 1] = "b", Math.pow(void 0, a), Math.pow(void 0, b), Math.pow(void 0, E.a), Math.pow(E.b, void 0); diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.1.normal.js index 0f0201875fa..0a3407f3d4e 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: amd //@target: ES3 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es2015.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.1.normal.js index 0f0201875fa..0a3407f3d4e 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: amd //@target: ES3 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3-amd_es5.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.1.normal.js index d87e2bd19c3..4ea4d42ecf9 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: commonjs //@target: ES3 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3_es2015.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es3_es5.1.normal.js index d87e2bd19c3..4ea4d42ecf9 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3_es5.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: commonjs //@target: ES3 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es3_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es3_es5.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es3_es5.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.1.normal.js index 12afc07244c..1d8c1ee0b68 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: amd //@target: ES5 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es2015.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.1.normal.js index 12afc07244c..1d8c1ee0b68 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: amd //@target: ES5 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5-amd_es5.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.1.normal.js index 4eb2894322e..a2dd0e82406 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: commonjs //@target: ES5 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5_es2015.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAndImport-es5_es5.1.normal.js index 4eb2894322e..a2dd0e82406 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5_es5.1.normal.js @@ -3,8 +3,7 @@ import f1 from "./m1"; //@module: commonjs //@target: ES5 // @filename: m1.ts -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAndImport-es5_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAndImport-es5_es5.2.minified.js index 10faeab021a..f558cda2b53 100644 --- a/crates/swc/tests/tsc-references/exportAndImport-es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAndImport-es5_es5.2.minified.js @@ -1,6 +1,5 @@ import f1 from "./m1"; -export default function f1() { -}; +export default function f1() {}; export default function f2() { f1(); }; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js index 18e4260de18..13f6703d5f1 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js @@ -3,6 +3,5 @@ import * as _ns from './a'; // @esModuleInterop: true // @noTypesAndSymbols: true // @Filename: a.ts -module.exports = { -}; +module.exports = {}; export { _ns as ns }; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js index 7bdd4c08ee9..ae955060097 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js @@ -1,4 +1,3 @@ import * as _ns from "./a"; -module.exports = { -}; +module.exports = {}; export { _ns as ns }; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js index 18e4260de18..13f6703d5f1 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js @@ -3,6 +3,5 @@ import * as _ns from './a'; // @esModuleInterop: true // @noTypesAndSymbols: true // @Filename: a.ts -module.exports = { -}; +module.exports = {}; export { _ns as ns }; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js index 7bdd4c08ee9..ae955060097 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js @@ -1,4 +1,3 @@ import * as _ns from "./a"; -module.exports = { -}; +module.exports = {}; export { _ns as ns }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.1.normal.js index cbcd306241b..bdc28027cb4 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.1.normal.js @@ -3,8 +3,7 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); class C1 { } // Invalid, as there is already an exported member. diff --git a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.2.minified.js index 184b73e09f8..8269cecf5d6 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es2015.2.minified.js @@ -1,4 +1,3 @@ var E1, E1; -(E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", module.exports = class { +(E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", module.exports = class { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.1.normal.js index 40eff201b00..3b0adadc245 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.1.normal.js @@ -8,8 +8,7 @@ export var E1; E1[E1["A"] = 0] = "A"; E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var C1 = function C1() { "use strict"; _classCallCheck(this, C1); diff --git a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.2.minified.js index 7cb65f08630..010e7361443 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentAndDeclaration_es5.2.minified.js @@ -1,5 +1,4 @@ -(E1 = E1 || (E1 = { -}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C"; +(E1 = E1 || (E1 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C"; var E1, E1, C1 = function() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js index c55d3e49e9e..f98080bd6c0 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js @@ -4,21 +4,18 @@ const foo1 = require('./foo_1'); var Foo; (function(Foo1) { var x = Foo1.x = foo1.x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts const foo2 = require("./foo_2"); (function(Foo2) { var x = Foo2.x = foo2.x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_2.ts const foo0 = require("./foo_0"); (function(Foo3) { var x = Foo3.x = foo0.x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js index 9d55b58e3a4..8218a576635 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js @@ -1,11 +1,8 @@ var Foo; const foo1 = require("./foo_1"); -(Foo || (Foo = { -})).x = foo1.x, module.exports = Foo; +(Foo || (Foo = {})).x = foo1.x, module.exports = Foo; const foo2 = require("./foo_2"); -(Foo || (Foo = { -})).x = foo2.x, module.exports = Foo; +(Foo || (Foo = {})).x = foo2.x, module.exports = Foo; const foo0 = require("./foo_0"); -(Foo || (Foo = { -})).x = foo0.x, module.exports = Foo; +(Foo || (Foo = {})).x = foo0.x, module.exports = Foo; export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js index 40fd8d27be2..c8cd397d4f7 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js @@ -4,21 +4,18 @@ var foo1 = require('./foo_1'); var Foo; (function(Foo1) { var x = Foo1.x = foo1.x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts var foo2 = require("./foo_2"); (function(Foo2) { var x = Foo2.x = foo2.x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_2.ts var foo0 = require("./foo_0"); (function(Foo3) { var x = Foo3.x = foo0.x; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js index c006527e32f..e7ce128265c 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js @@ -1,10 +1,7 @@ var Foo, foo1 = require("./foo_1"); -(Foo || (Foo = { -})).x = foo1.x, module.exports = Foo; +(Foo || (Foo = {})).x = foo1.x, module.exports = Foo; var foo2 = require("./foo_2"); -(Foo || (Foo = { -})).x = foo2.x, module.exports = Foo; +(Foo || (Foo = {})).x = foo2.x, module.exports = Foo; var foo0 = require("./foo_0"); -(Foo || (Foo = { -})).x = foo0.x, module.exports = Foo; +(Foo || (Foo = {})).x = foo0.x, module.exports = Foo; export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js index a3890d81f7e..02adea45042 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js @@ -1,8 +1,7 @@ // @module: commonjs // @Filename: foo_0.ts class Foo { - constructor(x){ - } + constructor(x){} } module.exports = Foo; // @Filename: foo_1.ts diff --git a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js index a23327d3cc9..f8e31b46cf9 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js @@ -1,6 +1,5 @@ module.exports = class { - constructor(x){ - } + constructor(x){} }; const foo = require("./foo_0"); new foo(!0), new foo({ diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js index 563d6d28f9e..942c980e193 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js @@ -5,8 +5,7 @@ var x; x("test"); x(42); var y = x.b; -if (!!x.c) { -} +if (!!x.c) {} var z = { x: 1, y: 2 diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js index 72cea341517..4094bfd9d3a 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js @@ -5,8 +5,7 @@ var x; x("test"); x(42); var y = x.b; -if (!!x.c) { -} +if (!!x.c) {} var z = { x: 1, y: 2 diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js index 5975c57a153..5b936eb9874 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js @@ -7,8 +7,7 @@ var Foo; } Foo1.a = a1; var b = Foo1.b = true; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); (function(Foo2) { function c(a2) { return a2; @@ -17,10 +16,8 @@ var Foo; let Test1; (function(Test) { var answer = Test.answer = 42; - })(Test1 = Foo2.Test || (Foo2.Test = { - })); -})(Foo || (Foo = { -})); + })(Test1 = Foo2.Test || (Foo2.Test = {})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts const foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js index 11259fa07b9..f153884e2d3 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js @@ -1,12 +1,9 @@ var Foo, Foo1, Foo2; -(Foo1 = Foo || (Foo = { -})).a = function() { +(Foo1 = Foo || (Foo = {})).a = function() { return 5; -}, Foo1.b = !0, (Foo2 = Foo || (Foo = { -})).c = function(a) { +}, Foo1.b = !0, (Foo2 = Foo || (Foo = {})).c = function(a) { return a; -}, (Foo2.Test || (Foo2.Test = { -})).answer = 42, module.exports = Foo; +}, (Foo2.Test || (Foo2.Test = {})).answer = 42, module.exports = Foo; const foo = require("./foo_0"); foo.a(), foo.b && (foo.Test.answer = foo.c(42)); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js index b1fe270022a..0beec08a922 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js @@ -7,8 +7,7 @@ var Foo; }; Foo1.a = a; var b = Foo1.b = true; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); (function(Foo2) { var c = function c(a) { return a; @@ -17,10 +16,8 @@ var Foo; var Test1; (function(Test) { var answer = Test.answer = 42; - })(Test1 = Foo2.Test || (Foo2.Test = { - })); -})(Foo || (Foo = { -})); + })(Test1 = Foo2.Test || (Foo2.Test = {})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts var foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js index e8cc1e94114..b9a3fef8cad 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js @@ -1,12 +1,9 @@ var Foo, Foo1, Foo2; -(Foo1 = Foo || (Foo = { -})).a = function() { +(Foo1 = Foo || (Foo = {})).a = function() { return 5; -}, Foo1.b = !0, (Foo2 = Foo || (Foo = { -})).c = function(a) { +}, Foo1.b = !0, (Foo2 = Foo || (Foo = {})).c = function(a) { return a; -}, (Foo2.Test || (Foo2.Test = { -})).answer = 42, module.exports = Foo; +}, (Foo2.Test || (Foo2.Test = {})).answer = 42, module.exports = Foo; var foo = require("./foo_0"); foo.a(), foo.b && (foo.Test.answer = foo.c(42)); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js index 5df4ee01272..7950f0bc125 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js @@ -7,8 +7,7 @@ class Foo { } (function(Foo1) { var answer = Foo1.answer = 42; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts const foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js index f71f19ee096..043a396a2b5 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js @@ -3,8 +3,7 @@ class Foo { this.test = "test"; } } -(Foo || (Foo = { -})).answer = 42, module.exports = Foo; +(Foo || (Foo = {})).answer = 42, module.exports = Foo; const foo = require("./foo_0"); 42 === foo.answer && new foo(); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js index 595a53256f9..2390d40d673 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js @@ -12,8 +12,7 @@ var Foo = function Foo() { }; (function(Foo) { var answer = Foo.answer = 42; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts var foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js index be6d16e98be..1850c1765ed 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js @@ -4,8 +4,7 @@ var Foo = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, Foo), this.test = "test"; }; -(Foo || (Foo = { -})).answer = 42, module.exports = Foo; +(Foo || (Foo = {})).answer = 42, module.exports = Foo; var foo = require("./foo_0"); 42 === foo.answer && new foo(); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js index 1b6047fbc58..26acedba0d6 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js @@ -5,12 +5,10 @@ foo; foo[foo["red"] = 0] = "red"; foo[foo["green"] = 1] = "green"; foo[foo["blue"] = 2] = "blue"; -})(foo || (foo = { -})); +})(foo || (foo = {})); (function(foo) { var answer = foo.answer = 42; -})(foo || (foo = { -})); +})(foo || (foo = {})); module.exports = foo; // @Filename: foo_1.ts const foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js index bf38a4817ef..ddf649a2f52 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js @@ -1,7 +1,5 @@ var foo, color, foo; -(foo = foo || (foo = { -}))[foo.red = 0] = "red", foo[foo.green = 1] = "green", foo[foo.blue = 2] = "blue", (foo || (foo = { -})).answer = 42, module.exports = foo; +(foo = foo || (foo = {}))[foo.red = 0] = "red", foo[foo.green = 1] = "green", foo[foo.blue = 2] = "blue", (foo || (foo = {})).answer = 42, module.exports = foo; const foo = require("./foo_0"); color === foo.green && (color = foo.answer); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js index 928ae5978f5..7ce78c1f5d0 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js @@ -5,12 +5,10 @@ foo; foo[foo["red"] = 0] = "red"; foo[foo["green"] = 1] = "green"; foo[foo["blue"] = 2] = "blue"; -})(foo || (foo = { -})); +})(foo || (foo = {})); (function(foo) { var answer = foo.answer = 42; -})(foo || (foo = { -})); +})(foo || (foo = {})); module.exports = foo; // @Filename: foo_1.ts var foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js index 7d876c43d62..0ed3e1c320f 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js @@ -1,6 +1,4 @@ -(foo = foo || (foo = { -}))[foo.red = 0] = "red", foo[foo.green = 1] = "green", foo[foo.blue = 2] = "blue", (foo || (foo = { -})).answer = 42, module.exports = foo; +(foo = foo || (foo = {}))[foo.red = 0] = "red", foo[foo.green = 1] = "green", foo[foo.blue = 2] = "blue", (foo || (foo = {})).answer = 42, module.exports = foo; var foo, foo, color, foo = require("./foo_0"); color === foo.green && (color = foo.answer); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js index fe021f0cf6c..906f8ba254e 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js @@ -5,8 +5,7 @@ function foo() { } (function(foo1) { var answer = foo1.answer = 42; -})(foo || (foo = { -})); +})(foo || (foo = {})); module.exports = foo; // @Filename: foo_1.ts const foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js index 6ec8d70c422..ba1a077b5bb 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js @@ -1,8 +1,7 @@ function foo() { return "test"; } -(foo || (foo = { -})).answer = 42, module.exports = foo; +(foo || (foo = {})).answer = 42, module.exports = foo; const foo = require("./foo_0"); 42 === foo.answer && foo(); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js index a6b1bff3629..7a233275ead 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js @@ -5,8 +5,7 @@ function foo() { } (function(foo1) { var answer = foo1.answer = 42; -})(foo || (foo = { -})); +})(foo || (foo = {})); module.exports = foo; // @Filename: foo_1.ts var foo = require("./foo_0"); diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js index a881c3bca09..acd3de41385 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js @@ -1,8 +1,7 @@ function foo() { return "test"; } -(foo || (foo = { -})).answer = 42, module.exports = foo; +(foo || (foo = {})).answer = 42, module.exports = foo; var foo = require("./foo_0"); 42 === foo.answer && foo(); export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js index 134b1bfafae..bdf617a805c 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js @@ -3,11 +3,9 @@ var Foo; (function(Foo1) { var answer = Foo1.answer = 42; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts const foo = require("./foo_0"); -if (foo.answer === 42) { -} +if (foo.answer === 42) {} export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js index 3f0023a36fc..61bcff18e60 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js @@ -1,6 +1,5 @@ var Foo; -(Foo || (Foo = { -})).answer = 42, module.exports = Foo; +(Foo || (Foo = {})).answer = 42, module.exports = Foo; const foo = require("./foo_0"); 42 === foo.answer; export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js index 8c1ce6d0b36..96b0c5c3974 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js @@ -3,11 +3,9 @@ var Foo; (function(Foo1) { var answer = Foo1.answer = 42; -})(Foo || (Foo = { -})); +})(Foo || (Foo = {})); module.exports = Foo; // @Filename: foo_1.ts var foo = require("./foo_0"); -if (foo.answer === 42) { -} +if (foo.answer === 42) {} export { }; diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js index 23e3584caf4..003e749967a 100644 --- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js @@ -1,4 +1,3 @@ var Foo; -(Foo || (Foo = { -})).answer = 42, module.exports = Foo, 42 === require("./foo_0").answer; +(Foo || (Foo = {})).answer = 42, module.exports = Foo, 42 === require("./foo_0").answer; export { }; diff --git a/crates/swc/tests/tsc-references/exportCodeGen_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportCodeGen_es2015.1.normal.js index 54c3d0eb560..3f07a51712b 100644 --- a/crates/swc/tests/tsc-references/exportCodeGen_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportCodeGen_es2015.1.normal.js @@ -6,8 +6,7 @@ var A; function lt12() { return x < 12; } -})(A || (A = { -})); +})(A || (A = {})); // should not fully qualify 'x' var B; (function(B) { @@ -15,16 +14,14 @@ var B; function lt12() { return x < 12; } -})(B || (B = { -})); +})(B || (B = {})); // not copied, since not exported var C; (function(C) { function no() { return false; } -})(C || (C = { -})); +})(C || (C = {})); // copies, since exported var D; (function(D1) { @@ -32,18 +29,15 @@ var D; return true; } D1.yes = yes; -})(D || (D = { -})); +})(D || (D = {})); // validate all exportable statements var E; (function(E1) { let Color; (function(Color) { Color[Color["Red"] = 0] = "Red"; - })(Color = E1.Color || (E1.Color = { - })); - function fn() { - } + })(Color = E1.Color || (E1.Color = {})); + function fn() {} E1.fn = fn; class C1 { } @@ -51,10 +45,8 @@ var E; let M1; (function(M) { var x = M.x = 42; - })(M1 = E1.M || (E1.M = { - })); -})(E || (E = { -})); + })(M1 = E1.M || (E1.M = {})); +})(E || (E = {})); // validate all exportable statements, // which are not exported var F; @@ -62,16 +54,12 @@ var F; let Color; (function(Color) { Color[Color["Red"] = 0] = "Red"; - })(Color || (Color = { - })); - function fn() { - } + })(Color || (Color = {})); + function fn() {} class C { } let M; (function(M) { var x = 42; - })(M || (M = { - })); -})(F || (F = { -})); + })(M || (M = {})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/exportCodeGen_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportCodeGen_es2015.2.minified.js index bbc7e4a7adc..bc09d1ea4ba 100644 --- a/crates/swc/tests/tsc-references/exportCodeGen_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportCodeGen_es2015.2.minified.js @@ -1,21 +1,13 @@ var A, D, E, F; -(A || (A = { -})).x = 12, (D || (D = { -})).yes = function() { +(A || (A = {})).x = 12, (D || (D = {})).yes = function() { return !0; }, (function(E1) { var Color; let Color; - (Color = Color = E1.Color || (E1.Color = { - }))[Color.Red = 0] = "Red", E1.fn = function() { - }, E1.C = class { - }, (E1.M || (E1.M = { - })).x = 42; -})(E || (E = { -})), (function(F) { + (Color = Color = E1.Color || (E1.Color = {}))[Color.Red = 0] = "Red", E1.fn = function() {}, E1.C = class { + }, (E1.M || (E1.M = {})).x = 42; +})(E || (E = {})), (function(F) { var Color; let Color; - (Color = Color || (Color = { - }))[Color.Red = 0] = "Red"; -})(F || (F = { -})); + (Color = Color || (Color = {}))[Color.Red = 0] = "Red"; +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/exportCodeGen_es5.1.normal.js b/crates/swc/tests/tsc-references/exportCodeGen_es5.1.normal.js index b37d4ee111a..d011cbc2a67 100644 --- a/crates/swc/tests/tsc-references/exportCodeGen_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportCodeGen_es5.1.normal.js @@ -11,8 +11,7 @@ var A; return x < 12; }; var x = A1.x = 12; -})(A || (A = { -})); +})(A || (A = {})); // should not fully qualify 'x' var B; (function(B) { @@ -20,16 +19,14 @@ var B; return x < 12; }; var x = 12; -})(B || (B = { -})); +})(B || (B = {})); // not copied, since not exported var C; (function(C) { var no = function no() { return false; }; -})(C || (C = { -})); +})(C || (C = {})); // copies, since exported var D; (function(D1) { @@ -37,18 +34,15 @@ var D; return true; }; D1.yes = yes; -})(D || (D = { -})); +})(D || (D = {})); // validate all exportable statements var E; (function(E1) { - var fn = function fn() { - }; + var fn = function fn() {}; var Color; (function(Color) { Color[Color["Red"] = 0] = "Red"; - })(Color = E1.Color || (E1.Color = { - })); + })(Color = E1.Color || (E1.Color = {})); E1.fn = fn; var C1 = function C1() { "use strict"; @@ -58,21 +52,17 @@ var E; var M1; (function(M) { var x = M.x = 42; - })(M1 = E1.M || (E1.M = { - })); -})(E || (E = { -})); + })(M1 = E1.M || (E1.M = {})); +})(E || (E = {})); // validate all exportable statements, // which are not exported var F; (function(F) { - var fn = function fn() { - }; + var fn = function fn() {}; var Color; (function(Color) { Color[Color["Red"] = 0] = "Red"; - })(Color || (Color = { - })); + })(Color || (Color = {})); var C2 = function C2() { "use strict"; _classCallCheck(this, C2); @@ -80,7 +70,5 @@ var F; var M; (function(M) { var x = 42; - })(M || (M = { - })); -})(F || (F = { -})); + })(M || (M = {})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/exportCodeGen_es5.2.minified.js b/crates/swc/tests/tsc-references/exportCodeGen_es5.2.minified.js index 4dd9674a287..39b8720194f 100644 --- a/crates/swc/tests/tsc-references/exportCodeGen_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportCodeGen_es5.2.minified.js @@ -2,28 +2,20 @@ var A, D, E, F; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } -(A || (A = { -})).x = 12, (D || (D = { -})).yes = function() { +(A || (A = {})).x = 12, (D || (D = {})).yes = function() { return !0; }, (function(E1) { - (Color = Color = E1.Color || (E1.Color = { - }))[Color.Red = 0] = "Red", E1.fn = function() { - }; + (Color = Color = E1.Color || (E1.Color = {}))[Color.Red = 0] = "Red", E1.fn = function() {}; var Color, Color, C = function() { "use strict"; _classCallCheck(this, C); }; - E1.C = C, (E1.M || (E1.M = { - })).x = 42; -})(E || (E = { -})), (function(F) { + E1.C = C, (E1.M || (E1.M = {})).x = 42; +})(E || (E = {})), (function(F) { var Color, Color; - (Color = Color || (Color = { - }))[Color.Red = 0] = "Red"; + (Color = Color || (Color = {}))[Color.Red = 0] = "Red"; var C = function() { "use strict"; _classCallCheck(this, C); }; -})(F || (F = { -})); +})(F || (F = {})); diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js index a7be473e12e..29a5380172c 100644 --- a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js @@ -1,5 +1,3 @@ // @Filename: /a.ts -const A = { -}; -export const AA = { -}; +const A = {}; +export const AA = {}; diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js index 8f5059ce51b..daf97fc3901 100644 --- a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js @@ -1,2 +1 @@ -export const AA = { -}; +export const AA = {}; diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js index 70a70f00a2a..6868bb6a8e1 100644 --- a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js @@ -1,5 +1,3 @@ // @Filename: /a.ts -var A = { -}; -export var AA = { -}; +var A = {}; +export var AA = {}; diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js index e2e6bef9289..64cf88bfa56 100644 --- a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js @@ -1,2 +1 @@ -export var AA = { -}; +export var AA = {}; diff --git a/crates/swc/tests/tsc-references/exportImportAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportImportAlias_es2015.1.normal.js index 980b5e5703c..80645aaa9cd 100644 --- a/crates/swc/tests/tsc-references/exportImportAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportImportAlias_es2015.1.normal.js @@ -9,14 +9,12 @@ var A; } } A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); var C; (function(C1) { var a1 = A; C1.a = a1; -})(C || (C = { -})); +})(C || (C = {})); var a = C.a.x; var b = new C.a.Point(0, 0); var c; @@ -35,17 +33,14 @@ var X; } } Y.Point = Point; - })(Y1 = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Y1 = X1.Y || (X1.Y = {})); +})(X || (X = {})); var Z; (function(Z1) { // 'y' should be a fundule here var y = X.Y; Z1.y = y; -})(Z || (Z = { -})); +})(Z || (Z = {})); var m = Z.y(); var n = new Z.y.Point(0, 0); var K; @@ -58,16 +53,13 @@ var K; K1.L = L1; (function(L) { var y = L.y = 12; - })(L1 = K1.L || (K1.L = { - })); -})(K || (K = { -})); + })(L1 = K1.L || (K1.L = {})); +})(K || (K = {})); var M; (function(M1) { var D = K.L; M1.D = D; -})(M || (M = { -})); +})(M || (M = {})); var o; var o = new M.D('Hello'); var p; diff --git a/crates/swc/tests/tsc-references/exportImportAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportImportAlias_es2015.2.minified.js index 6a7cb3d6d3f..eff70d57be2 100644 --- a/crates/swc/tests/tsc-references/exportImportAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportImportAlias_es2015.2.minified.js @@ -1,36 +1,28 @@ var A, A1, C, X, Z, K, M; -(A = A1 || (A1 = { -})).x = "hello world", A.Point = class { +(A = A1 || (A1 = {})).x = "hello world", A.Point = class { constructor(x, y){ this.x = x, this.y = y; } -}, (C || (C = { -})).a = A1, C.a.x, new C.a.Point(0, 0), (function(X1) { +}, (C || (C = {})).a = A1, C.a.x, new C.a.Point(0, 0), (function(X1) { function Y() { return 42; } - X1.Y = Y, (Y = X1.Y || (X1.Y = { - })).Point = class { + X1.Y = Y, (Y = X1.Y || (X1.Y = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } }; -})(X || (X = { -})), (function(Z1) { +})(X || (X = {})), (function(Z1) { var y = X.Y; Z1.y = y; -})(Z || (Z = { -})), Z.y(), new Z.y.Point(0, 0), (function(K1) { +})(Z || (Z = {})), Z.y(), new Z.y.Point(0, 0), (function(K1) { class L { constructor(name){ this.name = name; } } - K1.L = L, (L = K1.L || (K1.L = { - })).y = 12; -})(K || (K = { -})), (function(M1) { + K1.L = L, (L = K1.L || (K1.L = {})).y = 12; +})(K || (K = {})), (function(M1) { var D = K.L; M1.D = D; -})(M || (M = { -})), new M.D("Hello"); +})(M || (M = {})), new M.D("Hello"); diff --git a/crates/swc/tests/tsc-references/exportImportAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/exportImportAlias_es5.1.normal.js index f71550bd98d..ca4ad06b96b 100644 --- a/crates/swc/tests/tsc-references/exportImportAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportImportAlias_es5.1.normal.js @@ -14,14 +14,12 @@ var A; this.y = y; }; A1.Point = Point; -})(A || (A = { -})); +})(A || (A = {})); var C; (function(C1) { var a1 = A; C1.a = a1; -})(C || (C = { -})); +})(C || (C = {})); var a = C.a.x; var b = new C.a.Point(0, 0); var c; @@ -40,17 +38,14 @@ var X; this.y = y; }; Y.Point = Point; - })(Y = X1.Y || (X1.Y = { - })); -})(X || (X = { -})); + })(Y = X1.Y || (X1.Y = {})); +})(X || (X = {})); var Z; (function(Z1) { // 'y' should be a fundule here var y = X.Y; Z1.y = y; -})(Z || (Z = { -})); +})(Z || (Z = {})); var m = Z.y(); var n = new Z.y.Point(0, 0); var K; @@ -63,16 +58,13 @@ var K; K1.L = L; (function(L) { var y = L.y = 12; - })(L = K1.L || (K1.L = { - })); -})(K || (K = { -})); + })(L = K1.L || (K1.L = {})); +})(K || (K = {})); var M; (function(M1) { var D = K.L; M1.D = D; -})(M || (M = { -})); +})(M || (M = {})); var o; var o = new M.D('Hello'); var p; diff --git a/crates/swc/tests/tsc-references/exportImportAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/exportImportAlias_es5.2.minified.js index 64e1d79d386..5d66cec9806 100644 --- a/crates/swc/tests/tsc-references/exportImportAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportImportAlias_es5.2.minified.js @@ -9,32 +9,24 @@ function _classCallCheck(instance, Constructor) { _classCallCheck(this, Point), this.x = x, this.y = y; }; A1.Point = Point; -})(A || (A = { -})), (C || (C = { -})).a = A, C.a.x, new C.a.Point(0, 0), (function(X1) { +})(A || (A = {})), (C || (C = {})).a = A, C.a.x, new C.a.Point(0, 0), (function(X1) { var Y, Point, Y1 = function() { return 42; }; - X1.Y = Y1, Y = Y1 = X1.Y || (X1.Y = { - }), Point = function(x, y) { + X1.Y = Y1, Y = Y1 = X1.Y || (X1.Y = {}), Point = function(x, y) { "use strict"; _classCallCheck(this, Point), this.x = x, this.y = y; }, Y.Point = Point; -})(X || (X = { -})), (function(Z1) { +})(X || (X = {})), (function(Z1) { var y = X.Y; Z1.y = y; -})(Z || (Z = { -})), Z.y(), new Z.y.Point(0, 0), (function(K1) { +})(Z || (Z = {})), Z.y(), new Z.y.Point(0, 0), (function(K1) { var L = function(name) { "use strict"; _classCallCheck(this, L), this.name = name; }; - K1.L = L, (L = K1.L || (K1.L = { - })).y = 12; -})(K || (K = { -})), (function(M1) { + K1.L = L, (L = K1.L || (K1.L = {})).y = 12; +})(K || (K = {})), (function(M1) { var D = K.L; M1.D = D; -})(M || (M = { -})), new M.D("Hello"); +})(M || (M = {})), new M.D("Hello"); diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.1.normal.js index 7b21a3e6210..ce06234858d 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.1.normal.js @@ -5,8 +5,7 @@ import * as debug from './mod'; // @noEmit: true // @Filename: mod.js // Based on a pattern from adonis -exports.formatters = { -}; +exports.formatters = {}; // @Filename: first.js exports = require('./mod'); exports.formatters.j = function(v) { diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js index 802294f0583..0c63a3aee3d 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js @@ -1,6 +1,5 @@ import * as debug from "./mod"; -exports.formatters = { -}, (exports = require("./mod")).formatters.j = function(v) { +exports.formatters = {}, (exports = require("./mod")).formatters.j = function(v) { return v; }, (exports = require("./mod")).formatters.o = function(v) { return v; diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.1.normal.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.1.normal.js index 7b21a3e6210..ce06234858d 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.1.normal.js @@ -5,8 +5,7 @@ import * as debug from './mod'; // @noEmit: true // @Filename: mod.js // Based on a pattern from adonis -exports.formatters = { -}; +exports.formatters = {}; // @Filename: first.js exports = require('./mod'); exports.formatters.j = function(v) { diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js index 802294f0583..0c63a3aee3d 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js @@ -1,6 +1,5 @@ import * as debug from "./mod"; -exports.formatters = { -}, (exports = require("./mod")).formatters.j = function(v) { +exports.formatters = {}, (exports = require("./mod")).formatters.j = function(v) { return v; }, (exports = require("./mod")).formatters.o = function(v) { return v; diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.1.normal.js index 99f91a6be20..a996e5f4e1b 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.1.normal.js @@ -4,8 +4,7 @@ import * as s from './mod'; // @checkJs: true // @noEmit: true // @Filename: mod.js -exports.n = { -}; +exports.n = {}; exports.n.K = function() { this.x = 10; }; diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.2.minified.js index 7611cec6067..5ff715d8dd5 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces_es2015.2.minified.js @@ -1,6 +1,5 @@ import * as s from "./mod"; -exports.n = { -}, exports.n.K = function() { +exports.n = {}, exports.n.K = function() { this.x = 10; }, exports.Classic = class { constructor(){ diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.1.normal.js b/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.1.normal.js index 1f4125ce45a..11e4d78c8c2 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.1.normal.js @@ -9,8 +9,7 @@ function _classCallCheck(instance, Constructor) { // @checkJs: true // @noEmit: true // @Filename: mod.js -exports.n = { -}; +exports.n = {}; exports.n.K = function() { this.x = 10; }; diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.2.minified.js index 866b5449611..4d22a25d51f 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces_es5.2.minified.js @@ -1,6 +1,5 @@ import * as s from "./mod"; -exports.n = { -}, exports.n.K = function() { +exports.n = {}, exports.n.K = function() { this.x = 10; }, exports.Classic = function _class() { "use strict"; diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js index 34a62ed4a4b..de126bacc09 100644 --- a/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js @@ -7,8 +7,7 @@ export var x = 1; export var y = 2; // @filename: t2.ts export default "hello"; -export function foo() { -} +export function foo() {} // @filename: t3.ts var x = "x"; var y = "y"; diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js index b54b49eefac..765a81a0db5 100644 --- a/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js @@ -2,8 +2,7 @@ import hello from "./t4"; export var x = 1; export var y = 2; export default "hello"; -export function foo() { -} +export function foo() {} var z, x = "x", y = "y"; export { x, y, z }; export * from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js index 34a62ed4a4b..de126bacc09 100644 --- a/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js @@ -7,8 +7,7 @@ export var x = 1; export var y = 2; // @filename: t2.ts export default "hello"; -export function foo() { -} +export function foo() {} // @filename: t3.ts var x = "x"; var y = "y"; diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js index b54b49eefac..765a81a0db5 100644 --- a/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js @@ -2,8 +2,7 @@ import hello from "./t4"; export var x = 1; export var y = 2; export default "hello"; -export function foo() { -} +export function foo() {} var z, x = "x", y = "y"; export { x, y, z }; export * from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js index 9af0f5dcd55..d94bd91f239 100644 --- a/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js @@ -7,8 +7,7 @@ export var x = 1; export var y = 2; // @filename: t2.ts export default "hello"; -export function foo() { -} +export function foo() {} // @filename: t3.ts var x = "x"; var y = "y"; diff --git a/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js index b54b49eefac..765a81a0db5 100644 --- a/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js @@ -2,8 +2,7 @@ import hello from "./t4"; export var x = 1; export var y = 2; export default "hello"; -export function foo() { -} +export function foo() {} var z, x = "x", y = "y"; export { x, y, z }; export * from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js b/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js index 9af0f5dcd55..d94bd91f239 100644 --- a/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js @@ -7,8 +7,7 @@ export var x = 1; export var y = 2; // @filename: t2.ts export default "hello"; -export function foo() { -} +export function foo() {} // @filename: t3.ts var x = "x"; var y = "y"; diff --git a/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js b/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js index b54b49eefac..765a81a0db5 100644 --- a/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js @@ -2,8 +2,7 @@ import hello from "./t4"; export var x = 1; export var y = 2; export default "hello"; -export function foo() { -} +export function foo() {} var z, x = "x", y = "y"; export { x, y, z }; export * from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.1.normal.js index 3d35ad1e51f..e78cf4ea3e0 100644 --- a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.1.normal.js @@ -1,8 +1,7 @@ // @noemit: true // @allowjs: true // @filename: exportedAliasedEnumTag.js -var middlewarify = module.exports = { -}; +var middlewarify = module.exports = {}; /** @enum */ middlewarify.Type = { BEFORE: 'before' }; diff --git a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.2.minified.js index 7dbddff5cc3..8399df02f18 100644 --- a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es2015.2.minified.js @@ -1,4 +1,3 @@ -(module.exports = { -}).Type = { +(module.exports = {}).Type = { BEFORE: "before" }; diff --git a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.1.normal.js b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.1.normal.js index 3d35ad1e51f..e78cf4ea3e0 100644 --- a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.1.normal.js @@ -1,8 +1,7 @@ // @noemit: true // @allowjs: true // @filename: exportedAliasedEnumTag.js -var middlewarify = module.exports = { -}; +var middlewarify = module.exports = {}; /** @enum */ middlewarify.Type = { BEFORE: 'before' }; diff --git a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.2.minified.js b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.2.minified.js index 7dbddff5cc3..8399df02f18 100644 --- a/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportedAliasedEnumTag_es5.2.minified.js @@ -1,4 +1,3 @@ -(module.exports = { -}).Type = { +(module.exports = {}).Type = { BEFORE: "before" }; diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js index f3cea8d7550..9422cde38e8 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js @@ -4,8 +4,7 @@ import { I, N, T } from "./t1"; // @target: ES5 // @filename: t1.ts var v = 1; -function f() { -} +function f() {} class C { } var E; @@ -13,21 +12,18 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js index 5f9efb509ac..661d644c0fc 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js @@ -1,15 +1,11 @@ import { I, N, T } from "./t1"; -function f() { -} +function f() {} class C { } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var E, D, M, v, E, D, a = M.x; export { v, f, C, E, D, a }; export { v, f, C, I, E, D, M, N, T, a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js index c66cdac43b8..44f77783720 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js @@ -9,8 +9,7 @@ function _classCallCheck(instance, Constructor) { // @target: ES5 // @filename: t1.ts var v = 1; -function f() { -} +function f() {} var C = function C() { "use strict"; _classCallCheck(this, C); @@ -20,21 +19,18 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js index 51e1bc715c7..e0294d4a9db 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js @@ -1,19 +1,15 @@ import { I, N, T } from "./t1"; -function f() { -} +function f() {} var D, E, D, M, v, E, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; export { v, f, C, I, E, D, M, N, T, a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js index 138535cb556..c11f9e22864 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js @@ -4,8 +4,7 @@ import { I, N, T } from "./t1"; // @module: commonjs // @filename: t1.ts var v = 1; -function f() { -} +function f() {} class C { } var E; @@ -13,21 +12,18 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js index 5f9efb509ac..661d644c0fc 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js @@ -1,15 +1,11 @@ import { I, N, T } from "./t1"; -function f() { -} +function f() {} class C { } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var E, D, M, v, E, D, a = M.x; export { v, f, C, E, D, a }; export { v, f, C, I, E, D, M, N, T, a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js index ab0fc4f6ed4..51bba5b5c5b 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js @@ -9,8 +9,7 @@ function _classCallCheck(instance, Constructor) { // @module: commonjs // @filename: t1.ts var v = 1; -function f() { -} +function f() {} var C = function C() { "use strict"; _classCallCheck(this, C); @@ -20,21 +19,18 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js index 51e1bc715c7..e0294d4a9db 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js @@ -1,19 +1,15 @@ import { I, N, T } from "./t1"; -function f() { -} +function f() {} var D, E, D, M, v, E, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; export { v, f, C, I, E, D, M, N, T, a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js index e3c014e2b91..f140d9db5a6 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js @@ -3,8 +3,7 @@ import { I, N, T } from "./t1"; // @module: commonjs // @filename: t1.ts var v = 1; -function f() { -} +function f() {} class C { } var E; @@ -12,21 +11,18 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js index 5f9efb509ac..661d644c0fc 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js @@ -1,15 +1,11 @@ import { I, N, T } from "./t1"; -function f() { -} +function f() {} class C { } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var E, D, M, v, E, D, a = M.x; export { v, f, C, E, D, a }; export { v, f, C, I, E, D, M, N, T, a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js index 9859a719384..90ab8ef3623 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js @@ -8,8 +8,7 @@ function _classCallCheck(instance, Constructor) { // @module: commonjs // @filename: t1.ts var v = 1; -function f() { -} +function f() {} var C = function C() { "use strict"; _classCallCheck(this, C); @@ -19,21 +18,18 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js index 51e1bc715c7..e0294d4a9db 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js @@ -1,19 +1,15 @@ import { I, N, T } from "./t1"; -function f() { -} +function f() {} var D, E, D, M, v, E, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); var a = M.x; export { v, f, C, E, D, a }; export { v, f, C, I, E, D, M, N, T, a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js index d95ba9b3dce..fc322981b57 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js @@ -4,8 +4,7 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; // @target: ES5 // @filename: t1.ts export var v = 1; -export function f() { -} +export function f() {} export class C { } export var E; @@ -13,21 +12,18 @@ export var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); export var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); export var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js index b22d5294085..e2d1cac2cae 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js @@ -1,15 +1,11 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; -export function f() { -} +export function f() {} export class C { } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var E, D, M, v, E, D, a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js index 91bc2f4e3c4..7b1893256c5 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js @@ -9,8 +9,7 @@ function _classCallCheck(instance, Constructor) { // @target: ES5 // @filename: t1.ts export var v = 1; -export function f() { -} +export function f() {} export var C = function C() { "use strict"; _classCallCheck(this, C); @@ -20,21 +19,18 @@ export var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); export var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); export var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js index e4d8dee430b..301e5f3e40e 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js @@ -1,19 +1,15 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; -export function f() { -} +export function f() {} export var E, D, M, v, E, D, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js index 45a6e6d5967..ac512d96893 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js @@ -4,8 +4,7 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; // @module: commonjs // @filename: t1.ts export var v = 1; -export function f() { -} +export function f() {} export class C { } export var E; @@ -13,21 +12,18 @@ export var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); export var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); export var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js index b22d5294085..e2d1cac2cae 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js @@ -1,15 +1,11 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; -export function f() { -} +export function f() {} export class C { } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var E, D, M, v, E, D, a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js index ae1e6624464..6cc7b899443 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js @@ -9,8 +9,7 @@ function _classCallCheck(instance, Constructor) { // @module: commonjs // @filename: t1.ts export var v = 1; -export function f() { -} +export function f() {} export var C = function C() { "use strict"; _classCallCheck(this, C); @@ -20,21 +19,18 @@ export var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); export var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); export var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js index e4d8dee430b..301e5f3e40e 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js @@ -1,19 +1,15 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; -export function f() { -} +export function f() {} export var E, D, M, v, E, D, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js index f3e5b4ba1e2..347b8353e01 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js @@ -3,8 +3,7 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; // @module: commonjs // @filename: t1.ts export var v = 1; -export function f() { -} +export function f() {} export class C { } export var E; @@ -12,21 +11,18 @@ export var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); export var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); export var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js index b22d5294085..e2d1cac2cae 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js @@ -1,15 +1,11 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; -export function f() { -} +export function f() {} export class C { } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var E, D, M, v, E, D, a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js index 71a76081568..f1f99ce0e9b 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js @@ -8,8 +8,7 @@ function _classCallCheck(instance, Constructor) { // @module: commonjs // @filename: t1.ts export var v = 1; -export function f() { -} +export function f() {} export var C = function C() { "use strict"; _classCallCheck(this, C); @@ -19,21 +18,18 @@ export var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); export var D; (function(D) { D[D["A"] = 0] = "A"; D[D["B"] = 1] = "B"; D[D["C"] = 2] = "C"; -})(D || (D = { -})); +})(D || (D = {})); export var M; (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; // @filename: t2.ts diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js index e4d8dee430b..301e5f3e40e 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js @@ -1,19 +1,15 @@ import { I1 as I, N1 as N, T1 as T } from "./t1"; -export function f() { -} +export function f() {} export var E, D, M, v, E, D, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = { -}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D || (D = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (function(M1) { var x; M1.x = x; -})(M || (M = { -})); +})(M || (M = {})); export var a = M.x; export { v as v1, f as f1, C as C1, E as E1, D as D1, a as a1 }; export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js index dbbc24054c6..687e623b6fb 100644 --- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js @@ -4,7 +4,6 @@ var R; export default R = { "__esmodule": true, - "__proto__": { - } + "__proto__": {} }; const { __esmodule , __proto__ } = R; diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js index 4f0cac18682..340bebde42b 100644 --- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js @@ -1,7 +1,6 @@ var R; export default R = { "__esmodule": !0, - "__proto__": { - } + "__proto__": {} }; const { __esmodule , __proto__ } = R; diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js index f6b83e6e19a..40af1cd4ad3 100644 --- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js @@ -4,7 +4,6 @@ var R; export default R = { "__esmodule": true, - "__proto__": { - } + "__proto__": {} }; var __esmodule = R.__esmodule, __proto__ = R.__proto__; diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js index fd651f270fb..eeac88e77cb 100644 --- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js @@ -1,7 +1,6 @@ var R; export default R = { "__esmodule": !0, - "__proto__": { - } + "__proto__": {} }; R.__esmodule, R.__proto__; diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js index e54a90eae4c..877563d8920 100644 --- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js index d8344cd8792..b00122b8ac0 100644 --- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js @@ -34,8 +34,7 @@ var x = require("./foo1"), y = function(x1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/extendsTag1_es5.1.normal.js b/crates/swc/tests/tsc-references/extendsTag1_es5.1.normal.js index 9394b7d0cdb..111082e4737 100644 --- a/crates/swc/tests/tsc-references/extendsTag1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTag1_es5.1.normal.js @@ -14,8 +14,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -107,8 +106,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/extendsTag1_es5.2.minified.js b/crates/swc/tests/tsc-references/extendsTag1_es5.2.minified.js index e7c0c98fd9a..fdbc6dd2a21 100644 --- a/crates/swc/tests/tsc-references/extendsTag1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/extendsTag1_es5.2.minified.js @@ -4,8 +4,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -69,8 +68,7 @@ var My = function(Set) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/extendsTag2_es2015.1.normal.js b/crates/swc/tests/tsc-references/extendsTag2_es2015.1.normal.js index ff64ffe740a..03f1df32960 100644 --- a/crates/swc/tests/tsc-references/extendsTag2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTag2_es2015.1.normal.js @@ -6,8 +6,7 @@ /** * @constructor */ class A { - constructor(){ - } + constructor(){} } /** * @extends {A} diff --git a/crates/swc/tests/tsc-references/extendsTag2_es5.1.normal.js b/crates/swc/tests/tsc-references/extendsTag2_es5.1.normal.js index ccd0dd3c394..2d6b71b46ee 100644 --- a/crates/swc/tests/tsc-references/extendsTag2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTag2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/extendsTag2_es5.2.minified.js b/crates/swc/tests/tsc-references/extendsTag2_es5.2.minified.js index 8182ac6adf2..06a06af812e 100644 --- a/crates/swc/tests/tsc-references/extendsTag2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/extendsTag2_es5.2.minified.js @@ -32,8 +32,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/extendsTag3_es2015.1.normal.js b/crates/swc/tests/tsc-references/extendsTag3_es2015.1.normal.js index 4e41bf46b31..cf3d1f1ad80 100644 --- a/crates/swc/tests/tsc-references/extendsTag3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTag3_es2015.1.normal.js @@ -6,8 +6,7 @@ /** * @constructor */ class A { - constructor(){ - } + constructor(){} } /** * @extends {A} diff --git a/crates/swc/tests/tsc-references/extendsTag3_es5.1.normal.js b/crates/swc/tests/tsc-references/extendsTag3_es5.1.normal.js index 5f69b577660..52aff8f7343 100644 --- a/crates/swc/tests/tsc-references/extendsTag3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTag3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/extendsTag3_es5.2.minified.js b/crates/swc/tests/tsc-references/extendsTag3_es5.2.minified.js index 8182ac6adf2..06a06af812e 100644 --- a/crates/swc/tests/tsc-references/extendsTag3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/extendsTag3_es5.2.minified.js @@ -32,8 +32,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/extendsTag4_es2015.1.normal.js b/crates/swc/tests/tsc-references/extendsTag4_es2015.1.normal.js index fe82d0bae46..01b3a00b877 100644 --- a/crates/swc/tests/tsc-references/extendsTag4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTag4_es2015.1.normal.js @@ -6,8 +6,7 @@ /** * @constructor */ class A { - constructor(){ - } + constructor(){} } /** * @extends {A} */ diff --git a/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js b/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js index a0e47bf9ba3..4c4c3aff57f 100644 --- a/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js b/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js index 1ef21cf8af7..daf1c2e9161 100644 --- a/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js @@ -33,8 +33,7 @@ var C = function(B1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js index 0229afb806d..bb9517d31ff 100644 --- a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js @@ -10,10 +10,8 @@ var ns; class NestedClass { } nested.NestedClass = NestedClass; - })(nested1 = ns1.nested || (ns1.nested = { - })); -})(ns || (ns = { -})); + })(nested1 = ns1.nested || (ns1.nested = {})); +})(ns || (ns = {})); ns.Class; // Error ns.Value; // Error let c; diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js index 035d749442c..f7b6d7ab3b0 100644 --- a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js @@ -1,7 +1,5 @@ var ns, ns1; -(ns1 = ns || (ns = { -})).Class = class { -}, ns1.Value = "", (ns1.nested || (ns1.nested = { -})).NestedClass = class { +(ns1 = ns || (ns = {})).Class = class { +}, ns1.Value = "", (ns1.nested || (ns1.nested = {})).NestedClass = class { }, ns.Class, ns.Value; export { }; diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js b/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js index 732da5e3ebf..d2ba6fb0220 100644 --- a/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js @@ -19,10 +19,8 @@ var ns; _classCallCheck(this, NestedClass); }; nested.NestedClass = NestedClass; - })(nested1 = ns1.nested || (ns1.nested = { - })); -})(ns || (ns = { -})); + })(nested1 = ns1.nested || (ns1.nested = {})); +})(ns || (ns = {})); ns.Class; // Error ns.Value; // Error var c; diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js b/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js index bc798df7bf1..43e79740b45 100644 --- a/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js @@ -7,11 +7,9 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, Class); }; - ns1.Class = Class, ns1.Value = "", nested = ns1.nested || (ns1.nested = { - }), NestedClass = function() { + ns1.Class = Class, ns1.Value = "", nested = ns1.nested || (ns1.nested = {}), NestedClass = function() { "use strict"; _classCallCheck(this, NestedClass); }, nested.NestedClass = NestedClass; -}(ns || (ns = { -})), ns.Class, ns.Value; +}(ns || (ns = {})), ns.Class, ns.Value; export { }; diff --git a/crates/swc/tests/tsc-references/fluentClasses_es5.1.normal.js b/crates/swc/tests/tsc-references/fluentClasses_es5.1.normal.js index f4167b775f3..8ff0c38251f 100644 --- a/crates/swc/tests/tsc-references/fluentClasses_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/fluentClasses_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/fluentClasses_es5.2.minified.js b/crates/swc/tests/tsc-references/fluentClasses_es5.2.minified.js index 06fb81483a4..9d86ecfa183 100644 --- a/crates/swc/tests/tsc-references/fluentClasses_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/fluentClasses_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es2015.1.normal.js index a7e85c2c4e9..2c8ea55dc74 100644 --- a/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es2015.1.normal.js @@ -3,13 +3,10 @@ let a; for(let x in a){ let a1 = a[x + 1]; let a2 = a[x - 1]; - if (x === 1) { - } + if (x === 1) {} let a3 = x.unknownProperty; } var i; -for(var i in a){ -} +for(var i in a){} var j; -for(var j in a){ -} +for(var j in a){} diff --git a/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es5.1.normal.js index 315b47f3d8d..cb662689f43 100644 --- a/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatementsArrayErrors_es5.1.normal.js @@ -3,13 +3,10 @@ var a; for(var x in a){ var a1 = a[x + 1]; var a2 = a[x - 1]; - if (x === 1) { - } + if (x === 1) {} var a3 = x.unknownProperty; } var i; -for(var i in a){ -} +for(var i in a){} var j; -for(var j in a){ -} +for(var j in a){} diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring2_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring2_es2015.1.normal.js index fce226e5d38..e417cf611a0 100644 --- a/crates/swc/tests/tsc-references/for-inStatementsDestructuring2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring2_es2015.1.normal.js @@ -1,2 +1 @@ -for(var { a , b } in []){ -} +for(var { a , b } in []){} diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring_es2015.1.normal.js index 898a36c6a62..04a74c7b196 100644 --- a/crates/swc/tests/tsc-references/for-inStatementsDestructuring_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring_es2015.1.normal.js @@ -1,2 +1 @@ -for(var [a, b] in []){ -} +for(var [a, b] in []){} diff --git a/crates/swc/tests/tsc-references/for-inStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatements_es2015.1.normal.js index bb8460f6823..5a1bbac5687 100644 --- a/crates/swc/tests/tsc-references/for-inStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatements_es2015.1.normal.js @@ -1,108 +1,70 @@ var aString; -for(aString in { -}){ -} +for(aString in {}){} var anAny; -for(anAny in { -}){ -} -for(var x in { -}){ -} -for(var x in []){ -} +for(anAny in {}){} +for(var x in {}){} +for(var x in []){} for(var x in [ 1, 2, 3, 4, 5 -]){ -} -function fn() { -} -for(var x in fn()){ -} -for(var x in /[a-z]/){ -} -for(var x in new Date()){ -} +]){} +function fn() {} +for(var x in fn()){} +for(var x in /[a-z]/){} +for(var x in new Date()){} 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 42 ? d[x] : c[x]){ -} -for(var x in c[d]){ -} +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 42 ? d[x] : c[x]){} +for(var x in c[d]){} for(var x in (x1)=>x1 -){ -} +){} for(var x in function(x2, y) { return x2 + y; -}){ -} +}){} class A { biz() { - for(var x in this.biz()){ - } - for(var x in this.biz){ - } - for(var x in this){ - } + for(var x in this.biz()){} + for(var x in this.biz){} + for(var x in this){} return null; } static baz() { - for(var x in this){ - } - for(var x in this.baz){ - } - for(var x in this.baz()){ - } + for(var x in this){} + for(var x in this.baz){} + for(var x in this.baz()){} return null; } } class B extends A { boz() { - for(var x in this.biz()){ - } - for(var x in this.biz){ - } - for(var x in this){ - } - for(var x in super.biz){ - } - for(var x in super.biz()){ - } + for(var x in this.biz()){} + for(var x in this.biz){} + for(var x in this){} + for(var x in super.biz){} + for(var x in super.biz()){} return null; } } var i; -for(var x in i[42]){ -} +for(var x in i[42]){} var M; (function(M1) { class X { } M1.X = X; -})(M || (M = { -})); -for(var x in M){ -} -for(var x in M.X){ -} +})(M || (M = {})); +for(var x in M){} +for(var x in M.X){} var Color; (function(Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Blue"] = 1] = "Blue"; -})(Color || (Color = { -})); -for(var x in Color){ -} -for(var x in Color.Blue){ -} +})(Color || (Color = {})); +for(var x in Color){} +for(var x in Color.Blue){} diff --git a/crates/swc/tests/tsc-references/for-inStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-inStatements_es2015.2.minified.js index 96a2d5513a4..e2eea6dc198 100644 --- a/crates/swc/tests/tsc-references/for-inStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/for-inStatements_es2015.2.minified.js @@ -1,10 +1,7 @@ var aString, anAny, c, d, e, i, M, Color, Color; -for(aString in { -}); -for(anAny in { -}); -for(var x in { -}); +for(aString in {}); +for(anAny in {}); +for(var x in {}); for(var x in []); for(var x in [ 1, @@ -13,8 +10,7 @@ for(var x in [ 4, 5 ]); -function fn() { -} +function fn() {} for(var x in fn()); for(var x in /[a-z]/); for(var x in new Date()); @@ -30,10 +26,8 @@ for(var x in function(x2, y) { return x2 + y; }); for(var x in i[42]); -for(var x in (M || (M = { -})).X = class { +for(var x in (M || (M = {})).X = class { }, M); for(var x in M.X); -for(var x in (Color = Color || (Color = { -}))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue", Color); +for(var x in (Color = Color || (Color = {}))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue", Color); for(var x in Color.Blue); diff --git a/crates/swc/tests/tsc-references/for-inStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/for-inStatements_es5.1.normal.js index 061bb2f461c..eca10e2af80 100644 --- a/crates/swc/tests/tsc-references/for-inStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatements_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -107,55 +106,35 @@ function _createSuper(Derived) { }; } var aString; -for(aString in { -}){ -} +for(aString in {}){} var anAny; -for(anAny in { -}){ -} -for(var x in { -}){ -} -for(var x in []){ -} +for(anAny in {}){} +for(var x in {}){} +for(var x in []){} for(var x in [ 1, 2, 3, 4, 5 -]){ -} -function fn() { -} -for(var x in fn()){ -} -for(var x in /[a-z]/){ -} -for(var x in new Date()){ -} +]){} +function fn() {} +for(var x in fn()){} +for(var x in /[a-z]/){} +for(var x in new Date()){} 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 42 ? d[x] : c[x]){ -} -for(var x in c[d]){ -} +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 42 ? d[x] : c[x]){} +for(var x in c[d]){} for(var x in function(x1) { return x1; -}){ -} +}){} for(var x in function(x2, y) { return x2 + y; -}){ -} +}){} var A = /*#__PURE__*/ function() { "use strict"; function A() { @@ -165,12 +144,9 @@ var A = /*#__PURE__*/ function() { { key: "biz", value: function biz() { - for(var x in this.biz()){ - } - for(var x in this.biz){ - } - for(var x in this){ - } + for(var x in this.biz()){} + for(var x in this.biz){} + for(var x in this){} return null; } } @@ -178,12 +154,9 @@ var A = /*#__PURE__*/ function() { { key: "baz", value: function baz() { - for(var x in this){ - } - for(var x in this.baz){ - } - for(var x in this.baz()){ - } + for(var x in this){} + for(var x in this.baz){} + for(var x in this.baz()){} return null; } } @@ -202,16 +175,11 @@ var B = /*#__PURE__*/ function(A) { { key: "boz", value: function boz() { - for(var x in this.biz()){ - } - for(var x in this.biz){ - } - for(var x in this){ - } - for(var x in _get(_getPrototypeOf(B.prototype), "biz", this)){ - } - for(var x in _get(_getPrototypeOf(B.prototype), "biz", this).call(this)){ - } + for(var x in this.biz()){} + for(var x in this.biz){} + for(var x in this){} + for(var x in _get(_getPrototypeOf(B.prototype), "biz", this)){} + for(var x in _get(_getPrototypeOf(B.prototype), "biz", this).call(this)){} return null; } } @@ -219,8 +187,7 @@ var B = /*#__PURE__*/ function(A) { return B; }(A); var i; -for(var x in i[42]){ -} +for(var x in i[42]){} var M; (function(M1) { var X = function X() { @@ -228,19 +195,13 @@ var M; _classCallCheck(this, X); }; M1.X = X; -})(M || (M = { -})); -for(var x in M){ -} -for(var x in M.X){ -} +})(M || (M = {})); +for(var x in M){} +for(var x in M.X){} var Color; (function(Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Blue"] = 1] = "Blue"; -})(Color || (Color = { -})); -for(var x in Color){ -} -for(var x in Color.Blue){ -} +})(Color || (Color = {})); +for(var x in Color){} +for(var x in Color.Blue){} diff --git a/crates/swc/tests/tsc-references/for-inStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/for-inStatements_es5.2.minified.js index 308805872be..7775f45ac41 100644 --- a/crates/swc/tests/tsc-references/for-inStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/for-inStatements_es5.2.minified.js @@ -33,12 +33,9 @@ function _superPropBase(object, property) { for(; !Object.prototype.hasOwnProperty.call(object, property) && null !== (object = _getPrototypeOf(object));); return object; } -for(aString in { -}); -for(anAny in { -}); -for(var x in { -}); +for(aString in {}); +for(anAny in {}); +for(var x in {}); for(var x in []); for(var x in [ 1, @@ -47,8 +44,7 @@ for(var x in [ 4, 5 ]); -function fn() { -} +function fn() {} for(var x in fn()); for(var x in /[a-z]/); for(var x in new Date()); @@ -108,8 +104,7 @@ var Color, aString, anAny, c, d, e, i, M, Color, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -150,9 +145,7 @@ for(var x in !function(M1) { _classCallCheck(this, X); }; M1.X = X; -}(M || (M = { -})), M); +}(M || (M = {})), M); for(var x in M.X); -for(var x in (Color = Color || (Color = { -}))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue", Color); +for(var x in (Color = Color || (Color = {}))[Color.Red = 0] = "Red", Color[Color.Blue = 1] = "Blue", Color); for(var x in Color.Blue); diff --git a/crates/swc/tests/tsc-references/for-of10_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of10_es2015.1.normal.js index bbd5818b552..44374bf0cc6 100644 --- a/crates/swc/tests/tsc-references/for-of10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of10_es2015.1.normal.js @@ -2,5 +2,4 @@ var v; for (v of [ 0 -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/for-of11_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of11_es2015.1.normal.js index 3b845f23876..21376a36a22 100644 --- a/crates/swc/tests/tsc-references/for-of11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of11_es2015.1.normal.js @@ -3,5 +3,4 @@ var v; for (v of [ 0, "" -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/for-of12_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of12_es2015.1.normal.js index 8c6aa16a5a2..1f5f738b587 100644 --- a/crates/swc/tests/tsc-references/for-of12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of12_es2015.1.normal.js @@ -3,5 +3,4 @@ var v; for (v of [ 0, "" -].values()){ -} +].values()){} diff --git a/crates/swc/tests/tsc-references/for-of13_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of13_es2015.1.normal.js index db5e76f1b3d..f0929f3473e 100644 --- a/crates/swc/tests/tsc-references/for-of13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of13_es2015.1.normal.js @@ -2,5 +2,4 @@ var v; for (v of [ "" -].values()){ -} +].values()){} diff --git a/crates/swc/tests/tsc-references/for-of14_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of14_es2015.1.normal.js index 82ef5e26c05..c98b5806178 100644 --- a/crates/swc/tests/tsc-references/for-of14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of14_es2015.1.normal.js @@ -5,5 +5,4 @@ class StringIterator { } } var v; -for (v of new StringIterator){ -} // Should fail because the iterator is not iterable +for (v of new StringIterator){} // Should fail because the iterator is not iterable diff --git a/crates/swc/tests/tsc-references/for-of15_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of15_es2015.1.normal.js index 7474f8bcefa..0348768b07f 100644 --- a/crates/swc/tests/tsc-references/for-of15_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of15_es2015.1.normal.js @@ -9,5 +9,4 @@ class StringIterator { } } var v; -for (v of new StringIterator){ -} // Should fail +for (v of new StringIterator){} // Should fail diff --git a/crates/swc/tests/tsc-references/for-of16_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of16_es2015.1.normal.js index c4628919b6a..37a4acf489e 100644 --- a/crates/swc/tests/tsc-references/for-of16_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of16_es2015.1.normal.js @@ -6,5 +6,4 @@ class StringIterator { } } var v; -for (v of new StringIterator){ -} // Should fail +for (v of new StringIterator){} // Should fail diff --git a/crates/swc/tests/tsc-references/for-of17_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of17_es2015.1.normal.js index b85c8016233..92a76c55421 100644 --- a/crates/swc/tests/tsc-references/for-of17_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of17_es2015.1.normal.js @@ -12,5 +12,4 @@ class NumberIterator { } } var v; -for (v of new NumberIterator){ -} // Should succeed +for (v of new NumberIterator){} // Should succeed diff --git a/crates/swc/tests/tsc-references/for-of18_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of18_es2015.1.normal.js index 678db1de7c3..a14caa0f836 100644 --- a/crates/swc/tests/tsc-references/for-of18_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of18_es2015.1.normal.js @@ -12,5 +12,4 @@ class StringIterator { } } var v; -for (v of new StringIterator){ -} // Should succeed +for (v of new StringIterator){} // Should succeed diff --git a/crates/swc/tests/tsc-references/for-of1_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of1_es2015.1.normal.js index 909f10473dd..d84e36242e0 100644 --- a/crates/swc/tests/tsc-references/for-of1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of1_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 var v; -for (v of []){ -} +for (v of []){} diff --git a/crates/swc/tests/tsc-references/for-of22_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of22_es2015.1.normal.js index 3e9b856e0f2..55ef235bd36 100644 --- a/crates/swc/tests/tsc-references/for-of22_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of22_es2015.1.normal.js @@ -14,5 +14,4 @@ class FooIterator { } } v; -for (var v of new FooIterator){ -} +for (var v of new FooIterator){} diff --git a/crates/swc/tests/tsc-references/for-of24_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of24_es2015.1.normal.js index c98ec21b82c..7324e739615 100644 --- a/crates/swc/tests/tsc-references/for-of24_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of24_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 var x; -for (var v of x){ -} +for (var v of x){} diff --git a/crates/swc/tests/tsc-references/for-of25_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of25_es2015.1.normal.js index 9893da8d356..31631776bb1 100644 --- a/crates/swc/tests/tsc-references/for-of25_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of25_es2015.1.normal.js @@ -6,5 +6,4 @@ class StringIterator { } } var x; -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of26_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of26_es2015.1.normal.js index f9aea65d2a2..b4d8169f3ff 100644 --- a/crates/swc/tests/tsc-references/for-of26_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of26_es2015.1.normal.js @@ -9,5 +9,4 @@ class StringIterator { } } var x; -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of27_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of27_es2015.1.normal.js index a5c1e310542..c25e87b0272 100644 --- a/crates/swc/tests/tsc-references/for-of27_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of27_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES6 class StringIterator { } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of28_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of28_es2015.1.normal.js index a0d43d497fd..7c5ae3db64f 100644 --- a/crates/swc/tests/tsc-references/for-of28_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of28_es2015.1.normal.js @@ -5,5 +5,4 @@ class StringIterator { return this; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of29_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of29_es2015.1.normal.js index 7bba2e2a22b..12b76df2831 100644 --- a/crates/swc/tests/tsc-references/for-of29_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of29_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 var iterableWithOptionalIterator; -for (var v of iterableWithOptionalIterator){ -} +for (var v of iterableWithOptionalIterator){} diff --git a/crates/swc/tests/tsc-references/for-of30_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of30_es2015.1.normal.js index 5122d084bd0..c38a7b2fa33 100644 --- a/crates/swc/tests/tsc-references/for-of30_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of30_es2015.1.normal.js @@ -14,5 +14,4 @@ class StringIterator { this.return = 0; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of31_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of31_es2015.1.normal.js index ef789ef4fb7..56ccb10823f 100644 --- a/crates/swc/tests/tsc-references/for-of31_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of31_es2015.1.normal.js @@ -11,5 +11,4 @@ class StringIterator { return this; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of32_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of32_es2015.1.normal.js index 8cca01d6f73..13e3e3a3462 100644 --- a/crates/swc/tests/tsc-references/for-of32_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of32_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 //@noImplicitAny: true -for (var v of v){ -} +for (var v of v){} diff --git a/crates/swc/tests/tsc-references/for-of33_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of33_es2015.1.normal.js index d620a0d24fe..80444a8bc14 100644 --- a/crates/swc/tests/tsc-references/for-of33_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of33_es2015.1.normal.js @@ -6,5 +6,4 @@ class StringIterator { return v; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of34_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of34_es2015.1.normal.js index 2b792a6eb08..4b274debb75 100644 --- a/crates/swc/tests/tsc-references/for-of34_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of34_es2015.1.normal.js @@ -9,5 +9,4 @@ class StringIterator { return this; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of35_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of35_es2015.1.normal.js index 86278a3f050..5e7bea83f67 100644 --- a/crates/swc/tests/tsc-references/for-of35_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of35_es2015.1.normal.js @@ -12,5 +12,4 @@ class StringIterator { return this; } } -for (var v of new StringIterator){ -} +for (var v of new StringIterator){} diff --git a/crates/swc/tests/tsc-references/for-of47_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of47_es2015.1.normal.js index edce9a5b237..baf825fa46c 100644 --- a/crates/swc/tests/tsc-references/for-of47_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of47_es2015.1.normal.js @@ -9,8 +9,7 @@ var array = [ var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); for ({ x , y: y = E.x } of array){ x; y; diff --git a/crates/swc/tests/tsc-references/for-of47_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-of47_es2015.2.minified.js index c53766ded90..3122e6cb39a 100644 --- a/crates/swc/tests/tsc-references/for-of47_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/for-of47_es2015.2.minified.js @@ -1,6 +1,5 @@ var x, y, E, E; -for ({ x , y: y = E.x } of ((E = E || (E = { -}))[E.x = 0] = "x", [ +for ({ x , y: y = E.x } of ((E = E || (E = {}))[E.x = 0] = "x", [ { x: "", y: !0 diff --git a/crates/swc/tests/tsc-references/for-of47_es5.1.normal.js b/crates/swc/tests/tsc-references/for-of47_es5.1.normal.js index e12230bfcf8..a22b6d5d00e 100644 --- a/crates/swc/tests/tsc-references/for-of47_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of47_es5.1.normal.js @@ -9,8 +9,7 @@ var array = [ var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = array[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ diff --git a/crates/swc/tests/tsc-references/for-of47_es5.2.minified.js b/crates/swc/tests/tsc-references/for-of47_es5.2.minified.js index a3b179dd914..f97376ae8f4 100644 --- a/crates/swc/tests/tsc-references/for-of47_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/for-of47_es5.2.minified.js @@ -1,6 +1,5 @@ var E; -(E = E || (E = { -}))[E.x = 0] = "x"; +(E = E || (E = {}))[E.x = 0] = "x"; var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for(var E, ref, ref1, _step, _iterator = [ diff --git a/crates/swc/tests/tsc-references/for-of48_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of48_es2015.1.normal.js index 809e255c891..1a7762e4393 100644 --- a/crates/swc/tests/tsc-references/for-of48_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of48_es2015.1.normal.js @@ -9,8 +9,7 @@ var array = [ var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); for ({ x , y =E.x } of array){ x; y; diff --git a/crates/swc/tests/tsc-references/for-of48_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-of48_es2015.2.minified.js index 3898b1e1101..810f7a4d732 100644 --- a/crates/swc/tests/tsc-references/for-of48_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/for-of48_es2015.2.minified.js @@ -1,6 +1,5 @@ var x, y, E, E; -for ({ x , y =E.x } of ((E = E || (E = { -}))[E.x = 0] = "x", [ +for ({ x , y =E.x } of ((E = E || (E = {}))[E.x = 0] = "x", [ { x: "", y: !0 diff --git a/crates/swc/tests/tsc-references/for-of48_es5.1.normal.js b/crates/swc/tests/tsc-references/for-of48_es5.1.normal.js index e12230bfcf8..a22b6d5d00e 100644 --- a/crates/swc/tests/tsc-references/for-of48_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of48_es5.1.normal.js @@ -9,8 +9,7 @@ var array = [ var E; (function(E) { E[E["x"] = 0] = "x"; -})(E || (E = { -})); +})(E || (E = {})); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = array[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ diff --git a/crates/swc/tests/tsc-references/for-of48_es5.2.minified.js b/crates/swc/tests/tsc-references/for-of48_es5.2.minified.js index a3b179dd914..f97376ae8f4 100644 --- a/crates/swc/tests/tsc-references/for-of48_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/for-of48_es5.2.minified.js @@ -1,6 +1,5 @@ var E; -(E = E || (E = { -}))[E.x = 0] = "x"; +(E = E || (E = {}))[E.x = 0] = "x"; var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for(var E, ref, ref1, _step, _iterator = [ diff --git a/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js index 51fb2ea8039..e934906fab3 100644 --- a/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (let let of []){ -} +for (let let of []){} diff --git a/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js index f26bc9e41cf..5b7c906e370 100644 --- a/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES6 for (let [v, v] of [ [] -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js index 0e318b37749..ab71a721a68 100644 --- a/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (var let of []){ -} +for (var let of []){} diff --git a/crates/swc/tests/tsc-references/for-of57_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of57_es2015.1.normal.js index 97ca9171074..df953d78a9e 100644 --- a/crates/swc/tests/tsc-references/for-of57_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of57_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 var iter; -for (let num of iter){ -} +for (let num of iter){} diff --git a/crates/swc/tests/tsc-references/for-of7_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of7_es2015.1.normal.js index 0e6d177c45f..07ec5267a94 100644 --- a/crates/swc/tests/tsc-references/for-of7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of7_es2015.1.normal.js @@ -2,5 +2,4 @@ v; for (let v1 of [ 0 -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/for-of8_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of8_es2015.1.normal.js index 793bf07654e..ae7c3826cd3 100644 --- a/crates/swc/tests/tsc-references/for-of8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of8_es2015.1.normal.js @@ -2,5 +2,4 @@ v; for (var v of [ 0 -]){ -} +]){} diff --git a/crates/swc/tests/tsc-references/for-of9_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of9_es2015.1.normal.js index 67999bffe29..fe900c63f8a 100644 --- a/crates/swc/tests/tsc-references/for-of9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/for-of9_es2015.1.normal.js @@ -2,7 +2,5 @@ var v; for (v of [ "hello" -]){ -} -for (v of "hello"){ -} +]){} +for (v of "hello"){} diff --git a/crates/swc/tests/tsc-references/forBreakStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/forBreakStatements_es2015.1.normal.js index e8aa15c7781..57527ba0746 100644 --- a/crates/swc/tests/tsc-references/forBreakStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forBreakStatements_es2015.1.normal.js @@ -19,7 +19,6 @@ for(;;){ } SEVEN: for(;;)for(;;)for(;;)break SEVEN; EIGHT: for(;;){ - var fn = function() { - }; + var fn = function() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/forBreakStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/forBreakStatements_es5.1.normal.js index 6d6b63d2de8..ce4d6b825bc 100644 --- a/crates/swc/tests/tsc-references/forBreakStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forBreakStatements_es5.1.normal.js @@ -19,7 +19,6 @@ for(;;){ } SEVEN: for(;;)for(;;)for(;;)break SEVEN; EIGHT: for(;;){ - var fn = function fn() { - }; + var fn = function fn() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/forContinueStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/forContinueStatements_es2015.1.normal.js index f4e5ffac33b..e7efc60bad8 100644 --- a/crates/swc/tests/tsc-references/forContinueStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forContinueStatements_es2015.1.normal.js @@ -18,7 +18,6 @@ for(;;){ } SEVEN: for(;;)for(;;)for(;;)continue SEVEN; EIGHT: for(;;){ - var fn = function() { - }; + var fn = function() {}; continue EIGHT; } diff --git a/crates/swc/tests/tsc-references/forContinueStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/forContinueStatements_es5.1.normal.js index 3d5cc4d4007..88d021a4aa2 100644 --- a/crates/swc/tests/tsc-references/forContinueStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forContinueStatements_es5.1.normal.js @@ -18,7 +18,6 @@ for(;;){ } SEVEN: for(;;)for(;;)for(;;)continue SEVEN; EIGHT: for(;;){ - var fn = function fn() { - }; + var fn = function fn() {}; continue EIGHT; } diff --git a/crates/swc/tests/tsc-references/forInBreakStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/forInBreakStatements_es2015.1.normal.js index 516bb9586bb..7bf803fea1a 100644 --- a/crates/swc/tests/tsc-references/forInBreakStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forInBreakStatements_es2015.1.normal.js @@ -1,35 +1,23 @@ // @allowUnusedLabels: true -for(var x in { -}){ +for(var x in {}){ break; } -ONE: for(var x in { -}){ +ONE: for(var x in {}){ break ONE; } -TWO: THREE: for(var x in { -}){ +TWO: THREE: for(var x in {}){ break THREE; } -FOUR: for(var x in { -}){ - FIVE: for(var x in { - }){ +FOUR: for(var x in {}){ + FIVE: for(var x in {}){ break FOUR; } } -for(var x in { -}){ - SIX: for(var x in { - })break SIX; +for(var x in {}){ + SIX: for(var x in {})break SIX; } -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})break SEVEN; -EIGHT: for(var x in { -}){ - var fn = function() { - }; +SEVEN: for(var x in {})for(var x in {})for(var x in {})break SEVEN; +EIGHT: for(var x in {}){ + var fn = function() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/forInBreakStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/forInBreakStatements_es2015.2.minified.js index da99580742d..38ca01fdc95 100644 --- a/crates/swc/tests/tsc-references/forInBreakStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/forInBreakStatements_es2015.2.minified.js @@ -1,18 +1,7 @@ -for(var x in { -})break; -ONE: for(var x in { -})break ONE; -TWO: THREE: for(var x in { -})break THREE; -FOUR: for(var x in { -})FIVE: for(var x in { -})break FOUR; -for(var x in { -})SIX: for(var x in { -})break SIX; -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})break SEVEN; -EIGHT: for(var x in { -})break EIGHT; +for(var x in {})break; +ONE: for(var x in {})break ONE; +TWO: THREE: for(var x in {})break THREE; +FOUR: for(var x in {})FIVE: for(var x in {})break FOUR; +for(var x in {})SIX: for(var x in {})break SIX; +SEVEN: for(var x in {})for(var x in {})for(var x in {})break SEVEN; +EIGHT: for(var x in {})break EIGHT; diff --git a/crates/swc/tests/tsc-references/forInBreakStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/forInBreakStatements_es5.1.normal.js index e190167cdc9..a60692e1ba6 100644 --- a/crates/swc/tests/tsc-references/forInBreakStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forInBreakStatements_es5.1.normal.js @@ -1,35 +1,23 @@ // @allowUnusedLabels: true -for(var x in { -}){ +for(var x in {}){ break; } -ONE: for(var x in { -}){ +ONE: for(var x in {}){ break ONE; } -TWO: THREE: for(var x in { -}){ +TWO: THREE: for(var x in {}){ break THREE; } -FOUR: for(var x in { -}){ - FIVE: for(var x in { - }){ +FOUR: for(var x in {}){ + FIVE: for(var x in {}){ break FOUR; } } -for(var x in { -}){ - SIX: for(var x in { - })break SIX; +for(var x in {}){ + SIX: for(var x in {})break SIX; } -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})break SEVEN; -EIGHT: for(var x in { -}){ - var fn = function fn() { - }; +SEVEN: for(var x in {})for(var x in {})for(var x in {})break SEVEN; +EIGHT: for(var x in {}){ + var fn = function fn() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/forInBreakStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/forInBreakStatements_es5.2.minified.js index da99580742d..38ca01fdc95 100644 --- a/crates/swc/tests/tsc-references/forInBreakStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/forInBreakStatements_es5.2.minified.js @@ -1,18 +1,7 @@ -for(var x in { -})break; -ONE: for(var x in { -})break ONE; -TWO: THREE: for(var x in { -})break THREE; -FOUR: for(var x in { -})FIVE: for(var x in { -})break FOUR; -for(var x in { -})SIX: for(var x in { -})break SIX; -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})break SEVEN; -EIGHT: for(var x in { -})break EIGHT; +for(var x in {})break; +ONE: for(var x in {})break ONE; +TWO: THREE: for(var x in {})break THREE; +FOUR: for(var x in {})FIVE: for(var x in {})break FOUR; +for(var x in {})SIX: for(var x in {})break SIX; +SEVEN: for(var x in {})for(var x in {})for(var x in {})break SEVEN; +EIGHT: for(var x in {})break EIGHT; diff --git a/crates/swc/tests/tsc-references/forInContinueStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/forInContinueStatements_es2015.1.normal.js index 621e0749ab6..5cb7988cdff 100644 --- a/crates/swc/tests/tsc-references/forInContinueStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forInContinueStatements_es2015.1.normal.js @@ -1,35 +1,23 @@ // @allowUnusedLabels: true -for(var x in { -}){ +for(var x in {}){ continue; } -ONE: for(var x in { -}){ +ONE: for(var x in {}){ continue ONE; } -TWO: THREE: for(var x in { -}){ +TWO: THREE: for(var x in {}){ continue THREE; } -FOUR: for(var x in { -}){ - FIVE: for(var x in { - }){ +FOUR: for(var x in {}){ + FIVE: for(var x in {}){ continue FOUR; } } -for(var x in { -}){ - SIX: for(var x in { - })continue SIX; +for(var x in {}){ + SIX: for(var x in {})continue SIX; } -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})continue SEVEN; -EIGHT: for(var x in { -}){ - var fn = function() { - }; +SEVEN: for(var x in {})for(var x in {})for(var x in {})continue SEVEN; +EIGHT: for(var x in {}){ + var fn = function() {}; continue EIGHT; } diff --git a/crates/swc/tests/tsc-references/forInContinueStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/forInContinueStatements_es2015.2.minified.js index 74e677df675..ae0df3f32d1 100644 --- a/crates/swc/tests/tsc-references/forInContinueStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/forInContinueStatements_es2015.2.minified.js @@ -1,18 +1,7 @@ -for(var x in { -})continue; -ONE: for(var x in { -})continue ONE; -TWO: THREE: for(var x in { -})continue THREE; -FOUR: for(var x in { -})FIVE: for(var x in { -})continue FOUR; -for(var x in { -})SIX: for(var x in { -})continue SIX; -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})continue SEVEN; -EIGHT: for(var x in { -})continue EIGHT; +for(var x in {})continue; +ONE: for(var x in {})continue ONE; +TWO: THREE: for(var x in {})continue THREE; +FOUR: for(var x in {})FIVE: for(var x in {})continue FOUR; +for(var x in {})SIX: for(var x in {})continue SIX; +SEVEN: for(var x in {})for(var x in {})for(var x in {})continue SEVEN; +EIGHT: for(var x in {})continue EIGHT; diff --git a/crates/swc/tests/tsc-references/forInContinueStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/forInContinueStatements_es5.1.normal.js index db30d34a15a..a95ba04819d 100644 --- a/crates/swc/tests/tsc-references/forInContinueStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forInContinueStatements_es5.1.normal.js @@ -1,35 +1,23 @@ // @allowUnusedLabels: true -for(var x in { -}){ +for(var x in {}){ continue; } -ONE: for(var x in { -}){ +ONE: for(var x in {}){ continue ONE; } -TWO: THREE: for(var x in { -}){ +TWO: THREE: for(var x in {}){ continue THREE; } -FOUR: for(var x in { -}){ - FIVE: for(var x in { - }){ +FOUR: for(var x in {}){ + FIVE: for(var x in {}){ continue FOUR; } } -for(var x in { -}){ - SIX: for(var x in { - })continue SIX; +for(var x in {}){ + SIX: for(var x in {})continue SIX; } -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})continue SEVEN; -EIGHT: for(var x in { -}){ - var fn = function fn() { - }; +SEVEN: for(var x in {})for(var x in {})for(var x in {})continue SEVEN; +EIGHT: for(var x in {}){ + var fn = function fn() {}; continue EIGHT; } diff --git a/crates/swc/tests/tsc-references/forInContinueStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/forInContinueStatements_es5.2.minified.js index 74e677df675..ae0df3f32d1 100644 --- a/crates/swc/tests/tsc-references/forInContinueStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/forInContinueStatements_es5.2.minified.js @@ -1,18 +1,7 @@ -for(var x in { -})continue; -ONE: for(var x in { -})continue ONE; -TWO: THREE: for(var x in { -})continue THREE; -FOUR: for(var x in { -})FIVE: for(var x in { -})continue FOUR; -for(var x in { -})SIX: for(var x in { -})continue SIX; -SEVEN: for(var x in { -})for(var x in { -})for(var x in { -})continue SEVEN; -EIGHT: for(var x in { -})continue EIGHT; +for(var x in {})continue; +ONE: for(var x in {})continue ONE; +TWO: THREE: for(var x in {})continue THREE; +FOUR: for(var x in {})FIVE: for(var x in {})continue FOUR; +for(var x in {})SIX: for(var x in {})continue SIX; +SEVEN: for(var x in {})for(var x in {})for(var x in {})continue SEVEN; +EIGHT: for(var x in {})continue EIGHT; diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.1.normal.js index 4084da83240..c834afdb630 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.1.normal.js @@ -16,54 +16,35 @@ var M; return x.toString(); } M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); // all of these are errors -for(var a;;){ -} -for(var a = 1;;){ -} -for(var a = 'a string';;){ -} -for(var a = new C();;){ -} -for(var a = new D();;){ -} -for(var a = M;;){ -} -for(var b;;){ -} -for(var b = new C();;){ -} -for(var b = new C2();;){ -} -for(var f = F;;){ -} +for(var a;;){} +for(var a = 1;;){} +for(var a = 'a string';;){} +for(var a = new C();;){} +for(var a = new D();;){} +for(var a = M;;){} +for(var b;;){} +for(var b = new C();;){} +for(var b = new C2();;){} +for(var f = F;;){} for(var f = (x)=>'' -;;){ -} -for(var arr;;){ -} +;;){} +for(var arr;;){} for(var arr = [ 1, 2, 3, 4 -];;){ -} +];;){} for(var arr = [ new C(), new C2(), new D() -];;){ -} +];;){} for(var arr2 = [ new D() -];;){ -} -for(var arr2 = new Array();;){ -} -for(var m;;){ -} -for(var m = M.A;;){ -} +];;){} +for(var arr2 = new Array();;){} +for(var m;;){} +for(var m = M.A;;){} diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.2.minified.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.2.minified.js index 1b2803ca490..3451091a114 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es2015.2.minified.js @@ -5,8 +5,7 @@ class C2 extends C { } class D { } -for((M = M1 || (M1 = { -})).A = class { +for((M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); };;); diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.1.normal.js index f9b06c13366..4eb806e2eb8 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,55 +100,36 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); // all of these are errors -for(var a;;){ -} -for(var a = 1;;){ -} -for(var a = 'a string';;){ -} -for(var a = new C();;){ -} -for(var a = new D();;){ -} -for(var a = M;;){ -} -for(var b;;){ -} -for(var b = new C();;){ -} -for(var b = new C2();;){ -} -for(var f = F;;){ -} +for(var a;;){} +for(var a = 1;;){} +for(var a = 'a string';;){} +for(var a = new C();;){} +for(var a = new D();;){} +for(var a = M;;){} +for(var b;;){} +for(var b = new C();;){} +for(var b = new C2();;){} +for(var f = F;;){} for(var f = function(x) { return ''; -};;){ -} -for(var arr;;){ -} +};;){} +for(var arr;;){} for(var arr = [ 1, 2, 3, 4 -];;){ -} +];;){} for(var arr = [ new C(), new C2(), new D() -];;){ -} +];;){} for(var arr2 = [ new D() -];;){ -} -for(var arr2 = new Array();;){ -} -for(var m;;){ -} -for(var m = M.A;;){ -} +];;){} +for(var arr2 = new Array();;){} +for(var m;;){} +for(var m = M.A;;){} diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.2.minified.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.2.minified.js index 57735214fe0..0a28f273461 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl_es5.2.minified.js @@ -32,8 +32,7 @@ var M, C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -66,8 +65,7 @@ for(!function(M1) { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -}));;); +}(M || (M = {}));;); for(;;); for(;;); for(new C();;); diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es2015.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es2015.1.normal.js index c33ee914b13..5f0621cd085 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es2015.1.normal.js @@ -1,72 +1,49 @@ // @allowUnreachableCode: true // all expected to be valid -for(var x;;){ -} -for(var x = 2;;){ -} -for(var x = undefined;;){ -} +for(var x;;){} +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 p;;){ + for(var x = 'this is a string';;){} } +for(var p;;){} for(var p = { x: 1, y: 2 -};;){ -} +};;){} for(var p = { x: 0, y: undefined -};;){ -} +};;){} for(var p = { x: 1, y: undefined -};;){ -} +};;){} for(var p = { x: 1, y: 2 -};;){ -} +};;){} for(var p = { x: 0, y: undefined -};;){ -} -for(var p;;){ -} +};;){} +for(var p;;){} for(var fn = function(s) { return 42; -};;){ -} +};;){} for(var fn = (s)=>3 -;;){ -} -for(var fn;;){ -} -for(var fn;;){ -} -for(var fn = null;;){ -} -for(var fn;;){ -} -for(var a;;){ -} +;;){} +for(var fn;;){} +for(var fn;;){} +for(var fn = null;;){} +for(var fn;;){} +for(var a;;){} for(var a = [ 'a', 'b' -];;){ -} -for(var a = [];;){ -} -for(var a = [];;){ -} -for(var a = new Array();;){ -} -for(var a;;){ -} +];;){} +for(var a = [];;){} +for(var a = [];;){} +for(var a = new Array();;){} +for(var a;;){} diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es5.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es5.1.normal.js index fe52a2848cd..bb4c67ca4d1 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl_es5.1.normal.js @@ -1,73 +1,50 @@ // @allowUnreachableCode: true // all expected to be valid -for(var x;;){ -} -for(var x = 2;;){ -} -for(var x = undefined;;){ -} +for(var x;;){} +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 p;;){ + for(var x = 'this is a string';;){} } +for(var p;;){} for(var p = { x: 1, y: 2 -};;){ -} +};;){} for(var p = { x: 0, y: undefined -};;){ -} +};;){} for(var p = { x: 1, y: undefined -};;){ -} +};;){} for(var p = { x: 1, y: 2 -};;){ -} +};;){} for(var p = { x: 0, y: undefined -};;){ -} -for(var p;;){ -} +};;){} +for(var p;;){} for(var fn = function fn(s) { return 42; -};;){ -} +};;){} for(var fn = function(s) { return 3; -};;){ -} -for(var fn;;){ -} -for(var fn;;){ -} -for(var fn = null;;){ -} -for(var fn;;){ -} -for(var a;;){ -} +};;){} +for(var fn;;){} +for(var fn;;){} +for(var fn = null;;){} +for(var fn;;){} +for(var a;;){} for(var a = [ 'a', 'b' -];;){ -} -for(var a = [];;){ -} -for(var a = [];;){ -} -for(var a = new Array();;){ -} -for(var a;;){ -} +];;){} +for(var a = [];;){} +for(var a = [];;){} +for(var a = new Array();;){} +for(var a;;){} diff --git a/crates/swc/tests/tsc-references/forStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/forStatements_es2015.1.normal.js index 22d4e37d924..4aebb7e791c 100644 --- a/crates/swc/tests/tsc-references/forStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatements_es2015.1.normal.js @@ -14,45 +14,26 @@ var M; return x.toString(); } M1.F2 = F2; -})(M || (M = { -})); -for(var aNumber = 9.9;;){ -} -for(var aString = 'this is a string';;){ -} -for(var aDate = new Date(12);;){ -} -for(var anObject = new Object();;){ -} -for(var anAny = null;;){ -} -for(var aSecondAny = undefined;;){ -} -for(var aVoid = undefined;;){ -} -for(var anInterface = new C();;){ -} -for(var aClass = new C();;){ -} -for(var aGenericClass = new D();;){ -} +})(M || (M = {})); +for(var aNumber = 9.9;;){} +for(var aString = 'this is a string';;){} +for(var aDate = new Date(12);;){} +for(var anObject = new Object();;){} +for(var anAny = null;;){} +for(var aSecondAny = undefined;;){} +for(var aVoid = undefined;;){} +for(var anInterface = new C();;){} +for(var aClass = new C();;){} +for(var aGenericClass = new D();;){} for(var anObjectLiteral = { id: 12 -};;){ -} -for(var anOtherObjectLiteral = new C();;){ -} -for(var aFunction = F;;){ -} -for(var anOtherFunction = F;;){ -} +};;){} +for(var anOtherObjectLiteral = new C();;){} +for(var aFunction = F;;){} +for(var anOtherFunction = F;;){} for(var aLambda = (x)=>2 -;;){ -} -for(var aModule = M;;){ -} -for(var aClassInModule = new M.A();;){ -} +;;){} +for(var aModule = M;;){} +for(var aClassInModule = new M.A();;){} for(var aFunctionInModule = (x)=>'this is a string' -;;){ -} +;;){} diff --git a/crates/swc/tests/tsc-references/forStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/forStatements_es2015.2.minified.js index a44901739fc..8ae76d68541 100644 --- a/crates/swc/tests/tsc-references/forStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/forStatements_es2015.2.minified.js @@ -1,8 +1,7 @@ var M, M1; class C { } -for((M = M1 || (M1 = { -})).A = class { +for((M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); };;); diff --git a/crates/swc/tests/tsc-references/forStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/forStatements_es5.1.normal.js index f014d5d7b60..6116d7e7126 100644 --- a/crates/swc/tests/tsc-references/forStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatements_es5.1.normal.js @@ -25,47 +25,28 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); -for(var aNumber = 9.9;;){ -} -for(var aString = 'this is a string';;){ -} -for(var aDate = new Date(12);;){ -} -for(var anObject = new Object();;){ -} -for(var anAny = null;;){ -} -for(var aSecondAny = undefined;;){ -} -for(var aVoid = undefined;;){ -} -for(var anInterface = new C();;){ -} -for(var aClass = new C();;){ -} -for(var aGenericClass = new D();;){ -} +})(M || (M = {})); +for(var aNumber = 9.9;;){} +for(var aString = 'this is a string';;){} +for(var aDate = new Date(12);;){} +for(var anObject = new Object();;){} +for(var anAny = null;;){} +for(var aSecondAny = undefined;;){} +for(var aVoid = undefined;;){} +for(var anInterface = new C();;){} +for(var aClass = new C();;){} +for(var aGenericClass = new D();;){} for(var anObjectLiteral = { id: 12 -};;){ -} -for(var anOtherObjectLiteral = new C();;){ -} -for(var aFunction = F;;){ -} -for(var anOtherFunction = F;;){ -} +};;){} +for(var anOtherObjectLiteral = new C();;){} +for(var aFunction = F;;){} +for(var anOtherFunction = F;;){} for(var aLambda = function(x) { return 2; -};;){ -} -for(var aModule = M;;){ -} -for(var aClassInModule = new M.A();;){ -} +};;){} +for(var aModule = M;;){} +for(var aClassInModule = new M.A();;){} for(var aFunctionInModule = function(x) { return 'this is a string'; -};;){ -} +};;){} diff --git a/crates/swc/tests/tsc-references/forStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/forStatements_es5.2.minified.js index 4bcd6a9660a..3f82fb8e219 100644 --- a/crates/swc/tests/tsc-references/forStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/forStatements_es5.2.minified.js @@ -16,8 +16,7 @@ for(!function(M1) { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -}));;); +}(M || (M = {}));;); for(;;); for(new Date(12);;); for(new Object();;); diff --git a/crates/swc/tests/tsc-references/forgottenNew_es2015.1.normal.js b/crates/swc/tests/tsc-references/forgottenNew_es2015.1.normal.js index 6b252474195..0935c48bac8 100644 --- a/crates/swc/tests/tsc-references/forgottenNew_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/forgottenNew_es2015.1.normal.js @@ -3,6 +3,5 @@ var Tools; class NullLogger { } Tools1.NullLogger = NullLogger; -})(Tools || (Tools = { -})); +})(Tools || (Tools = {})); var logger = Tools.NullLogger(); diff --git a/crates/swc/tests/tsc-references/forgottenNew_es2015.2.minified.js b/crates/swc/tests/tsc-references/forgottenNew_es2015.2.minified.js index 6ad2ac237a3..b83a8e1ec3a 100644 --- a/crates/swc/tests/tsc-references/forgottenNew_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/forgottenNew_es2015.2.minified.js @@ -1,4 +1,3 @@ var Tools; -(Tools || (Tools = { -})).NullLogger = class { +(Tools || (Tools = {})).NullLogger = class { }, Tools.NullLogger(); diff --git a/crates/swc/tests/tsc-references/forgottenNew_es5.1.normal.js b/crates/swc/tests/tsc-references/forgottenNew_es5.1.normal.js index f49c980cb7e..9f6035ae56a 100644 --- a/crates/swc/tests/tsc-references/forgottenNew_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/forgottenNew_es5.1.normal.js @@ -10,6 +10,5 @@ var Tools; _classCallCheck(this, NullLogger); }; Tools1.NullLogger = NullLogger; -})(Tools || (Tools = { -})); +})(Tools || (Tools = {})); var logger = Tools.NullLogger(); diff --git a/crates/swc/tests/tsc-references/forgottenNew_es5.2.minified.js b/crates/swc/tests/tsc-references/forgottenNew_es5.2.minified.js index 39e12e24cb0..29dc9c64bb5 100644 --- a/crates/swc/tests/tsc-references/forgottenNew_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/forgottenNew_es5.2.minified.js @@ -7,5 +7,4 @@ var Tools; }(this, NullLogger); }; Tools1.NullLogger = NullLogger; -}(Tools || (Tools = { -})), Tools.NullLogger(); +}(Tools || (Tools = {})), Tools.NullLogger(); diff --git a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.1.normal.js index 00ef792b776..246d600c4f6 100644 --- a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.1.normal.js @@ -3,10 +3,8 @@ function foo(x) { return x; } foo(1); -foo(()=>{ -}, 1); -foo(1, ()=>{ -}); +foo(()=>{}, 1); +foo(1, ()=>{}); function foo2(x) { return x; } diff --git a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.2.minified.js b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.2.minified.js index 996b97811a5..6ba27f36652 100644 --- a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.2.minified.js @@ -5,9 +5,7 @@ function foo(x) { function foo2(x) { return x; } -foo(1), foo(()=>{ -}, 1), foo(1, ()=>{ -}), foo2(new Function()), foo2((x)=>x +foo(1), foo(()=>{}, 1), foo(1, ()=>{}), foo2(new Function()), foo2((x)=>x ), foo2(class { }), foo2(b), foo2((x)=>x ), foo2((x, y)=>x diff --git a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.1.normal.js b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.1.normal.js index 8aae47f5f72..478d07bb9a2 100644 --- a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.1.normal.js @@ -8,10 +8,8 @@ function foo(x) { return x; } foo(1); -foo(function() { -}, 1); -foo(1, function() { -}); +foo(function() {}, 1); +foo(1, function() {}); function foo2(x) { return x; } diff --git a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.2.minified.js b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.2.minified.js index 6c67150e28e..b4ef64abfde 100644 --- a/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es5.2.minified.js @@ -7,9 +7,7 @@ function foo(x) { function foo2(x) { return x; } -foo(1), foo(function() { -}, 1), foo(1, function() { -}); +foo(1), foo(function() {}, 1), foo(1, function() {}); var b, b2, f2, C = function() { "use strict"; _classCallCheck(this, C); diff --git a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.1.normal.js index f601315db58..3433748fcc4 100644 --- a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.1.normal.js @@ -4,8 +4,7 @@ E; (function(E) { E[E["red"] = 0] = "red"; E[E["blue"] = 1] = "blue"; -})(E || (E = { -})); +})(E || (E = {})); // A contextual signature S is extracted from a function type T as follows: // If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. var a0 = (num, str)=>{ @@ -13,8 +12,7 @@ var a0 = (num, str)=>{ return 0; }; class Class { - foo() { - } + foo() {} } var a1 = (a11)=>{ a11.foo(); @@ -26,8 +24,7 @@ var a1 = (a11)=>{ // and if all of the signatures are identical ignoring return types, // then S is a signature with the same parameters and a union of the return types. var b1; -b1 = (k, h)=>{ -}; +b1 = (k, h)=>{}; var b2; b2 = (foo, bar)=>{ return foo + 1; @@ -36,8 +33,7 @@ b2 = (foo, bar)=>{ return "hello"; }; var b3; -b3 = (name, number)=>{ -}; +b3 = (name, number)=>{}; var b4 = (number = 1)=>{ return "hello"; }; @@ -55,8 +51,7 @@ b6 = (i)=>{ i.toExponential(); return i; }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) -b7 = (j, m)=>{ -}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = (j, m)=>{}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) class C { constructor(){ var k1 = (j, k)=>{ diff --git a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.2.minified.js b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.2.minified.js index 3bc3c48ba9b..e6a1c40ce67 100644 --- a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es2015.2.minified.js @@ -1,4 +1,3 @@ var E, E; -(E = E || (E = { -}))[E.red = 0] = "red", E[E.blue = 1] = "blue", (num, str)=>(num.toExponential(), 0) +(E = E || (E = {}))[E.red = 0] = "red", E[E.blue = 1] = "blue", (num, str)=>(num.toExponential(), 0) ; diff --git a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.1.normal.js b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.1.normal.js index 53a43d47a1d..6336e4ea9f2 100644 --- a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.1.normal.js @@ -23,8 +23,7 @@ E; (function(E) { E[E["red"] = 0] = "red"; E[E["blue"] = 1] = "blue"; -})(E || (E = { -})); +})(E || (E = {})); // A contextual signature S is extracted from a function type T as follows: // If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. var a0 = function(num, str) { @@ -39,8 +38,7 @@ var Class = /*#__PURE__*/ function() { _createClass(Class, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return Class; @@ -55,8 +53,7 @@ var a1 = function(a11) { // and if all of the signatures are identical ignoring return types, // then S is a signature with the same parameters and a union of the return types. var b1; -b1 = function(k, h) { -}; +b1 = function(k, h) {}; var b2; b2 = function(foo, bar) { return foo + 1; @@ -65,8 +62,7 @@ b2 = function(foo, bar) { return "hello"; }; var b3; -b3 = function(name, number) { -}; +b3 = function(name, number) {}; var b4 = function() { var number = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return "hello"; @@ -86,8 +82,7 @@ b6 = function(i) { i.toExponential(); return i; }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) -b7 = function(j, m) { -}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = function(j, m) {}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) var C = function C() { "use strict"; _classCallCheck(this, C); diff --git a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.2.minified.js b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.2.minified.js index 842c8423151..4707e2cccc9 100644 --- a/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/functionExpressionContextualTyping1_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -(E = E || (E = { -}))[E.red = 0] = "red", E[E.blue = 1] = "blue"; +(E = E || (E = {}))[E.red = 0] = "red", E[E.blue = 1] = "blue"; var E, E, Class = function() { "use strict"; var Constructor, protoProps, staticProps; @@ -18,8 +17,7 @@ var E, E, Class = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Class).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Class; }(), C = function() { diff --git a/crates/swc/tests/tsc-references/functionImplementationErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionImplementationErrors_es2015.1.normal.js index 766d7fa3bda..7e7edf9f06a 100644 --- a/crates/swc/tests/tsc-references/functionImplementationErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionImplementationErrors_es2015.1.normal.js @@ -25,16 +25,14 @@ var f4 = function() { } }; // Function implemetnation with non -void return type annotation with no return -function f5() { -} +function f5() {} var m; // Function signature with parameter initializer referencing in scope local variable function f6(n = m) { var m = 4; } // Function signature with initializer referencing other parameter to the right -function f7(n = m, m) { -} +function f7(n = m, m) {} // FunctionExpression with non -void return type annotation with a throw, no return, and other code // Should be error but isn't undefined === function() { diff --git a/crates/swc/tests/tsc-references/functionImplementationErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/functionImplementationErrors_es5.1.normal.js index 1c2e9ff3f9b..8eb9a9e599e 100644 --- a/crates/swc/tests/tsc-references/functionImplementationErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionImplementationErrors_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -96,8 +95,7 @@ var f4 = function f4() { } }; // Function implemetnation with non -void return type annotation with no return -function f5() { -} +function f5() {} var m; // Function signature with parameter initializer referencing in scope local variable function f6() { diff --git a/crates/swc/tests/tsc-references/functionImplementationErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/functionImplementationErrors_es5.2.minified.js index d426f8d0326..5f8059ebc3e 100644 --- a/crates/swc/tests/tsc-references/functionImplementationErrors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/functionImplementationErrors_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/functionImplementations_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionImplementations_es2015.1.normal.js index de9fe6ff99f..84abd82d4fd 100644 --- a/crates/swc/tests/tsc-references/functionImplementations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionImplementations_es2015.1.normal.js @@ -1,7 +1,6 @@ // @allowUnreachableCode: true // FunctionExpression with no return type annotation and no return statement returns void -var v = function() { -}(); +var v = function() {}(); // FunctionExpression f with no return type annotation and directly references f in its body returns any var a = function f() { return f; diff --git a/crates/swc/tests/tsc-references/functionImplementations_es5.1.normal.js b/crates/swc/tests/tsc-references/functionImplementations_es5.1.normal.js index 1c87a602ec5..856c8079c48 100644 --- a/crates/swc/tests/tsc-references/functionImplementations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionImplementations_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -71,8 +70,7 @@ function _createSuper(Derived1) { } // @allowUnreachableCode: true // FunctionExpression with no return type annotation and no return statement returns void -var v = function() { -}(); +var v = function() {}(); // FunctionExpression f with no return type annotation and directly references f in its body returns any var a = function f() { return f; diff --git a/crates/swc/tests/tsc-references/functionImplementations_es5.2.minified.js b/crates/swc/tests/tsc-references/functionImplementations_es5.2.minified.js index bb62c002286..c5a290bfbcf 100644 --- a/crates/swc/tests/tsc-references/functionImplementations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/functionImplementations_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/functionLiteralForOverloads2_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionLiteralForOverloads2_es2015.1.normal.js index 4f921b526f9..a99940131cf 100644 --- a/crates/swc/tests/tsc-references/functionLiteralForOverloads2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionLiteralForOverloads2_es2015.1.normal.js @@ -1,11 +1,9 @@ // basic uses of function literals with constructor overloads class C { - constructor(x){ - } + constructor(x){} } class D { - constructor(x){ - } + constructor(x){} } var f = C; var f2 = C; diff --git a/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js index 8d01161729a..3d97b072d55 100644 --- a/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js @@ -2,24 +2,17 @@ //Function overload with different name from implementation signature var M; (function(M) { - function fn1() { - } + function fn1() {} var fn1; var fn2; - function fn2() { - } -})(M || (M = { -})); -function fn3() { -} + function fn2() {} +})(M || (M = {})); +function fn3() {} var fn3; function func() { var fn4; - function fn4() { - } - function fn5() { - } + function fn4() {} + function fn5() {} var fn5; } -function overrr() { -} +function overrr() {} diff --git a/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js b/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js index 3f50cc4b7af..5eb1ec8f8b2 100644 --- a/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js @@ -2,24 +2,17 @@ //Function overload with different name from implementation signature var M; (function(M) { - var fn1 = function fn1() { - }; - var fn2 = function fn2() { - }; + var fn1 = function fn1() {}; + var fn2 = function fn2() {}; var fn1; var fn2; -})(M || (M = { -})); -function fn3() { -} +})(M || (M = {})); +function fn3() {} var fn3; function func() { - var fn4 = function fn4() { - }; - var fn5 = function fn5() { - }; + var fn4 = function fn4() {}; + var fn5 = function fn5() {}; var fn4; var fn5; } -function overrr() { -} +function overrr() {} diff --git a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es2015.1.normal.js index 1b22d2ddca9..530f2f62b40 100644 --- a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es2015.1.normal.js @@ -65,20 +65,16 @@ function f10() { // returns number => void function f11() { if (true) { - return (x)=>{ - }; + return (x)=>{}; } else { - return (x)=>{ - }; + return (x)=>{}; } } // returns Object => void function f12() { if (true) { - return (x)=>{ - }; + return (x)=>{}; } else { - return (x)=>{ - }; + return (x)=>{}; } } diff --git a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es5.1.normal.js b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es5.1.normal.js index bb531ca8e22..aa560b3f5c3 100644 --- a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements2_es5.1.normal.js @@ -65,20 +65,16 @@ function f10() { // returns number => void function f11() { if (true) { - return function(x) { - }; + return function(x) {}; } else { - return function(x) { - }; + return function(x) {}; } } // returns Object => void function f12() { if (true) { - return function(x) { - }; + return function(x) {}; } else { - return function(x) { - }; + return function(x) {}; } } diff --git a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es2015.1.normal.js index 83457ec5788..7bd717885bc 100644 --- a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es2015.1.normal.js @@ -27,8 +27,7 @@ function f3() { function f4() { try { return 1; - } catch (e) { - } finally{ + } catch (e) {} finally{ return ''; } } diff --git a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es5.1.normal.js index 83457ec5788..7bd717885bc 100644 --- a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements_es5.1.normal.js @@ -27,8 +27,7 @@ function f3() { function f4() { try { return 1; - } catch (e) { - } finally{ + } catch (e) {} finally{ return ''; } } diff --git a/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.1.normal.js index 4c47f94f968..279dcf4a3ee 100644 --- a/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.1.normal.js @@ -675,8 +675,7 @@ class x85 { d1, d2 ] - ){ - } + ){} } class x86 { constructor(parm = function() { @@ -684,8 +683,7 @@ class x86 { d1, d2 ]; - }){ - } + }){} } class x87 { constructor(parm = function named() { @@ -693,16 +691,14 @@ class x87 { d1, d2 ]; - }){ - } + }){} } class x88 { constructor(parm = ()=>[ d1, d2 ] - ){ - } + ){} } class x89 { constructor(parm = function() { @@ -710,8 +706,7 @@ class x89 { d1, d2 ]; - }){ - } + }){} } class x90 { constructor(parm = function named() { @@ -719,29 +714,25 @@ class x90 { d1, d2 ]; - }){ - } + }){} } class x91 { constructor(parm = [ d1, d2 - ]){ - } + ]){} } class x92 { constructor(parm = [ d1, d2 - ]){ - } + ]){} } class x93 { constructor(parm = [ d1, d2 - ]){ - } + ]){} } class x94 { constructor(parm = { @@ -749,15 +740,13 @@ class x94 { d1, d2 ] - }){ - } + }){} } class x95 { constructor(parm = (n)=>{ var n; return null; - }){ - } + }){} } class x96 { constructor(parm = { @@ -767,8 +756,7 @@ class x96 { d2 ]; } - }){ - } + }){} } class x97 { constructor(parm = ()=>[ @@ -998,69 +986,58 @@ function x121(parm = ()=>[ d1, d2 ] -) { -} +) {} function x122(parm = function() { return [ d1, d2 ]; -}) { -} +}) {} function x123(parm = function named() { return [ d1, d2 ]; -}) { -} +}) {} function x124(parm = ()=>[ d1, d2 ] -) { -} +) {} function x125(parm = function() { return [ d1, d2 ]; -}) { -} +}) {} function x126(parm = function named() { return [ d1, d2 ]; -}) { -} +}) {} function x127(parm = [ d1, d2 -]) { -} +]) {} function x128(parm = [ d1, d2 -]) { -} +]) {} function x129(parm = [ d1, d2 -]) { -} +]) {} function x130(parm = { n: [ d1, d2 ] -}) { -} +}) {} function x131(parm = (n)=>{ var n; return null; -}) { -} +}) {} function x132(parm = { func: (n)=>{ return [ @@ -1068,8 +1045,7 @@ function x132(parm = { d2 ]; } -}) { -} +}) {} function x133() { return ()=>[ d1, @@ -1493,8 +1469,7 @@ var x181; d2 ] ; -})(x181 || (x181 = { -})); +})(x181 || (x181 = {})); var x182; (function(x182) { var t = function() { @@ -1503,8 +1478,7 @@ var x182; d2 ]; }; -})(x182 || (x182 = { -})); +})(x182 || (x182 = {})); var x183; (function(x183) { var t = function named() { @@ -1513,8 +1487,7 @@ var x183; d2 ]; }; -})(x183 || (x183 = { -})); +})(x183 || (x183 = {})); var x184; (function(x184) { var t = ()=>[ @@ -1522,8 +1495,7 @@ var x184; d2 ] ; -})(x184 || (x184 = { -})); +})(x184 || (x184 = {})); var x185; (function(x185) { var t = function() { @@ -1532,8 +1504,7 @@ var x185; d2 ]; }; -})(x185 || (x185 = { -})); +})(x185 || (x185 = {})); var x186; (function(x186) { var t = function named() { @@ -1542,32 +1513,28 @@ var x186; d2 ]; }; -})(x186 || (x186 = { -})); +})(x186 || (x186 = {})); var x187; (function(x187) { var t = [ d1, d2 ]; -})(x187 || (x187 = { -})); +})(x187 || (x187 = {})); var x188; (function(x188) { var t = [ d1, d2 ]; -})(x188 || (x188 = { -})); +})(x188 || (x188 = {})); var x189; (function(x189) { var t = [ d1, d2 ]; -})(x189 || (x189 = { -})); +})(x189 || (x189 = {})); var x190; (function(x190) { var t = { @@ -1576,16 +1543,14 @@ var x190; d2 ] }; -})(x190 || (x190 = { -})); +})(x190 || (x190 = {})); var x191; (function(x191) { var t = (n)=>{ var n; return null; }; -})(x191 || (x191 = { -})); +})(x191 || (x191 = {})); var x192; (function(x192) { var t = { @@ -1596,8 +1561,7 @@ var x192; ]; } }; -})(x192 || (x192 = { -})); +})(x192 || (x192 = {})); var x193; (function(x1931) { var t = x1931.t = ()=>[ @@ -1605,8 +1569,7 @@ var x193; d2 ] ; -})(x193 || (x193 = { -})); +})(x193 || (x193 = {})); var x194; (function(x1941) { var t = x1941.t = function() { @@ -1615,8 +1578,7 @@ var x194; d2 ]; }; -})(x194 || (x194 = { -})); +})(x194 || (x194 = {})); var x195; (function(x1951) { var t = x1951.t = function named() { @@ -1625,8 +1587,7 @@ var x195; d2 ]; }; -})(x195 || (x195 = { -})); +})(x195 || (x195 = {})); var x196; (function(x1961) { var t = x1961.t = ()=>[ @@ -1634,8 +1595,7 @@ var x196; d2 ] ; -})(x196 || (x196 = { -})); +})(x196 || (x196 = {})); var x197; (function(x1971) { var t = x1971.t = function() { @@ -1644,8 +1604,7 @@ var x197; d2 ]; }; -})(x197 || (x197 = { -})); +})(x197 || (x197 = {})); var x198; (function(x1981) { var t = x1981.t = function named() { @@ -1654,32 +1613,28 @@ var x198; d2 ]; }; -})(x198 || (x198 = { -})); +})(x198 || (x198 = {})); var x199; (function(x1991) { var t = x1991.t = [ d1, d2 ]; -})(x199 || (x199 = { -})); +})(x199 || (x199 = {})); var x200; (function(x2001) { var t = x2001.t = [ d1, d2 ]; -})(x200 || (x200 = { -})); +})(x200 || (x200 = {})); var x201; (function(x2011) { var t = x2011.t = [ d1, d2 ]; -})(x201 || (x201 = { -})); +})(x201 || (x201 = {})); var x202; (function(x2021) { var t = x2021.t = { @@ -1688,16 +1643,14 @@ var x202; d2 ] }; -})(x202 || (x202 = { -})); +})(x202 || (x202 = {})); var x203; (function(x2031) { var t = x2031.t = (n)=>{ var n; return null; }; -})(x203 || (x203 = { -})); +})(x203 || (x203 = {})); var x204; (function(x2041) { var t = x2041.t = { @@ -1708,8 +1661,7 @@ var x204; ]; } }; -})(x204 || (x204 = { -})); +})(x204 || (x204 = {})); var x206 = function() { return [ d1, @@ -2426,86 +2378,74 @@ var x320 = true ? { ]; } } : undefined; -function x321(n) { -} +function x321(n) {} x321(()=>[ d1, d2 ] ); -function x322(n) { -} +function x322(n) {} x322(function() { return [ d1, d2 ]; }); -function x323(n) { -} +function x323(n) {} x323(function named() { return [ d1, d2 ]; }); -function x324(n) { -} +function x324(n) {} x324(()=>[ d1, d2 ] ); -function x325(n) { -} +function x325(n) {} x325(function() { return [ d1, d2 ]; }); -function x326(n) { -} +function x326(n) {} x326(function named() { return [ d1, d2 ]; }); -function x327(n) { -} +function x327(n) {} x327([ d1, d2 ]); -function x328(n) { -} +function x328(n) {} x328([ d1, d2 ]); -function x329(n) { -} +function x329(n) {} x329([ d1, d2 ]); -function x330(n) { -} +function x330(n) {} x330({ n: [ d1, d2 ] }); -function x331(n) { -} +function x331(n) {} x331((n)=>{ var n; return null; }); -function x332(n) { -} +function x332(n) {} x332({ func: (n)=>{ return [ @@ -2602,86 +2542,74 @@ x344({ ]; } }); -var x345 = function(n) { -}; +var x345 = function(n) {}; x345(()=>[ d1, d2 ] ); -var x346 = function(n) { -}; +var x346 = function(n) {}; x346(function() { return [ d1, d2 ]; }); -var x347 = function(n) { -}; +var x347 = function(n) {}; x347(function named() { return [ d1, d2 ]; }); -var x348 = function(n) { -}; +var x348 = function(n) {}; x348(()=>[ d1, d2 ] ); -var x349 = function(n) { -}; +var x349 = function(n) {}; x349(function() { return [ d1, d2 ]; }); -var x350 = function(n) { -}; +var x350 = function(n) {}; x350(function named() { return [ d1, d2 ]; }); -var x351 = function(n) { -}; +var x351 = function(n) {}; x351([ d1, d2 ]); -var x352 = function(n) { -}; +var x352 = function(n) {}; x352([ d1, d2 ]); -var x353 = function(n) { -}; +var x353 = function(n) {}; x353([ d1, d2 ]); -var x354 = function(n) { -}; +var x354 = function(n) {}; x354({ n: [ d1, d2 ] }); -var x355 = function(n) { -}; +var x355 = function(n) {}; x355((n)=>{ var n; return null; }); -var x356 = function(n) { -}; +var x356 = function(n) {}; x356({ func: (n)=>{ return [ diff --git a/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.2.minified.js b/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.2.minified.js index 64e9798b548..5cb2e12d421 100644 --- a/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/generatedContextualTyping_es2015.2.minified.js @@ -183,62 +183,50 @@ var x193, x194, x195, x196, x197, x198, x199, x200, x201, x202, x203, x204, b = d1, d2 ] -}, (x193 || (x193 = { -})).t = ()=>[ +}, (x193 || (x193 = {})).t = ()=>[ d1, d2 ] -, (x194 || (x194 = { -})).t = function() { +, (x194 || (x194 = {})).t = function() { return [ d1, d2 ]; -}, (x195 || (x195 = { -})).t = function() { +}, (x195 || (x195 = {})).t = function() { return [ d1, d2 ]; -}, (x196 || (x196 = { -})).t = ()=>[ +}, (x196 || (x196 = {})).t = ()=>[ d1, d2 ] -, (x197 || (x197 = { -})).t = function() { +, (x197 || (x197 = {})).t = function() { return [ d1, d2 ]; -}, (x198 || (x198 = { -})).t = function() { +}, (x198 || (x198 = {})).t = function() { return [ d1, d2 ]; -}, (x199 || (x199 = { -})).t = [ +}, (x199 || (x199 = {})).t = [ d1, d2 -], (x200 || (x200 = { -})).t = [ +], (x200 || (x200 = {})).t = [ d1, d2 -], (x201 || (x201 = { -})).t = [ +], (x201 || (x201 = {})).t = [ d1, d2 -], (x202 || (x202 = { -})).t = { +], (x202 || (x202 = {})).t = { n: [ d1, d2 ] -}, (x203 || (x203 = { -})).t = (n)=>null -, (x204 || (x204 = { -})).t = { +}, (x203 || (x203 = {})).t = (n)=>null +, (x204 || (x204 = {})).t = { func: (n)=>[ d1, d2 diff --git a/crates/swc/tests/tsc-references/generatedContextualTyping_es5.1.normal.js b/crates/swc/tests/tsc-references/generatedContextualTyping_es5.1.normal.js index 748b1a54bc9..6509d339a54 100644 --- a/crates/swc/tests/tsc-references/generatedContextualTyping_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatedContextualTyping_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -1734,8 +1733,7 @@ var x181; d2 ]; }; -})(x181 || (x181 = { -})); +})(x181 || (x181 = {})); var x182; (function(x182) { var t = function t() { @@ -1744,8 +1742,7 @@ var x182; d2 ]; }; -})(x182 || (x182 = { -})); +})(x182 || (x182 = {})); var x183; (function(x183) { var t = function named() { @@ -1754,8 +1751,7 @@ var x183; d2 ]; }; -})(x183 || (x183 = { -})); +})(x183 || (x183 = {})); var x184; (function(x184) { var t = function() { @@ -1764,8 +1760,7 @@ var x184; d2 ]; }; -})(x184 || (x184 = { -})); +})(x184 || (x184 = {})); var x185; (function(x185) { var t = function t() { @@ -1774,8 +1769,7 @@ var x185; d2 ]; }; -})(x185 || (x185 = { -})); +})(x185 || (x185 = {})); var x186; (function(x186) { var t = function named() { @@ -1784,32 +1778,28 @@ var x186; d2 ]; }; -})(x186 || (x186 = { -})); +})(x186 || (x186 = {})); var x187; (function(x187) { var t = [ d1, d2 ]; -})(x187 || (x187 = { -})); +})(x187 || (x187 = {})); var x188; (function(x188) { var t = [ d1, d2 ]; -})(x188 || (x188 = { -})); +})(x188 || (x188 = {})); var x189; (function(x189) { var t = [ d1, d2 ]; -})(x189 || (x189 = { -})); +})(x189 || (x189 = {})); var x190; (function(x190) { var t = { @@ -1818,16 +1808,14 @@ var x190; d2 ] }; -})(x190 || (x190 = { -})); +})(x190 || (x190 = {})); var x191; (function(x191) { var t = function(n) { var n; return null; }; -})(x191 || (x191 = { -})); +})(x191 || (x191 = {})); var x192; (function(x192) { var t = { @@ -1838,8 +1826,7 @@ var x192; ]; } }; -})(x192 || (x192 = { -})); +})(x192 || (x192 = {})); var x193; (function(x1931) { var t = x1931.t = function() { @@ -1848,8 +1835,7 @@ var x193; d2 ]; }; -})(x193 || (x193 = { -})); +})(x193 || (x193 = {})); var x194; (function(x1941) { var t = x1941.t = function t() { @@ -1858,8 +1844,7 @@ var x194; d2 ]; }; -})(x194 || (x194 = { -})); +})(x194 || (x194 = {})); var x195; (function(x1951) { var t = x1951.t = function named() { @@ -1868,8 +1853,7 @@ var x195; d2 ]; }; -})(x195 || (x195 = { -})); +})(x195 || (x195 = {})); var x196; (function(x1961) { var t = x1961.t = function() { @@ -1878,8 +1862,7 @@ var x196; d2 ]; }; -})(x196 || (x196 = { -})); +})(x196 || (x196 = {})); var x197; (function(x1971) { var t = x1971.t = function t() { @@ -1888,8 +1871,7 @@ var x197; d2 ]; }; -})(x197 || (x197 = { -})); +})(x197 || (x197 = {})); var x198; (function(x1981) { var t = x1981.t = function named() { @@ -1898,32 +1880,28 @@ var x198; d2 ]; }; -})(x198 || (x198 = { -})); +})(x198 || (x198 = {})); var x199; (function(x1991) { var t = x1991.t = [ d1, d2 ]; -})(x199 || (x199 = { -})); +})(x199 || (x199 = {})); var x200; (function(x2001) { var t = x2001.t = [ d1, d2 ]; -})(x200 || (x200 = { -})); +})(x200 || (x200 = {})); var x201; (function(x2011) { var t = x2011.t = [ d1, d2 ]; -})(x201 || (x201 = { -})); +})(x201 || (x201 = {})); var x202; (function(x2021) { var t = x2021.t = { @@ -1932,16 +1910,14 @@ var x202; d2 ] }; -})(x202 || (x202 = { -})); +})(x202 || (x202 = {})); var x203; (function(x2031) { var t = x2031.t = function(n) { var n; return null; }; -})(x203 || (x203 = { -})); +})(x203 || (x203 = {})); var x204; (function(x2041) { var t = x2041.t = { @@ -1952,8 +1928,7 @@ var x204; ]; } }; -})(x204 || (x204 = { -})); +})(x204 || (x204 = {})); var x206 = function x206() { return [ d1, @@ -2686,88 +2661,76 @@ var x320 = true ? { ]; } } : undefined; -function x321(n) { -} +function x321(n) {} x321(function() { return [ d1, d2 ]; }); -function x322(n) { -} +function x322(n) {} x322(function() { return [ d1, d2 ]; }); -function x323(n) { -} +function x323(n) {} x323(function named() { return [ d1, d2 ]; }); -function x324(n) { -} +function x324(n) {} x324(function() { return [ d1, d2 ]; }); -function x325(n) { -} +function x325(n) {} x325(function() { return [ d1, d2 ]; }); -function x326(n) { -} +function x326(n) {} x326(function named() { return [ d1, d2 ]; }); -function x327(n) { -} +function x327(n) {} x327([ d1, d2 ]); -function x328(n) { -} +function x328(n) {} x328([ d1, d2 ]); -function x329(n) { -} +function x329(n) {} x329([ d1, d2 ]); -function x330(n) { -} +function x330(n) {} x330({ n: [ d1, d2 ] }); -function x331(n) { -} +function x331(n) {} x331(function(n) { var n; return null; }); -function x332(n) { -} +function x332(n) {} x332({ func: function(n) { return [ @@ -2878,88 +2841,76 @@ x344({ ]; } }); -var x345 = function x345(n) { -}; +var x345 = function x345(n) {}; x345(function() { return [ d1, d2 ]; }); -var x346 = function x346(n) { -}; +var x346 = function x346(n) {}; x346(function() { return [ d1, d2 ]; }); -var x347 = function x347(n) { -}; +var x347 = function x347(n) {}; x347(function named() { return [ d1, d2 ]; }); -var x348 = function x348(n) { -}; +var x348 = function x348(n) {}; x348(function() { return [ d1, d2 ]; }); -var x349 = function x349(n) { -}; +var x349 = function x349(n) {}; x349(function() { return [ d1, d2 ]; }); -var x350 = function x350(n) { -}; +var x350 = function x350(n) {}; x350(function named() { return [ d1, d2 ]; }); -var x351 = function x351(n) { -}; +var x351 = function x351(n) {}; x351([ d1, d2 ]); -var x352 = function x352(n) { -}; +var x352 = function x352(n) {}; x352([ d1, d2 ]); -var x353 = function x353(n) { -}; +var x353 = function x353(n) {}; x353([ d1, d2 ]); -var x354 = function x354(n) { -}; +var x354 = function x354(n) {}; x354({ n: [ d1, d2 ] }); -var x355 = function x355(n) { -}; +var x355 = function x355(n) {}; x355(function(n) { var n; return null; }); -var x356 = function x356(n) { -}; +var x356 = function x356(n) {}; x356({ func: function(n) { return [ diff --git a/crates/swc/tests/tsc-references/generatedContextualTyping_es5.2.minified.js b/crates/swc/tests/tsc-references/generatedContextualTyping_es5.2.minified.js index 83b69c03c6b..d3e88c407e7 100644 --- a/crates/swc/tests/tsc-references/generatedContextualTyping_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatedContextualTyping_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -911,108 +910,89 @@ var x85 = function() { }; _classCallCheck(this, x120), this.parm = parm; }; -(x193 || (x193 = { -})).t = function() { +(x193 || (x193 = {})).t = function() { return [ d1, d2 ]; -}, (x194 || (x194 = { -})).t = function() { +}, (x194 || (x194 = {})).t = function() { return [ d1, d2 ]; -}, (x195 || (x195 = { -})).t = function() { +}, (x195 || (x195 = {})).t = function() { return [ d1, d2 ]; -}, (x196 || (x196 = { -})).t = function() { +}, (x196 || (x196 = {})).t = function() { return [ d1, d2 ]; -}, (x197 || (x197 = { -})).t = function() { +}, (x197 || (x197 = {})).t = function() { return [ d1, d2 ]; -}, (x198 || (x198 = { -})).t = function() { +}, (x198 || (x198 = {})).t = function() { return [ d1, d2 ]; -}, (x199 || (x199 = { -})).t = [ +}, (x199 || (x199 = {})).t = [ d1, d2 -], (x200 || (x200 = { -})).t = [ +], (x200 || (x200 = {})).t = [ d1, d2 -], (x201 || (x201 = { -})).t = [ +], (x201 || (x201 = {})).t = [ d1, d2 -], (x202 || (x202 = { -})).t = { +], (x202 || (x202 = {})).t = { n: [ d1, d2 ] -}, (x203 || (x203 = { -})).t = function(n) { +}, (x203 || (x203 = {})).t = function(n) { return null; -}, (x204 || (x204 = { -})).t = { +}, (x204 || (x204 = {})).t = { func: function(n) { return [ d1, d2 ]; } -}, (function(n) { -})(function() { +}, (function(n) {})(function() { return [ d1, d2 ]; -}), (function(n) { -})(function() { +}), (function(n) {})(function() { return [ d1, d2 ]; -}), (function(n) { -})(function() { +}), (function(n) {})(function() { return [ d1, d2 ]; -}), (function(n) { -})(function() { +}), (function(n) {})(function() { return [ d1, d2 ]; -}), (function(n) { -})(function() { +}), (function(n) {})(function() { return [ d1, d2 ]; -}), (function(n) { -})(function() { +}), (function(n) {})(function() { return [ d1, d2 ]; -}), (function(n) { -})(function(n) { +}), (function(n) {})(function(n) { return null; }); diff --git a/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js index b0afe9e5787..e0c610d48a9 100644 --- a/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js @@ -587,8 +587,7 @@ function _f3() { } }, syncGenerator); }); - o = _defineProperty({ - }, Symbol.asyncIterator, syncGenerator); + o = _defineProperty({}, Symbol.asyncIterator, syncGenerator); _iteratorAbruptCompletion = false, _didIteratorError6 = false; _ctx1.prev = 3; _iterator = _asyncIterator(o); diff --git a/crates/swc/tests/tsc-references/generatorAssignability_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorAssignability_es5.2.minified.js index ca373838609..d355bb393bb 100644 --- a/crates/swc/tests/tsc-references/generatorAssignability_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorAssignability_es5.2.minified.js @@ -430,8 +430,7 @@ function _f3() { return _ctx.stop(); } }, syncGenerator); - }), o = _defineProperty({ - }, Symbol.asyncIterator, syncGenerator), _iteratorAbruptCompletion = !1, _didIteratorError6 = !1, _ctx1.prev = 3, _iterator = _asyncIterator(o); + }), o = _defineProperty({}, Symbol.asyncIterator, syncGenerator), _iteratorAbruptCompletion = !1, _didIteratorError6 = !1, _ctx1.prev = 3, _iterator = _asyncIterator(o); case 5: return _ctx1.next = 7, _iterator.next(); case 7: diff --git a/crates/swc/tests/tsc-references/generatorImplicitAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorImplicitAny_es2015.1.normal.js index 7ec9701e14e..d24fbf5fc6e 100644 --- a/crates/swc/tests/tsc-references/generatorImplicitAny_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorImplicitAny_es2015.1.normal.js @@ -2,8 +2,7 @@ // @strictNullChecks: true // @noImplicitReturns: true // @noImplicitAny: true -function* g() { -} +function* g() {} function* g2() { const value = yield; // error: implicit any } diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext5_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext5_es2015.1.normal.js index da9b6432259..30f0da6c4eb 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext5_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 //@declaration: true class C { - *generator() { - } + *generator() {} } diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.1.normal.js index e4644d591a8..5345da27393 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.1.normal.js @@ -2,8 +2,6 @@ //@declaration: true var M; (function(M1) { - function* generator() { - } + function* generator() {} M1.generator = generator; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.2.minified.js b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.2.minified.js index 75627c2620e..e5d40c1707a 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es2015.2.minified.js @@ -1,4 +1,2 @@ var M; -(M || (M = { -})).generator = function*() { -}; +(M || (M = {})).generator = function*() {}; diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js index 535845bc32f..8aa5de2143f 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js @@ -13,5 +13,4 @@ var M; }, generator); }); M1.generator = generator; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.2.minified.js index b552971bfa2..45e3e0dd86c 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.2.minified.js @@ -11,5 +11,4 @@ import regeneratorRuntime from "regenerator-runtime"; }, generator); }); M1.generator = generator; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorOverloads4_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads4_es2015.1.normal.js index 93c96925069..025892ba066 100644 --- a/crates/swc/tests/tsc-references/generatorOverloads4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorOverloads4_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES6 class C { - *f(s) { - } + *f(s) {} } diff --git a/crates/swc/tests/tsc-references/generatorOverloads5_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads5_es2015.1.normal.js index 16461e3816b..918312d09d6 100644 --- a/crates/swc/tests/tsc-references/generatorOverloads5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorOverloads5_es2015.1.normal.js @@ -1,7 +1,5 @@ //@target: ES6 var M; (function(M) { - function* f(s) { - } -})(M || (M = { -})); + function* f(s) {} +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js index b7f59315004..313e010e158 100644 --- a/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js @@ -11,5 +11,4 @@ var M; } }, f); }); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorOverloads5_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorOverloads5_es5.2.minified.js index 1e051c61a3a..fb6b0b295b0 100644 --- a/crates/swc/tests/tsc-references/generatorOverloads5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorOverloads5_es5.2.minified.js @@ -10,5 +10,4 @@ import regeneratorRuntime from "regenerator-runtime"; } }, f); }); -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es2015.1.normal.js index 2aafe12115e..f6b82ff2b35 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es2015.1.normal.js @@ -1,5 +1,4 @@ -function* g000() { -} +function* g000() {} // 'yield' iteration type inference function* g001() { yield; diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeInference_es2015.1.normal.js index 8b9d341f451..db0e5cf565e 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeInference_es2015.1.normal.js @@ -1,5 +1,4 @@ -function* g000() { -} +function* g000() {} // 'yield' iteration type inference function* g001() { yield; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js index 9615736d040..02b6eca3a4d 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.2.minified.js index 50568d6f0ac..bb70c1ddaa2 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.2.minified.js @@ -46,8 +46,7 @@ var _marked = regeneratorRuntime.mark(function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js index f69a1d28350..5cb2ad23b1e 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.2.minified.js index ee570449ab6..ed9cc7f33fd 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.2.minified.js @@ -48,8 +48,7 @@ var _marked = regeneratorRuntime.mark(function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck1_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck1_es2015.1.normal.js index 1a4a595e334..6036377fd2f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck1_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js index 9f57fd35386..78e0caa999c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.2.minified.js index d6948309f05..3dac790eaa1 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.2.minified.js @@ -46,8 +46,7 @@ var _marked = regeneratorRuntime.mark(function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js index 73e3552c9f6..97fcd34b2e2 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.2.minified.js index 035a0948648..622ad1fc1a7 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.2.minified.js @@ -56,8 +56,7 @@ var _marked = regeneratorRuntime.mark(function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js index e16e6a5b4c1..28bb2acae64 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.2.minified.js index d1273e70a78..bbc5170597f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.2.minified.js @@ -58,8 +58,7 @@ var _marked = regeneratorRuntime.mark(function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js index be73638f55a..8b76eb9ded4 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.2.minified.js index f81d4f5de36..c62914fcbda 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.2.minified.js @@ -60,8 +60,7 @@ var _marked = regeneratorRuntime.mark(function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js index b9bb2c9c746..cf6bf3473a9 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.2.minified.js index 4a108f93b9e..81cacda88d8 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.2.minified.js @@ -33,8 +33,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js index 1aade544a2d..a552c0fb430 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js @@ -18,8 +18,7 @@ function g() { return regeneratorRuntime.wrap(function g$(_ctx1) { while(1)switch(_ctx1.prev = _ctx1.next){ case 0: - return _ctx1.delegateYield(_defineProperty({ - }, Symbol.iterator, regeneratorRuntime.mark(function _callee() { + return _ctx1.delegateYield(_defineProperty({}, Symbol.iterator, regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.2.minified.js index c353285f336..3540fa05168 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.2.minified.js @@ -11,8 +11,7 @@ var _marked = regeneratorRuntime.mark(function() { return regeneratorRuntime.wrap(function(_ctx1) { for(;;)switch(_ctx1.prev = _ctx1.next){ case 0: - return _ctx1.delegateYield(_defineProperty({ - }, Symbol.iterator, regeneratorRuntime.mark(function _callee() { + return _ctx1.delegateYield(_defineProperty({}, Symbol.iterator, regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck2_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck2_es2015.1.normal.js index 1a4a595e334..6036377fd2f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck2_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck3_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck3_es2015.1.normal.js index 1a4a595e334..6036377fd2f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck3_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js index ea001d54a0b..a0b8fffa1f9 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.2.minified.js index 3f903659a33..3888a5800f5 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js index c468b86d727..d80f9d62120 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js @@ -20,8 +20,7 @@ function g() { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.t0 = _defineProperty; - _ctx.t1 = { - }; + _ctx.t1 = {}; _ctx.next = 4; return 0; case 4: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.2.minified.js index 7f640490c78..8ff9bb0be82 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.2.minified.js @@ -12,8 +12,7 @@ var _marked = regeneratorRuntime.mark(function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.t0 = _defineProperty, _ctx.t1 = { - }, _ctx.next = 4, 0; + return _ctx.t0 = _defineProperty, _ctx.t1 = {}, _ctx.next = 4, 0; case 4: _ctx.t2 = _ctx.sent, x = (0, _ctx.t0)(_ctx.t1, _ctx.t2, 0); case 6: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck42_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck42_es2015.1.normal.js index 53d9d05e619..dd967b1a46e 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck42_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck42_es2015.1.normal.js @@ -1,7 +1,6 @@ //@target: ES6 function* g() { let x = { - [yield 0] () { - } + [yield 0] () {} }; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js index 35b2bc62d0c..a4434739f8a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js @@ -20,14 +20,12 @@ function g() { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.t0 = _defineProperty; - _ctx.t1 = { - }; + _ctx.t1 = {}; _ctx.next = 4; return 0; case 4: _ctx.t2 = _ctx.sent; - _ctx.t3 = function() { - }; + _ctx.t3 = function() {}; x = (0, _ctx.t0)(_ctx.t1, _ctx.t2, _ctx.t3); case 7: case "end": diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.2.minified.js index b03f52c3ea6..aa0d288c9b1 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.2.minified.js @@ -12,11 +12,9 @@ var _marked = regeneratorRuntime.mark(function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.t0 = _defineProperty, _ctx.t1 = { - }, _ctx.next = 4, 0; + return _ctx.t0 = _defineProperty, _ctx.t1 = {}, _ctx.next = 4, 0; case 4: - _ctx.t2 = _ctx.sent, _ctx.t3 = function() { - }, x = (0, _ctx.t0)(_ctx.t1, _ctx.t2, _ctx.t3); + _ctx.t2 = _ctx.sent, _ctx.t3 = function() {}, x = (0, _ctx.t0)(_ctx.t1, _ctx.t2, _ctx.t3); case 7: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck43_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck43_es2015.1.normal.js index c9c29d28841..11c01afa9c1 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck43_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck43_es2015.1.normal.js @@ -1,7 +1,6 @@ //@target: ES6 function* g() { let x = { - *[yield 0] () { - } + *[yield 0] () {} }; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js index 800aa929fe1..6144f4b8f85 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js @@ -20,8 +20,7 @@ function g() { while(1)switch(_ctx1.prev = _ctx1.next){ case 0: _ctx1.t0 = _defineProperty; - _ctx1.t1 = { - }; + _ctx1.t1 = {}; _ctx1.next = 4; return 0; case 4: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.2.minified.js index cd34ef65f81..e111c234470 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.2.minified.js @@ -12,8 +12,7 @@ var _marked = regeneratorRuntime.mark(function() { return regeneratorRuntime.wrap(function(_ctx1) { for(;;)switch(_ctx1.prev = _ctx1.next){ case 0: - return _ctx1.t0 = _defineProperty, _ctx1.t1 = { - }, _ctx1.next = 4, 0; + return _ctx1.t0 = _defineProperty, _ctx1.t1 = {}, _ctx1.next = 4, 0; case 4: _ctx1.t2 = _ctx1.sent, _ctx1.t3 = regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js index b01c3af105f..010525a4efe 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js @@ -25,10 +25,8 @@ function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - _mutatorMap = { - }; - _obj = { - }; + _mutatorMap = {}; + _obj = {}; _ctx.next = 4; return 0; case 4: @@ -42,8 +40,7 @@ function g() { _ctx.next = 11; break; } - _ctx.t1 = { - }; + _ctx.t1 = {}; case 11: _mutatorMap[_ctx.t0] = _ctx.t1; _ctx.next = 14; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.2.minified.js index 3759b855851..7145a8069cf 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.2.minified.js @@ -15,9 +15,7 @@ var _marked = regeneratorRuntime.mark(function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - return _mutatorMap = { - }, _obj = { - }, _ctx.next = 4, 0; + return _mutatorMap = {}, _obj = {}, _ctx.next = 4, 0; case 4: return _ctx.t0 = _ctx.sent, _ctx.next = 7, 0; case 7: @@ -25,8 +23,7 @@ var _marked = regeneratorRuntime.mark(function() { _ctx.next = 11; break; } - _ctx.t1 = { - }; + _ctx.t1 = {}; case 11: return _mutatorMap[_ctx.t0] = _ctx.t1, _ctx.next = 14, 0; case 14: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.2.minified.js index 825e5101cb4..55c3f30d9a1 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.2.minified.js @@ -11,5 +11,4 @@ foo("", regeneratorRuntime.mark(function _callee() { return _ctx.stop(); } }, _callee); -}), function(p) { -}); // T is fixed, should be string +}), function(p) {}); // T is fixed, should be string diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js index a2c5dbfe002..6b8ab79cc6a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js @@ -16,8 +16,7 @@ foo("", regeneratorRuntime.mark(function _callee1() { return regeneratorRuntime.wrap(function _callee$(_ctx1) { while(1)switch(_ctx1.prev = _ctx1.next){ case 0: - return _ctx1.delegateYield(_defineProperty({ - }, Symbol.iterator, regeneratorRuntime.mark(function _callee() { + return _ctx1.delegateYield(_defineProperty({}, Symbol.iterator, regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.2.minified.js index 2534444cdd3..155784616f7 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.2.minified.js @@ -11,8 +11,7 @@ foo("", regeneratorRuntime.mark(function _callee1() { return regeneratorRuntime.wrap(function(_ctx1) { for(;;)switch(_ctx1.prev = _ctx1.next){ case 0: - return _ctx1.delegateYield(_defineProperty({ - }, Symbol.iterator, regeneratorRuntime.mark(function _callee() { + return _ctx1.delegateYield(_defineProperty({}, Symbol.iterator, regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: @@ -30,5 +29,4 @@ foo("", regeneratorRuntime.mark(function _callee1() { return _ctx1.stop(); } }, _callee1); -}), function(p) { -}); // T is fixed, should be string +}), function(p) {}); // T is fixed, should be string diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck47_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck47_es2015.1.normal.js index bb70db0a28e..19bcb1adfcf 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck47_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck47_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 //@noImplicitAny: true -function* g() { -} +function* g() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck4_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck4_es2015.1.normal.js index 1a4a595e334..6036377fd2f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck4_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js index 2ca9cb71dbb..7196554b56c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.2.minified.js index 11a598e64dc..bb1721a53a9 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck5_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck5_es2015.1.normal.js index 1a4a595e334..6036377fd2f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck5_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js index 4fd4966c118..b2bd5b76d4e 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js @@ -50,8 +50,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.2.minified.js index 1a4e7857188..7e60a1c689a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.1.normal.js index e44c8bdc5ea..4597b488984 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.1.normal.js @@ -12,8 +12,7 @@ export const Nothing = strategy("Nothing", function*(state) { yield 1; return state; }); -export const Nothing1 = strategy("Nothing", function*(state) { -}); +export const Nothing1 = strategy("Nothing", function*(state) {}); export const Nothing2 = strategy("Nothing", function*(state) { return 1; }); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.2.minified.js index 9df5e9abdbb..d254cfd7c93 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck63_es2015.2.minified.js @@ -6,8 +6,7 @@ export function strategy(stratName, gen) { export const Nothing = strategy("Nothing", function*(state) { return yield 1, state; }); -export const Nothing1 = strategy("Nothing", function*(state) { -}); +export const Nothing1 = strategy("Nothing", function*(state) {}); export const Nothing2 = strategy("Nothing", function*(state) { return 1; }); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck6_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck6_es2015.1.normal.js index 1a4a595e334..6036377fd2f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck6_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck7_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck7_es2015.1.normal.js index b84624b2caa..e46dc8d9ba2 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck7_es2015.1.normal.js @@ -1,2 +1 @@ -function* g1() { -} +function* g1() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck8_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck8_es2015.1.normal.js index fa7b977b2a3..0acc461226f 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck8_es2015.1.normal.js @@ -1,2 +1 @@ -function* g3() { -} +function* g3() {} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck9_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck9_es2015.1.normal.js index ac2f6b1f4be..1568bf17602 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck9_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -function* g3() { -} +function* g3() {} diff --git a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.1.normal.js index 6f224da8735..6f973fd57f7 100644 --- a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.1.normal.js @@ -2,40 +2,34 @@ var m1; (function(m1) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m1 || (m1 = { -})); +})(m1 || (m1 = {})); ////////////////////////////////////// var m2; (function(m2) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m2 || (m2 = { -})); +})(m2 || (m2 = {})); ////////////////////////////////////// var m3; (function(m3) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m3 || (m3 = { -})); +})(m3 || (m3 = {})); ////////////////////////////////////// var m4; (function(m4) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m4 || (m4 = { -})); +})(m4 || (m4 = {})); ////////////////////////////////////// var m5; (function(m5) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m5 || (m5 = { -})); +})(m5 || (m5 = {})); ////////////////////////////////////// var m6; (function(m6) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m6 || (m6 = { -})); +})(m6 || (m6 = {})); diff --git a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.2.minified.js index fe807dd213e..1d293593144 100644 --- a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es2015.2.minified.js @@ -1,8 +1,2 @@ var m1, m2, m3, m4, m5, m6; -m1 || (m1 = { -}), (void 0).then(testFunction), m2 || (m2 = { -}), (void 0).then(testFunction), m3 || (m3 = { -}), (void 0).then(testFunction), m4 || (m4 = { -}), (void 0).then(testFunction), m5 || (m5 = { -}), (void 0).then(testFunction), m6 || (m6 = { -}), (void 0).then(testFunction); +m1 || (m1 = {}), (void 0).then(testFunction), m2 || (m2 = {}), (void 0).then(testFunction), m3 || (m3 = {}), (void 0).then(testFunction), m4 || (m4 = {}), (void 0).then(testFunction), m5 || (m5 = {}), (void 0).then(testFunction), m6 || (m6 = {}), (void 0).then(testFunction); diff --git a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.1.normal.js index 6f224da8735..6f973fd57f7 100644 --- a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.1.normal.js @@ -2,40 +2,34 @@ var m1; (function(m1) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m1 || (m1 = { -})); +})(m1 || (m1 = {})); ////////////////////////////////////// var m2; (function(m2) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m2 || (m2 = { -})); +})(m2 || (m2 = {})); ////////////////////////////////////// var m3; (function(m3) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m3 || (m3 = { -})); +})(m3 || (m3 = {})); ////////////////////////////////////// var m4; (function(m4) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m4 || (m4 = { -})); +})(m4 || (m4 = {})); ////////////////////////////////////// var m5; (function(m5) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m5 || (m5 = { -})); +})(m5 || (m5 = {})); ////////////////////////////////////// var m6; (function(m6) { var numPromise; var newPromise = numPromise.then(testFunction); -})(m6 || (m6 = { -})); +})(m6 || (m6 = {})); diff --git a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.2.minified.js index fe807dd213e..1d293593144 100644 --- a/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallToOverloadedMethodWithOverloadedArguments_es5.2.minified.js @@ -1,8 +1,2 @@ var m1, m2, m3, m4, m5, m6; -m1 || (m1 = { -}), (void 0).then(testFunction), m2 || (m2 = { -}), (void 0).then(testFunction), m3 || (m3 = { -}), (void 0).then(testFunction), m4 || (m4 = { -}), (void 0).then(testFunction), m5 || (m5 = { -}), (void 0).then(testFunction), m6 || (m6 = { -}), (void 0).then(testFunction); +m1 || (m1 = {}), (void 0).then(testFunction), m2 || (m2 = {}), (void 0).then(testFunction), m3 || (m3 = {}), (void 0).then(testFunction), m4 || (m4 = {}), (void 0).then(testFunction), m5 || (m5 = {}), (void 0).then(testFunction), m6 || (m6 = {}), (void 0).then(testFunction); diff --git a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es2015.2.minified.js index 038d4c7ffb2..4d262436d77 100644 --- a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es2015.2.minified.js @@ -15,12 +15,9 @@ var i, c = new class { foo5(t, u) { return t; } - foo6() { - } - foo7(u) { - } - foo8() { - } + foo6() {} + foo7(u) {} + foo8() {} constructor(t, u){ this.t = t, this.u = u; } diff --git a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es5.2.minified.js index db1e0f75cd7..75220a06e81 100644 --- a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference_es5.2.minified.js @@ -46,18 +46,15 @@ var i, C = function() { }, { key: "foo6", - value: function() { - } + value: function() {} }, { key: "foo7", - value: function(u) { - } + value: function(u) {} }, { key: "foo8", - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), c = new C("", 1); diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es2015.2.minified.js index d0b0582b210..33d730ad0c8 100644 --- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es2015.2.minified.js @@ -1,3 +1,2 @@ -function foo(t) { -} +function foo(t) {} foo(1), foo(null), foo(new Object()), foo(1), foo(new Date()); diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es5.2.minified.js index d0b0582b210..33d730ad0c8 100644 --- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference2_es5.2.minified.js @@ -1,3 +1,2 @@ -function foo(t) { -} +function foo(t) {} foo(1), foo(null), foo(new Object()), foo(1), foo(new Date()); diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es2015.2.minified.js index 038d6a90fa5..6766816fd3d 100644 --- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es2015.2.minified.js @@ -18,12 +18,9 @@ var b, d1, d2, i, c = new class { foo5(t, u) { return t; } - foo6() { - } - foo7(u) { - } - foo8() { - } + foo6() {} + foo7(u) {} + foo8() {} constructor(t, u){ this.t = t, this.u = u; } diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.1.normal.js index 001d1b16adb..a01385a0a15 100644 --- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.2.minified.js index 61f8fcbf429..ab2670ec931 100644 --- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -114,18 +113,15 @@ var C = function() { }, { key: "foo6", - value: function() { - } + value: function() {} }, { key: "foo7", - value: function(u) { - } + value: function(u) {} }, { key: "foo8", - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), c = new C(b, d1); diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es2015.2.minified.js index 8c764e1a58b..64b779fd87a 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es2015.2.minified.js @@ -1,4 +1,3 @@ var b; -function foo4(cb) { -} +function foo4(cb) {} foo4(void 0), foo4(b); diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es5.2.minified.js index 8c764e1a58b..64b779fd87a 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments3_es5.2.minified.js @@ -1,4 +1,3 @@ var b; -function foo4(cb) { -} +function foo4(cb) {} foo4(void 0), foo4(b); diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es2015.2.minified.js index 8c764e1a58b..64b779fd87a 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es2015.2.minified.js @@ -1,4 +1,3 @@ var b; -function foo4(cb) { -} +function foo4(cb) {} foo4(void 0), foo4(b); diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es5.2.minified.js index 94af665826b..3236d182f9e 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments4_es5.2.minified.js @@ -8,6 +8,5 @@ var a, b, C = function() { "use strict"; _classCallCheck(this, D); }; -function foo4(cb) { -} +function foo4(cb) {} foo4(a), foo4(b); diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.1.normal.js index dc2ed0ce2db..cbff2e412e8 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.1.normal.js @@ -32,13 +32,11 @@ var onlyT; let E; (function(E) { E[E["A"] = 0] = "A"; - })(E || (E = { - })); + })(E || (E = {})); let F; (function(F) { F[F["A"] = 0] = "A"; - })(F || (F = { - })); + })(F || (F = {})); function foo3(x, a, b) { var r; return r; @@ -46,8 +44,7 @@ var onlyT; var r71 = foo3(E.A, (x)=>E.A , (x)=>F.A ); // error -})(onlyT || (onlyT = { -})); +})(onlyT || (onlyT = {})); var TU; (function(TU) { function foo(a, b) { @@ -79,13 +76,11 @@ var TU; let E; (function(E) { E[E["A"] = 0] = "A"; - })(E || (E = { - })); + })(E || (E = {})); let F; (function(F) { F[F["A"] = 0] = "A"; - })(F || (F = { - })); + })(F || (F = {})); function foo3(x, a, b) { var r; return r; @@ -93,5 +88,4 @@ var TU; var r72 = foo3(E.A, (x)=>E.A , (x)=>F.A ); -})(TU || (TU = { -})); +})(TU || (TU = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.2.minified.js index 65ec8287cb1..98118b38628 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es2015.2.minified.js @@ -2,25 +2,17 @@ var onlyT, TU; !function(onlyT) { var E, F; let E; - (E = E || (E = { - }))[E.A = 0] = "A"; + (E = E || (E = {}))[E.A = 0] = "A"; let F; - (F = F || (F = { - }))[F.A = 0] = "A", (function(x, a, b) { - })(E.A, (x)=>E.A + (F = F || (F = {}))[F.A = 0] = "A", (function(x, a, b) {})(E.A, (x)=>E.A , (x)=>F.A ); -}(onlyT || (onlyT = { -})), (function(TU) { +}(onlyT || (onlyT = {})), (function(TU) { var E, F; let E; - (E = E || (E = { - }))[E.A = 0] = "A"; + (E = E || (E = {}))[E.A = 0] = "A"; let F; - (F = F || (F = { - }))[F.A = 0] = "A", (function(x, a, b) { - })(E.A, (x)=>E.A + (F = F || (F = {}))[F.A = 0] = "A", (function(x, a, b) {})(E.A, (x)=>E.A , (x)=>F.A ); -})(TU || (TU = { -})); +})(TU || (TU = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.1.normal.js index 67bc93f6370..a22bb678c45 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.1.normal.js @@ -44,20 +44,17 @@ var onlyT; var E; (function(E) { E[E["A"] = 0] = "A"; - })(E || (E = { - })); + })(E || (E = {})); var F; (function(F) { F[F["A"] = 0] = "A"; - })(F || (F = { - })); + })(F || (F = {})); var r71 = foo3(E.A, function(x) { return E.A; }, function(x) { return F.A; }); // error -})(onlyT || (onlyT = { -})); +})(onlyT || (onlyT = {})); var TU; (function(TU) { var foo = function foo(a, b) { @@ -101,17 +98,14 @@ var TU; var E; (function(E) { E[E["A"] = 0] = "A"; - })(E || (E = { - })); + })(E || (E = {})); var F; (function(F) { F[F["A"] = 0] = "A"; - })(F || (F = { - })); + })(F || (F = {})); var r72 = foo3(E.A, function(x) { return E.A; }, function(x) { return F.A; }); -})(TU || (TU = { -})); +})(TU || (TU = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.2.minified.js index 05499f8cc93..1f2c59cd837 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2_es5.2.minified.js @@ -1,34 +1,24 @@ var onlyT, TU; !function(onlyT) { var E, F, E, F; - (function(a, b) { - })(function(x) { + (function(a, b) {})(function(x) { return 1; }, function(x) { return ""; - }), (E = E || (E = { - }))[E.A = 0] = "A", (F = F || (F = { - }))[F.A = 0] = "A", (function(x, a, b) { - })(E.A, function(x) { + }), (E = E || (E = {}))[E.A = 0] = "A", (F = F || (F = {}))[F.A = 0] = "A", (function(x, a, b) {})(E.A, function(x) { return E.A; }, function(x) { return F.A; }); -}(onlyT || (onlyT = { -})), (function(TU) { +}(onlyT || (onlyT = {})), (function(TU) { var E, F, E, F; - (function(a, b) { - })(function(x) { + (function(a, b) {})(function(x) { return 1; }, function(x) { return ""; - }), (E = E || (E = { - }))[E.A = 0] = "A", (F = F || (F = { - }))[F.A = 0] = "A", (function(x, a, b) { - })(E.A, function(x) { + }), (E = E || (E = {}))[E.A = 0] = "A", (F = F || (F = {}))[F.A = 0] = "A", (function(x, a, b) {})(E.A, function(x) { return E.A; }, function(x) { return F.A; }); -})(TU || (TU = { -})); +})(TU || (TU = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.1.normal.js index 26554856fdb..d5fad6006e0 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.1.normal.js @@ -25,13 +25,11 @@ var r5 = foo(new Object(), (x)=>'' var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["A"] = 0] = "A"; -})(F || (F = { -})); +})(F || (F = {})); var r6 = foo(E.A, (x)=>E.A , (x)=>F.A ); // number => number diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.2.minified.js index 2abf6d899e1..118ea6fa504 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es2015.2.minified.js @@ -1,8 +1,6 @@ var E, F, x, E, F; -function foo(x, a, b) { -} -function foo2(x, a, b) { -} +function foo(x, a, b) {} +function foo2(x, a, b) {} foo("", (x)=>"" , (x)=>null ), foo("", (x)=>"" @@ -15,9 +13,7 @@ foo("", (x)=>"" , (x)=>"" ), foo(new Object(), (x)=>"" , (x)=>"" -), (E = E || (E = { -}))[E.A = 0] = "A", (F = F || (F = { -}))[F.A = 0] = "A", foo(E.A, (x)=>E.A +), (E = E || (E = {}))[E.A = 0] = "A", (F = F || (F = {}))[F.A = 0] = "A", foo(E.A, (x)=>E.A , (x)=>F.A ), foo2("", (x)=>"" , (x)=>null diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.1.normal.js index b6b00901ea6..47256997ee9 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.1.normal.js @@ -37,13 +37,11 @@ var r5 = foo(new Object(), function(x) { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var F; (function(F) { F[F["A"] = 0] = "A"; -})(F || (F = { -})); +})(F || (F = {})); var r6 = foo(E.A, function(x) { return E.A; }, function(x) { diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.2.minified.js index ea9c97affcd..e96535bfe09 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3_es5.2.minified.js @@ -1,8 +1,6 @@ var E, F, x, E, F; -function foo(x, a, b) { -} -function foo2(x, a, b) { -} +function foo(x, a, b) {} +function foo2(x, a, b) {} foo("", function(x) { return ""; }, function(x) { @@ -27,9 +25,7 @@ foo("", function(x) { return ""; }, function(x) { return ""; -}), (E = E || (E = { -}))[E.A = 0] = "A", (F = F || (F = { -}))[F.A = 0] = "A", foo(E.A, function(x) { +}), (E = E || (E = {}))[E.A = 0] = "A", (F = F || (F = {}))[F.A = 0] = "A", foo(E.A, function(x) { return E.A; }, function(x) { return F.A; diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es2015.2.minified.js index 5ef1ae273ba..532aaafa7c9 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es2015.2.minified.js @@ -1,6 +1,5 @@ var a, b; -function foo(a, b) { -} +function foo(a, b) {} foo((x)=>1 , (x)=>"" ), foo((x)=>null diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es5.2.minified.js index bb6328970ff..a8bf82d5b11 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments_es5.2.minified.js @@ -1,6 +1,5 @@ var a, b; -function foo(a, b) { -} +function foo(a, b) {} foo(function(x) { return 1; }, function(x) { diff --git a/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es2015.2.minified.js index af6cbe9c07d..62fa334fb87 100644 --- a/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es2015.2.minified.js @@ -1,4 +1,3 @@ var a, b, x, y, s1, s2; -function foo(x, y) { -} +function foo(x, y) {} foo(a, b), foo(b, a), foo(a, x), foo(x, a), foo(a, y), foo(y, a), foo(x, y), foo(y, x), foo(s1, s2), foo(s2, s1); diff --git a/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es5.2.minified.js index af6cbe9c07d..62fa334fb87 100644 --- a/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithNonSymmetricSubtypes_es5.2.minified.js @@ -1,4 +1,3 @@ var a, b, x, y, s1, s2; -function foo(x, y) { -} +function foo(x, y) {} foo(a, b), foo(b, a), foo(a, x), foo(x, a), foo(a, y), foo(y, a), foo(x, y), foo(y, x), foo(s1, s2), foo(s2, s1); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.1.normal.js index ed0977421c5..f6d89db64cf 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.2.minified.js index fa8f3f5d555..ba487560403 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es2015.2.minified.js index 715e72251c5..29baa1ce7a2 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es2015.2.minified.js @@ -2,8 +2,7 @@ class Base { } class Derived extends Base { } -function f(x) { -} +function f(x) {} function f3(x, y) { return y(null); } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.1.normal.js index 00fcb90a6b3..766c8826713 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.2.minified.js index 9edfc596d70..02493dffcff 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -55,8 +54,7 @@ var Base = function() { } return Derived1; }(Base); -function f(x) { -} +function f(x) {} function f3(x, y) { return y(null); } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es2015.2.minified.js index d21141b5cba..b8a1b92ad40 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es2015.2.minified.js @@ -4,8 +4,7 @@ class Derived extends Base { } class Derived2 extends Base { } -function f2(a) { -} +function f2(a) {} function f3(y, x) { return y(null); } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.1.normal.js index 8e9193a5e85..cd1b32c0935 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.2.minified.js index 189ef3e96c3..7eeb03fa133 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,8 +64,7 @@ var Base = function() { } return Derived2; }(Base); -function f2(a) { -} +function f2(a) {} function f3(y, x) { return y(null); } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.1.normal.js index b4ac5943ace..941bb825655 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.1.normal.js @@ -16,18 +16,11 @@ var r3 = foo(c, { foo: c }); var r4 = foo(null, null); -var r5 = foo({ -}, null); -var r6 = foo(null, { -}); -var r7 = foo({ -}, { -}); -var r8 = foo(()=>{ -}, ()=>{ -}); -var r9 = foo(()=>{ -}, ()=>1 +var r5 = foo({}, null); +var r6 = foo(null, {}); +var r7 = foo({}, {}); +var r8 = foo(()=>{}, ()=>{}); +var r9 = foo(()=>{}, ()=>1 ); function other() { var r4 = foo(c, d); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.2.minified.js index b4e5584abe0..152686c0463 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es2015.2.minified.js @@ -6,12 +6,5 @@ function foo(t, t2) { foo(c, d), foo(d, c), foo(c, { x: "", foo: c -}), foo(null, null), foo({ -}, null), foo(null, { -}), foo({ -}, { -}), foo(()=>{ -}, ()=>{ -}), foo(()=>{ -}, ()=>1 +}), foo(null, null), foo({}, null), foo(null, {}), foo({}, {}), foo(()=>{}, ()=>{}), foo(()=>{}, ()=>1 ); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.1.normal.js index 5838c19f567..0e559d2254e 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.1.normal.js @@ -25,18 +25,11 @@ var r3 = foo(c, { foo: c }); var r4 = foo(null, null); -var r5 = foo({ -}, null); -var r6 = foo(null, { -}); -var r7 = foo({ -}, { -}); -var r8 = foo(function() { -}, function() { -}); -var r9 = foo(function() { -}, function() { +var r5 = foo({}, null); +var r6 = foo(null, {}); +var r7 = foo({}, {}); +var r8 = foo(function() {}, function() {}); +var r9 = foo(function() {}, function() { return 1; }); function other() { diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.2.minified.js index dd6e9474a9b..c6e52754498 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4_es5.2.minified.js @@ -16,13 +16,6 @@ function foo(t, t2) { foo(c, d), foo(d, c), foo(c, { x: "", foo: c -}), foo(null, null), foo({ -}, null), foo(null, { -}), foo({ -}, { -}), foo(function() { -}, function() { -}), foo(function() { -}, function() { +}), foo(null, null), foo({}, null), foo(null, {}), foo({}, {}), foo(function() {}, function() {}), foo(function() {}, function() { return 1; }); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.1.normal.js index 5edaf42d147..f26da3fedc6 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.1.normal.js @@ -11,8 +11,7 @@ var c; var d; var r2 = foo(d, c); // the constraints are self-referencing, no downstream error var r9 = foo(()=>1 -, ()=>{ -}); // the constraints are self-referencing, no downstream error +, ()=>{}); // the constraints are self-referencing, no downstream error function other() { var r5 = foo(c, d); // error } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.2.minified.js index 9548738f818..a91ba5f8d52 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es2015.2.minified.js @@ -4,5 +4,4 @@ function foo(t, t2) { ; } foo(d, c), foo(()=>1 -, ()=>{ -}); +, ()=>{}); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.1.normal.js index de640e7f2af..479213e5444 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.1.normal.js @@ -21,8 +21,7 @@ var d; var r2 = foo(d, c); // the constraints are self-referencing, no downstream error var r9 = foo(function() { return 1; -}, function() { -}); // the constraints are self-referencing, no downstream error +}, function() {}); // the constraints are self-referencing, no downstream error function other() { var r5 = foo(c, d); // error } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.2.minified.js index 16feb240710..33c800bdf12 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints5_es5.2.minified.js @@ -15,5 +15,4 @@ function foo(t, t2) { } foo(d, c), foo(function() { return 1; -}, function() { -}); +}, function() {}); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es2015.2.minified.js index b1e2f7ad942..9eaa9505bc3 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es2015.2.minified.js @@ -1,8 +1,6 @@ class X { } -function foo(t, t2) { -} +function foo(t, t2) {} var c1 = new X(), d1 = new X(); -function foo2(t, t2) { -} +function foo2(t, t2) {} foo(c1, d1), foo(c1, c1), foo2(c1, d1), foo2(c1, c1); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es5.2.minified.js index 00a4619765e..504e38e32d6 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints_es5.2.minified.js @@ -11,9 +11,7 @@ var C = function() { "use strict"; _classCallCheck(this, X); }; -function foo(t, t2) { -} +function foo(t, t2) {} var c1 = new X(), d1 = new X(); -function foo2(t, t2) { -} +function foo2(t, t2) {} foo(c1, d1), foo(c1, c1), foo2(c1, d1), foo2(c1, c1); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndInitializers_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndInitializers_es2015.1.normal.js index 0812796b5db..f7fb253c934 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndInitializers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndInitializers_es2015.1.normal.js @@ -5,13 +5,8 @@ function foo(x = null) { function foo2(x = undefined) { return x; } // ok -function foo3(x = 1) { -} // error -function foo4(x, y = x) { -} // error -function foo5(x, y = x) { -} // ok -function foo6(x, y, z = y) { -} // error -function foo7(x, y = x) { -} // should be ok +function foo3(x = 1) {} // error +function foo4(x, y = x) {} // error +function foo5(x, y = x) {} // ok +function foo6(x, y, z = y) {} // error +function foo7(x, y = x) {} // should be ok diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es2015.2.minified.js index 203c6e3318f..d2496435fea 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es2015.2.minified.js @@ -1,6 +1,5 @@ class X { } -function foo(t, t2) { -} +function foo(t, t2) {} var c1 = new X(); foo(c1, new X()), foo(c1, c1); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es5.2.minified.js index 640cfb96c9f..20342c8250c 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs_es5.2.minified.js @@ -11,7 +11,6 @@ var C = function() { "use strict"; _classCallCheck(this, X); }; -function foo(t, t2) { -} +function foo(t, t2) {} var c1 = new X(); foo(c1, new X()), foo(c1, c1); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.1.normal.js index ce7a85d8000..03aebb6c653 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.1.normal.js @@ -8,8 +8,7 @@ var NonGenericParameter; } var b; var r3 = foo4(b); // ok -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { function foo5(cb) { @@ -28,5 +27,4 @@ var GenericParameter; var r13 = foo7(1, a); // ok var c; var r14 = foo7(1, c); // ok -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.2.minified.js index 4a0ef3d3ad8..1e5f57395ab 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es2015.2.minified.js @@ -5,5 +5,4 @@ var GenericParameter; return cb; } foo7(1, a), foo7(1, c); -}(GenericParameter || (GenericParameter = { -})); +}(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.1.normal.js index 6e0a008d645..e5f077c7774 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.1.normal.js @@ -8,8 +8,7 @@ var NonGenericParameter; var a; var b; var r3 = foo4(b); // ok -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { var foo5 = function foo5(cb) { @@ -28,5 +27,4 @@ var GenericParameter; var r13 = foo7(1, a); // ok var c; var r14 = foo7(1, c); // ok -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.2.minified.js index 9046883d63f..d4cb1e31592 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments2_es5.2.minified.js @@ -4,5 +4,4 @@ var GenericParameter; return cb; }; foo7(1, a), foo7(1, c); -}(GenericParameter || (GenericParameter = { -})); +}(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.1.normal.js index 69d1a9e0911..b1dc7015295 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.1.normal.js @@ -9,8 +9,7 @@ var NonGenericParameter; var r = foo4(a); var b; var r2 = foo4(b); -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { function foo5(cb) { @@ -33,5 +32,4 @@ var GenericParameter; var c2; var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.2.minified.js index 1a8ab9092cd..ef6916e8d92 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es2015.2.minified.js @@ -5,8 +5,7 @@ var NonGenericParameter, GenericParameter; return new cb(null); } foo4(void 0), foo4(b); -}(NonGenericParameter || (NonGenericParameter = { -})), (function(GenericParameter) { +}(NonGenericParameter || (NonGenericParameter = {})), (function(GenericParameter) { var a, b, c, c2; function foo5(cb) { return cb; @@ -18,5 +17,4 @@ var NonGenericParameter, GenericParameter; return cb; } foo5(a), foo5(b), foo6(a), foo6(b), foo7(1, b), foo7(1, c), foo7(1, c2); -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.1.normal.js index 3032c6a71be..0815d42dff9 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.1.normal.js @@ -9,8 +9,7 @@ var NonGenericParameter; var r = foo4(a); var b; var r2 = foo4(b); -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { var foo5 = function foo5(cb) { @@ -33,5 +32,4 @@ var GenericParameter; var c2; var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.2.minified.js index c5ab2528446..cd1c48dfd43 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedConstructorTypedArguments_es5.2.minified.js @@ -4,8 +4,7 @@ var NonGenericParameter, GenericParameter; return new cb(null); }; foo4(a), foo4(b); -}(NonGenericParameter || (NonGenericParameter = { -})), (function(GenericParameter) { +}(NonGenericParameter || (NonGenericParameter = {})), (function(GenericParameter) { var a, b, c, c2, foo5 = function(cb) { return cb; }, foo6 = function(cb) { @@ -14,5 +13,4 @@ var NonGenericParameter, GenericParameter; return cb; }; foo5(a), foo5(b), foo6(a), foo6(b), foo7(1, b), foo7(1, c), foo7(1, c2); -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.1.normal.js index 70b79a746c9..c5ad6fd7250 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.1.normal.js @@ -10,8 +10,7 @@ var NonGenericParameter; var r; return r; }); // ok -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { function foo5(cb) { @@ -31,5 +30,4 @@ var GenericParameter; ); // ok var a; var r14 = foo7(1, a); // ok -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.2.minified.js index 8349733898a..0f08f3be586 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es2015.2.minified.js @@ -1,17 +1,11 @@ var NonGenericParameter, GenericParameter; -NonGenericParameter || (NonGenericParameter = { -}), (function(cb) { -})((x)=>{ -}), (function(GenericParameter) { +NonGenericParameter || (NonGenericParameter = {}), (function(cb) {})((x)=>{}), (function(GenericParameter) { var a; function foo7(x, cb) { return cb; } - (function(cb) { - })((x)=>x - ), (function(cb) { - })((x, y)=>"" + (function(cb) {})((x)=>x + ), (function(cb) {})((x, y)=>"" ), foo7(1, (x)=>x ), foo7(1, a); -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.1.normal.js index 295b90c5544..cd0d0c5cf23 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.1.normal.js @@ -10,8 +10,7 @@ var NonGenericParameter; var r; return r; }); // ok -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { var foo5 = function foo5(cb) { @@ -34,5 +33,4 @@ var GenericParameter; }); // ok var a; var r14 = foo7(1, a); // ok -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.2.minified.js index d6711b5791a..ca8a987be8c 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2_es5.2.minified.js @@ -1,19 +1,13 @@ var NonGenericParameter, GenericParameter; -NonGenericParameter || (NonGenericParameter = { -}), (function(cb) { -})(function(x) { -}), (function(GenericParameter) { +NonGenericParameter || (NonGenericParameter = {}), (function(cb) {})(function(x) {}), (function(GenericParameter) { var a, foo7 = function(x, cb) { return cb; }; - (function(cb) { - })(function(x) { + (function(cb) {})(function(x) { return x; - }), (function(cb) { - })(function(x, y) { + }), (function(cb) {})(function(x, y) { return ""; }), foo7(1, function(x) { return x; }), foo7(1, a); -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.1.normal.js index 5cdf9deadc3..f2f6bc0e68e 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.1.normal.js @@ -11,8 +11,7 @@ var NonGenericParameter; ); var r4 = foo4((x)=>x ); -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { function foo5(cb) { @@ -40,5 +39,4 @@ var GenericParameter; ); // 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] -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.2.minified.js index 60fd24f4eb7..0f841fb89a3 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es2015.2.minified.js @@ -7,8 +7,7 @@ var NonGenericParameter, GenericParameter; foo4(a), foo4((x)=>x ), foo4((x)=>x ); -}(NonGenericParameter || (NonGenericParameter = { -})), (function(GenericParameter) { +}(NonGenericParameter || (NonGenericParameter = {})), (function(GenericParameter) { var a, a; function foo5(cb) { return cb; @@ -26,5 +25,4 @@ var NonGenericParameter, GenericParameter; ), foo7(1, (x)=>x ), foo7(1, (x)=>"" ), foo7(1, a); -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.1.normal.js index 5f0e4a96ac1..499f95f9b85 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.1.normal.js @@ -13,8 +13,7 @@ var NonGenericParameter; var r4 = foo4(function(x) { return x; }); -})(NonGenericParameter || (NonGenericParameter = { -})); +})(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function(GenericParameter) { var foo5 = function foo5(cb) { @@ -48,5 +47,4 @@ var GenericParameter; }); // 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] -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.2.minified.js index a57decb4aad..ca614af5595 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments_es5.2.minified.js @@ -8,8 +8,7 @@ var NonGenericParameter, GenericParameter; }), foo4(function(x) { return x; }); -}(NonGenericParameter || (NonGenericParameter = { -})), (function(GenericParameter) { +}(NonGenericParameter || (NonGenericParameter = {})), (function(GenericParameter) { var a, a, foo5 = function(cb) { return cb; }, foo6 = function(cb) { @@ -30,5 +29,4 @@ var NonGenericParameter, GenericParameter; }), foo7(1, function(x) { return ""; }), foo7(1, a); -})(GenericParameter || (GenericParameter = { -})); +})(GenericParameter || (GenericParameter = {})); diff --git a/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.1.normal.js index b8c30674422..9abedd39b21 100644 --- a/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.1.normal.js @@ -31,10 +31,8 @@ i2.tuple1 = [ "bar" ]; i2.tuple1 = [ - { - }, - { - } + {}, + {} ]; // error i1.tuple1 = [ @@ -42,12 +40,9 @@ i1.tuple1 = [ "foo" ]; i1.tuple1 = [ - { - }, - { - } + {}, + {} ]; i2.tuple1 = [ - { - } + {} ]; diff --git a/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.2.minified.js index a73601d77bc..d514ee1b18a 100644 --- a/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithTupleType_es2015.2.minified.js @@ -19,19 +19,14 @@ i1.tuple1 = [ 5, "bar" ], i2.tuple1 = [ - { - }, - { - } + {}, + {} ], i1.tuple1 = [ 5, "foo" ], i1.tuple1 = [ - { - }, - { - } + {}, + {} ], i2.tuple1 = [ - { - } + {} ]; diff --git a/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.1.normal.js index b8c30674422..9abedd39b21 100644 --- a/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.1.normal.js @@ -31,10 +31,8 @@ i2.tuple1 = [ "bar" ]; i2.tuple1 = [ - { - }, - { - } + {}, + {} ]; // error i1.tuple1 = [ @@ -42,12 +40,9 @@ i1.tuple1 = [ "foo" ]; i1.tuple1 = [ - { - }, - { - } + {}, + {} ]; i2.tuple1 = [ - { - } + {} ]; diff --git a/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.2.minified.js index a73601d77bc..d514ee1b18a 100644 --- a/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithTupleType_es5.2.minified.js @@ -19,19 +19,14 @@ i1.tuple1 = [ 5, "bar" ], i2.tuple1 = [ - { - }, - { - } + {}, + {} ], i1.tuple1 = [ 5, "foo" ], i1.tuple1 = [ - { - }, - { - } + {}, + {} ], i2.tuple1 = [ - { - } + {} ]; diff --git a/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.1.normal.js index b5963445fd8..0f955b39ea0 100644 --- a/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.2.minified.js index 62f7b76becd..ab659d93748 100644 --- a/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericClassExpressionInFunction_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.1.normal.js index 27f645847e5..8f0660f9061 100644 --- a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.1.normal.js @@ -24,8 +24,7 @@ var ImmediatelyFix; ); // number var r3a = c2.foo((x)=>1 ); // number -})(ImmediatelyFix || (ImmediatelyFix = { -})); +})(ImmediatelyFix || (ImmediatelyFix = {})); var WithCandidates; (function(WithCandidates) { class C { @@ -71,5 +70,4 @@ var WithCandidates; return ''; }, 1); // error } -})(WithCandidates || (WithCandidates = { -})); +})(WithCandidates || (WithCandidates = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.2.minified.js index 1e276a38b00..85a34b2c3fa 100644 --- a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es2015.2.minified.js @@ -17,8 +17,7 @@ var ImmediatelyFix, WithCandidates; c2.foo((x)=>1 ), c2.foo((x)=>1 ); -}(ImmediatelyFix || (ImmediatelyFix = { -})), (function(WithCandidates) { +}(ImmediatelyFix || (ImmediatelyFix = {})), (function(WithCandidates) { var c, c2; c.foo2(1, function(a) { return ""; @@ -28,5 +27,4 @@ var ImmediatelyFix, WithCandidates; , ""), c2.foo3(1, function(a) { return ""; }, ""); -})(WithCandidates || (WithCandidates = { -})); +})(WithCandidates || (WithCandidates = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.1.normal.js b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.1.normal.js index 878f85ac768..88047a07897 100644 --- a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.1.normal.js @@ -68,8 +68,7 @@ var ImmediatelyFix; var r3a = c2.foo(function(x) { return 1; }); // number -})(ImmediatelyFix || (ImmediatelyFix = { -})); +})(ImmediatelyFix || (ImmediatelyFix = {})); var WithCandidates; (function(WithCandidates) { var other = function other(t, u) { @@ -152,5 +151,4 @@ var WithCandidates; return C3; }(); var c3; -})(WithCandidates || (WithCandidates = { -})); +})(WithCandidates || (WithCandidates = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.2.minified.js b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.2.minified.js index f9a770f35d7..8f70eed3229 100644 --- a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments_es5.2.minified.js @@ -52,8 +52,7 @@ function _createClass(Constructor, protoProps, staticProps) { }), c2.foo(function(x) { return 1; }); -}(ImmediatelyFix || (ImmediatelyFix = { -})), (function(WithCandidates) { +}(ImmediatelyFix || (ImmediatelyFix = {})), (function(WithCandidates) { var c, c2, C = function() { "use strict"; function C() { @@ -108,5 +107,4 @@ function _createClass(Constructor, protoProps, staticProps) { } ]), C3; }(); -})(WithCandidates || (WithCandidates = { -})); +})(WithCandidates || (WithCandidates = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.1.normal.js index 267377b90ea..be30a3fae3a 100644 --- a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.1.normal.js @@ -28,8 +28,7 @@ var Class; var g2; var r = g2.foo2(c1, d1); var r2 = g2.foo2(c1, c1); -})(Class || (Class = { -})); +})(Class || (Class = {})); var Interface; (function(Interface) { var c1 = new X(); @@ -40,5 +39,4 @@ var Interface; var g2; var r = g2.foo2(c1, d1); var r2 = g2.foo2(c1, c1); -})(Interface || (Interface = { -})); +})(Interface || (Interface = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.2.minified.js b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.2.minified.js index 3021ed270d7..1b5524aebbc 100644 --- a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es2015.2.minified.js @@ -4,9 +4,7 @@ class X { !function(Class) { var g, g2, c1 = new X(), d1 = new X(); g.foo(c1, d1), g.foo(c1, c1), g2.foo2(c1, d1), g2.foo2(c1, c1); -}(Class || (Class = { -})), (function(Interface) { +}(Class || (Class = {})), (function(Interface) { var g, g2, c1 = new X(), d1 = new X(); g.foo(c1, d1), g.foo(c1, c1), g2.foo2(c1, d1), g2.foo2(c1, c1); -})(Interface || (Interface = { -})); +})(Interface || (Interface = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.1.normal.js index 577b78e6958..013b9b5ec8d 100644 --- a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.1.normal.js @@ -71,8 +71,7 @@ var Class; var g2; var r = g2.foo2(c1, d1); var r2 = g2.foo2(c1, c1); -})(Class || (Class = { -})); +})(Class || (Class = {})); var Interface; (function(Interface) { var c1 = new X(); @@ -83,5 +82,4 @@ var Interface; var g2; var r = g2.foo2(c1, d1); var r2 = g2.foo2(c1, c1); -})(Interface || (Interface = { -})); +})(Interface || (Interface = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.2.minified.js b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.2.minified.js index 624529574a5..443969eeca1 100644 --- a/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericClassWithObjectTypeArgsAndConstraints_es5.2.minified.js @@ -29,8 +29,7 @@ var Class, Interface, C = function() { return _createClass(G, [ { key: "foo", - value: function(t, t2) { - } + value: function(t, t2) {} } ]), G; }(), c1 = new X(), d1 = new X(); @@ -43,15 +42,12 @@ var Class, Interface, C = function() { return _createClass(G2, [ { key: "foo2", - value: function(t, t2) { - } + value: function(t, t2) {} } ]), G2; }(); g2.foo2(c1, d1), g2.foo2(c1, c1); -}(Class || (Class = { -})), (function(Interface) { +}(Class || (Class = {})), (function(Interface) { var g, g2, c1 = new X(), d1 = new X(); g.foo(c1, d1), g.foo(c1, c1), g2.foo2(c1, d1), g2.foo2(c1, c1); -})(Interface || (Interface = { -})); +})(Interface || (Interface = {})); diff --git a/crates/swc/tests/tsc-references/genericObjectRest_es2015.1.normal.js b/crates/swc/tests/tsc-references/genericObjectRest_es2015.1.normal.js index b142b8c1661..c265e93225b 100644 --- a/crates/swc/tests/tsc-references/genericObjectRest_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/genericObjectRest_es2015.1.normal.js @@ -13,8 +13,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -29,10 +28,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -63,8 +60,7 @@ var _typeof = function(obj) { // @target: es2015 const a = 'a'; function f1(obj) { - let r0 = _extends({ - }, obj); + let r0 = _extends({}, obj); let { a: a1 } = obj, r1 = _objectWithoutProperties(obj, [ "a" ]); diff --git a/crates/swc/tests/tsc-references/genericObjectRest_es5.1.normal.js b/crates/swc/tests/tsc-references/genericObjectRest_es5.1.normal.js index 6d970271719..d5bd18d9474 100644 --- a/crates/swc/tests/tsc-references/genericObjectRest_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericObjectRest_es5.1.normal.js @@ -13,8 +13,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -29,10 +28,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -63,8 +60,7 @@ var _typeof = function(obj) { // @target: es2015 var a = 'a'; function f1(obj) { - var r0 = _extends({ - }, obj); + var r0 = _extends({}, obj); var a1 = obj.a, r1 = _objectWithoutProperties(obj, [ "a" ]); diff --git a/crates/swc/tests/tsc-references/generic_es2015.1.normal.js b/crates/swc/tests/tsc-references/generic_es2015.1.normal.js index fd09f4351fa..a0798cddc67 100644 --- a/crates/swc/tests/tsc-references/generic_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generic_es2015.1.normal.js @@ -7,8 +7,7 @@ let a = { let b = { a: 3 }; -let c = { -}; +let c = {}; let d = { a: "" }; diff --git a/crates/swc/tests/tsc-references/generic_es5.1.normal.js b/crates/swc/tests/tsc-references/generic_es5.1.normal.js index 46769718c36..429739408b4 100644 --- a/crates/swc/tests/tsc-references/generic_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generic_es5.1.normal.js @@ -14,8 +14,7 @@ var a = { var b = { a: 3 }; -var c = { -}; +var c = {}; var d = { a: "" }; diff --git a/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es2015.1.normal.js b/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es2015.1.normal.js index 457cb465ace..7d553c66a32 100644 --- a/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es2015.1.normal.js @@ -3,23 +3,19 @@ // if a matching set accessor exists and that set accessor has a parameter type annotation, // return expressions are contextually typed by the type given in the set accessor's parameter type annotation. class C { - set X(x) { - } + set X(x) {} get X() { return "string"; // Error; get contextual type by set accessor parameter type annotation } - set Y(y) { - } + set Y(y) {} get Y() { return true; } - set W(w) { - } + set W(w) {} get W() { return true; } - set Z(z) { - } + set Z(z) {} get Z() { return 1; } diff --git a/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.1.normal.js b/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.1.normal.js index 73690247400..70dd7aa99d2 100644 --- a/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.1.normal.js @@ -32,32 +32,28 @@ var C = // @target: es5 get: function get() { return "string"; // Error; get contextual type by set accessor parameter type annotation }, - set: function set(x) { - } + set: function set(x) {} }, { key: "Y", get: function get() { return true; }, - set: function set(y) { - } + set: function set(y) {} }, { key: "W", get: function get() { return true; }, - set: function set(w) { - } + set: function set(w) {} }, { key: "Z", get: function get() { return 1; }, - set: function set(z) { - } + set: function set(z) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.2.minified.js b/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.2.minified.js index c32dfcc7909..141a5a63d4d 100644 --- a/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/getSetAccessorContextualTyping_es5.2.minified.js @@ -18,32 +18,28 @@ var C = function() { get: function() { return "string"; }, - set: function(x) { - } + set: function(x) {} }, { key: "Y", get: function() { return !0; }, - set: function(y) { - } + set: function(y) {} }, { key: "W", get: function() { return !0; }, - set: function(w) { - } + set: function(w) {} }, { key: "Z", get: function() { return 1; }, - set: function(z) { - } + set: function(z) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es2015.1.normal.js b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es2015.1.normal.js index 394efbbcf20..21c24074be3 100644 --- a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es2015.1.normal.js @@ -13,13 +13,11 @@ var c = [ null ]; // {}[] var d = [ - { - }, + {}, 1 ]; // {}[] var e = [ - { - }, + {}, Object ]; // {}[] var f = [ @@ -159,8 +157,7 @@ var derived2; ()=>derived ] ]; // {}[] -})(Derived || (Derived = { -})); +})(Derived || (Derived = {})); var WithContextualType; (function(WithContextualType) { // no errors @@ -177,8 +174,7 @@ var WithContextualType; , ()=>derived2 ]; -})(WithContextualType || (WithContextualType = { -})); +})(WithContextualType || (WithContextualType = {})); function foo(t, u) { var a = [ t, diff --git a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.1.normal.js b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.1.normal.js index a42337aaf40..f543019aa72 100644 --- a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -84,13 +83,11 @@ var c = [ null ]; // {}[] var d = [ - { - }, + {}, 1 ]; // {}[] var e = [ - { - }, + {}, Object ]; // {}[] var f = [ @@ -286,8 +283,7 @@ var derived2; } ] ]; // {}[] -})(Derived || (Derived = { -})); +})(Derived || (Derived = {})); var WithContextualType; (function(WithContextualType) { // no errors @@ -307,8 +303,7 @@ var WithContextualType; return derived2; } ]; -})(WithContextualType || (WithContextualType = { -})); +})(WithContextualType || (WithContextualType = {})); function foo(t, u) { var a = [ t, diff --git a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.2.minified.js b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.2.minified.js index f543b64dbba..c183ef954ff 100644 --- a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.1.normal.js index 2d555de1ce8..da6d4565c82 100644 --- a/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.1.normal.js @@ -19,8 +19,7 @@ var M; return x.toString(); } M1.F2 = F21; -})(M || (M = { -})); +})(M || (M = {})); var N; (function(N1) { class A { @@ -30,214 +29,128 @@ var N; return x.toString(); } N1.F2 = F22; -})(N || (N = { -})); +})(N || (N = {})); // literals -if (true) { -} -while(true){ -} -do { -}while (true) -if (null) { -} -while(null){ -} -do { -}while (null) -if (undefined) { -} -while(undefined){ -} -do { -}while (undefined) -if (0) { -} -while(0){ -} -do { -}while (0) -if ('a string') { -} -while('a string'){ -} -do { -}while ('a string') -if ('') { -} -while(''){ -} -do { -}while ('') -if (/[a-z]/) { -} -while(/[a-z]/){ -} -do { -}while (/[a-z]/) -if ([]) { -} -while([]){ -} -do { -}while ([]) +if (true) {} +while(true){} +do {}while (true) +if (null) {} +while(null){} +do {}while (null) +if (undefined) {} +while(undefined){} +do {}while (undefined) +if (0) {} +while(0){} +do {}while (0) +if ('a string') {} +while('a string'){} +do {}while ('a string') +if ('') {} +while(''){} +do {}while ('') +if (/[a-z]/) {} +while(/[a-z]/){} +do {}while (/[a-z]/) +if ([]) {} +while([]){} +do {}while ([]) if ([ 1, 2 -]) { -} +]) {} while([ 1, 2 -]){ -} -do { -}while ([ +]){} +do {}while ([ 1, 2 ]) -if ({ -}) { -} -while({ -}){ -} -do { -}while ({ -}) +if ({}) {} +while({}){} +do {}while ({}) if ({ x: 1, y: 'a' -}) { -} +}) {} while({ x: 1, y: 'a' -}){ -} -do { -}while ({ +}){} +do {}while ({ x: 1, y: 'a' }) if (()=>43 -) { -} +) {} while(()=>43 -){ -} -do { -}while (()=>43 +){} +do {}while (()=>43 ) -if (new C()) { -} -while(new C()){ -} -do { -}while (new C()) -if (new D()) { -} -while(new D()){ -} -do { -}while (new D()) +if (new C()) {} +while(new C()){} +do {}while (new C()) +if (new D()) {} +while(new D()){} +do {}while (new D()) // references var a = true; -if (a) { -} -while(a){ -} -do { -}while (a) +if (a) {} +while(a){} +do {}while (a) var b = null; -if (b) { -} -while(b){ -} -do { -}while (b) +if (b) {} +while(b){} +do {}while (b) var c = undefined; -if (c) { -} -while(c){ -} -do { -}while (c) +if (c) {} +while(c){} +do {}while (c) var d = 0; -if (d) { -} -while(d){ -} -do { -}while (d) +if (d) {} +while(d){} +do {}while (d) var e = 'a string'; -if (e) { -} -while(e){ -} -do { -}while (e) +if (e) {} +while(e){} +do {}while (e) var f = ''; -if (f) { -} -while(f){ -} -do { -}while (f) +if (f) {} +while(f){} +do {}while (f) var g = /[a-z]/; -if (g) { -} -while(g){ -} -do { -}while (g) +if (g) {} +while(g){} +do {}while (g) var h = []; -if (h) { -} -while(h){ -} -do { -}while (h) +if (h) {} +while(h){} +do {}while (h) var i = [ 1, 2 ]; -if (i) { -} -while(i){ -} -do { -}while (i) -var j = { -}; -if (j) { -} -while(j){ -} -do { -}while (j) +if (i) {} +while(i){} +do {}while (i) +var j = {}; +if (j) {} +while(j){} +do {}while (j) var k = { x: 1, y: 'a' }; -if (k) { -} -while(k){ -} -do { -}while (k) +if (k) {} +while(k){} +do {}while (k) function fn(x) { return null; } -if (fn()) { -} -while(fn()){ -} -do { -}while (fn()) -if (fn) { -} -while(fn){ -} -do { -}while (fn) +if (fn()) {} +while(fn()){} +do {}while (fn()) +if (fn) {} +while(fn){} +do {}while (fn) diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.2.minified.js index 5144f23e690..12249403e8f 100644 --- a/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/ifDoWhileStatements_es2015.2.minified.js @@ -2,12 +2,10 @@ class C { } class D { } -for((M = M1 || (M1 = { -})).A = class { +for((M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); -}, (N = N1 || (N1 = { -})).A = class { +}, (N = N1 || (N1 = {})).A = class { }, N.F2 = function(x) { return x.toString(); };;); @@ -72,8 +70,7 @@ for(var i = [ ]; i;); do ; while (i) -for(var j = { -}; j;); +for(var j = {}; j;); do ; while (j) for(var k = { diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.1.normal.js index e5858a98409..90f60b291fe 100644 --- a/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -104,8 +103,7 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var N; (function(N1) { var F2 = function F2(x) { @@ -117,217 +115,131 @@ var N; }; N1.A = A; N1.F2 = F2; -})(N || (N = { -})); +})(N || (N = {})); // literals -if (true) { -} -while(true){ -} -do { -}while (true) -if (null) { -} -while(null){ -} -do { -}while (null) -if (undefined) { -} -while(undefined){ -} -do { -}while (undefined) -if (0) { -} -while(0){ -} -do { -}while (0) -if ('a string') { -} -while('a string'){ -} -do { -}while ('a string') -if ('') { -} -while(''){ -} -do { -}while ('') -if (/[a-z]/) { -} -while(/[a-z]/){ -} -do { -}while (/[a-z]/) -if ([]) { -} -while([]){ -} -do { -}while ([]) +if (true) {} +while(true){} +do {}while (true) +if (null) {} +while(null){} +do {}while (null) +if (undefined) {} +while(undefined){} +do {}while (undefined) +if (0) {} +while(0){} +do {}while (0) +if ('a string') {} +while('a string'){} +do {}while ('a string') +if ('') {} +while(''){} +do {}while ('') +if (/[a-z]/) {} +while(/[a-z]/){} +do {}while (/[a-z]/) +if ([]) {} +while([]){} +do {}while ([]) if ([ 1, 2 -]) { -} +]) {} while([ 1, 2 -]){ -} -do { -}while ([ +]){} +do {}while ([ 1, 2 ]) -if ({ -}) { -} -while({ -}){ -} -do { -}while ({ -}) +if ({}) {} +while({}){} +do {}while ({}) if ({ x: 1, y: 'a' -}) { -} +}) {} while({ x: 1, y: 'a' -}){ -} -do { -}while ({ +}){} +do {}while ({ x: 1, y: 'a' }) if (function() { return 43; -}) { -} +}) {} while(function() { return 43; -}){ -} -do { -}while (function() { +}){} +do {}while (function() { return 43; }) -if (new C()) { -} -while(new C()){ -} -do { -}while (new C()) -if (new D()) { -} -while(new D()){ -} -do { -}while (new D()) +if (new C()) {} +while(new C()){} +do {}while (new C()) +if (new D()) {} +while(new D()){} +do {}while (new D()) // references var a = true; -if (a) { -} -while(a){ -} -do { -}while (a) +if (a) {} +while(a){} +do {}while (a) var b = null; -if (b) { -} -while(b){ -} -do { -}while (b) +if (b) {} +while(b){} +do {}while (b) var c = undefined; -if (c) { -} -while(c){ -} -do { -}while (c) +if (c) {} +while(c){} +do {}while (c) var d = 0; -if (d) { -} -while(d){ -} -do { -}while (d) +if (d) {} +while(d){} +do {}while (d) var e = 'a string'; -if (e) { -} -while(e){ -} -do { -}while (e) +if (e) {} +while(e){} +do {}while (e) var f = ''; -if (f) { -} -while(f){ -} -do { -}while (f) +if (f) {} +while(f){} +do {}while (f) var g = /[a-z]/; -if (g) { -} -while(g){ -} -do { -}while (g) +if (g) {} +while(g){} +do {}while (g) var h = []; -if (h) { -} -while(h){ -} -do { -}while (h) +if (h) {} +while(h){} +do {}while (h) var i = [ 1, 2 ]; -if (i) { -} -while(i){ -} -do { -}while (i) -var j = { -}; -if (j) { -} -while(j){ -} -do { -}while (j) +if (i) {} +while(i){} +do {}while (i) +var j = {}; +if (j) {} +while(j){} +do {}while (j) var k = { x: 1, y: 'a' }; -if (k) { -} -while(k){ -} -do { -}while (k) +if (k) {} +while(k){} +do {}while (k) function fn(x) { return null; } -if (fn()) { -} -while(fn()){ -} -do { -}while (fn()) -if (fn) { -} -while(fn){ -} -do { -}while (fn) +if (fn()) {} +while(fn()){} +do {}while (fn()) +if (fn) {} +while(fn){} +do {}while (fn) diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.2.minified.js index c53e8189b1c..9457d218745 100644 --- a/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/ifDoWhileStatements_es5.2.minified.js @@ -32,8 +32,7 @@ var M, N, C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -66,8 +65,7 @@ for(!function(M1) { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -})), (function(N1) { +}(M || (M = {})), (function(N1) { var A = function() { "use strict"; _classCallCheck(this, A); @@ -75,8 +73,7 @@ for(!function(M1) { N1.A = A, N1.F2 = function(x) { return x.toString(); }; -})(N || (N = { -}));;); +})(N || (N = {}));;); for(;;); do ; while (null) @@ -134,8 +131,7 @@ for(var i = [ ]; i;); do ; while (i) -for(var j = { -}; j;); +for(var j = {}; j;); do ; while (j) for(var k = { diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.1.normal.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.1.normal.js index f6ae45ae394..48c948aa71a 100644 --- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.1.normal.js @@ -19,8 +19,7 @@ var M; } class Bar3 extends Foo1 { } -})(M || (M = { -})); +})(M || (M = {})); // two levels of privates var M2; (function(M2) { @@ -38,5 +37,4 @@ var M2; } class Bar3 extends Foo2 { } -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.2.minified.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.2.minified.js index 58f90959112..bcbfcce8728 100644 --- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es2015.2.minified.js @@ -2,5 +2,4 @@ var M2; !function(M2) { var b; b.z, b.x, b.y; -}(M2 || (M2 = { -})); +}(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.1.normal.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.1.normal.js index 87e6c4a5b86..d02ab1bcfea 100644 --- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -150,8 +149,7 @@ var M; } return Bar3; }(Foo); -})(M || (M = { -})); +})(M || (M = {})); // two levels of privates var M2; (function(M2) { @@ -203,5 +201,4 @@ var M2; } return Bar3; }(Foo); -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.2.minified.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.2.minified.js index c7879e1ffc4..c7cbf28d834 100644 --- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -110,8 +109,7 @@ var M, M2, Foo = function() { } return Bar3; }(Foo4); -}(M || (M = { -})), (function(M2) { +}(M || (M = {})), (function(M2) { var b, Foo9 = function() { "use strict"; _classCallCheck(this, Foo9); @@ -150,5 +148,4 @@ var M, M2, Foo = function() { } return Bar3; }(Foo9); -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.1.normal.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.1.normal.js index d334e1336a9..f354ea60c8b 100644 --- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.2.minified.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.2.minified.js index 8f51d9ec169..8c572ef10a7 100644 --- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.1.normal.js b/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.1.normal.js index 80808ecdc73..8b7d6203a94 100644 --- a/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.1.normal.js @@ -7,8 +7,7 @@ var moduleA; } } moduleA1.Point = Point; -})(moduleA || (moduleA = { -})); +})(moduleA || (moduleA = {})); var p; var p; var p; @@ -19,8 +18,7 @@ class clodule { x: 0, y: 0 }; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); var p; var p; var p; @@ -35,8 +33,7 @@ function fundule() { x: 0, y: 0 }; -})(fundule || (fundule = { -})); +})(fundule || (fundule = {})); var p; var p; var p; diff --git a/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.2.minified.js b/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.2.minified.js index 967fd4becc6..ecd97bb7429 100644 --- a/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importAliasIdentifiers_es2015.2.minified.js @@ -1,6 +1,5 @@ var moduleA; -(moduleA || (moduleA = { -})).Point = class { +(moduleA || (moduleA = {})).Point = class { constructor(x, y){ this.x = x, this.y = y; } diff --git a/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.1.normal.js b/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.1.normal.js index 30a6e53f601..c03f0b7f0d2 100644 --- a/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.1.normal.js @@ -12,8 +12,7 @@ var moduleA; this.y = y; }; moduleA1.Point = Point; -})(moduleA || (moduleA = { -})); +})(moduleA || (moduleA = {})); var p; var p; var p; @@ -26,8 +25,7 @@ var clodule = function clodule() { x: 0, y: 0 }; -})(clodule || (clodule = { -})); +})(clodule || (clodule = {})); var p; var p; var p; @@ -42,8 +40,7 @@ function fundule() { x: 0, y: 0 }; -})(fundule || (fundule = { -})); +})(fundule || (fundule = {})); var p; var p; var p; diff --git a/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.2.minified.js b/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.2.minified.js index 9fc01efdaff..d5fe012dba8 100644 --- a/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importAliasIdentifiers_es5.2.minified.js @@ -7,8 +7,7 @@ function _classCallCheck(instance, Constructor) { _classCallCheck(this, Point), this.x = x, this.y = y; }; moduleA1.Point = Point; -}(moduleA || (moduleA = { -})); +}(moduleA || (moduleA = {})); var moduleA, clodule = function() { "use strict"; _classCallCheck(this, clodule); diff --git a/crates/swc/tests/tsc-references/importNonExternalModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/importNonExternalModule_es2015.1.normal.js index c2f7d0fff7e..c21caa7ac66 100644 --- a/crates/swc/tests/tsc-references/importNonExternalModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importNonExternalModule_es2015.1.normal.js @@ -3,11 +3,9 @@ var foo; (function(foo1) { var answer = foo1.answer = 42; -})(foo || (foo = { -})); +})(foo || (foo = {})); // @Filename: foo_1.ts const foo = require("./foo_0"); // Import should fail. foo_0 not an external module -if (foo.answer === 42) { -} +if (foo.answer === 42) {} export { }; diff --git a/crates/swc/tests/tsc-references/importNonExternalModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/importNonExternalModule_es2015.2.minified.js index 5f7c7278aa4..37fd5a8a529 100644 --- a/crates/swc/tests/tsc-references/importNonExternalModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importNonExternalModule_es2015.2.minified.js @@ -1,6 +1,5 @@ var foo; -(foo || (foo = { -})).answer = 42; +(foo || (foo = {})).answer = 42; const foo = require("./foo_0"); 42 === foo.answer; export { }; diff --git a/crates/swc/tests/tsc-references/importNonExternalModule_es5.1.normal.js b/crates/swc/tests/tsc-references/importNonExternalModule_es5.1.normal.js index ea0ba57a8d1..f6cae5f8b50 100644 --- a/crates/swc/tests/tsc-references/importNonExternalModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importNonExternalModule_es5.1.normal.js @@ -3,11 +3,9 @@ var foo; (function(foo1) { var answer = foo1.answer = 42; -})(foo || (foo = { -})); +})(foo || (foo = {})); // @Filename: foo_1.ts var foo = require("./foo_0"); // Import should fail. foo_0 not an external module -if (foo.answer === 42) { -} +if (foo.answer === 42) {} export { }; diff --git a/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js b/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js index 20150730f53..555ddd583d7 100644 --- a/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js @@ -1,6 +1,5 @@ var foo; -(foo || (foo = { -})).answer = 42; +(foo || (foo = {})).answer = 42; var foo = require("./foo_0"); 42 === foo.answer; export { }; diff --git a/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.1.normal.js b/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.1.normal.js index 76787b91f45..b9255c56923 100644 --- a/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.1.normal.js @@ -8,14 +8,12 @@ var C; y: 0, z: 0 }; -})(C || (C = { -})); +})(C || (C = {})); // no code gen expected var D; (function(D) { var p; -})(D || (D = { -})); +})(D || (D = {})); // no code gen expected var E; (function(E1) { @@ -23,5 +21,4 @@ var E; return 0 - x.x; } E1.xDist = xDist; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.2.minified.js b/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.2.minified.js index 306d3306fb8..507264a126e 100644 --- a/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importStatementsInterfaces_es2015.2.minified.js @@ -1,5 +1,4 @@ var E; -(E || (E = { -})).xDist = function(x) { +(E || (E = {})).xDist = function(x) { return 0 - x.x; }; diff --git a/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.1.normal.js b/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.1.normal.js index 19580cee268..accf52db3c6 100644 --- a/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.1.normal.js @@ -8,14 +8,12 @@ var C; y: 0, z: 0 }; -})(C || (C = { -})); +})(C || (C = {})); // no code gen expected var D; (function(D) { var p; -})(D || (D = { -})); +})(D || (D = {})); // no code gen expected var E; (function(E1) { @@ -23,5 +21,4 @@ var E; return 0 - x.x; }; E1.xDist = xDist; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.2.minified.js b/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.2.minified.js index 306d3306fb8..507264a126e 100644 --- a/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importStatementsInterfaces_es5.2.minified.js @@ -1,5 +1,4 @@ var E; -(E || (E = { -})).xDist = function(x) { +(E || (E = {})).xDist = function(x) { return 0 - x.x; }; diff --git a/crates/swc/tests/tsc-references/importStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/importStatements_es2015.1.normal.js index 5237ec16c0e..f6bf7136818 100644 --- a/crates/swc/tests/tsc-references/importStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importStatements_es2015.1.normal.js @@ -8,8 +8,7 @@ var A; } A1.Point = Point; var Origin = A1.Origin = new Point(0, 0); -})(A || (A = { -})); +})(A || (A = {})); // no code gen expected var C; (function(C) { @@ -19,15 +18,13 @@ var C; x: 0, y: 0 }; -})(C || (C = { -})); +})(C || (C = {})); // code gen expected var D; (function(D) { var a = A; var p = new a.Point(1, 1); -})(D || (D = { -})); +})(D || (D = {})); var E; (function(E1) { var a = A; @@ -35,5 +32,4 @@ var E; return a.Origin.x - x.x; } E1.xDist = xDist; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/importStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/importStatements_es2015.2.minified.js index f0775ca628d..640f3ab1181 100644 --- a/crates/swc/tests/tsc-references/importStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importStatements_es2015.2.minified.js @@ -6,12 +6,9 @@ var A, D, E; } } A1.Point = Point, A1.Origin = new Point(0, 0); -}(A || (A = { -})), D || (D = { -}), new A.Point(1, 1), (function(E1) { +}(A || (A = {})), D || (D = {}), new A.Point(1, 1), (function(E1) { var a = A; E1.xDist = function(x) { return a.Origin.x - x.x; }; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/importStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/importStatements_es5.1.normal.js index fea8345b68c..1afeddd96b0 100644 --- a/crates/swc/tests/tsc-references/importStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importStatements_es5.1.normal.js @@ -13,8 +13,7 @@ var A; }; A1.Point = Point; var Origin = A1.Origin = new Point(0, 0); -})(A || (A = { -})); +})(A || (A = {})); // no code gen expected var C; (function(C) { @@ -24,15 +23,13 @@ var C; x: 0, y: 0 }; -})(C || (C = { -})); +})(C || (C = {})); // code gen expected var D; (function(D) { var a = A; var p = new a.Point(1, 1); -})(D || (D = { -})); +})(D || (D = {})); var E; (function(E1) { var xDist = function xDist(x) { @@ -40,5 +37,4 @@ var E; }; var a = A; E1.xDist = xDist; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/importStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/importStatements_es5.2.minified.js index 600d6dfd134..2c9b420d6f4 100644 --- a/crates/swc/tests/tsc-references/importStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importStatements_es5.2.minified.js @@ -7,12 +7,9 @@ var A, D, E; })(this, Point), this.x = x, this.y = y; }; A1.Point = Point, A1.Origin = new Point(0, 0); -}(A || (A = { -})), D || (D = { -}), new A.Point(1, 1), (function(E1) { +}(A || (A = {})), D || (D = {}), new A.Point(1, 1), (function(E1) { var a = A; E1.xDist = function(x) { return a.Origin.x - x.x; }; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/importTypeAmbient_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeAmbient_es2015.1.normal.js index 8e6d3ac23ac..ab1e2117d2b 100644 --- a/crates/swc/tests/tsc-references/importTypeAmbient_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importTypeAmbient_es2015.1.normal.js @@ -7,8 +7,7 @@ let y = { b: 0 }; class Bar2 { - constructor(input){ - } + constructor(input){} } let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js index 45093277799..c663f8786eb 100644 --- a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js @@ -1,7 +1,6 @@ module.exports = Point; class Bar { - constructor(input){ - } + constructor(input){} } export { Bar }; // @filename: usage.ts @@ -20,8 +19,7 @@ export let y = { } }; export class Bar2 { - constructor(input){ - } + constructor(input){} } export let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js index ed1493d3473..ef18d1ddba0 100644 --- a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js @@ -1,7 +1,6 @@ module.exports = Point; class Bar { - constructor(input){ - } + constructor(input){} } export { Bar }; export const x = { @@ -19,8 +18,7 @@ export let y = { } }; export class Bar2 { - constructor(input){ - } + constructor(input){} } export let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js index 2a693777882..45734fe5bfb 100644 --- a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js @@ -1,7 +1,6 @@ module.exports = Point; class Bar { - constructor(input){ - } + constructor(input){} } export { Bar }; // @filename: usage.ts @@ -18,8 +17,7 @@ export let z = { b: 0 }; export class Bar2 { - constructor(input){ - } + constructor(input){} } export let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js index 8d4b7b18735..6e00d1620c6 100644 --- a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js @@ -1,7 +1,6 @@ module.exports = Point; class Bar { - constructor(input){ - } + constructor(input){} } export { Bar }; export const x = { @@ -17,8 +16,7 @@ export let z = { b: 0 }; export class Bar2 { - constructor(input){ - } + constructor(input){} } export let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js index b8447eb6db6..0e1d4cabe6a 100644 --- a/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js @@ -1,7 +1,6 @@ module.exports = Point; class Bar { - constructor(input){ - } + constructor(input){} } export { Bar }; // @filename: usage.ts @@ -14,8 +13,7 @@ export let y = { b: 0 }; export class Bar2 { - constructor(input){ - } + constructor(input){} } export let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js index bb4750b9cc4..4440b407a8e 100644 --- a/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js @@ -1,7 +1,6 @@ module.exports = Point; class Bar { - constructor(input){ - } + constructor(input){} } export { Bar }; export const x = { @@ -13,8 +12,7 @@ export let y = { b: 0 }; export class Bar2 { - constructor(input){ - } + constructor(input){} } export let shim = { Bar: Bar2 diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js index 5d48c182d01..9c6725e1a01 100644 --- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js @@ -10,8 +10,7 @@ export var C; (function(C) { C[C["One"] = 0] = "One"; C[C["Two"] = 1] = "Two"; -})(C || (C = { -})); +})(C || (C = {})); let a; let b; console.log(a, b); @@ -34,8 +33,7 @@ class H { module.exports = H; // @Filename: /i.ts const H = require('./h'); // Error -let h = { -}; +let h = {}; console.log(h); // @Filename: /j.ts const H = require('./h'); // noUnusedLocals error only @@ -44,8 +42,7 @@ K; (function(K) { K[K["One"] = 0] = "One"; K[K["Two"] = 1] = "Two"; -})(K || (K = { -})); +})(K || (K = {})); module.exports = K; // @Filename: /l.ts const K = require('./k'); diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js index 9396e5a4bd3..e6ecd4fb22b 100644 --- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js @@ -4,8 +4,7 @@ class _class { export { _class as default }; export class A { } -(C = C || (C = { -}))[C.One = 0] = "One", C[C.Two = 1] = "Two"; +(C = C || (C = {}))[C.One = 0] = "One", C[C.Two = 1] = "Two"; let a, b; console.log(a, b); let a, b; @@ -21,10 +20,8 @@ class H { } module.exports = H; const H = require("./h"); -console.log({ -}); +console.log({}); const H = require("./h"); -(K = K || (K = { -}))[K.One = 0] = "One", K[K.Two = 1] = "Two", module.exports = K; +(K = K || (K = {}))[K.One = 0] = "One", K[K.Two = 1] = "Two", module.exports = K; const K = require("./k"); K.One; diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js index 2eb6516ba9c..a2a04a569c7 100644 --- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js @@ -19,8 +19,7 @@ export var C; (function(C) { C[C["One"] = 0] = "One"; C[C["Two"] = 1] = "Two"; -})(C || (C = { -})); +})(C || (C = {})); var a; var b; console.log(a, b); @@ -44,8 +43,7 @@ var H = function H() { module.exports = H; // @Filename: /i.ts var H = require('./h'); // Error -var h = { -}; +var h = {}; console.log(h); // @Filename: /j.ts var H = require('./h'); // noUnusedLocals error only @@ -54,8 +52,7 @@ K; (function(K) { K[K["One"] = 0] = "One"; K[K["Two"] = 1] = "Two"; -})(K || (K = { -})); +})(K || (K = {})); module.exports = K; // @Filename: /l.ts var K = require('./k'); diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js index 10f65329d5d..7668727edcc 100644 --- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js @@ -10,8 +10,7 @@ export var A = function() { "use strict"; _classCallCheck(this, A); }; -(C = C || (C = { -}))[C.One = 0] = "One", C[C.Two = 1] = "Two", console.log(a, b), console.log(a, b); +(C = C || (C = {}))[C.One = 0] = "One", C[C.Two = 1] = "Two", console.log(a, b), console.log(a, b); var a = A; console.log(a, b), C.One; var c = C.Two, d = C.Two; @@ -22,10 +21,8 @@ var H = function() { }; module.exports = H; var C, H = require("./h"); -console.log({ -}); +console.log({}); var K, H = require("./h"); -(K = K || (K = { -}))[K.One = 0] = "One", K[K.Two = 1] = "Two", module.exports = K; +(K = K || (K = {}))[K.One = 0] = "One", K[K.Two = 1] = "Two", module.exports = K; var K = require("./k"); K.One; diff --git a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.1.normal.js index 28cc602b24b..6e84c21f89d 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.1.normal.js @@ -3,8 +3,7 @@ class Foo { var E; (function(E) { E[E["a"] = 0] = "a"; -})(E || (E = { -})); +})(E || (E = {})); var x; // invalid left operands // the left operand is required to be of type Any, the String primitive type, or the Number primitive type @@ -22,8 +21,7 @@ var ra5 = null in x; var ra6 = undefined in x; var ra7 = E.a in x; var ra8 = false in x; -var ra9 = { -} in x; +var ra9 = {} in x; var ra10 = a5 in x; var ra11 = a6 in x; // invalid right operands @@ -44,5 +42,4 @@ var rb8 = x in ''; var rb9 = x in null; var rb10 = x in undefined; // both operands are invalid -var rc1 = { -} in ''; +var rc1 = {} in ''; diff --git a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.2.minified.js index a4ac76a48ee..8eb36bb5d1a 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E, x, a1; -(E = E || (E = { -}))[E.a = 0] = "a", a1 in x, (void 0) in x, E.a in x; +(E = E || (E = {}))[E.a = 0] = "a", a1 in x, (void 0) in x, E.a in x; diff --git a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.1.normal.js index 3bea7d3764a..3684fd057b0 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.1.normal.js @@ -10,8 +10,7 @@ var Foo = function Foo() { var E; (function(E) { E[E["a"] = 0] = "a"; -})(E || (E = { -})); +})(E || (E = {})); var x; // invalid left operands // the left operand is required to be of type Any, the String primitive type, or the Number primitive type @@ -29,8 +28,7 @@ var ra5 = null in x; var ra6 = undefined in x; var ra7 = E.a in x; var ra8 = false in x; -var ra9 = { -} in x; +var ra9 = {} in x; var ra10 = a5 in x; var ra11 = a6 in x; // invalid right operands @@ -51,5 +49,4 @@ var rb8 = x in ''; var rb9 = x in null; var rb10 = x in undefined; // both operands are invalid -var rc1 = { -} in ''; +var rc1 = {} in ''; diff --git a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.2.minified.js index 83c89c26886..8e5c4290a56 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands_es5.2.minified.js @@ -4,5 +4,4 @@ var E, x, a1, E, Foo = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, Foo); }; -(E = E || (E = { -}))[E.a = 0] = "a", a1 in x, E.a in x; +(E = E || (E = {}))[E.a = 0] = "a", a1 in x, E.a in x; diff --git a/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es2015.1.normal.js index 4ac160be17c..7f133b64308 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es2015.1.normal.js @@ -16,8 +16,7 @@ var ra7 = a4 in x; // the right operand is required to be of type Any, an object type, or a type parameter type var b1; var rb1 = x in b1; -var rb2 = x in { -}; +var rb2 = x in {}; function foo(t) { var rb3 = x in t; } diff --git a/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es5.1.normal.js index 4ac160be17c..7f133b64308 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inOperatorWithValidOperands_es5.1.normal.js @@ -16,8 +16,7 @@ var ra7 = a4 in x; // the right operand is required to be of type Any, an object type, or a type parameter type var b1; var rb1 = x in b1; -var rb2 = x in { -}; +var rb2 = x in {}; function foo(t) { var rb3 = x in t; } diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.1.normal.js index 1cb10025e7e..c7046fec294 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.1.normal.js @@ -15,8 +15,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsNumber1 = ++ANY; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.2.minified.js index 88c81ac7e6c..e027f6dc85e 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es2015.2.minified.js @@ -8,8 +8,7 @@ var ANY, ANY1, M, ANY2 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new class { }(); ++ANY, ++ANY1, ANY1++, ANY1++, ++ANY2[0], ++obj.x, ++obj.y, ++objA.a, ++M.n, ANY2[0]++, obj.x++, obj.y++, objA.a++, M.n++, ++ANY, ++ANY1, ++ANY2[0], ++ANY, ++ANY1, ++objA.a, ++M.n, ANY++, ANY1++, ANY2[0]++, ANY++, ANY1++, objA.a++, M.n++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.1.normal.js index b604688b02d..e5aafbee488 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.1.normal.js @@ -22,8 +22,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsNumber1 = ++ANY; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.2.minified.js index 977feec35bd..99af6f023c8 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherType_es5.2.minified.js @@ -13,7 +13,6 @@ var ANY, ANY1, M, ANY2 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ++ANY, ++ANY1, ANY1++, ANY1++, ++ANY2[0], ++obj.x, ++obj.y, ++objA.a, ++M.n, ANY2[0]++, obj.x++, obj.y++, objA.a++, M.n++, ++ANY, ++ANY1, ++ANY2[0], ++ANY, ++ANY1, ++objA.a, ++M.n, ANY++, ANY1++, ANY2[0]++, ANY++, ANY1++, objA.a++, M.n++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js index 31b35341f90..a1e3936adf6 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js @@ -1,15 +1,12 @@ var // ++ operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = ++ENUM; var ResultIsNumber2 = ++ENUM1; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js index 11fe3a8a9b9..a2f1bdd3422 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM, ++ENUM1, ENUM++, ENUM1++, ++ENUM[1] + ENUM[2], ENUM[1] + ENUM[2]++, ++ENUM, ++ENUM1, ENUM++, ENUM1++; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM, ++ENUM1, ENUM++, ENUM1++, ++ENUM[1] + ENUM[2], ENUM[1] + ENUM[2]++, ++ENUM, ++ENUM1, ENUM++, ENUM1++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js index 31b35341f90..a1e3936adf6 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js @@ -1,15 +1,12 @@ var // ++ operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = ++ENUM; var ResultIsNumber2 = ++ENUM1; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js index 11fe3a8a9b9..a2f1bdd3422 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM, ++ENUM1, ENUM++, ENUM1++, ++ENUM[1] + ENUM[2], ENUM[1] + ENUM[2]++, ++ENUM, ++ENUM1, ENUM++, ENUM1++; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM, ++ENUM1, ENUM++, ENUM1++, ++ENUM[1] + ENUM[2], ENUM[1] + ENUM[2]++, ++ENUM, ++ENUM1, ENUM++, ENUM1++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.1.normal.js index 07292be8f32..ec97cbadf29 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.1.normal.js @@ -4,8 +4,7 @@ ENUM1; ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // expression var ResultIsNumber1 = ++ENUM1["B"]; var ResultIsNumber2 = ENUM1.B++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.2.minified.js index 78b45bb31fb..8cf5ddb6646 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM1.B, ENUM1.B++, ++ENUM1.B, ENUM1.B++; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM1.B, ENUM1.B++, ++ENUM1.B, ENUM1.B++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.1.normal.js index 07292be8f32..ec97cbadf29 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.1.normal.js @@ -4,8 +4,7 @@ ENUM1; ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // expression var ResultIsNumber1 = ++ENUM1["B"]; var ResultIsNumber2 = ENUM1.B++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.2.minified.js index 78b45bb31fb..8cf5ddb6646 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM1.B, ENUM1.B++, ++ENUM1.B, ENUM1.B++; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ++ENUM1.B, ENUM1.B++, ++ENUM1.B, ENUM1.B++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.1.normal.js index 6be42ea012e..44efef8cd0e 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.1.normal.js @@ -10,8 +10,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = ++NUMBER; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.2.minified.js index fc91a5e903d..8a3b5db3d48 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es2015.2.minified.js @@ -5,8 +5,7 @@ var NUMBER, M, NUMBER1 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new class { }(); ++NUMBER, NUMBER++, ++objA.a, ++M.n, objA.a++, M.n++, NUMBER1[0]++, ++NUMBER, ++NUMBER1[0], ++objA.a, ++M.n, ++objA.a, M.n, NUMBER++, NUMBER1[0]++, objA.a++, M.n++, objA.a++, M.n++; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.1.normal.js index 85eece06e5f..a2593cb436d 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = ++NUMBER; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.2.minified.js index 9eb3a1de635..de910b74517 100644 --- a/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberType_es5.2.minified.js @@ -10,7 +10,6 @@ var NUMBER, M, NUMBER1 = [ !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ++NUMBER, NUMBER++, ++objA.a, ++M.n, objA.a++, M.n++, NUMBER1[0]++, ++NUMBER, ++NUMBER1[0], ++objA.a, ++M.n, ++objA.a, M.n, NUMBER++, NUMBER1[0]++, objA.a++, M.n++, objA.a++, M.n++; diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.1.normal.js index 06b718db7fb..b2f2078796d 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.2.minified.js index 7d5c2f56f0f..fe030a35134 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3_es5.2.minified.js @@ -38,8 +38,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.1.normal.js index feb2e2241df..f4b7013e66d 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.2.minified.js index 28c5437dff2..46ea74e3b5d 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4_es5.2.minified.js @@ -51,8 +51,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.1.normal.js index d25904549f7..31dca6bde5a 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.2.minified.js index 7acb28a01a5..a4467242031 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5_es5.2.minified.js @@ -51,8 +51,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.1.normal.js index d2d1895cfbd..1292fa899c7 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.1.normal.js @@ -1,8 +1,7 @@ // no inference in TS files, even for `this` aliases: var app = function() { var _this = this; - _this.swap = function() { - }; + _this.swap = function() {}; }; var a = new app(); a; diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.2.minified.js index 589231691bd..56003fbc73c 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es2015.2.minified.js @@ -1,5 +1,4 @@ new function() { var _this = this; - _this.swap = function() { - }; + _this.swap = function() {}; }(); diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.1.normal.js index 4e87f2cd15e..b74530fee59 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.1.normal.js @@ -1,8 +1,7 @@ // no inference in TS files, even for `this` aliases: var app = function app() { var _this = this; - _this.swap = function() { - }; + _this.swap = function() {}; }; var a = new app(); a; diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.2.minified.js index 589231691bd..56003fbc73c 100644 --- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments8_es5.2.minified.js @@ -1,5 +1,4 @@ new function() { var _this = this; - _this.swap = function() { - }; + _this.swap = function() {}; }(); diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.1.normal.js index c6fd29edf49..6b7da5ac646 100644 --- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.1.normal.js @@ -6,27 +6,23 @@ import * as a from "./a"; export class C1 { } C1.staticProp = 0; -export function F1() { -} +export function F1() {} F1.staticProp = 0; export var C2 = class { }; C2.staticProp = 0; -export let F2 = function() { -}; +export let F2 = function() {}; F2.staticProp = 0; //@filename: global.js class C3 { } C3.staticProp = 0; -function F3() { -} +function F3() {} F3.staticProp = 0; var C4 = class { }; C4.staticProp = 0; -let F4 = function() { -}; +let F4 = function() {}; F4.staticProp = 0; var n; var n = a.C1.staticProp; diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js index b183e097853..f1bb49f14f9 100644 --- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js @@ -2,20 +2,16 @@ import * as a from "./a"; export class C1 { } C1.staticProp = 0; -export function F1() { -} +export function F1() {} F1.staticProp = 0; export var n, C2 = class { }; C2.staticProp = 0; -export let F2 = function() { -}; +export let F2 = function() {}; F2.staticProp = 0, (class { -}).staticProp = 0, (function() { -}).staticProp = 0; +}).staticProp = 0, (function() {}).staticProp = 0; var C4 = class { }; C4.staticProp = 0; -let F4 = function() { -}; +let F4 = function() {}; F4.staticProp = 0, a.C1.staticProp, a.C2.staticProp, a.F1.staticProp, a.F2.staticProp, C4.staticProp, F4.staticProp; diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js index 2da8dc7cb12..6e27fb3c23a 100644 --- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js @@ -13,32 +13,28 @@ export var C1 = function C1() { _classCallCheck(this, C1); }; C1.staticProp = 0; -export function F1() { -} +export function F1() {} F1.staticProp = 0; export var C2 = function _class() { "use strict"; _classCallCheck(this, _class); }; C2.staticProp = 0; -export var F2 = function F2() { -}; +export var F2 = function F2() {}; F2.staticProp = 0; var C3 = function C3() { "use strict"; _classCallCheck(this, C3); }; C3.staticProp = 0; -function F3() { -} +function F3() {} F3.staticProp = 0; var C4 = function _class() { "use strict"; _classCallCheck(this, _class); }; C4.staticProp = 0; -var F4 = function F4() { -}; +var F4 = function F4() {}; F4.staticProp = 0; var n; var n = a.C1.staticProp; diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js index c7f293d8ab2..296de25d846 100644 --- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js @@ -7,28 +7,24 @@ export var n, C1 = function() { _classCallCheck(this, C1); }; C1.staticProp = 0; -export function F1() { -} +export function F1() {} F1.staticProp = 0; export var C2 = function _class() { "use strict"; _classCallCheck(this, _class); }; C2.staticProp = 0; -export var F2 = function() { -}; +export var F2 = function() {}; F2.staticProp = 0; var C3 = function() { "use strict"; _classCallCheck(this, C3); }; -C3.staticProp = 0, (function() { -}).staticProp = 0; +C3.staticProp = 0, (function() {}).staticProp = 0; var C4 = function _class() { "use strict"; _classCallCheck(this, _class); }; C4.staticProp = 0; -var F4 = function() { -}; +var F4 = function() {}; F4.staticProp = 0, a.C1.staticProp, a.C2.staticProp, a.F1.staticProp, a.F2.staticProp, C3.staticProp, C4.staticProp, F4.staticProp; diff --git a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.1.normal.js b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.1.normal.js index c4737b36d00..48a0e1f1578 100644 --- a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.1.normal.js @@ -1,11 +1,9 @@ class C { foo() { - C.prototype.foo = ()=>{ - }; + C.prototype.foo = ()=>{}; } bar(x1) { - C.prototype.bar = ()=>{ - } // error + C.prototype.bar = ()=>{} // error ; C.prototype.bar = (x)=>x ; // ok diff --git a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.2.minified.js b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.2.minified.js index cb0cf22e3f3..6d3447fb00a 100644 --- a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es2015.2.minified.js @@ -1,11 +1,9 @@ class C { foo() { - C.prototype.foo = ()=>{ - }; + C.prototype.foo = ()=>{}; } bar(x1) { - return C.prototype.bar = ()=>{ - }, C.prototype.bar = (x)=>x + return C.prototype.bar = ()=>{}, C.prototype.bar = (x)=>x , C.prototype.bar = (x)=>1 , 1; } diff --git a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.1.normal.js b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.1.normal.js index ba45922ae9e..8751e8fa963 100644 --- a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.1.normal.js @@ -26,15 +26,13 @@ var C = /*#__PURE__*/ function() { { key: "foo", value: function foo() { - C.prototype.foo = function() { - }; + C.prototype.foo = function() {}; } }, { key: "bar", value: function bar(x1) { - C.prototype.bar = function() { - } // error + C.prototype.bar = function() {} // error ; C.prototype.bar = function(x) { return x; diff --git a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.2.minified.js b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.2.minified.js index c0e8565e50a..58b8ca183fa 100644 --- a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype_es5.2.minified.js @@ -16,15 +16,13 @@ var C = function() { { key: "foo", value: function() { - C.prototype.foo = function() { - }; + C.prototype.foo = function() {}; } }, { key: "bar", value: function(x1) { - return C.prototype.bar = function() { - }, C.prototype.bar = function(x) { + return C.prototype.bar = function() {}, C.prototype.bar = function(x) { return x; }, C.prototype.bar = function(x) { return 1; diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.1.normal.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.1.normal.js index 0d6c56b6154..0aba7630d89 100644 --- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.1.normal.js @@ -4,8 +4,7 @@ var NonGeneric; get y() { return 1; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -22,16 +21,14 @@ var NonGeneric; var r3 = r.y; r.y = 4; var r6 = d.y(); // error -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { class C { get y() { return null; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -48,5 +45,4 @@ var Generic; var r3 = r.y; r.y = ''; var r6 = d.y(); // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.2.minified.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.2.minified.js index 6559d1a7a50..cc29c60b8cf 100644 --- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es2015.2.minified.js @@ -4,8 +4,7 @@ var NonGeneric, Generic; get y() { return 1; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -16,14 +15,12 @@ var NonGeneric, Generic; var d = new class extends C { }(1, 2), r = d.fn(); r.x, r.y, r.y = 4, d.y(); -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { class C { get y() { return null; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -34,5 +31,4 @@ var NonGeneric, Generic; var d = new class extends C { }(1, ""), r = d.fn(); r.x, r.y, r.y = "", d.y(); -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.1.normal.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.1.normal.js index 0fc67af3325..9ab3aa2e02a 100644 --- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -98,8 +97,7 @@ var NonGeneric; get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} }, { key: "fn", @@ -126,8 +124,7 @@ var NonGeneric; var r3 = r.y; r.y = 4; var r6 = d.y(); // error -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { var C = /*#__PURE__*/ function() { @@ -143,8 +140,7 @@ var Generic; get: function get() { return null; }, - set: function set(v) { - } + set: function set(v) {} }, { key: "fn", @@ -171,5 +167,4 @@ var Generic; var r3 = r.y; r.y = ''; var r6 = d.y(); // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.2.minified.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.2.minified.js index af758a30fa9..436d730a8f2 100644 --- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType_es5.2.minified.js @@ -37,8 +37,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -67,8 +66,7 @@ function _createSuper(Derived) { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} }, { key: "fn", @@ -87,8 +85,7 @@ function _createSuper(Derived) { return D; }(C), d = new D(1, 2), r = d.fn(); r.x, r.y, r.y = 4, d.y(); -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { var C = function() { "use strict"; function C(a, b) { @@ -100,8 +97,7 @@ function _createSuper(Derived) { get: function() { return null; }, - set: function(v) { - } + set: function(v) {} }, { key: "fn", @@ -120,5 +116,4 @@ function _createSuper(Derived) { return D; }(C), d = new D(1, ""), r = d.fn(); r.x, r.y, r.y = "", d.y(); -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.1.normal.js b/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.1.normal.js index 9a774d45005..095b37f8b49 100644 --- a/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.1.normal.js @@ -4,8 +4,7 @@ var NonGeneric; get y() { return 1; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -20,16 +19,14 @@ var NonGeneric; var r3 = r.y; r.y = 4; var r6 = c.y(); // error -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { class C { get y() { return null; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -44,5 +41,4 @@ var Generic; var r3 = r.y; r.y = ''; var r6 = c.y(); // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.2.minified.js b/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.2.minified.js index cb7e56e0152..c37235172ff 100644 --- a/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/instancePropertyInClassType_es2015.2.minified.js @@ -4,8 +4,7 @@ var NonGeneric, Generic; get y() { return 1; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -14,14 +13,12 @@ var NonGeneric, Generic; } }(1, 2), r = c.fn(); r.x, r.y, r.y = 4, c.y(); -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { var c = new class { get y() { return null; } - set y(v) { - } + set y(v) {} fn() { return this; } @@ -30,5 +27,4 @@ var NonGeneric, Generic; } }(1, ""), r = c.fn(); r.x, r.y, r.y = "", c.y(); -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.1.normal.js b/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.1.normal.js index d8e4375d742..7629eff2332 100644 --- a/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.1.normal.js @@ -32,8 +32,7 @@ var NonGeneric; get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} }, { key: "fn", @@ -50,8 +49,7 @@ var NonGeneric; var r3 = r.y; r.y = 4; var r6 = c.y(); // error -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { var C = /*#__PURE__*/ function() { @@ -67,8 +65,7 @@ var Generic; get: function get() { return null; }, - set: function set(v) { - } + set: function set(v) {} }, { key: "fn", @@ -85,5 +82,4 @@ var Generic; var r3 = r.y; r.y = ''; var r6 = c.y(); // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.2.minified.js b/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.2.minified.js index f07833b2769..199455178a0 100644 --- a/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/instancePropertyInClassType_es5.2.minified.js @@ -23,8 +23,7 @@ function _createClass(Constructor, protoProps, staticProps) { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} }, { key: "fn", @@ -35,8 +34,7 @@ function _createClass(Constructor, protoProps, staticProps) { ]), C; }(), c = new C(1, 2), r = c.fn(); r.x, r.y, r.y = 4, c.y(); -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { var C = function() { "use strict"; function C(a, b) { @@ -48,8 +46,7 @@ function _createClass(Constructor, protoProps, staticProps) { get: function() { return null; }, - set: function(v) { - } + set: function(v) {} }, { key: "fn", @@ -60,5 +57,4 @@ function _createClass(Constructor, protoProps, staticProps) { ]), C; }(), c = new C(1, ""), r = c.fn(); r.x, r.y, r.y = "", c.y(); -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es2015.1.normal.js index 08e85835ec6..fb90a110af1 100644 --- a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es2015.1.normal.js @@ -1,6 +1,5 @@ class C { - foo() { - } + foo() {} } var x; // invalid left operand @@ -38,5 +37,4 @@ var rb8 = x instanceof o1; var rb9 = x instanceof o2; var rb10 = x instanceof o3; // both operands are invalid -var rc1 = '' instanceof { -}; +var rc1 = '' instanceof {}; diff --git a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.1.normal.js index 7a08d57dc8e..12d4faa0b38 100644 --- a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.1.normal.js @@ -32,8 +32,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; @@ -74,5 +73,4 @@ 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_es5.2.minified.js b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.2.minified.js index 51c72e964bb..38adcc1d6f9 100644 --- a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands_es5.2.minified.js @@ -18,10 +18,8 @@ var x, a1, a2, a3, a4, b1, b2, b3, b4, o1, o2, o3, C = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); -_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/instantiateNonGenericTypeWithTypeArguments_es2015.1.normal.js b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.1.normal.js index 76cab07dc91..2eac6c36b31 100644 --- a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.1.normal.js @@ -3,8 +3,7 @@ class C { } var c = new C(); -function Foo() { -} +function Foo() {} var r = new Foo(); var f; var r2 = new f(); diff --git a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.2.minified.js b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.2.minified.js index c6ea0682c9e..635790223fb 100644 --- a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es2015.2.minified.js @@ -1,4 +1,3 @@ var f, a; new class { -}(), new function() { -}(), new f(), new a(); +}(), new function() {}(), new f(), new a(); diff --git a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.1.normal.js b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.1.normal.js index eb9607cdda2..f9ad54da936 100644 --- a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.1.normal.js @@ -8,8 +8,7 @@ var C = function C() { _classCallCheck(this, C); }; var c = new C(); -function Foo() { -} +function Foo() {} var r = new Foo(); var f; var r2 = new f(); diff --git a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.2.minified.js b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.2.minified.js index f6a7fc58697..5af5f29c2c1 100644 --- a/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/instantiateNonGenericTypeWithTypeArguments_es5.2.minified.js @@ -4,5 +4,4 @@ var f, a, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -new C(), new function() { -}(), new f(), new a(); +new C(), new function() {}(), new f(), new a(); diff --git a/crates/swc/tests/tsc-references/instantiatedModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/instantiatedModule_es2015.1.normal.js index 5133e29268c..89518301e46 100644 --- a/crates/swc/tests/tsc-references/instantiatedModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/instantiatedModule_es2015.1.normal.js @@ -2,8 +2,7 @@ var M; (function(M1) { var Point = M1.Point = 1; -})(M || (M = { -})); +})(M || (M = {})); // primary expression var m; var m = M; @@ -25,8 +24,7 @@ var M2; } } M21.Point = Point; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); var m2; var m2 = M2; // static side of the class @@ -44,10 +42,8 @@ var M3; (function(Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Red"] = 1] = "Red"; - })(Color = M31.Color || (M31.Color = { - })); -})(M3 || (M3 = { -})); + })(Color = M31.Color || (M31.Color = {})); +})(M3 || (M3 = {})); var m3; var m3 = M3; var a3; diff --git a/crates/swc/tests/tsc-references/instantiatedModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/instantiatedModule_es2015.2.minified.js index 62167fd19a7..4266218588f 100644 --- a/crates/swc/tests/tsc-references/instantiatedModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/instantiatedModule_es2015.2.minified.js @@ -1,8 +1,6 @@ -(M || (M = { -})).Point = 1; +(M || (M = {})).Point = 1; var M, m, M2, m2, a2, M3, m3, a3, m = M; -m.Point, (M2 || (M2 = { -})).Point = class { +m.Point, (M2 || (M2 = {})).Point = class { static Origin() { return { x: 0, @@ -14,9 +12,7 @@ var m2 = M2, a2 = m2.Point, a2 = M2.Point; a2.Origin(), new m2.Point(), new M2.Point(), (function(M31) { var Color; let Color; - (Color = Color = M31.Color || (M31.Color = { - }))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; -})(M3 || (M3 = { -})); + (Color = Color = M31.Color || (M31.Color = {}))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; +})(M3 || (M3 = {})); var m3 = M3, a3 = m3.Color, a3 = M3.Color; a3.Blue, M3.Color.Red, m3.Color.Blue; diff --git a/crates/swc/tests/tsc-references/instantiatedModule_es5.1.normal.js b/crates/swc/tests/tsc-references/instantiatedModule_es5.1.normal.js index 0d972ed8221..822067ef283 100644 --- a/crates/swc/tests/tsc-references/instantiatedModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/instantiatedModule_es5.1.normal.js @@ -21,8 +21,7 @@ function _createClass(Constructor, protoProps, staticProps) { var M; (function(M1) { var Point = M1.Point = 1; -})(M || (M = { -})); +})(M || (M = {})); // primary expression var m; var m = M; @@ -54,8 +53,7 @@ var M2; return Point; }(); M21.Point = Point; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); var m2; var m2 = M2; // static side of the class @@ -73,10 +71,8 @@ var M3; (function(Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Red"] = 1] = "Red"; - })(Color = M31.Color || (M31.Color = { - })); -})(M3 || (M3 = { -})); + })(Color = M31.Color || (M31.Color = {})); +})(M3 || (M3 = {})); var m3; var m3 = M3; var a3; diff --git a/crates/swc/tests/tsc-references/instantiatedModule_es5.2.minified.js b/crates/swc/tests/tsc-references/instantiatedModule_es5.2.minified.js index 2a940670864..934530cd13a 100644 --- a/crates/swc/tests/tsc-references/instantiatedModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/instantiatedModule_es5.2.minified.js @@ -1,5 +1,4 @@ -(M || (M = { -})).Point = 1; +(M || (M = {})).Point = 1; var M, m, M2, m2, a2, M3, m3, a3, m = M; m.Point, (function(M21) { var Point = function() { @@ -28,14 +27,11 @@ m.Point, (function(M21) { ]), Point; }(); M21.Point = Point; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); var m2 = M2, a2 = m2.Point, a2 = M2.Point; a2.Origin(), new m2.Point(), new M2.Point(), (function(M31) { var Color, Color; - (Color = Color = M31.Color || (M31.Color = { - }))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; -})(M3 || (M3 = { -})); + (Color = Color = M31.Color || (M31.Color = {}))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; +})(M3 || (M3 = {})); var m3 = M3, a3 = m3.Color, a3 = M3.Color; a3.Blue, M3.Color.Red, m3.Color.Blue; diff --git a/crates/swc/tests/tsc-references/interfaceExtendingClass_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendingClass_es2015.1.normal.js index 84cf21e968e..36eb9d20c9f 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendingClass_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceExtendingClass_es2015.1.normal.js @@ -1,6 +1,5 @@ class Foo { - y() { - } + y() {} get Z() { return 1; } diff --git a/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.1.normal.js index 7f726889773..61c9578d1ca 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.1.normal.js @@ -25,8 +25,7 @@ var Foo = /*#__PURE__*/ function() { _createClass(Foo, [ { key: "y", - value: function y() { - } + value: function y() {} }, { key: "Z", diff --git a/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.2.minified.js index bd7a371dd62..cf9946aaa78 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceExtendingClass_es5.2.minified.js @@ -15,8 +15,7 @@ var i, Foo = function() { return protoProps = [ { key: "y", - value: function() { - } + value: function() {} }, { key: "Z", diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.1.normal.js index b5288c9a607..7a92c364eaf 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.1.normal.js @@ -13,5 +13,4 @@ var EX; EX[EX["A"] = 0] = "A"; EX[EX["B"] = 1] = "B"; EX[EX["C"] = 2] = "C"; -})(EX || (EX = { -})); +})(EX || (EX = {})); diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.2.minified.js index 166de463ac1..b791125e3d9 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es2015.2.minified.js @@ -9,5 +9,4 @@ class C4 extends Constructor() { } class C5 extends Constructor() { } -(EX = EX || (EX = { -}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; +(EX = EX || (EX = {}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.1.normal.js index abd9100769d..a5d81b7d521 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -124,5 +123,4 @@ var EX; EX[EX["A"] = 0] = "A"; EX[EX["B"] = 1] = "B"; EX[EX["C"] = 2] = "C"; -})(EX || (EX = { -})); +})(EX || (EX = {})); diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.2.minified.js index 7e6c497b771..fcfe51b841a 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -86,5 +85,4 @@ var EX, EX, C1 = function(_super) { } return C5; }(Constructor()); -(EX = EX || (EX = { -}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; +(EX = EX || (EX = {}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.1.normal.js index 7d3b45cbf06..b62ccf60c76 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.1.normal.js @@ -17,8 +17,7 @@ var EX; EX[EX["A"] = 0] = "A"; EX[EX["B"] = 1] = "B"; EX[EX["C"] = 2] = "C"; -})(EX || (EX = { -})); +})(EX || (EX = {})); class C20 extends Constructor() { } class C21 extends Constructor() { diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.2.minified.js index 31f4966c71b..bf6b60dc996 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es2015.2.minified.js @@ -13,8 +13,7 @@ class C6 extends Constructor() { } class C7 extends Constructor() { } -(EX = EX || (EX = { -}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; +(EX = EX || (EX = {}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; class C20 extends Constructor() { } class C21 extends Constructor() { diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.1.normal.js index c79c815eba5..04bd5033f32 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -144,8 +143,7 @@ var EX; EX[EX["A"] = 0] = "A"; EX[EX["B"] = 1] = "B"; EX[EX["C"] = 2] = "C"; -})(EX || (EX = { -})); +})(EX || (EX = {})); var C20 = /*#__PURE__*/ function(_super) { "use strict"; _inherits(C20, _super); diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.2.minified.js index 53075c11889..15a509bb21b 100644 --- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -102,8 +101,7 @@ var EX, EX, C1 = function(_super) { } return C7; }(Constructor()); -(EX = EX || (EX = { -}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; +(EX = EX || (EX = {}))[EX.A = 0] = "A", EX[EX.B = 1] = "B", EX[EX.C = 2] = "C"; var C20 = function(_super) { "use strict"; _inherits(C20, _super); diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.1.normal.js index 855586a475a..e6a018a0983 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.1.normal.js @@ -1,29 +1,24 @@ class C { } -function f1() { -} +function f1() {} var M; (function(M1) { var y = M1.y = 1; -})(M || (M = { -})); +})(M || (M = {})); var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var a = { a: 1, b: '', c: true, - d: { - }, + d: {}, e: null, f: [ 1 ], - g: { - }, + g: {}, h: (x)=>1 , i: (x)=>x @@ -32,7 +27,6 @@ var a = { k: new C(), l: f1, m: M, - n: { - }, + n: {}, o: E.A }; diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.2.minified.js index 81fb85e7029..8486c5f78ab 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es2015.2.minified.js @@ -1,5 +1,3 @@ var E, M, E; -(M || (M = { -})).y = 1, (E = E || (E = { -}))[E.A = 0] = "A", new class { +(M || (M = {})).y = 1, (E = E || (E = {}))[E.A = 0] = "A", new class { }(), E.A; diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.1.normal.js index 9cf1282a484..4f86b90a45c 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.1.normal.js @@ -7,30 +7,25 @@ var C = function C() { "use strict"; _classCallCheck(this, C); }; -function f1() { -} +function f1() {} var M; (function(M1) { var y = M1.y = 1; -})(M || (M = { -})); +})(M || (M = {})); var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var a = { a: 1, b: '', c: true, - d: { - }, + d: {}, e: null, f: [ 1 ], - g: { - }, + g: {}, h: function(x) { return 1; }, @@ -41,7 +36,6 @@ var a = { k: new C(), l: f1, m: M, - n: { - }, + n: {}, o: E.A }; diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.2.minified.js index caf96ad584e..c26c9767b91 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType_es5.2.minified.js @@ -4,6 +4,4 @@ var E, M, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(M || (M = { -})).y = 1, (E = E || (E = { -}))[E.A = 0] = "A", new C(), E.A; +(M || (M = {})).y = 1, (E = E || (E = {}))[E.A = 0] = "A", new C(), E.A; diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es2015.1.normal.js index bb74772aa90..1a917400fb1 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es2015.1.normal.js @@ -1,8 +1,6 @@ class Base { - x() { - } + x() {} } class Base2 { - x() { - } + x() {} } diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.1.normal.js index 50532ab4e9d..d2a2e68f781 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.1.normal.js @@ -25,8 +25,7 @@ var Base = /*#__PURE__*/ function() { _createClass(Base, [ { key: "x", - value: function x() { - } + value: function x() {} } ]); return Base; @@ -39,8 +38,7 @@ var Base2 = /*#__PURE__*/ function() { _createClass(Base2, [ { key: "x", - value: function x() { - } + value: function x() {} } ]); return Base2; diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.2.minified.js b/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.2.minified.js index 291f6016777..a1c157b2276 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyThatIsPrivateInBaseType2_es5.2.minified.js @@ -18,8 +18,7 @@ var Base = function() { return _createClass(Base, [ { key: "x", - value: function() { - } + value: function() {} } ]), Base; }(), Base2 = function() { @@ -30,8 +29,7 @@ var Base = function() { return _createClass(Base2, [ { key: "x", - value: function() { - } + value: function() {} } ]), Base2; }(); diff --git a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.1.normal.js index ebdae1a11df..f0b4b622512 100644 --- a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.1.normal.js @@ -7,8 +7,7 @@ E; E[E["D"] = 3] = "D"; E[E["E"] = 4] = "E"; E[E["F"] = 5] = "F"; -})(E || (E = { -})); +})(E || (E = {})); let x0; // 'a' | 'b' | 'c' let x1; // 'b' | 'c' let x2; // 'c' diff --git a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.2.minified.js index fa1613981de..faec2542576 100644 --- a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D", E[E.E = 4] = "E", E[E.F = 5] = "F"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D", E[E.E = 4] = "E", E[E.F = 5] = "F"; diff --git a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.1.normal.js index 342ab87e926..f09b124b32d 100644 --- a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.1.normal.js @@ -7,8 +7,7 @@ E; E[E["D"] = 3] = "D"; E[E["E"] = 4] = "E"; E[E["F"] = 5] = "F"; -})(E || (E = { -})); +})(E || (E = {})); var x0; // 'a' | 'b' | 'c' var x1; // 'b' | 'c' var x2; // 'c' diff --git a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.2.minified.js index fa1613981de..faec2542576 100644 --- a/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionOfUnionOfUnitTypes_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D", E[E.E = 4] = "E", E[E.F = 5] = "F"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D", E[E.E = 4] = "E", E[E.F = 5] = "F"; diff --git a/crates/swc/tests/tsc-references/intersectionReductionStrict_es2015.1.normal.js b/crates/swc/tests/tsc-references/intersectionReductionStrict_es2015.1.normal.js index 7f6f6c2994a..3011bc3ab72 100644 --- a/crates/swc/tests/tsc-references/intersectionReductionStrict_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionReductionStrict_es2015.1.normal.js @@ -12,13 +12,9 @@ const x2 = { x1[k] = 'bar'; // Error x2[k] = 'bar'; // Error var Tag1; -(function(Tag1) { -})(Tag1 || (Tag1 = { -})); +(function(Tag1) {})(Tag1 || (Tag1 = {})); var Tag2; -(function(Tag2) { -})(Tag2 || (Tag2 = { -})); +(function(Tag2) {})(Tag2 || (Tag2 = {})); s1 = s2; s2 = s1; t1 = t2; diff --git a/crates/swc/tests/tsc-references/intersectionReductionStrict_es5.1.normal.js b/crates/swc/tests/tsc-references/intersectionReductionStrict_es5.1.normal.js index 25d728c5b82..34992b96eaa 100644 --- a/crates/swc/tests/tsc-references/intersectionReductionStrict_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionReductionStrict_es5.1.normal.js @@ -12,13 +12,9 @@ var x2 = { x1[k] = 'bar'; // Error x2[k] = 'bar'; // Error var Tag1; -(function(Tag1) { -})(Tag1 || (Tag1 = { -})); +(function(Tag1) {})(Tag1 || (Tag1 = {})); var Tag2; -(function(Tag2) { -})(Tag2 || (Tag2 = { -})); +(function(Tag2) {})(Tag2 || (Tag2 = {})); s1 = s2; s2 = s1; t1 = t2; diff --git a/crates/swc/tests/tsc-references/intersectionReduction_es2015.1.normal.js b/crates/swc/tests/tsc-references/intersectionReduction_es2015.1.normal.js index aa9efe16afb..4005ab9a206 100644 --- a/crates/swc/tests/tsc-references/intersectionReduction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionReduction_es2015.1.normal.js @@ -14,13 +14,9 @@ const x2 = { x1[k] = 'bar'; // Error x2[k] = 'bar'; // Error var Tag1; -(function(Tag1) { -})(Tag1 || (Tag1 = { -})); +(function(Tag1) {})(Tag1 || (Tag1 = {})); var Tag2; -(function(Tag2) { -})(Tag2 || (Tag2 = { -})); +(function(Tag2) {})(Tag2 || (Tag2 = {})); s1 = s2; s2 = s1; t1 = t2; diff --git a/crates/swc/tests/tsc-references/intersectionReduction_es5.1.normal.js b/crates/swc/tests/tsc-references/intersectionReduction_es5.1.normal.js index 0a01eb6c427..fb493696977 100644 --- a/crates/swc/tests/tsc-references/intersectionReduction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionReduction_es5.1.normal.js @@ -14,13 +14,9 @@ var x2 = { x1[k] = 'bar'; // Error x2[k] = 'bar'; // Error var Tag1; -(function(Tag1) { -})(Tag1 || (Tag1 = { -})); +(function(Tag1) {})(Tag1 || (Tag1 = {})); var Tag2; -(function(Tag2) { -})(Tag2 || (Tag2 = { -})); +(function(Tag2) {})(Tag2 || (Tag2 = {})); s1 = s2; s2 = s1; t1 = t2; diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js index b3319f87d6f..3c18ddd848a 100644 --- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js @@ -12,13 +12,10 @@ let x11; let x12; let x13; let x14; -const intersectDictionaries = (d11, d21)=>Object.assign({ - }, d11, d21) +const intersectDictionaries = (d11, d21)=>Object.assign({}, d11, d21) ; -const testDictionary = (_value)=>{ -}; -const d1 = { -}; +const testDictionary = (_value)=>{}; +const d1 = {}; testDictionary(d1); const d2 = intersectDictionaries(d1, d1); testDictionary(d2); diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js index 19a391bede7..51411f91bfa 100644 --- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js @@ -1,8 +1,5 @@ -const intersectDictionaries = (d11, d21)=>Object.assign({ - }, d11, d21) -, testDictionary = (_value)=>{ -}, d1 = { -}; +const intersectDictionaries = (d11, d21)=>Object.assign({}, d11, d21) +, testDictionary = (_value)=>{}, d1 = {}; testDictionary(d1); const d2 = intersectDictionaries(d1, d1); testDictionary(d2); diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js index deb4b4913c8..09fd97af735 100644 --- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js @@ -13,13 +13,10 @@ var x12; var x13; var x14; var intersectDictionaries = function(d11, d21) { - return Object.assign({ - }, d11, d21); -}; -var testDictionary = function(_value) { -}; -var d1 = { + return Object.assign({}, d11, d21); }; +var testDictionary = function(_value) {}; +var d1 = {}; testDictionary(d1); var d2 = intersectDictionaries(d1, d1); testDictionary(d2); diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.2.minified.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.2.minified.js index 928799aabc8..0dccaf7946c 100644 --- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.2.minified.js @@ -1,9 +1,6 @@ var intersectDictionaries = function(d11, d2) { - return Object.assign({ - }, d11, d2); -}, testDictionary = function(_value) { -}, d1 = { -}; + return Object.assign({}, d11, d2); +}, testDictionary = function(_value) {}, d1 = {}; testDictionary(d1), testDictionary(intersectDictionaries(d1, d1)); var d3 = { s: "" diff --git a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.1.normal.js index 0fc43fa51bf..1a5596b00ad 100644 --- a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.1.normal.js @@ -2,8 +2,7 @@ var x; x = 1; x = true; x = ''; -x = { -}; +x = {}; class C { } var c; @@ -14,8 +13,7 @@ x = i; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); x = M; function f(a) { x = a; diff --git a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.2.minified.js index febd4f2fdf2..110e96cdc5a 100644 --- a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es2015.2.minified.js @@ -1,7 +1,5 @@ var x, M; -x = 1, x = !0, x = "", x = { -}, x = class { -}, x = void 0, x = void 0, (M || (M = { -})).x = 1, x = M, x = function(a) { +x = 1, x = !0, x = "", x = {}, x = class { +}, x = void 0, x = void 0, (M || (M = {})).x = 1, x = M, x = function(a) { x = a; }; diff --git a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.1.normal.js index fd7593c3fae..652be10a53c 100644 --- a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.1.normal.js @@ -7,8 +7,7 @@ var x; x = 1; x = true; x = ''; -x = { -}; +x = {}; var C = function C() { "use strict"; _classCallCheck(this, C); @@ -21,8 +20,7 @@ x = i; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); x = M; function f(a) { x = a; diff --git a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.2.minified.js index d5e64cccbc7..38f3083c357 100644 --- a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid_es5.2.minified.js @@ -1,12 +1,10 @@ -x = 1, x = !0, x = "", x = { -}; +x = 1, x = !0, x = "", x = {}; var x, c, i, M, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -x = C, x = c, x = i, (M || (M = { -})).x = 1, x = M, x = function(a) { +x = C, x = c, x = i, (M || (M = {})).x = 1, x = M, x = function(a) { x = a; }; diff --git a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.1.normal.js index 912ca589a39..809ee0b0b3c 100644 --- a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.1.normal.js @@ -6,8 +6,7 @@ var d = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var e = x; class C { } @@ -18,8 +17,7 @@ var h2 = x; // no error var M; (function(M1) { var a = M1.a = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; diff --git a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.2.minified.js index 73cfe1ba672..bfa2c57a3aa 100644 --- a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es2015.2.minified.js @@ -1,4 +1,2 @@ var E, E, M; -(E = E || (E = { -}))[E.A = 0] = "A", (M || (M = { -})).a = 1, M = !0; +(E = E || (E = {}))[E.A = 0] = "A", (M || (M = {})).a = 1, M = !0; diff --git a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.1.normal.js index 12c6687fed6..c9d3671bcdd 100644 --- a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.1.normal.js @@ -11,8 +11,7 @@ var d = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var e = x; var C = function C() { "use strict"; @@ -25,8 +24,7 @@ var h2 = x; // no error var M; (function(M1) { var a = M1.a = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; diff --git a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.2.minified.js index fc9319d34b3..71aad6356aa 100644 --- a/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidBooleanAssignments_es5.2.minified.js @@ -1,11 +1,9 @@ var E, E, M; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; var C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(M || (M = { -})).a = 1, M = !0; +(M || (M = {})).a = 1, M = !0; diff --git a/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.1.normal.js index 308222f46a2..9ce6e48c5a5 100644 --- a/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.1.normal.js @@ -2,21 +2,18 @@ var E; (function(E) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; -})(E || (E = { -})); +})(E || (E = {})); var E2; (function(E2) { E2[E2["A"] = 0] = "A"; E2[E2["B"] = 1] = "B"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var e; var e2; e = E2.A; e2 = E.A; e = null; -e = { -}; +e = {}; e = ''; function f(a) { e = a; diff --git a/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.2.minified.js index eb412bc21f5..15fd0a36329 100644 --- a/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidEnumAssignments_es2015.2.minified.js @@ -1,4 +1,2 @@ var E, E2, E, E2; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", (E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", E2[E2.B = 1] = "B", E2.A, E.A; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", (E2 = E2 || (E2 = {}))[E2.A = 0] = "A", E2[E2.B = 1] = "B", E2.A, E.A; diff --git a/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.1.normal.js index 308222f46a2..9ce6e48c5a5 100644 --- a/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.1.normal.js @@ -2,21 +2,18 @@ var E; (function(E) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; -})(E || (E = { -})); +})(E || (E = {})); var E2; (function(E2) { E2[E2["A"] = 0] = "A"; E2[E2["B"] = 1] = "B"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var e; var e2; e = E2.A; e2 = E.A; e = null; -e = { -}; +e = {}; e = ''; function f(a) { e = a; diff --git a/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.2.minified.js index eb412bc21f5..15fd0a36329 100644 --- a/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidEnumAssignments_es5.2.minified.js @@ -1,4 +1,2 @@ var E, E2, E, E2; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", (E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", E2[E2.B = 1] = "B", E2.A, E.A; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", (E2 = E2 || (E2 = {}))[E2.A = 0] = "A", E2[E2.B = 1] = "B", E2.A, E.A; diff --git a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.1.normal.js index 74aca4469bf..e8099aa25ac 100644 --- a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.1.normal.js @@ -6,6 +6,5 @@ var E; (function(E) { E[E["Red"] = 0] = "Red"; E[E["Blue"] = 1] = "Blue"; -})(E || (E = { -})); +})(E || (E = {})); export { }; diff --git a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.2.minified.js index 07396d54f21..3caf1c73b53 100644 --- a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es2015.2.minified.js @@ -1,4 +1,3 @@ var E, E; -(E = E || (E = { -}))[E.Red = 0] = "Red", E[E.Blue = 1] = "Blue"; +(E = E || (E = {}))[E.Red = 0] = "Red", E[E.Blue = 1] = "Blue"; export { }; diff --git a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.1.normal.js index 4655b26e229..17cf5dbc4a4 100644 --- a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.1.normal.js @@ -13,6 +13,5 @@ var E; (function(E) { E[E["Red"] = 0] = "Red"; E[E["Blue"] = 1] = "Blue"; -})(E || (E = { -})); +})(E || (E = {})); export { }; diff --git a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.2.minified.js index 3e252890ed2..c45a298aa24 100644 --- a/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidImportAliasIdentifiers_es5.2.minified.js @@ -4,6 +4,5 @@ var E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.Red = 0] = "Red", E[E.Blue = 1] = "Blue"; +(E = E || (E = {}))[E.Red = 0] = "Red", E[E.Blue = 1] = "Blue"; export { }; diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js index f02f3a8026a..a122eb5954f 100644 --- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js @@ -4,12 +4,10 @@ var M; } M1.Point = Point; var Point = M1.Point = 1; -})(M || (M = { -})); +})(M || (M = {})); var M2; (function(M21) { var Point = M21.Point = 1; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); var m = M2; var p; // Error diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js index 66e2ae633bc..b717302c519 100644 --- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js @@ -4,6 +4,4 @@ var M, M2; } M1.Point = Point; var Point = M1.Point = 1; -}(M || (M = { -})), (M2 || (M2 = { -})).Point = 1; +}(M || (M = {})), (M2 || (M2 = {})).Point = 1; diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js index b33575d3411..0d51d07d708 100644 --- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js @@ -11,12 +11,10 @@ var M; }; M1.Point = Point; var Point = M1.Point = 1; -})(M || (M = { -})); +})(M || (M = {})); var M2; (function(M21) { var Point = M21.Point = 1; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); var m = M2; var p; // Error diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js index 36d6de11816..0f68aefee2d 100644 --- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js @@ -8,6 +8,4 @@ var M, M2; }; M1.Point = Point; var Point = M1.Point = 1; -}(M || (M = { -})), (M2 || (M2 = { -})).Point = 1; +}(M || (M = {})), (M2 || (M2 = {})).Point = 1; diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.1.normal.js index ebd9df5a8d5..88aaf17188f 100644 --- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; return x.toString(); } M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); // all of these are errors var a; var a = 1; diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.2.minified.js index 7ffbee9765c..e8346edf1b9 100644 --- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es2015.2.minified.js @@ -5,8 +5,7 @@ class C2 extends C { } class D { } -(M = M1 || (M1 = { -})).A = class { +(M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); }, new C(), new D(), new C(), new C2(), new C(), new C2(), new D(), new D(), new Array(), M1.A; diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.1.normal.js index dcc17348e9b..94b70f3ea7c 100644 --- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,8 +100,7 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); // all of these are errors var a; var a = 1; diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.2.minified.js index 6fb129e497a..cb1b0b56cf7 100644 --- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations_es5.2.minified.js @@ -32,8 +32,7 @@ var M, C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -66,5 +65,4 @@ var M, C = function() { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -})), new C(), new D(), new C(), new C2(), new C(), new C2(), new D(), new D(), new Array(), M.A; +}(M || (M = {})), new C(), new D(), new C(), new C2(), new C(), new C2(), new D(), new D(), new Array(), M.A; diff --git a/crates/swc/tests/tsc-references/invalidNestedModules_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidNestedModules_es2015.1.normal.js index e3751896a88..930af936c75 100644 --- a/crates/swc/tests/tsc-references/invalidNestedModules_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidNestedModules_es2015.1.normal.js @@ -7,22 +7,17 @@ var A; class Point { } C.Point = Point; - })(C1 = B.C || (B.C = { - })); - })(B1 = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(C1 = B.C || (B.C = {})); + })(B1 = A1.B || (A1.B = {})); +})(A || (A = {})); (function(A2) { let B2; (function(B) { class C { } B.C = C; - })(B2 = A2.B || (A2.B = { - })); -})(A || (A = { -})); + })(B2 = A2.B || (A2.B = {})); +})(A || (A = {})); var M2; (function(M21) { let X1; @@ -30,16 +25,12 @@ var M2; class Point { } X.Point = Point; - })(X1 = M21.X || (M21.X = { - })); -})(M2 || (M2 = { -})); + })(X1 = M21.X || (M21.X = {})); +})(M2 || (M2 = {})); (function(M22) { let X2; (function(X) { var Point; X.Point = Point; - })(X2 = M22.X || (M22.X = { - })); -})(M2 || (M2 = { -})); + })(X2 = M22.X || (M22.X = {})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/invalidNestedModules_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidNestedModules_es2015.2.minified.js index 2e7e83b237e..7765ceb9e0c 100644 --- a/crates/swc/tests/tsc-references/invalidNestedModules_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidNestedModules_es2015.2.minified.js @@ -1,20 +1,11 @@ var A, M2, A1, M21; !function(A2) { var B; - ((B = A2.B || (A2.B = { - })).C || (B.C = { - })).Point = class { + ((B = A2.B || (A2.B = {})).C || (B.C = {})).Point = class { }; -}(A || (A = { -})), ((A1 = A || (A = { -})).B || (A1.B = { -})).C = class { -}, ((M21 = M2 || (M2 = { -})).X || (M21.X = { -})).Point = class { +}(A || (A = {})), ((A1 = A || (A = {})).B || (A1.B = {})).C = class { +}, ((M21 = M2 || (M2 = {})).X || (M21.X = {})).Point = class { }, (function(M22) { var Point; - (M22.X || (M22.X = { - })).Point = Point; -})(M2 || (M2 = { -})); + (M22.X || (M22.X = {})).Point = Point; +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/invalidNestedModules_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidNestedModules_es5.1.normal.js index 362ec495d7c..1f8920fcf6b 100644 --- a/crates/swc/tests/tsc-references/invalidNestedModules_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidNestedModules_es5.1.normal.js @@ -14,12 +14,9 @@ var A; _classCallCheck(this, Point); }; C.Point = Point; - })(C1 = B.C || (B.C = { - })); - })(B1 = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(C1 = B.C || (B.C = {})); + })(B1 = A1.B || (A1.B = {})); +})(A || (A = {})); (function(A2) { var B2; (function(B) { @@ -28,10 +25,8 @@ var A; _classCallCheck(this, C); }; B.C = C; - })(B2 = A2.B || (A2.B = { - })); -})(A || (A = { -})); + })(B2 = A2.B || (A2.B = {})); +})(A || (A = {})); var M2; (function(M21) { var X1; @@ -41,16 +36,12 @@ var M2; _classCallCheck(this, Point); }; X.Point = Point; - })(X1 = M21.X || (M21.X = { - })); -})(M2 || (M2 = { -})); + })(X1 = M21.X || (M21.X = {})); +})(M2 || (M2 = {})); (function(M22) { var X2; (function(X) { var Point; X.Point = Point; - })(X2 = M22.X || (M22.X = { - })); -})(M2 || (M2 = { -})); + })(X2 = M22.X || (M22.X = {})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/invalidNestedModules_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidNestedModules_es5.2.minified.js index 4cec8b0a2da..231b92fe2d3 100644 --- a/crates/swc/tests/tsc-references/invalidNestedModules_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidNestedModules_es5.2.minified.js @@ -4,32 +4,23 @@ function _classCallCheck(instance, Constructor) { } !function(A1) { var B, C, Point; - C = (B = A1.B || (A1.B = { - })).C || (B.C = { - }), Point = function() { + C = (B = A1.B || (A1.B = {})).C || (B.C = {}), Point = function() { "use strict"; _classCallCheck(this, Point); }, C.Point = Point; -}(A || (A = { -})), (function(A2) { +}(A || (A = {})), (function(A2) { var B, C; - B = A2.B || (A2.B = { - }), C = function() { + B = A2.B || (A2.B = {}), C = function() { "use strict"; _classCallCheck(this, C); }, B.C = C; -})(A || (A = { -})), (function(M21) { +})(A || (A = {})), (function(M21) { var X, Point; - X = M21.X || (M21.X = { - }), Point = function() { + X = M21.X || (M21.X = {}), Point = function() { "use strict"; _classCallCheck(this, Point); }, X.Point = Point; -})(M2 || (M2 = { -})), (function(M22) { +})(M2 || (M2 = {})), (function(M22) { var Point; - (M22.X || (M22.X = { - })).Point = Point; -})(M2 || (M2 = { -})); + (M22.X || (M22.X = {})).Point = Point; +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.1.normal.js index 7d44fc35eb0..9c8f9e1c733 100644 --- a/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.1.normal.js @@ -12,8 +12,7 @@ var g2 = 1; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; diff --git a/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.2.minified.js index b28dbf2b217..8507219ae1c 100644 --- a/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidNumberAssignments_es2015.2.minified.js @@ -1,3 +1,2 @@ var M; -(M || (M = { -})).x = 1, M = 1; +(M || (M = {})).x = 1, M = 1; diff --git a/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.1.normal.js index b7cf312dc83..a69cf17e63a 100644 --- a/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.1.normal.js @@ -19,8 +19,7 @@ var g2 = 1; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; diff --git a/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.2.minified.js index c2163a3f68d..034c07a83e7 100644 --- a/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidNumberAssignments_es5.2.minified.js @@ -4,5 +4,4 @@ var M, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(M || (M = { -})).x = 1, M = 1; +(M || (M = {})).x = 1, M = 1; diff --git a/crates/swc/tests/tsc-references/invalidReturnStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidReturnStatements_es2015.1.normal.js index 61f1a349ef8..4679ef9787c 100644 --- a/crates/swc/tests/tsc-references/invalidReturnStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidReturnStatements_es2015.1.normal.js @@ -1,17 +1,11 @@ // all the following should be error -function fn1() { -} -function fn2() { -} -function fn3() { -} -function fn4() { -} -function fn7() { -} // should be valid: any includes void +function fn1() {} +function fn2() {} +function fn3() {} +function fn4() {} +function fn7() {} // should be valid: any includes void class C { - dispose() { - } + dispose() {} } class D extends C { } diff --git a/crates/swc/tests/tsc-references/invalidReturnStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidReturnStatements_es5.1.normal.js index b1c383ca766..596a270f275 100644 --- a/crates/swc/tests/tsc-references/invalidReturnStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidReturnStatements_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -84,16 +83,11 @@ function _createSuper(Derived) { }; } // all the following should be error -function fn1() { -} -function fn2() { -} -function fn3() { -} -function fn4() { -} -function fn7() { -} // should be valid: any includes void +function fn1() {} +function fn2() {} +function fn3() {} +function fn4() {} +function fn7() {} // should be valid: any includes void var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -102,8 +96,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "dispose", - value: function dispose() { - } + value: function dispose() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/invalidReturnStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidReturnStatements_es5.2.minified.js index e849e4e0357..7ca5bcf2297 100644 --- a/crates/swc/tests/tsc-references/invalidReturnStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidReturnStatements_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function() { return protoProps = [ { key: "dispose", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), D = function(C) { @@ -48,8 +47,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.1.normal.js index 1aa9c413447..acd1a14aee7 100644 --- a/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.1.normal.js @@ -12,8 +12,7 @@ var g2 = 1; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; @@ -22,6 +21,5 @@ i = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var j = x; diff --git a/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.2.minified.js index 0fa0ea3bdd1..43ab2b2344b 100644 --- a/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidStringAssignments_es2015.2.minified.js @@ -1,4 +1,2 @@ var M, E, E; -(M || (M = { -})).x = 1, M = "", (E = E || (E = { -}))[E.A = 0] = "A"; +(M || (M = {})).x = 1, M = "", (E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/invalidStringAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidStringAssignments_es5.1.normal.js index e07e9a73b60..fd0a0e4603e 100644 --- a/crates/swc/tests/tsc-references/invalidStringAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidStringAssignments_es5.1.normal.js @@ -19,8 +19,7 @@ var g2 = 1; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; @@ -29,6 +28,5 @@ i = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var j = x; diff --git a/crates/swc/tests/tsc-references/invalidStringAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidStringAssignments_es5.2.minified.js index 1e8655c1773..e9620c96a9e 100644 --- a/crates/swc/tests/tsc-references/invalidStringAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidStringAssignments_es5.2.minified.js @@ -4,6 +4,4 @@ var M, E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(M || (M = { -})).x = 1, M = "", (E = E || (E = { -}))[E.A = 0] = "A"; +(M || (M = {})).x = 1, M = "", (E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.1.normal.js index ce84afeb3f6..f3ece07d83a 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.1.normal.js @@ -2,8 +2,7 @@ var x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E = x; E.A = x; class C { @@ -16,10 +15,8 @@ I = x; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; -function i(a) { -} +function i(a) {} // BUG 767030 i = x; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.2.minified.js index 444bd7b9d0a..e9cba93c78e 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es2015.2.minified.js @@ -1,4 +1,2 @@ var x, E, M, E; -(E = E || (E = { -}))[E.A = 0] = "A", (E = x).A = x, I = x, (M || (M = { -})).x = 1, M = x; +(E = E || (E = {}))[E.A = 0] = "A", (E = x).A = x, I = x, (M || (M = {})).x = 1, M = x; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.1.normal.js index 223965c6cec..89c6c24d1d5 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.1.normal.js @@ -7,8 +7,7 @@ var x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E = x; E.A = x; var C = function C() { @@ -23,10 +22,8 @@ I = x; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; -function i(a) { -} +function i(a) {} // BUG 767030 i = x; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.2.minified.js index 52b76477c83..70e3a461a0b 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedAssignments_es5.2.minified.js @@ -1,10 +1,8 @@ -(E = E || (E = { -}))[E.A = 0] = "A", (E = x).A = x; +(E = E || (E = {}))[E.A = 0] = "A", (E = x).A = x; var E, x, E, M, C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -C = x, I = x, (M || (M = { -})).x = 1, M = x; +C = x, I = x, (M || (M = {})).x = 1, M = x; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.1.normal.js index d21771f9411..61b6a802d6d 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.1.normal.js @@ -15,12 +15,10 @@ x = c; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); x = M; x = { - f () { - } + f () {} }; function f(a1) { x = a1; @@ -29,7 +27,6 @@ x = f; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E; x = E.A; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.2.minified.js index 0842fba191a..652bec0ec87 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedValues_es2015.2.minified.js @@ -1,10 +1,7 @@ var x, M, E, E; x = 1, x = "", x = !0, x = void 0, x = null, x = class { -}, x = void 0, x = void 0, (M || (M = { -})).x = 1, x = M, x = { - f () { - } +}, x = void 0, x = void 0, (M || (M = {})).x = 1, x = M, x = { + f () {} }, x = function(a) { x = a; -}, (E = E || (E = { -}))[E.A = 0] = "A", x = E, x = E.A; +}, (E = E || (E = {}))[E.A = 0] = "A", x = E, x = E.A; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.1.normal.js index 0ce60417396..dcba3c9831f 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.1.normal.js @@ -22,12 +22,10 @@ x = c; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); x = M; x = { - f: function f() { - } + f: function f() {} }; function f(a1) { x = a1; @@ -36,7 +34,6 @@ x = f; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E; x = E.A; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.2.minified.js index a397219b546..8104c6ede93 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedValues_es5.2.minified.js @@ -5,11 +5,8 @@ var E, x, a, b, c, M, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -x = C, x = b, x = c, (M || (M = { -})).x = 1, x = M, x = { - f: function() { - } +x = C, x = b, x = c, (M || (M = {})).x = 1, x = M, x = { + f: function() {} }, x = function(a1) { x = a1; -}, (E = E || (E = { -}))[E.A = 0] = "A", x = E, x = E.A; +}, (E = E || (E = {}))[E.A = 0] = "A", x = E, x = E.A; diff --git a/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.1.normal.js index 2340782b239..805ba23e995 100644 --- a/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.1.normal.js @@ -12,8 +12,7 @@ var g2 = 1; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; @@ -22,11 +21,9 @@ i = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E; x = E.A; x = { - f () { - } + f () {} }; diff --git a/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.2.minified.js index 6f0b26d67f9..95ac123a689 100644 --- a/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidVoidAssignments_es2015.2.minified.js @@ -1,7 +1,4 @@ var x, M, E, E; -(M || (M = { -})).x = 1, M = x, (E = E || (E = { -}))[E.A = 0] = "A", x = E, x = E.A, x = { - f () { - } +(M || (M = {})).x = 1, M = x, (E = E || (E = {}))[E.A = 0] = "A", x = E, x = E.A, x = { + f () {} }; diff --git a/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.1.normal.js index a294a5ba566..9d2cdc890ca 100644 --- a/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.1.normal.js @@ -19,8 +19,7 @@ var g2 = 1; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = x; function i(a1) { a1 = x; @@ -29,11 +28,9 @@ i = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E; x = E.A; x = { - f: function f() { - } + f: function f() {} }; diff --git a/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.2.minified.js index 5b2fefda16e..988351d1b62 100644 --- a/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidVoidAssignments_es5.2.minified.js @@ -4,9 +4,6 @@ var x, M, E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(M || (M = { -})).x = 1, M = x, (E = E || (E = { -}))[E.A = 0] = "A", x = E, x = E.A, x = { - f: function() { - } +(M || (M = {})).x = 1, M = x, (E = E || (E = {}))[E.A = 0] = "A", x = E, x = E.A, x = { + f: function() {} }; diff --git a/crates/swc/tests/tsc-references/invalidVoidValues_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidVoidValues_es2015.1.normal.js index 185a88324e4..1f4aa3a2fb3 100644 --- a/crates/swc/tests/tsc-references/invalidVoidValues_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidVoidValues_es2015.1.normal.js @@ -5,8 +5,7 @@ x = true; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E; x = E.A; class C { @@ -16,14 +15,12 @@ x = a; var b; x = b; x = { - f () { - } + f () {} }; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); x = M; function f(a1) { x = a1; diff --git a/crates/swc/tests/tsc-references/invalidVoidValues_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidVoidValues_es2015.2.minified.js index 15b18ccac99..c2c8c885845 100644 --- a/crates/swc/tests/tsc-references/invalidVoidValues_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidVoidValues_es2015.2.minified.js @@ -1,9 +1,6 @@ var x, E, a, b, M, E; -x = 1, x = "", x = !0, (E = E || (E = { -}))[E.A = 0] = "A", x = E, x = E.A, x = a, x = b, x = { - f () { - } -}, (M || (M = { -})).x = 1, x = M, x = function(a1) { +x = 1, x = "", x = !0, (E = E || (E = {}))[E.A = 0] = "A", x = E, x = E.A, x = a, x = b, x = { + f () {} +}, (M || (M = {})).x = 1, x = M, x = function(a1) { x = a1; }; diff --git a/crates/swc/tests/tsc-references/invalidVoidValues_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidVoidValues_es5.1.normal.js index af09aca9b6d..4a9e8a7cd65 100644 --- a/crates/swc/tests/tsc-references/invalidVoidValues_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidVoidValues_es5.1.normal.js @@ -10,8 +10,7 @@ x = true; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); x = E; x = E.A; var C = function C() { @@ -23,14 +22,12 @@ x = a; var b; x = b; x = { - f: function f() { - } + f: function f() {} }; var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); x = M; function f(a1) { x = a1; diff --git a/crates/swc/tests/tsc-references/invalidVoidValues_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidVoidValues_es5.2.minified.js index 32e300fdb9f..510e91ea6bd 100644 --- a/crates/swc/tests/tsc-references/invalidVoidValues_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidVoidValues_es5.2.minified.js @@ -1,5 +1,4 @@ -x = 1, x = "", x = !0, (E = E || (E = { -}))[E.A = 0] = "A", x = E, x = E.A; +x = 1, x = "", x = !0, (E = E || (E = {}))[E.A = 0] = "A", x = E, x = E.A; var E, x, E, a, b, M, C = function() { "use strict"; !function(instance, Constructor) { @@ -7,9 +6,7 @@ var E, x, E, a, b, M, C = function() { }(this, C); }; x = a, x = b, x = { - f: function() { - } -}, (M || (M = { -})).x = 1, x = M, x = function(a1) { + f: function() {} +}, (M || (M = {})).x = 1, x = M, x = function(a1) { x = a1; }; diff --git a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.1.normal.js index 16908fdafaf..b6b9b5bdeba 100644 --- a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.1.normal.js @@ -7,16 +7,14 @@ function unbox(x) { return x.value; } function boxify(obj) { - let result = { - }; + let result = {}; for(let k in obj){ result[k] = box(obj[k]); } return result; } function unboxify(obj) { - let result = { - }; + let result = {}; for(let k in obj){ result[k] = unbox(obj[k]); } @@ -148,11 +146,9 @@ let x4 = f24({ }); // Repro from #29765 function getProps(obj, list) { - return { - }; + return {}; } -const myAny = { -}; +const myAny = {}; const o1 = getProps(myAny, [ 'foo', 'bar' diff --git a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.2.minified.js index c72e0b30bd9..4090d16abdd 100644 --- a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es2015.2.minified.js @@ -16,8 +16,7 @@ let o = { b: 7 }; function getProps(obj, list) { - return { - }; + return {}; } o = o, f20({ foo: 42, @@ -39,8 +38,7 @@ o = o, f20({ foo: 42, bar: "hello" }); -const myAny = { -}; +const myAny = {}; getProps(myAny, [ "foo", "bar" diff --git a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.1.normal.js b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.1.normal.js index 0daa444fa53..0902d9c53d1 100644 --- a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.1.normal.js @@ -7,16 +7,14 @@ function unbox(x) { return x.value; } function boxify(obj) { - var result = { - }; + var result = {}; for(var k in obj){ result[k] = box(obj[k]); } return result; } function unboxify(obj) { - var result = { - }; + var result = {}; for(var k in obj){ result[k] = unbox(obj[k]); } @@ -154,11 +152,9 @@ var x4 = f24({ }); // Repro from #29765 function getProps(obj, list) { - return { - }; + return {}; } -var myAny = { -}; +var myAny = {}; var o1 = getProps(myAny, [ 'foo', 'bar' diff --git a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.2.minified.js b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.2.minified.js index 4dc1191a159..5021784d1f8 100644 --- a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference_es5.2.minified.js @@ -23,8 +23,7 @@ var foo = function(object, partial) { b: 7 }; function getProps(obj, list) { - return { - }; + return {}; } foo(o, { b: 9 @@ -50,8 +49,7 @@ foo(o, { foo: 42, bar: "hello" }); -var myAny = { -}; +var myAny = {}; getProps(myAny, [ "foo", "bar" diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.1.normal.js index be87966bd46..506828e7cf2 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun([a, b]) { -} +function fun([a, b]) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.2.minified.js index 47480e25cc2..e9d55a398fc 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern10_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function([a, b]) { -}(new class { +!function([a, b]) {}(new class { next() { return { value: new Foo, diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.1.normal.js index f1d6f20b725..55f067cf781 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.2.minified.js index 10047277d45..79cc926b604 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern10_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.1.normal.js index d7c7db68d6f..5797eb0f34b 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun([a, b] = new FooIterator) { -} +function fun([a, b] = new FooIterator) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.2.minified.js index 3a0a472d529..94da18f3bf1 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern11_es2015.2.minified.js @@ -14,5 +14,4 @@ class FooIterator { return this; } } -!function([a, b] = new FooIterator) { -}(new FooIterator); +!function([a, b] = new FooIterator) {}(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.1.normal.js index f24174abaf1..94587be2549 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.2.minified.js index 5455177b7ca..eadd6e1db0e 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern11_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.1.normal.js index cf8c7700f53..25940095401 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun([a, ...b] = new FooIterator) { -} +function fun([a, ...b] = new FooIterator) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.2.minified.js index fe126d14730..dd4b0e2a4bd 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern12_es2015.2.minified.js @@ -14,5 +14,4 @@ class FooIterator { return this; } } -!function([a, ...b] = new FooIterator) { -}(new FooIterator); +!function([a, ...b] = new FooIterator) {}(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.1.normal.js index ebda686aa95..f1155a8e7d1 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.2.minified.js index f0e70976023..becd2426367 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern12_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.1.normal.js index 60265e8653a..6cab3c19eb0 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun([a, ...b]) { -} +function fun([a, ...b]) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.2.minified.js index c3c6252724c..2be337324c8 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern13_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function([a, ...b]) { -}(new class { +!function([a, ...b]) {}(new class { next() { return { value: new Foo, diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.1.normal.js index f7395bf3281..5dbea6776d8 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.2.minified.js index 5369258f055..ab15a98508d 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern13_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.1.normal.js index 69238f77bdb..6a77bb63482 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun(...[a, ...b]) { -} +function fun(...[a, ...b]) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.2.minified.js index e6a12ee4c64..5b6679e6ed9 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern14_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function(...[a, ...b]) { -}(new class { +!function(...[a, ...b]) {}(new class { next() { return { value: new Foo, diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.1.normal.js index 55341fd27bd..c5183400eb5 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.2.minified.js index 47fc79669fa..2158977f798 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern14_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.1.normal.js index b5c370b40f0..47afe017945 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun(...[a, b]) { -} +function fun(...[a, b]) {} fun(...new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.2.minified.js index 10bb9f82d0d..92f2d632767 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern15_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function(...[a, b]) { -}(...new class { +!function(...[a, b]) {}(...new class { next() { return { value: new Foo, diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.1.normal.js index 67e84810d1c..448e06b7b3d 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.1.normal.js @@ -121,8 +121,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.2.minified.js index 5d71c12bf8e..52ce88d1b13 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern15_es5.2.minified.js @@ -54,8 +54,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.1.normal.js index 611f80aa504..ad854e35ecb 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function fun(...[a, b]) { -} +function fun(...[a, b]) {} fun(...new FooIteratorIterator); class Bar { } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.2.minified.js index 77fc6c0fe72..29f08b44651 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern16_es2015.2.minified.js @@ -1,5 +1,4 @@ -!function(...[a, b]) { -}(...new FooIteratorIterator); +!function(...[a, b]) {}(...new FooIteratorIterator); class Bar { } class Foo extends Bar { diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.1.normal.js index 4706bb8801a..bb6f243189f 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.1.normal.js @@ -121,8 +121,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.2.minified.js index f770cfb226a..3bce46caf44 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern16_es5.2.minified.js @@ -89,8 +89,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.1.normal.js index bf23fd83998..658ae236dd5 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun(...[a, b]) { -} +function fun(...[a, b]) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.2.minified.js index 856f32cb1c3..1c6cd02fc1c 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern17_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function(...[a, b]) { -}(new class { +!function(...[a, b]) {}(new class { next() { return { value: new Foo, diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.1.normal.js index cd8f501266a..177435d6b2f 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.2.minified.js index 4059304130e..a2f546fe9ee 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern17_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.1.normal.js index be87966bd46..506828e7cf2 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.1.normal.js @@ -15,6 +15,5 @@ class FooIterator { return this; } } -function fun([a, b]) { -} +function fun([a, b]) {} fun(new FooIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.2.minified.js index 47480e25cc2..e9d55a398fc 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern18_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function([a, b]) { -}(new class { +!function([a, b]) {}(new class { next() { return { value: new Foo, diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.1.normal.js index f1d6f20b725..55f067cf781 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.2.minified.js index 10047277d45..79cc926b604 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern18_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.1.normal.js index 1afac1a7030..9d27b82495e 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.1.normal.js @@ -17,6 +17,5 @@ class FooArrayIterator { return this; } } -function fun([[a], b]) { -} +function fun([[a], b]) {} fun(new FooArrayIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.2.minified.js index a1ad6bd4762..4b329a5cdea 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern19_es2015.2.minified.js @@ -2,8 +2,7 @@ class Bar { } class Foo extends Bar { } -!function([[a], b]) { -}(new class { +!function([[a], b]) {}(new class { next() { return { value: [ diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.1.normal.js index 48a236c8ad4..a70ce57d446 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.2.minified.js index 5154f964696..71085bcf5d1 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern19_es5.2.minified.js @@ -75,8 +75,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.1.normal.js index cbc2a969e10..e38f6e100a2 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.1.normal.js @@ -19,6 +19,5 @@ class FooArrayIterator { } function fun(...[[a = new Foo], b = [ new Foo -]]) { -} +]]) {} fun(...new FooArrayIterator); diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.2.minified.js index a3a736a901c..e04f2d61816 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern20_es2015.2.minified.js @@ -4,8 +4,7 @@ class Foo extends Bar { } !function(...[[a = new Foo], b = [ new Foo -]]) { -}(...new class { +]]) {}(...new class { next() { return { value: [ diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.1.normal.js index f57c55d88c5..20cbb8bb8b5 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.1.normal.js @@ -121,8 +121,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.2.minified.js index 8382fa70cf7..0163977d394 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern20_es5.2.minified.js @@ -78,8 +78,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.1.normal.js index 0dc6994113a..7cf73b5ac10 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) {} takeFirstTwoEntries(new Map([ [ "", diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.2.minified.js index d789d279bb3..94b05ad4f3c 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern25_es2015.2.minified.js @@ -1,5 +1,4 @@ -!function(...[[k1, v1], [k2, v2]]) { -}(new Map([ +!function(...[[k1, v1], [k2, v2]]) {}(new Map([ [ "", 0 diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.1.normal.js index 0dc6994113a..7cf73b5ac10 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) {} takeFirstTwoEntries(new Map([ [ "", diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.2.minified.js index d789d279bb3..94b05ad4f3c 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern26_es2015.2.minified.js @@ -1,5 +1,4 @@ -!function(...[[k1, v1], [k2, v2]]) { -}(new Map([ +!function(...[[k1, v1], [k2, v2]]) {}(new Map([ [ "", 0 diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.1.normal.js index 6cecfe4442c..bb35e6549fe 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) {} takeFirstTwoEntries(...new Map([ [ "", diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.2.minified.js index f4ed13b8065..d540d18145f 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern27_es2015.2.minified.js @@ -1,5 +1,4 @@ -!function(...[[k1, v1], [k2, v2]]) { -}(...new Map([ +!function(...[[k1, v1], [k2, v2]]) {}(...new Map([ [ "", 0 diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.1.normal.js index 352e27cf0d1..52b8ed4a98a 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.1.normal.js @@ -1,7 +1,6 @@ // @lib: es2015 // @target: ES6 -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) {} takeFirstTwoEntries(...new Map([ [ "", diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.2.minified.js index 35f52a50abd..6c8786405ab 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern28_es2015.2.minified.js @@ -1,5 +1,4 @@ -!function(...[[k1, v1], [k2, v2]]) { -}(...new Map([ +!function(...[[k1, v1], [k2, v2]]) {}(...new Map([ [ "", 0 diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.1.normal.js index e0f40675833..aa5e2dfd805 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) {} takeFirstTwoEntries(...new Map([ [ "", diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.2.minified.js index 5540338f006..afa3db79979 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern29_es2015.2.minified.js @@ -1,5 +1,4 @@ -!function(...[[k1, v1], [k2, v2]]) { -}(...new Map([ +!function(...[[k1, v1], [k2, v2]]) {}(...new Map([ [ "", !0 diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.1.normal.js index 1750bf9ffad..d3094323850 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.2.minified.js index a14f5c3186c..22c1f182085 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern3_es5.2.minified.js @@ -43,8 +43,7 @@ var ref, arr, i, Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.1.normal.js index 49940b7daec..9a2db347693 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.2.minified.js index 2305dc67823..7233ab24d12 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern4_es5.2.minified.js @@ -43,8 +43,7 @@ var ref, arr, Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.1.normal.js index 1750bf9ffad..d3094323850 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.2.minified.js index a14f5c3186c..22c1f182085 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern5_es5.2.minified.js @@ -43,8 +43,7 @@ var ref, arr, i, Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.1.normal.js index 49940b7daec..9a2db347693 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.2.minified.js index 2305dc67823..7233ab24d12 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern6_es5.2.minified.js @@ -43,8 +43,7 @@ var ref, arr, Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.1.normal.js index 1750bf9ffad..d3094323850 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.2.minified.js index a14f5c3186c..22c1f182085 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern7_es5.2.minified.js @@ -43,8 +43,7 @@ var ref, arr, i, Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.1.normal.js index 49940b7daec..9a2db347693 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.2.minified.js index 2305dc67823..7233ab24d12 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern8_es5.2.minified.js @@ -43,8 +43,7 @@ var ref, arr, Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern9_es2015.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern9_es2015.1.normal.js index 461f9e3cf17..d1e790eb052 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern9_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function fun([a, b] = new FooIterator) { -} +function fun([a, b] = new FooIterator) {} class Bar { } class Foo extends Bar { diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.1.normal.js b/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.1.normal.js index 738ebabb070..441dd80ab30 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.1.normal.js @@ -109,8 +109,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.2.minified.js b/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.2.minified.js index 9c2926887d0..321f733dc5f 100644 --- a/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iterableArrayPattern9_es5.2.minified.js @@ -38,8 +38,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.1.normal.js index 0ff3f7e093f..0a1e604dd02 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.1.normal.js @@ -1,7 +1,6 @@ //@target: ES6 class Foo { - constructor(...s){ - } + constructor(...s){} } var tmp = Symbol.iterator; class SymbolIterator { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.2.minified.js index f8ec06e469a..047a12a5c58 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es2015.2.minified.js @@ -1,7 +1,6 @@ var tmp = Symbol.iterator, tmp1 = Symbol.iterator; new class { - constructor(...s){ - } + constructor(...s){} }(...[ ...new class { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.1.normal.js index b8495423bf9..56ddff016c9 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.1.normal.js @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.2.minified.js index e3b8a2fceef..9731ace5f70 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall12_es5.2.minified.js @@ -12,8 +12,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.1.normal.js index a336997dade..6da3491ba25 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function foo(s) { -} +function foo(s) {} var tmp = Symbol.iterator; class SymbolIterator { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.2.minified.js index 21033425803..ba606f355a7 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es2015.2.minified.js @@ -1,6 +1,5 @@ var tmp = Symbol.iterator; -!function(s) { -}(...new class { +!function(s) {}(...new class { next() { return { value: Symbol(), diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.1.normal.js index d0004b0fcf7..a7ae0f94f64 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.1.normal.js @@ -43,8 +43,7 @@ function _unsupportedIterableToArray(o, minLen) { if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } //@target: ES6 -function foo(s) { -} +function foo(s) {} var tmp = Symbol.iterator; var SymbolIterator = /*#__PURE__*/ function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.2.minified.js index 9643ef774e2..302eb6c679e 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall2_es5.2.minified.js @@ -35,8 +35,7 @@ var arr, tmp = Symbol.iterator, SymbolIterator = function() { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), SymbolIterator; }(); -(function(s) { -}).apply(void 0, function(arr) { +(function(s) {}).apply(void 0, function(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }(arr = new SymbolIterator) || function(iter) { if ("undefined" != typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) return Array.from(iter); diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.1.normal.js index 5220d2c6134..1da0dbf6e80 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function foo(...s) { -} +function foo(...s) {} var tmp = Symbol.iterator; class SymbolIterator { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.2.minified.js index 1ab2f70e116..bae475665e2 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall3_es2015.2.minified.js @@ -1,6 +1,5 @@ var tmp = Symbol.iterator; -!function(...s) { -}(...new class { +!function(...s) {}(...new class { next() { return { value: Symbol(), diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.1.normal.js index 5aad3d805b1..82c526b8acc 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function foo(s1, ...s) { -} +function foo(s1, ...s) {} var tmp = Symbol.iterator; class SymbolIterator { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.2.minified.js index cd67cd0fe89..a460bd78bbf 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall4_es2015.2.minified.js @@ -1,6 +1,5 @@ var tmp = Symbol.iterator; -!function(s1, ...s) { -}(...new class { +!function(s1, ...s) {}(...new class { next() { return { value: Symbol(), diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.1.normal.js index a3e10ea915c..f91ca247139 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function foo(...s) { -} +function foo(...s) {} var tmp = Symbol.iterator; class SymbolIterator { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.2.minified.js index a8db635a7a3..2f14b086ea2 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall5_es2015.2.minified.js @@ -1,6 +1,5 @@ var tmp = Symbol.iterator, tmp1 = Symbol.iterator; -!function(...s) { -}(...new class { +!function(...s) {}(...new class { next() { return { value: Symbol(), diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.1.normal.js index a3e10ea915c..f91ca247139 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function foo(...s) { -} +function foo(...s) {} var tmp = Symbol.iterator; class SymbolIterator { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.2.minified.js index a8db635a7a3..2f14b086ea2 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall6_es2015.2.minified.js @@ -1,6 +1,5 @@ var tmp = Symbol.iterator, tmp1 = Symbol.iterator; -!function(...s) { -}(...new class { +!function(...s) {}(...new class { next() { return { value: Symbol(), diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.1.normal.js index c8f7bd32ec1..37dba4310be 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.1.normal.js @@ -1,7 +1,6 @@ //@target: ES6 class Foo { - constructor(...s){ - } + constructor(...s){} } var tmp = Symbol.iterator; class SymbolIterator { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.2.minified.js index c387f8ece0f..b4ddfad2a1b 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es2015.2.minified.js @@ -1,7 +1,6 @@ var tmp = Symbol.iterator, tmp1 = Symbol.iterator; new class { - constructor(...s){ - } + constructor(...s){} }(...new class { next() { return { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.1.normal.js index 3d6c63fc338..34d48b40b98 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.1.normal.js @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.2.minified.js index fd8f13235f0..0284cd4af55 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall8_es5.2.minified.js @@ -12,8 +12,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.1.normal.js index 22d69bac4c6..44d862f8a5a 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.1.normal.js @@ -1,7 +1,6 @@ //@target: ES6 class Foo { - constructor(...s){ - } + constructor(...s){} } var tmp = Symbol.iterator; class SymbolIterator { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.2.minified.js index 0d856dd7b3f..775e1e25a93 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es2015.2.minified.js @@ -1,7 +1,6 @@ var tmp = Symbol.iterator, tmp1 = Symbol.iterator; new class { - constructor(...s){ - } + constructor(...s){} }(...new class { next() { return { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.1.normal.js index 4705babff2e..2c594c9413c 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.1.normal.js @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.2.minified.js index 812013e43f2..0a4edd16a50 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall9_es5.2.minified.js @@ -12,8 +12,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.1.normal.js index a336997dade..6da3491ba25 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -function foo(s) { -} +function foo(s) {} var tmp = Symbol.iterator; class SymbolIterator { next() { diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.2.minified.js index 21033425803..ba606f355a7 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es2015.2.minified.js @@ -1,6 +1,5 @@ var tmp = Symbol.iterator; -!function(s) { -}(...new class { +!function(s) {}(...new class { next() { return { value: Symbol(), diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.1.normal.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.1.normal.js index d0004b0fcf7..a7ae0f94f64 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.1.normal.js @@ -43,8 +43,7 @@ function _unsupportedIterableToArray(o, minLen) { if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } //@target: ES6 -function foo(s) { -} +function foo(s) {} var tmp = Symbol.iterator; var SymbolIterator = /*#__PURE__*/ function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.2.minified.js b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.2.minified.js index 9643ef774e2..302eb6c679e 100644 --- a/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/iteratorSpreadInCall_es5.2.minified.js @@ -35,8 +35,7 @@ var arr, tmp = Symbol.iterator, SymbolIterator = function() { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), SymbolIterator; }(); -(function(s) { -}).apply(void 0, function(arr) { +(function(s) {}).apply(void 0, function(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }(arr = new SymbolIterator) || function(iter) { if ("undefined" != typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) return Array.from(iter); diff --git a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.1.normal.js index 027c43d915b..44e0c359519 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.1.normal.js @@ -3,10 +3,7 @@ // @checkJs: true // #24131 // @Filename: a.js -const a = { -}; -a.d = function() { -}; +const a = {}; +a.d = function() {}; // @Filename: b.js -a.d.prototype = { -}; +a.d.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js index aa7586fbd1e..c975bb09fc0 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js @@ -1,5 +1,2 @@ -const a = { -}; -a.d = function() { -}, a.d.prototype = { -}; +const a = {}; +a.d = function() {}, a.d.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.1.normal.js index 6abd2ddc87c..9f720302f4b 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.1.normal.js @@ -3,10 +3,7 @@ // @checkJs: true // #24131 // @Filename: a.js -var a = { -}; -a.d = function() { -}; +var a = {}; +a.d = function() {}; // @Filename: b.js -a.d.prototype = { -}; +a.d.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js index bf21a86971a..8f094e55a14 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js @@ -1,5 +1,2 @@ -var a = { -}; -a.d = function() { -}, a.d.prototype = { -}; +var a = {}; +a.d = function() {}, a.d.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.1.normal.js index 315935a94b3..1a853a6f05c 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.1.normal.js @@ -1,4 +1,3 @@ // @Filename: b.js -C.prototype = { -}; +C.prototype = {}; C.bar = 2; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.2.minified.js index 5491ea64457..c323373613f 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es2015.2.minified.js @@ -1,2 +1 @@ -C.prototype = { -}, C.bar = 2; +C.prototype = {}, C.bar = 2; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.1.normal.js index 315935a94b3..1a853a6f05c 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.1.normal.js @@ -1,4 +1,3 @@ // @Filename: b.js -C.prototype = { -}; +C.prototype = {}; C.bar = 2; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.2.minified.js index 5491ea64457..c323373613f 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration2_es5.2.minified.js @@ -1,2 +1 @@ -C.prototype = { -}, C.bar = 2; +C.prototype = {}, C.bar = 2; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.1.normal.js index 3f003056c86..ee32e063e89 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.1.normal.js @@ -1,5 +1,3 @@ // @Filename: b.js -const A = { -}; -A.d = { -}; +const A = {}; +A.d = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.2.minified.js index 60a60284752..856297c1e15 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es2015.2.minified.js @@ -1,4 +1,2 @@ -const A = { -}; -A.d = { -}; +const A = {}; +A.d = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.1.normal.js index 62e3f048a35..ebc3e550da7 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.1.normal.js @@ -1,5 +1,3 @@ // @Filename: b.js -var A = { -}; -A.d = { -}; +var A = {}; +A.d = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.2.minified.js index a12f6efb32b..831d0ef8e93 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration3_es5.2.minified.js @@ -1,3 +1 @@ -({ -}).d = { -}; +({}).d = {}; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.1.normal.js index 9981ba3a450..bf165fbba42 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.1.normal.js @@ -2,10 +2,8 @@ // @checkJs: true // @noEmit: true // @Filename: a.js -var /*1*/ x = function foo() { -}; -x.a = function bar() { -}; +var /*1*/ x = function foo() {}; +x.a = function bar() {}; // @Filename: b.ts var x = function() { return 1; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js index b7a0432f1c3..39e6fc25b79 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js @@ -1,5 +1,3 @@ -var x = function() { -}; -x.a = function() { -}; +var x = function() {}; +x.a = function() {}; var x = 1; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.1.normal.js index 9981ba3a450..bf165fbba42 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.1.normal.js @@ -2,10 +2,8 @@ // @checkJs: true // @noEmit: true // @Filename: a.js -var /*1*/ x = function foo() { -}; -x.a = function bar() { -}; +var /*1*/ x = function foo() {}; +x.a = function bar() {}; // @Filename: b.ts var x = function() { return 1; diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js index b7a0432f1c3..39e6fc25b79 100644 --- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js @@ -1,5 +1,3 @@ -var x = function() { -}; -x.a = function() { -}; +var x = function() {}; +x.a = function() {}; var x = 1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js index 7714d1d3841..6aeb717d7af 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js @@ -8,8 +8,7 @@ export class Base { }; return json; } - constructor(){ - } + constructor(){} } export class Argument extends Base { /** @@ -22,6 +21,5 @@ export class Argument extends Base { } /** * @param {*} defs - */ *validate(defs) { - } + */ *validate(defs) {} } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js index 4cd7f8ce77f..72e884c8265 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js @@ -6,15 +6,12 @@ export class Base { inheritance: void 0 }; } - constructor(){ - } + constructor(){} } export class Argument extends Base { - static parse(tokeniser) { - } + static parse(tokeniser) {} get type() { return "argument"; } - *validate(defs) { - } + *validate(defs) {} } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js index 6e3ab9eb73e..c61c3cb09c6 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js @@ -64,8 +64,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js index 704b2632677..1a43c31687c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js @@ -57,8 +57,7 @@ export var Argument = function(Base) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -100,8 +99,7 @@ export var Argument = function(Base) { ], [ { key: "parse", - value: function(tokeniser) { - } + value: function(tokeniser) {} } ]), Argument; }(Base); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js index e1b3546b837..d6b2d74992e 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js index ef7832a80f0..58d8fb140b0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js @@ -34,8 +34,7 @@ var Bar = require("./bar"), Foo = function(Bar1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.1.normal.js index e27b7e3886c..38bbf65a44d 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.1.normal.js @@ -6,7 +6,5 @@ // @filename: index.js // https://github.com/microsoft/TypeScript/issues/35801 let A; -A = { -}; -A.prototype.b = { -}; +A = {}; +A.prototype.b = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.2.minified.js index b3dbe7c52b3..8be4034f4cf 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es2015.2.minified.js @@ -1,3 +1 @@ -({ -}).prototype.b = { -}; +({}).prototype.b = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.1.normal.js index ec5b97f3449..a19c1abc722 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.1.normal.js @@ -6,7 +6,5 @@ // @filename: index.js // https://github.com/microsoft/TypeScript/issues/35801 var A; -A = { -}; -A.prototype.b = { -}; +A = {}; +A.prototype.b = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.2.minified.js index b3dbe7c52b3..8be4034f4cf 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassLikeHeuristic_es5.2.minified.js @@ -1,3 +1 @@ -({ -}).prototype.b = { -}; +({}).prototype.b = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.1.normal.js index 15189731e27..e01604f899c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.1.normal.js @@ -5,7 +5,6 @@ // @declaration: true // @filename: source.js export class Clazz { - static method() { - } + static method() {} } Clazz.method.prop = 5; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.2.minified.js index ab560016273..4d3ef6d2e5f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es2015.2.minified.js @@ -1,5 +1,4 @@ export class Clazz { - static method() { - } + static method() {} } Clazz.method.prop = 5; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.1.normal.js index c2c7c4cf3b5..392cc53d418 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.1.normal.js @@ -31,8 +31,7 @@ export var Clazz = /*#__PURE__*/ function() { _createClass(Clazz, null, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return Clazz; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.2.minified.js index 1022a3d152b..e04b3d984e8 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStaticMethodAugmentation_es5.2.minified.js @@ -14,8 +14,7 @@ export var Clazz = function() { })(Constructor = Clazz, [ { key: "method", - value: function() { - } + value: function() {} } ]), Clazz; }(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.1.normal.js index 36ea7ca7030..0b96af024d5 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.1.normal.js @@ -8,11 +8,9 @@ class Handler { static get OPTIONS() { return 1; } - process() { - } + process() {} } -Handler.statische = function() { -}; +Handler.statische = function() {}; const Strings = { a: "A", b: "B" diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.2.minified.js index c14a723530d..5de7aa4c418 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es2015.2.minified.js @@ -2,11 +2,9 @@ class Handler { static get OPTIONS() { return 1; } - process() { - } + process() {} } -Handler.statische = function() { -}, module.exports = Handler, module.exports.Strings = { +Handler.statische = function() {}, module.exports = Handler, module.exports.Strings = { a: "A", b: "B" } /** diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.1.normal.js index 05111da079e..871f1933213 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.1.normal.js @@ -31,8 +31,7 @@ var Handler = // @allowJs: true _createClass(Handler, [ { key: "process", - value: function process() { - } + value: function process() {} } ], [ { @@ -44,8 +43,7 @@ var Handler = // @allowJs: true ]); return Handler; }(); -Handler.statische = function() { -}; +Handler.statische = function() {}; var Strings = { a: "A", b: "B" diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.2.minified.js index 9712766f7a3..839ff6ebdaa 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic_es5.2.minified.js @@ -22,13 +22,11 @@ var Handler = function() { ], protoProps = [ { key: "process", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Handler).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Handler; }(); -Handler.statische = function() { -}, module.exports = Handler, module.exports.Strings = { +Handler.statische = function() {}, module.exports = Handler, module.exports.Strings = { a: "A", b: "B" } /** diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.1.normal.js index cfdd443c3d5..e4f1329d312 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.2.minified.js index 4fffa17a86b..34a5cc76f3d 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.1.normal.js index 95990dde19d..8b2b8556d8b 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.1.normal.js @@ -17,8 +17,7 @@ export class D { /** * @param {number} a * @param {number} b - */ constructor(a, b){ - } + */ constructor(a, b){} } /** * @template T,U @@ -30,8 +29,7 @@ export class D { } /** * @param {U} _p - */ set f1(_p) { - } + */ set f1(_p) {} /** * @return {U} */ get f2() { @@ -39,8 +37,7 @@ export class D { } /** * @param {U} _p - */ set f3(_p) { - } + */ set f3(_p) {} /** * @return {string} */ static get s1() { @@ -48,8 +45,7 @@ export class D { } /** * @param {string} _p - */ static set s1(_p) { - } + */ static set s1(_p) {} /** * @return {string} */ static get s2() { @@ -57,8 +53,7 @@ export class D { } /** * @param {string} _p - */ static set s3(_p) { - } + */ static set s3(_p) {} /** * @param {T} a * @param {U} b @@ -80,8 +75,7 @@ E.staticInitializedField = 12; /** * @param {T} a * @param {U} b - */ constructor(a, b){ - } + */ constructor(a, b){} } class G { } @@ -136,10 +130,8 @@ var x = /** @type {*} */ (null); export class VariableBase extends x { } export class HasStatics { - static staticMethod() { - } + static staticMethod() {} } export class ExtendsStatics extends HasStatics { - static also() { - } + static also() {} } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.2.minified.js index 3de449e7f99..114456459f5 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es2015.2.minified.js @@ -8,30 +8,25 @@ export class C { C.Cls = class { }; export class D { - constructor(a, b){ - } + constructor(a, b){} } export class E { get f1() { return null; } - set f1(_p) { - } + set f1(_p) {} get f2() { return null; } - set f3(_p) { - } + set f3(_p) {} static get s1() { return ""; } - static set s1(_p) { - } + static set s1(_p) {} static get s2() { return ""; } - static set s3(_p) { - } + static set s3(_p) {} constructor(a, b){ this.initializedField = 12; } @@ -41,8 +36,7 @@ export class F { static create(a, b) { return new F(a, b); } - constructor(a, b){ - } + constructor(a, b){} } class G { } @@ -84,10 +78,8 @@ export class O extends N { export class VariableBase extends null { } export class HasStatics { - static staticMethod() { - } + static staticMethod() {} } export class ExtendsStatics extends HasStatics { - static also() { - } + static also() {} } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.1.normal.js index df910d33995..f21d26782dc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -128,8 +127,7 @@ export var D = function D(a, b) { }, set: /** * @param {U} _p - */ function set(_p) { - } + */ function set(_p) {} }, { key: "f2", @@ -143,8 +141,7 @@ export var D = function D(a, b) { key: "f3", set: /** * @param {U} _p - */ function set(_p) { - } + */ function set(_p) {} } ], [ { @@ -156,8 +153,7 @@ export var D = function D(a, b) { }, set: /** * @param {string} _p - */ function set(_p) { - } + */ function set(_p) {} }, { key: "s2", @@ -171,8 +167,7 @@ export var D = function D(a, b) { key: "s3", set: /** * @param {string} _p - */ function set(_p) { - } + */ function set(_p) {} } ]); return E; @@ -308,8 +303,7 @@ export var HasStatics = /*#__PURE__*/ function() { _createClass(HasStatics, null, [ { key: "staticMethod", - value: function staticMethod() { - } + value: function staticMethod() {} } ]); return HasStatics; @@ -325,8 +319,7 @@ export var ExtendsStatics = /*#__PURE__*/ function(HasStatics) { _createClass(ExtendsStatics, null, [ { key: "also", - value: function also() { - } + value: function also() {} } ]); return ExtendsStatics; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.2.minified.js index 32bd27f488d..d551e5ea660 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClasses_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -92,8 +91,7 @@ export var E = function() { get: function() { return null; }, - set: function(_p) { - } + set: function(_p) {} }, { key: "f2", @@ -103,8 +101,7 @@ export var E = function() { }, { key: "f3", - set: function(_p) { - } + set: function(_p) {} } ], [ { @@ -112,8 +109,7 @@ export var E = function() { get: function() { return ""; }, - set: function(_p) { - } + set: function(_p) {} }, { key: "s2", @@ -123,8 +119,7 @@ export var E = function() { }, { key: "s3", - set: function(_p) { - } + set: function(_p) {} } ]), E; }(); @@ -231,8 +226,7 @@ export var HasStatics = function() { return _createClass(HasStatics, null, [ { key: "staticMethod", - value: function() { - } + value: function() {} } ]), HasStatics; }(); @@ -246,8 +240,7 @@ export var ExtendsStatics = function(HasStatics) { return _createClass(ExtendsStatics, null, [ { key: "also", - value: function() { - } + value: function() {} } ]), ExtendsStatics; }(HasStatics); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js index 2dc5319ec04..913dd805168 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js @@ -27,12 +27,10 @@ var _key, _key1; var TopLevelSym = Symbol(); var InnerSym = Symbol(); var _obj; -module.exports = (_obj = { -}, _defineProperty(_obj, TopLevelSym, function() { +module.exports = (_obj = {}, _defineProperty(_obj, TopLevelSym, function() { var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 12; return x; -}), _defineProperty(_obj, "items", _defineProperty({ -}, InnerSym, function() { +}), _defineProperty(_obj, "items", _defineProperty({}, InnerSym, function() { var arg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { x: 12 }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js index 9518202be78..abcb473bc82 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js @@ -7,12 +7,10 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } var _key, _key1, _obj, TopLevelSym = Symbol(), InnerSym = Symbol(); -module.exports = (_defineProperty(_obj = { -}, TopLevelSym, function() { +module.exports = (_defineProperty(_obj = {}, TopLevelSym, function() { var x = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 12; return x; -}), _defineProperty(_obj, "items", _defineProperty({ -}, InnerSym, function() { +}), _defineProperty(_obj, "items", _defineProperty({}, InnerSym, function() { var arg = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { x: 12 }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.1.normal.js index 5f7e11d5af3..9e9a19164c4 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.1.normal.js @@ -9,6 +9,5 @@ const m = require("./exporter"); module.exports = m.default; module.exports.memberName = "thing"; // @filename: exporter.js -function validate() { -} +function validate() {} export default validate; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js index 9e4fe1e0901..a8021c15ed6 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js @@ -1,4 +1,3 @@ const m = require("./exporter"); module.exports = m.default, module.exports.memberName = "thing"; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.1.normal.js index 9624c88f420..9de58368c17 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.1.normal.js @@ -9,6 +9,5 @@ var m = require("./exporter"); module.exports = m.default; module.exports.memberName = "thing"; // @filename: exporter.js -function validate() { -} +function validate() {} export default validate; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.2.minified.js index dc58548317d..6d9232b48a4 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es5.2.minified.js @@ -1,4 +1,3 @@ var m = require("./exporter"); module.exports = m.default, module.exports.memberName = "thing"; -export default function() { -}; +export default function() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js index 90d800ffdc0..0cdfcc79302 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js @@ -36,5 +36,4 @@ export default 12; * @typedef {string | number} default */ // @filename: index6.js // merge type alias and function (OK) -export default function func() { -}; +export default function func() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js index e2a90ca77a0..06313975e9b 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js @@ -19,5 +19,4 @@ export default class extends Fab { } }; export default 12; -export default function func() { -}; +export default function func() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js index ced51160cb1..341427b6a30 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js @@ -51,8 +51,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -114,5 +113,4 @@ export default 12; * @typedef {string | number} default */ // @filename: index6.js // merge type alias and function (OK) -export default function func() { -}; +export default function func() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js index a61b08423c4..1526a02447b 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js @@ -43,8 +43,7 @@ var Bar = function(Fab1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -69,5 +68,4 @@ var Bar = function(Fab1) { }(Fab); export default Bar; export default 12; -export default function func() { -}; +export default function func() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.1.normal.js index f36539b29b8..35cd69a22ad 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.1.normal.js @@ -1,59 +1,44 @@ export var A; -(function(A) { -})(A || (A = { -})); +(function(A) {})(A || (A = {})); export var B; (function(B) { B[B["Member"] = 0] = "Member"; -})(B || (B = { -})); +})(B || (B = {})); var C; -(function(C) { -})(C || (C = { -})); +(function(C) {})(C || (C = {})); export { C }; var DD; -(function(DD) { -})(DD || (DD = { -})); +(function(DD) {})(DD || (DD = {})); export { DD as D }; export var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); export { E as EE }; export { F as FF }; export var F; -(function(F) { -})(F || (F = { -})); +(function(F) {})(F || (F = {})); export var G; (function(G) { G[G["A"] = 1] = "A"; G[G["B"] = 2] = "B"; G[G["C"] = 3] = "C"; -})(G || (G = { -})); +})(G || (G = {})); export var H; (function(H) { H["A"] = "a"; H["B"] = "b"; -})(H || (H = { -})); +})(H || (H = {})); export var I; (function(I) { I[I["A"] = "a"] = "a"; I[I["B"] = 0] = 0; I[I["C"] = 1] = "C"; -})(I || (I = { -})); +})(I || (I = {})); export var J; (function(J) { J[J["A"] = 1] = "A"; J[J["B"] = 2] = "B"; J[J["C"] = 3] = "C"; -})(J || (J = { -})); +})(J || (J = {})); export var K; (function(K) { K[K["None"] = 0] = "None"; @@ -61,8 +46,7 @@ export var K; K[K["B"] = 2] = "B"; K[K["C"] = 4] = "C"; K[K["Mask"] = 7] = "Mask"; -})(K || (K = { -})); +})(K || (K = {})); export var L; (function(L) { L[L["None"] = 0] = "None"; @@ -70,5 +54,4 @@ export var L; L[L["B"] = 2] = "B"; L[L["C"] = 4] = "C"; L[L["Mask"] = 7] = "Mask"; -})(L || (L = { -})); +})(L || (L = {})); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.2.minified.js index 47bf00fe379..05b312c9ffb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es2015.2.minified.js @@ -1,14 +1,7 @@ var B, C, DD, E, F, G, H, I, J, K, L, B, G, H, I, J, K, L; -(B = B || (B = { -}))[B.Member = 0] = "Member"; +(B = B || (B = {}))[B.Member = 0] = "Member"; export { C }; export { DD as D }; export { E as EE }; export { F as FF }; -(G = G || (G = { -}))[G.A = 1] = "A", G[G.B = 2] = "B", G[G.C = 3] = "C", (H = H || (H = { -})).A = "a", H.B = "b", (I = I || (I = { -}))[I.A = "a"] = "a", I[I.B = 0] = 0, I[I.C = 1] = "C", (J = J || (J = { -}))[J.A = 1] = "A", J[J.B = 2] = "B", J[J.C = 3] = "C", (K = K || (K = { -}))[K.None = 0] = "None", K[K.A = 1] = "A", K[K.B = 2] = "B", K[K.C = 4] = "C", K[K.Mask = 7] = "Mask", (L = L || (L = { -}))[L.None = 0] = "None", L[L.A = 1] = "A", L[L.B = 2] = "B", L[L.C = 4] = "C", L[L.Mask = 7] = "Mask"; +(G = G || (G = {}))[G.A = 1] = "A", G[G.B = 2] = "B", G[G.C = 3] = "C", (H = H || (H = {})).A = "a", H.B = "b", (I = I || (I = {}))[I.A = "a"] = "a", I[I.B = 0] = 0, I[I.C = 1] = "C", (J = J || (J = {}))[J.A = 1] = "A", J[J.B = 2] = "B", J[J.C = 3] = "C", (K = K || (K = {}))[K.None = 0] = "None", K[K.A = 1] = "A", K[K.B = 2] = "B", K[K.C = 4] = "C", K[K.Mask = 7] = "Mask", (L = L || (L = {}))[L.None = 0] = "None", L[L.A = 1] = "A", L[L.B = 2] = "B", L[L.C = 4] = "C", L[L.Mask = 7] = "Mask"; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.1.normal.js index f36539b29b8..35cd69a22ad 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.1.normal.js @@ -1,59 +1,44 @@ export var A; -(function(A) { -})(A || (A = { -})); +(function(A) {})(A || (A = {})); export var B; (function(B) { B[B["Member"] = 0] = "Member"; -})(B || (B = { -})); +})(B || (B = {})); var C; -(function(C) { -})(C || (C = { -})); +(function(C) {})(C || (C = {})); export { C }; var DD; -(function(DD) { -})(DD || (DD = { -})); +(function(DD) {})(DD || (DD = {})); export { DD as D }; export var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); export { E as EE }; export { F as FF }; export var F; -(function(F) { -})(F || (F = { -})); +(function(F) {})(F || (F = {})); export var G; (function(G) { G[G["A"] = 1] = "A"; G[G["B"] = 2] = "B"; G[G["C"] = 3] = "C"; -})(G || (G = { -})); +})(G || (G = {})); export var H; (function(H) { H["A"] = "a"; H["B"] = "b"; -})(H || (H = { -})); +})(H || (H = {})); export var I; (function(I) { I[I["A"] = "a"] = "a"; I[I["B"] = 0] = 0; I[I["C"] = 1] = "C"; -})(I || (I = { -})); +})(I || (I = {})); export var J; (function(J) { J[J["A"] = 1] = "A"; J[J["B"] = 2] = "B"; J[J["C"] = 3] = "C"; -})(J || (J = { -})); +})(J || (J = {})); export var K; (function(K) { K[K["None"] = 0] = "None"; @@ -61,8 +46,7 @@ export var K; K[K["B"] = 2] = "B"; K[K["C"] = 4] = "C"; K[K["Mask"] = 7] = "Mask"; -})(K || (K = { -})); +})(K || (K = {})); export var L; (function(L) { L[L["None"] = 0] = "None"; @@ -70,5 +54,4 @@ export var L; L[L["B"] = 2] = "B"; L[L["C"] = 4] = "C"; L[L["Mask"] = 7] = "Mask"; -})(L || (L = { -})); +})(L || (L = {})); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.2.minified.js index 47bf00fe379..05b312c9ffb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsEnums_es5.2.minified.js @@ -1,14 +1,7 @@ var B, C, DD, E, F, G, H, I, J, K, L, B, G, H, I, J, K, L; -(B = B || (B = { -}))[B.Member = 0] = "Member"; +(B = B || (B = {}))[B.Member = 0] = "Member"; export { C }; export { DD as D }; export { E as EE }; export { F as FF }; -(G = G || (G = { -}))[G.A = 1] = "A", G[G.B = 2] = "B", G[G.C = 3] = "C", (H = H || (H = { -})).A = "a", H.B = "b", (I = I || (I = { -}))[I.A = "a"] = "a", I[I.B = 0] = 0, I[I.C = 1] = "C", (J = J || (J = { -}))[J.A = 1] = "A", J[J.B = 2] = "B", J[J.C = 3] = "C", (K = K || (K = { -}))[K.None = 0] = "None", K[K.A = 1] = "A", K[K.B = 2] = "B", K[K.C = 4] = "C", K[K.Mask = 7] = "Mask", (L = L || (L = { -}))[L.None = 0] = "None", L[L.A = 1] = "A", L[L.B = 2] = "B", L[L.C = 4] = "C", L[L.Mask = 7] = "Mask"; +(G = G || (G = {}))[G.A = 1] = "A", G[G.B = 2] = "B", G[G.C = 3] = "C", (H = H || (H = {})).A = "a", H.B = "b", (I = I || (I = {}))[I.A = "a"] = "a", I[I.B = 0] = 0, I[I.C = 1] = "C", (J = J || (J = {}))[J.A = 1] = "A", J[J.B = 2] = "B", J[J.C = 3] = "C", (K = K || (K = {}))[K.None = 0] = "None", K[K.A = 1] = "A", K[K.B = 2] = "B", K[K.C = 4] = "C", K[K.Mask = 7] = "Mask", (L = L || (L = {}))[L.None = 0] = "None", L[L.A = 1] = "A", L[L.B = 2] = "B", L[L.C = 4] = "C", L[L.Mask = 7] = "Mask"; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.1.normal.js index 3a8d0801379..ff07818cdcf 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.1.normal.js @@ -12,5 +12,4 @@ module.exports.Sub = function() { this.instance = new module.exports(10); }; -module.exports.Sub.prototype = { -}; +module.exports.Sub.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.2.minified.js index 02910fd4dc7..8c3ee6c45da 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es2015.2.minified.js @@ -2,5 +2,4 @@ module.exports = function(p) { this.t = 12 + p; }, module.exports.Sub = function() { this.instance = new module.exports(10); -}, module.exports.Sub.prototype = { -}; +}, module.exports.Sub.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.1.normal.js index 3a8d0801379..ff07818cdcf 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.1.normal.js @@ -12,5 +12,4 @@ module.exports.Sub = function() { this.instance = new module.exports(10); }; -module.exports.Sub.prototype = { -}; +module.exports.Sub.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.2.minified.js index 02910fd4dc7..8c3ee6c45da 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunctionWithSub_es5.2.minified.js @@ -2,5 +2,4 @@ module.exports = function(p) { this.t = 12 + p; }, module.exports.Sub = function() { this.instance = new module.exports(10); -}, module.exports.Sub.prototype = { -}; +}, module.exports.Sub.prototype = {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.1.normal.js index 050e9767b9e..ef60d90f415 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.1.normal.js @@ -8,6 +8,5 @@ this.x = 1; }; module.exports.MyClass.prototype = { - a: function() { - } + a: function() {} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.2.minified.js index f7ae3f0acd2..f530085aedb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es2015.2.minified.js @@ -1,6 +1,5 @@ module.exports.MyClass = function() { this.x = 1; }, module.exports.MyClass.prototype = { - a: function() { - } + a: function() {} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.1.normal.js index 5f158cde113..21d20e22a1f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.1.normal.js @@ -8,6 +8,5 @@ this.x = 1; }; module.exports.MyClass.prototype = { - a: function a() { - } + a: function a() {} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.2.minified.js index f7ae3f0acd2..f530085aedb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedConstructorFunction_es5.2.minified.js @@ -1,6 +1,5 @@ module.exports.MyClass = function() { this.x = 1; }, module.exports.MyClass.prototype = { - a: function() { - } + a: function() {} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.1.normal.js index f80b23b38cc..49cc0c0350a 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.1.normal.js @@ -4,12 +4,10 @@ // @declaration: true // @filename: index.js Object.defineProperty(module.exports, "a", { - value: function a() { - } + value: function a() {} }); Object.defineProperty(module.exports, "b", { - value: function b() { - } + value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" @@ -66,8 +64,7 @@ Object.defineProperty(module.exports, "h", { value: hh }); Object.defineProperty(module.exports, "i", { - value: function i() { - } + value: function i() {} }); Object.defineProperty(module.exports, "ii", { value: module.exports.i @@ -77,6 +74,5 @@ Object.defineProperty(module.exports, "jj", { value: module.exports.j }); Object.defineProperty(module.exports, "j", { - value: function j() { - } + value: function j() {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.2.minified.js index 00ad80737f8..8d419878ce0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es2015.2.minified.js @@ -1,9 +1,7 @@ Object.defineProperty(module.exports, "a", { - value: function() { - } + value: function() {} }), Object.defineProperty(module.exports, "b", { - value: function() { - } + value: function() {} }), Object.defineProperty(module.exports.b, "cat", { value: "cat" }), Object.defineProperty(module.exports, "d", { @@ -29,13 +27,11 @@ Object.defineProperty(module.exports, "a", { return a.x && b.y(); } }), Object.defineProperty(module.exports, "i", { - value: function() { - } + value: function() {} }), Object.defineProperty(module.exports, "ii", { value: module.exports.i }), Object.defineProperty(module.exports, "jj", { value: module.exports.j }), Object.defineProperty(module.exports, "j", { - value: function() { - } + value: function() {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.1.normal.js index f80b23b38cc..49cc0c0350a 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.1.normal.js @@ -4,12 +4,10 @@ // @declaration: true // @filename: index.js Object.defineProperty(module.exports, "a", { - value: function a() { - } + value: function a() {} }); Object.defineProperty(module.exports, "b", { - value: function b() { - } + value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" @@ -66,8 +64,7 @@ Object.defineProperty(module.exports, "h", { value: hh }); Object.defineProperty(module.exports, "i", { - value: function i() { - } + value: function i() {} }); Object.defineProperty(module.exports, "ii", { value: module.exports.i @@ -77,6 +74,5 @@ Object.defineProperty(module.exports, "jj", { value: module.exports.j }); Object.defineProperty(module.exports, "j", { - value: function j() { - } + value: function j() {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.2.minified.js index 00ad80737f8..8d419878ce0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportDefinePropertyEmit_es5.2.minified.js @@ -1,9 +1,7 @@ Object.defineProperty(module.exports, "a", { - value: function() { - } + value: function() {} }), Object.defineProperty(module.exports, "b", { - value: function() { - } + value: function() {} }), Object.defineProperty(module.exports.b, "cat", { value: "cat" }), Object.defineProperty(module.exports, "d", { @@ -29,13 +27,11 @@ Object.defineProperty(module.exports, "a", { return a.x && b.y(); } }), Object.defineProperty(module.exports, "i", { - value: function() { - } + value: function() {} }), Object.defineProperty(module.exports, "ii", { value: module.exports.i }), Object.defineProperty(module.exports, "jj", { value: module.exports.j }), Object.defineProperty(module.exports, "j", { - value: function() { - } + value: function() {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js index f7d18bbaa33..d96014bf4dc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js @@ -18,8 +18,7 @@ import "./bar2"; export class Foo { } // @filename: func.js -export function func() { -} +export function func() {} // @filename: bar.js export * from "./cls"; // @filename: bar2.js diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js index edc28633a2f..59b70ee2286 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js @@ -10,8 +10,7 @@ import "./bar"; import "./bar2"; export class Foo { } -export function func() { -} +export function func() {} export * from "./cls"; export * from "./func"; export * from "./cls"; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js index c3c65ef628c..2361eaff688 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js @@ -25,8 +25,7 @@ export var Foo = function Foo() { _classCallCheck(this, Foo); }; // @filename: func.js -export function func() { -} +export function func() {} // @filename: bar.js export * from "./cls"; // @filename: bar2.js diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js index b682e6994aa..a4752e3df37 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js @@ -14,8 +14,7 @@ export var Foo = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, Foo); }; -export function func() { -} +export function func() {} export * from "./cls"; export * from "./func"; export * from "./cls"; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.1.normal.js index 84bb267f0aa..c5563256862 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.1.normal.js @@ -14,8 +14,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; @@ -107,8 +106,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.2.minified.js index d6d4626a3dd..ac0d2b546eb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases_es5.2.minified.js @@ -4,8 +4,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -69,8 +68,7 @@ var FancyError = function(Error) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.1.normal.js index dccdf754545..2cef68b840f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.1.normal.js @@ -8,16 +8,14 @@ * Foos a bar together using an `a` and a `b` * @param {number} a * @param {string} b - */ export function foo(a, b) { -} + */ export function foo(a, b) {} /** * Legacy - DO NOT USE */ export class Aleph { /** * Doesn't actually do anything * @returns {void} - */ doIt() { - } + */ doIt() {} /** * Impossible to construct. * @param {Aleph} a diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.2.minified.js index 4bf7f101b64..f3f910d0221 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es2015.2.minified.js @@ -1,8 +1,6 @@ -export function foo() { -} +export function foo() {} export class Aleph { - doIt() { - } + doIt() {} constructor(a, b){ this.field = b; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.1.normal.js index d0e7922ff20..408e930a56f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.1.normal.js @@ -27,8 +27,7 @@ function _createClass(Constructor, protoProps, staticProps) { * Foos a bar together using an `a` and a `b` * @param {number} a * @param {string} b - */ export function foo(a, b) { -} + */ export function foo(a, b) {} /** * Legacy - DO NOT USE */ export var Aleph = /*#__PURE__*/ function() { @@ -45,8 +44,7 @@ function _createClass(Constructor, protoProps, staticProps) { * Doesn't actually do anything * @returns {void} */ key: "doIt", - value: function doIt() { - } + value: function doIt() {} } ]); return Aleph; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.2.minified.js index eea47bb266b..0b618b68719 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionJSDoc_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -export function foo() { -} +export function foo() {} export var Aleph = function() { "use strict"; var Constructor, protoProps, staticProps; @@ -17,8 +16,7 @@ export var Aleph = function() { return protoProps = [ { key: "doIt", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Aleph).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Aleph; }(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.1.normal.js index 9d8498b83a0..54c530ac202 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.1.normal.js @@ -4,8 +4,7 @@ // @outDir: ./out // @declaration: true // @filename: source.js -function foo() { -} +function foo() {} // properties foo.x = 1; foo.y = 1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.2.minified.js index e4118428084..774d0e3e1fc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es2015.2.minified.js @@ -1,3 +1,2 @@ -function foo() { -} +function foo() {} foo.x = 1, foo.y = 1, foo.break = 1, foo.case = 1, foo.catch = 1, foo.class = 1, foo.const = 1, foo.continue = 1, foo.debugger = 1, foo.default = 1, foo.delete = 1, foo.do = 1, foo.else = 1, foo.enum = 1, foo.export = 1, foo.extends = 1, foo.false = 1, foo.finally = 1, foo.for = 1, foo.function = 1, foo.if = 1, foo.import = 1, foo.in = 1, foo.instanceof = 1, foo.new = 1, foo.null = 1, foo.return = 1, foo.super = 1, foo.switch = 1, foo.this = 1, foo.throw = 1, foo.true = 1, foo.try = 1, foo.typeof = 1, foo.var = 1, foo.void = 1, foo.while = 1, foo.with = 1, foo.implements = 1, foo.interface = 1, foo.let = 1, foo.package = 1, foo.private = 1, foo.protected = 1, foo.public = 1, foo.static = 1, foo.yield = 1, foo.abstract = 1, foo.as = 1, foo.asserts = 1, foo.any = 1, foo.async = 1, foo.await = 1, foo.boolean = 1, foo.constructor = 1, foo.declare = 1, foo.get = 1, foo.infer = 1, foo.is = 1, foo.keyof = 1, foo.module = 1, foo.namespace = 1, foo.never = 1, foo.readonly = 1, foo.require = 1, foo.number = 1, foo.object = 1, foo.set = 1, foo.string = 1, foo.symbol = 1, foo.type = 1, foo.undefined = 1, foo.unique = 1, foo.unknown = 1, foo.from = 1, foo.global = 1, foo.bigint = 1, foo.of = 1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.1.normal.js index 9d8498b83a0..54c530ac202 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.1.normal.js @@ -4,8 +4,7 @@ // @outDir: ./out // @declaration: true // @filename: source.js -function foo() { -} +function foo() {} // properties foo.x = 1; foo.y = 1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.2.minified.js index e4118428084..774d0e3e1fc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordPropExhaustive_es5.2.minified.js @@ -1,3 +1,2 @@ -function foo() { -} +function foo() {} foo.x = 1, foo.y = 1, foo.break = 1, foo.case = 1, foo.catch = 1, foo.class = 1, foo.const = 1, foo.continue = 1, foo.debugger = 1, foo.default = 1, foo.delete = 1, foo.do = 1, foo.else = 1, foo.enum = 1, foo.export = 1, foo.extends = 1, foo.false = 1, foo.finally = 1, foo.for = 1, foo.function = 1, foo.if = 1, foo.import = 1, foo.in = 1, foo.instanceof = 1, foo.new = 1, foo.null = 1, foo.return = 1, foo.super = 1, foo.switch = 1, foo.this = 1, foo.throw = 1, foo.true = 1, foo.try = 1, foo.typeof = 1, foo.var = 1, foo.void = 1, foo.while = 1, foo.with = 1, foo.implements = 1, foo.interface = 1, foo.let = 1, foo.package = 1, foo.private = 1, foo.protected = 1, foo.public = 1, foo.static = 1, foo.yield = 1, foo.abstract = 1, foo.as = 1, foo.asserts = 1, foo.any = 1, foo.async = 1, foo.await = 1, foo.boolean = 1, foo.constructor = 1, foo.declare = 1, foo.get = 1, foo.infer = 1, foo.is = 1, foo.keyof = 1, foo.module = 1, foo.namespace = 1, foo.never = 1, foo.readonly = 1, foo.require = 1, foo.number = 1, foo.object = 1, foo.set = 1, foo.string = 1, foo.symbol = 1, foo.type = 1, foo.undefined = 1, foo.unique = 1, foo.unknown = 1, foo.from = 1, foo.global = 1, foo.bigint = 1, foo.of = 1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.1.normal.js index f060f41b082..7b94f37d76c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.1.normal.js @@ -4,14 +4,11 @@ // @outDir: ./out // @declaration: true // @filename: source.js -function foo() { -} +function foo() {} foo.null = true; -function bar() { -} +function bar() {} bar.async = true; bar.normal = false; -function baz() { -} +function baz() {} baz.class = true; baz.normal = false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.2.minified.js index 02268f10bc6..8ef9295bc7c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es2015.2.minified.js @@ -1,6 +1,3 @@ -function bar() { -} -function baz() { -} -(function() { -}).null = !0, bar.async = !0, bar.normal = !1, baz.class = !0, baz.normal = !1; +function bar() {} +function baz() {} +(function() {}).null = !0, bar.async = !0, bar.normal = !1, baz.class = !0, baz.normal = !1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js index f060f41b082..7b94f37d76c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js @@ -4,14 +4,11 @@ // @outDir: ./out // @declaration: true // @filename: source.js -function foo() { -} +function foo() {} foo.null = true; -function bar() { -} +function bar() {} bar.async = true; bar.normal = false; -function baz() { -} +function baz() {} baz.class = true; baz.normal = false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.2.minified.js index 02268f10bc6..8ef9295bc7c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.2.minified.js @@ -1,6 +1,3 @@ -function bar() { -} -function baz() { -} -(function() { -}).null = !0, bar.async = !0, bar.normal = !1, baz.class = !0, baz.normal = !1; +function bar() {} +function baz() {} +(function() {}).null = !0, bar.async = !0, bar.normal = !1, baz.class = !0, baz.normal = !1; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.1.normal.js index 0b59c02b003..35af0d3e14f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.1.normal.js @@ -5,12 +5,9 @@ // @declaration: true // @filename: source.js module.exports = MyClass; -function MyClass() { -} -MyClass.staticMethod = function() { -}; -MyClass.prototype.method = function() { -}; +function MyClass() {} +MyClass.staticMethod = function() {}; +MyClass.prototype.method = function() {}; MyClass.staticProperty = 123; /** * Callback to be invoked when test execution is complete. * diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.2.minified.js index 92d7b45d246..32b76c3a20e 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es2015.2.minified.js @@ -1,5 +1,2 @@ -function MyClass() { -} -module.exports = MyClass, MyClass.staticMethod = function() { -}, MyClass.prototype.method = function() { -}, MyClass.staticProperty = 123; +function MyClass() {} +module.exports = MyClass, MyClass.staticMethod = function() {}, MyClass.prototype.method = function() {}, MyClass.staticProperty = 123; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.1.normal.js index 0b59c02b003..35af0d3e14f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.1.normal.js @@ -5,12 +5,9 @@ // @declaration: true // @filename: source.js module.exports = MyClass; -function MyClass() { -} -MyClass.staticMethod = function() { -}; -MyClass.prototype.method = function() { -}; +function MyClass() {} +MyClass.staticMethod = function() {}; +MyClass.prototype.method = function() {}; MyClass.staticProperty = 123; /** * Callback to be invoked when test execution is complete. * diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.2.minified.js index 92d7b45d246..32b76c3a20e 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionPrototypeStatic_es5.2.minified.js @@ -1,5 +1,2 @@ -function MyClass() { -} -module.exports = MyClass, MyClass.staticMethod = function() { -}, MyClass.prototype.method = function() { -}, MyClass.staticProperty = 123; +function MyClass() {} +module.exports = MyClass, MyClass.staticMethod = function() {}, MyClass.prototype.method = function() {}, MyClass.staticProperty = 123; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.1.normal.js index bbeb3cc1568..f3ac322e11f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.1.normal.js @@ -3,8 +3,7 @@ // @outDir: ./out // @declaration: true // @filename: index.js -function foo() { -} +function foo() {} foo.foo = foo; foo.default = foo; module.exports = foo; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.2.minified.js index 735f06b2c97..491c051ac97 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es2015.2.minified.js @@ -1,3 +1,2 @@ -function foo() { -} +function foo() {} foo.foo = foo, foo.default = foo, module.exports = foo; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.1.normal.js index bbeb3cc1568..f3ac322e11f 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.1.normal.js @@ -3,8 +3,7 @@ // @outDir: ./out // @declaration: true // @filename: index.js -function foo() { -} +function foo() {} foo.foo = foo; foo.default = foo; module.exports = foo; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.2.minified.js index 735f06b2c97..491c051ac97 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionWithDefaultAssignedMember_es5.2.minified.js @@ -1,3 +1,2 @@ -function foo() { -} +function foo() {} foo.foo = foo, foo.default = foo, module.exports = foo; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.1.normal.js index ad37e769af7..d76fca4067a 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.1.normal.js @@ -3,13 +3,10 @@ // @outDir: ./out // @declaration: true // @filename: index.js -module.exports.a = function a() { -}; -module.exports.b = function b() { -}; +module.exports.a = function a() {}; +module.exports.b = function b() {}; module.exports.b.cat = "cat"; -module.exports.c = function c() { -}; +module.exports.c = function c() {}; module.exports.c.Cls = class { }; /** @@ -48,10 +45,8 @@ module.exports.g = g; return a.x && b.y(); } module.exports.h = hh; -module.exports.i = function i() { -}; +module.exports.i = function i() {}; module.exports.ii = module.exports.i; // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings module.exports.jj = module.exports.j; -module.exports.j = function j() { -}; +module.exports.j = function j() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.2.minified.js index a02d7f0ec86..42c4fe2b950 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es2015.2.minified.js @@ -1,7 +1,4 @@ -module.exports.a = function() { -}, module.exports.b = function() { -}, module.exports.b.cat = "cat", module.exports.c = function() { -}, module.exports.c.Cls = class { +module.exports.a = function() {}, module.exports.b = function() {}, module.exports.b.cat = "cat", module.exports.c = function() {}, module.exports.c.Cls = class { }, module.exports.d = function(a, b) { return null; }, module.exports.e = function(a, b) { @@ -12,6 +9,4 @@ module.exports.a = function() { return a.x && b.y(); }, module.exports.h = function(a, b) { return a.x && b.y(); -}, module.exports.i = function() { -}, module.exports.ii = module.exports.i, module.exports.jj = module.exports.j, module.exports.j = function() { -}; +}, module.exports.i = function() {}, module.exports.ii = module.exports.i, module.exports.jj = module.exports.j, module.exports.j = function() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.1.normal.js index 5dde042256f..2d771c6813c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.1.normal.js @@ -8,13 +8,10 @@ function _classCallCheck(instance, Constructor) { // @outDir: ./out // @declaration: true // @filename: index.js -module.exports.a = function a() { -}; -module.exports.b = function b() { -}; +module.exports.a = function a() {}; +module.exports.b = function b() {}; module.exports.b.cat = "cat"; -module.exports.c = function c() { -}; +module.exports.c = function c() {}; module.exports.c.Cls = function _class() { "use strict"; _classCallCheck(this, _class); @@ -55,10 +52,8 @@ module.exports.g = g; return a.x && b.y(); } module.exports.h = hh; -module.exports.i = function i() { -}; +module.exports.i = function i() {}; module.exports.ii = module.exports.i; // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings module.exports.jj = module.exports.j; -module.exports.j = function j() { -}; +module.exports.j = function j() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.2.minified.js index c791e6b8f6e..1469c88d071 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionsCjs_es5.2.minified.js @@ -1,7 +1,4 @@ -module.exports.a = function() { -}, module.exports.b = function() { -}, module.exports.b.cat = "cat", module.exports.c = function() { -}, module.exports.c.Cls = function _class() { +module.exports.a = function() {}, module.exports.b = function() {}, module.exports.b.cat = "cat", module.exports.c = function() {}, module.exports.c.Cls = function _class() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); @@ -16,6 +13,4 @@ module.exports.a = function() { return a.x && b.y(); }, module.exports.h = function(a, b) { return a.x && b.y(); -}, module.exports.i = function() { -}, module.exports.ii = module.exports.i, module.exports.jj = module.exports.j, module.exports.j = function() { -}; +}, module.exports.i = function() {}, module.exports.ii = module.exports.i, module.exports.jj = module.exports.j, module.exports.j = function() {}; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.1.normal.js index 71856e119ea..5b33c7ecc74 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.1.normal.js @@ -3,13 +3,10 @@ // @outDir: ./out // @declaration: true // @filename: index.js -export function a() { -} -export function b() { -} +export function a() {} +export function b() {} b.cat = "cat"; -export function c() { -} +export function c() {} c.Cls = class { }; /** @@ -48,9 +45,7 @@ export { g }; return a3.x && b2.y(); } export { hh as h }; -export function i() { -} +export function i() {} export { i as ii }; export { j as jj }; -export function j() { -} +export function j() {} diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.2.minified.js index 22d17dbb593..41c375c4873 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es2015.2.minified.js @@ -1,10 +1,7 @@ -export function a() { -} -export function b() { -} +export function a() {} +export function b() {} b.cat = "cat"; -export function c() { -} +export function c() {} c.Cls = class { }; export function d() { @@ -25,9 +22,7 @@ function hh(a3, b2) { return a3.x && b2.y(); } export { hh as h }; -export function i() { -} +export function i() {} export { i as ii }; export { j as jj }; -export function j() { -} +export function j() {} diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.1.normal.js index bc596e2ac09..7900827d7a1 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.1.normal.js @@ -8,13 +8,10 @@ function _classCallCheck(instance, Constructor) { // @outDir: ./out // @declaration: true // @filename: index.js -export function a() { -} -export function b() { -} +export function a() {} +export function b() {} b.cat = "cat"; -export function c() { -} +export function c() {} c.Cls = function _class() { "use strict"; _classCallCheck(this, _class); @@ -55,9 +52,7 @@ export { g }; return a3.x && b2.y(); } export { hh as h }; -export function i() { -} +export function i() {} export { i as ii }; export { j as jj }; -export function j() { -} +export function j() {} diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.2.minified.js index 761f09df722..80fa2c35ccc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctions_es5.2.minified.js @@ -1,10 +1,7 @@ -export function a() { -} -export function b() { -} +export function a() {} +export function b() {} b.cat = "cat"; -export function c() { -} +export function c() {} c.Cls = function _class() { "use strict"; !function(instance, Constructor) { @@ -29,9 +26,7 @@ function hh(a3, b2) { return a3.x && b2.y(); } export { hh as h }; -export function i() { -} +export function i() {} export { i as ii }; export { j as jj }; -export function j() { -} +export function j() {} diff --git a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.1.normal.js index bfccac0d957..6bb98fdf4a0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.1.normal.js @@ -12,15 +12,13 @@ export class A { export class B { /** * @param {number} _arg - */ set x(_arg) { - } + */ set x(_arg) {} } export class C { get x() { return 12; } - set x(_arg) { - } + set x(_arg) {} } export class D { } @@ -34,8 +32,7 @@ export class E { Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg - */ set (_arg) { - } + */ set (_arg) {} }); export class F { } @@ -45,6 +42,5 @@ Object.defineProperty(F.prototype, "x", { }, /** * @param {number} _arg - */ set (_arg) { - } + */ set (_arg) {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.2.minified.js index eb21e31f7ed..6cf8c635858 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es2015.2.minified.js @@ -4,15 +4,13 @@ export class A { } } export class B { - set x(_arg) { - } + set x(_arg) {} } export class C { get x() { return 12; } - set x(_arg) { - } + set x(_arg) {} } export class D { } @@ -24,8 +22,7 @@ Object.defineProperty(D.prototype, "x", { export class E { } Object.defineProperty(E.prototype, "x", { - set (_arg) { - } + set (_arg) {} }); export class F { } @@ -33,6 +30,5 @@ Object.defineProperty(F.prototype, "x", { get () { return 12; }, - set (_arg) { - } + set (_arg) {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.1.normal.js index 7e74b30b7c9..7c968e98b5d 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.1.normal.js @@ -48,8 +48,7 @@ export var B = /*#__PURE__*/ function() { key: "x", set: /** * @param {number} _arg - */ function set(_arg) { - } + */ function set(_arg) {} } ]); return B; @@ -65,8 +64,7 @@ export var C = /*#__PURE__*/ function() { get: function get() { return 12; }, - set: function set(_arg) { - } + set: function set(_arg) {} } ]); return C; @@ -87,8 +85,7 @@ export var E = function E() { Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg - */ set: function set(_arg) { - } + */ set: function set(_arg) {} }); export var F = function F() { "use strict"; @@ -100,6 +97,5 @@ Object.defineProperty(F.prototype, "x", { }, /** * @param {number} _arg - */ set: function set(_arg) { - } + */ set: function set(_arg) {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.2.minified.js index 30c981419f3..42b9364a00b 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsGetterSetter_es5.2.minified.js @@ -32,8 +32,7 @@ export var B = function() { return _createClass(B, [ { key: "x", - set: function(_arg) { - } + set: function(_arg) {} } ]), B; }(); @@ -48,8 +47,7 @@ export var C = function() { get: function() { return 12; }, - set: function(_arg) { - } + set: function(_arg) {} } ]), C; }(); @@ -67,8 +65,7 @@ export var E = function() { _classCallCheck(this, E); }; Object.defineProperty(E.prototype, "x", { - set: function(_arg) { - } + set: function(_arg) {} }); export var F = function() { "use strict"; @@ -78,6 +75,5 @@ Object.defineProperty(F.prototype, "x", { get: function() { return 12; }, - set: function(_arg) { - } + set: function(_arg) {} }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js index 330d0d251b3..4367e1299fc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js @@ -1,11 +1,9 @@ -const myTypes = { -}; +const myTypes = {}; exports.myTypes = myTypes; const { myTypes } = require("./file.js"); module.exports = { testFn: function(input) { return "number" == typeof input ? 2 * input : null; }, - testFnTypes: { - } + testFnTypes: {} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js index 74019cdc8ea..2ab1e098430 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js @@ -1,11 +1,9 @@ -var myTypes = { -}; +var myTypes = {}; exports.myTypes = myTypes; var myTypes = require("./file.js").myTypes; module.exports = { testFn: function(input) { return "number" == typeof input ? 2 * input : null; }, - testFnTypes: { - } + testFnTypes: {} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es2015.1.normal.js index 2cfd793126e..9003b6ff87d 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es2015.1.normal.js @@ -6,9 +6,7 @@ // @filename: file.js /** * @param {Array} x - */ function x(x) { -} + */ function x(x) {} /** * @param {Promise} x - */ function y(x) { -} + */ function y(x) {} diff --git a/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es5.1.normal.js index 2cfd793126e..9003b6ff87d 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsMissingGenerics_es5.1.normal.js @@ -6,9 +6,7 @@ // @filename: file.js /** * @param {Array} x - */ function x(x) { -} + */ function x(x) {} /** * @param {Promise} x - */ function y(x) { -} + */ function y(x) {} diff --git a/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es2015.1.normal.js index 6a91d17e700..7d6c7d139ca 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es2015.1.normal.js @@ -6,8 +6,7 @@ // @filename: file.js /** * @param {Array=} y desc - */ function x(y) { -} + */ function x(y) {} // @ts-ignore /** @param {function (Array)} func Invoked */ function y(func) { diff --git a/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es5.1.normal.js index 6a91d17e700..7d6c7d139ca 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsMissingTypeParameters_es5.1.normal.js @@ -6,8 +6,7 @@ // @filename: file.js /** * @param {Array=} y desc - */ function x(y) { -} + */ function x(y) {} // @ts-ignore /** @param {function (Array)} func Invoked */ function y(func) { diff --git a/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es2015.1.normal.js index b50278fa71d..103d6c507b7 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es2015.1.normal.js @@ -41,8 +41,7 @@ class X { * @param {string?} error.code the error code to send the cancellation with * @returns {Promise.<*>} resolves when the event has been sent. */ cancel({ reason , code }) { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } class Y { @@ -55,7 +54,6 @@ class Y { * @param {string?} error.suberr.code the error code to send the cancellation with * @returns {Promise.<*>} resolves when the event has been sent. */ cancel({ reason , suberr }) { - return _asyncToGenerator(function*() { - })(); + return _asyncToGenerator(function*() {})(); } } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.1.normal.js index 7f6eca65501..ba073352482 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.1.normal.js @@ -5,8 +5,7 @@ // @declaration: true // @filename: base.js class Base { - constructor(){ - } + constructor(){} } const BaseFactory = ()=>{ return new Base(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.2.minified.js index 9bc0f139bf6..3a57e96f469 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit1_es2015.2.minified.js @@ -1,6 +1,5 @@ class Base { - constructor(){ - } + constructor(){} } const BaseFactory = ()=>new Base() ; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.1.normal.js index cfd8e8a33fb..82e2e783066 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.1.normal.js @@ -5,8 +5,7 @@ // @declaration: true // @filename: base.js class Base { - constructor(){ - } + constructor(){} } const BaseFactory = ()=>{ return new Base(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.2.minified.js index 9bc0f139bf6..3a57e96f469 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsParameterTagReusesInputNodeInEmit2_es2015.2.minified.js @@ -1,6 +1,5 @@ class Base { - constructor(){ - } + constructor(){} } const BaseFactory = ()=>new Base() ; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.1.normal.js index 516949948cd..38aeb7f951c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.1.normal.js @@ -7,6 +7,5 @@ export class Clazz { /** * @param {function(this:Object, ...*):*} functionDeclaration - */ method(functionDeclaration) { - } + */ method(functionDeclaration) {} } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.2.minified.js index 4d43b46136f..3aa64aabba7 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es2015.2.minified.js @@ -1,4 +1,3 @@ export class Clazz { - method(functionDeclaration) { - } + method(functionDeclaration) {} } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.1.normal.js index 4bf0302d9b1..864dc46b228 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.1.normal.js @@ -33,8 +33,7 @@ export var Clazz = /*#__PURE__*/ function() { /** * @param {function(this:Object, ...*):*} functionDeclaration */ key: "method", - value: function method(functionDeclaration) { - } + value: function method(functionDeclaration) {} } ]); return Clazz; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.2.minified.js index 27f2260f531..3186e23e3fc 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsRestArgsWithThisTypeInJSDocFunction_es5.2.minified.js @@ -15,8 +15,7 @@ export var Clazz = function() { return Constructor = Clazz, protoProps = [ { key: "method", - value: function(functionDeclaration) { - } + value: function(functionDeclaration) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Clazz; }(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.1.normal.js index 5019325dc19..28428fe056e 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.1.normal.js @@ -8,8 +8,7 @@ export class Super { /** * @param {string} firstArg * @param {string} secondArg - */ constructor(firstArg, secondArg){ - } + */ constructor(firstArg, secondArg){} } export class Sub extends Super { constructor(){ diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.2.minified.js index c1acd9e9388..fa93c1fa078 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es2015.2.minified.js @@ -1,6 +1,5 @@ export class Super { - constructor(firstArg, secondArg){ - } + constructor(firstArg, secondArg){} } export class Sub extends Super { constructor(){ diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.1.normal.js index 8d4fd114147..c924a7510e6 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.2.minified.js index a6ed9a0cc9b..8d217e526ba 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor_es5.2.minified.js @@ -33,8 +33,7 @@ export var Sub = function(Super1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.1.normal.js index b0eff3bd66e..2dcd0beaab3 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.1.normal.js @@ -11,7 +11,6 @@ export class A { } class Base extends A { // This method is required to reproduce #35932 - verify() { - } + verify() {} } export { Base as default }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.2.minified.js index c4cad3cbf92..b022887c444 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es2015.2.minified.js @@ -4,7 +4,6 @@ export class A { } } class Base extends A { - verify() { - } + verify() {} } export { Base as default }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.1.normal.js index 5d40a362ae1..e94e93c42eb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -116,8 +115,7 @@ var Base = /*#__PURE__*/ function(A) { { // This method is required to reproduce #35932 key: "verify", - value: function verify() { - } + value: function verify() {} } ]); return Base; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.2.minified.js index 058cb69a307..73f4da4c921 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes_es5.2.minified.js @@ -52,8 +52,7 @@ var Base = function(A) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -76,8 +75,7 @@ var Base = function(A) { return _createClass(Base, [ { key: "verify", - value: function() { - } + value: function() {} } ]), Base; }(A); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.1.normal.js index 9a16d1ad6c2..6ed8f018ab6 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.1.normal.js @@ -1,8 +1,7 @@ // @filename: index.js /// const Something = require("fs").Something; -module.exports.A = { -}; +module.exports.A = {}; module.exports.A.B = { thing: new Something() }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.2.minified.js index e4c96f3bb80..b548acd97cb 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es2015.2.minified.js @@ -1,5 +1,4 @@ const Something = require("fs").Something; -module.exports.A = { -}, module.exports.A.B = { +module.exports.A = {}, module.exports.A.B = { thing: new Something() }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.1.normal.js index 0fbe8d27f67..97e79aa2a33 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.1.normal.js @@ -1,8 +1,7 @@ // @filename: index.js /// var Something = require("fs").Something; -module.exports.A = { -}; +module.exports.A = {}; module.exports.A.B = { thing: new Something() }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.2.minified.js index faf88dd26ae..797a70e4d45 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences3_es5.2.minified.js @@ -1,5 +1,4 @@ var Something = require("fs").Something; -module.exports.A = { -}, module.exports.A.B = { +module.exports.A = {}, module.exports.A.B = { thing: new Something() }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.1.normal.js index a8aba248b96..51c0a855aed 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.1.normal.js @@ -8,7 +8,5 @@ export var A; (function(B) { const Something1 = require("fs").Something; const thing = new Something1(); - })(B = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(B = A1.B || (A1.B = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.2.minified.js index 053c7961644..c25bcf0efb6 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es2015.2.minified.js @@ -3,6 +3,4 @@ export const Something = 2; !function(B) { const Something1 = require("fs").Something; new Something1(); -}((A1 = A || (A = { -})).B || (A1.B = { -})); +}((A1 = A || (A = {})).B || (A1.B = {})); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.1.normal.js index 9375bcfaedb..43b3b0da6f6 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.1.normal.js @@ -8,7 +8,5 @@ export var A; (function(B) { var Something1 = require("fs").Something; var thing = new Something1(); - })(B = A1.B || (A1.B = { - })); -})(A || (A = { -})); + })(B = A1.B || (A1.B = {})); +})(A || (A = {})); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.2.minified.js index db63f6789d3..133aa308c92 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences4_es5.2.minified.js @@ -1,5 +1,3 @@ var A, A1, Something = 2; export { A1 as A }; -(A = A1 || (A1 = { -})).B || (A.B = { -}), new (require("fs")).Something(); +(A = A1 || (A1 = {})).B || (A.B = {}), new (require("fs")).Something(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.1.normal.js index 6f03892be0b..78de9327358 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.1.normal.js @@ -6,8 +6,7 @@ /** * @typedef {string | number} Whatever */ class Conn { - method() { - } + method() {} constructor(){ this.item = 3; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js index e93accee28d..f097b978761 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js @@ -1,6 +1,5 @@ module.exports = class { - method() { - } + method() {} constructor(){ this.item = 3; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js index 87a8effac5b..bddcb0ba313 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js @@ -33,8 +33,7 @@ var Conn = // @allowJs: true _createClass(Conn, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return Conn; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js index a097de128a0..bbcda06f3b0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js @@ -16,8 +16,7 @@ var Conn = function() { return protoProps = [ { key: "method", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Conn).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Conn; }(); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.1.normal.js index d2d36c7bdd2..0d50d1e6002 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.1.normal.js @@ -21,8 +21,7 @@ label: 'Style & Layout' } }; -/** @type {Object} */ const taskNameToGroup = { -}; +/** @type {Object} */ const taskNameToGroup = {}; module.exports = { taskGroups, taskNameToGroup @@ -38,7 +37,6 @@ const { taskGroups , taskNameToGroup } = require('./module.js'); /** * @param {TaskGroup} x * @param {TaskNode} y - */ constructor(x, y){ - } + */ constructor(x, y){} } module.exports = MainThreadTasks; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js index fb8a45c27c5..51f5593ee67 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js @@ -7,14 +7,12 @@ const taskGroups = { id: "styleLayout", label: "Style & Layout" } -}, taskNameToGroup = { -}; +}, taskNameToGroup = {}; module.exports = { taskGroups, taskNameToGroup }; const { taskGroups , taskNameToGroup } = require("./module.js"); module.exports = class { - constructor(x, y){ - } + constructor(x, y){} }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js index ec1040d21c0..20d9f830500 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js @@ -26,8 +26,7 @@ function _classCallCheck(instance, Constructor) { label: 'Style & Layout' } }; -/** @type {Object} */ var taskNameToGroup = { -}; +/** @type {Object} */ var taskNameToGroup = {}; module.exports = { taskGroups: taskGroups, taskNameToGroup: taskNameToGroup diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js index 22d6e825af8..eb8c9e5b9f2 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js @@ -7,8 +7,7 @@ var taskGroups = { id: "styleLayout", label: "Style & Layout" } -}, taskNameToGroup = { -}; +}, taskNameToGroup = {}; module.exports = { taskGroups: taskGroups, taskNameToGroup: taskNameToGroup diff --git a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.1.normal.js index cf9ca4f4e80..7da723e5c9b 100644 --- a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.1.normal.js @@ -1,30 +1,24 @@ // @out: output.js // @allowJs: true // @filename: a.js -var variable = { -}; +var variable = {}; variable.a = 0; class C { constructor(){ - this.initializedMember = { - }; - this.member = { - }; + this.initializedMember = {}; + this.member = {}; this.member.a = 0; } } var obj = { - property: { - } + property: {} }; obj.property.a = 0; var arr = [ - { - } + {} ]; function getObj() { - return { - }; + return {}; } // @filename: b.ts variable.a = 1; diff --git a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js index 40865b6e535..7823c58779d 100644 --- a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js @@ -1,21 +1,15 @@ -var variable = { -}; +var variable = {}; variable.a = 0; class C { constructor(){ - this.initializedMember = { - }, this.member = { - }, this.member.a = 0; + this.initializedMember = {}, this.member = {}, this.member.a = 0; } } var obj = { - property: { - } + property: {} }; obj.property.a = 0; var arr = [ - { - } + {} ]; -variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, ({ -}).a = 1; +variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, ({}).a = 1; diff --git a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.1.normal.js b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.1.normal.js index 29904b6a2ce..22bf604ffb4 100644 --- a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.1.normal.js @@ -6,30 +6,24 @@ function _classCallCheck(instance, Constructor) { // @out: output.js // @allowJs: true // @filename: a.js -var variable = { -}; +var variable = {}; variable.a = 0; var C = function C() { "use strict"; _classCallCheck(this, C); - this.initializedMember = { - }; - this.member = { - }; + this.initializedMember = {}; + this.member = {}; this.member.a = 0; }; var obj = { - property: { - } + property: {} }; obj.property.a = 0; var arr = [ - { - } + {} ]; function getObj() { - return { - }; + return {}; } // @filename: b.ts variable.a = 1; diff --git a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js index 5c77a05b3bb..66525044c10 100644 --- a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js @@ -1,21 +1,15 @@ -var variable = { -}; +var variable = {}; variable.a = 0; var C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, C), this.initializedMember = { - }, this.member = { - }, this.member.a = 0; + }(this, C), this.initializedMember = {}, this.member = {}, this.member.a = 0; }, obj = { - property: { - } + property: {} }; obj.property.a = 0; var arr = [ - { - } + {} ]; -variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, ({ -}).a = 1; +variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, ({}).a = 1; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.1.normal.js index a740b14894a..d7c54cd2294 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.1.normal.js @@ -9,8 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru /// /* @jsxImportSource preact */ const a = /*#__PURE__*/ _jsxs(_Fragment, { children: [ - /*#__PURE__*/ _jsx("p", { - }), + /*#__PURE__*/ _jsx("p", {}), "text", /*#__PURE__*/ _jsx("div", { className: "foo" @@ -19,8 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru }); const a = /*#__PURE__*/ _jsxs(_Fragment, { children: [ - /*#__PURE__*/ _jsx("p", { - }), + /*#__PURE__*/ _jsx("p", {}), "text", /*#__PURE__*/ _jsx("div", { className: "foo" diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.2.minified.js index c85593262d3..86b835e2368 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es2015.2.minified.js @@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru import "./preact"; _jsxs(_Fragment, { children: [ - _jsx("p", { - }), + _jsx("p", {}), "text", _jsx("div", { className: "foo" @@ -11,8 +10,7 @@ _jsxs(_Fragment, { ] }), _jsxs(_Fragment, { children: [ - _jsx("p", { - }), + _jsx("p", {}), "text", _jsx("div", { className: "foo" diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.1.normal.js index 3978ace088d..be628df4634 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.1.normal.js @@ -9,8 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru /// /* @jsxImportSource preact */ var a = /*#__PURE__*/ _jsxs(_Fragment, { children: [ - /*#__PURE__*/ _jsx("p", { - }), + /*#__PURE__*/ _jsx("p", {}), "text", /*#__PURE__*/ _jsx("div", { className: "foo" @@ -19,8 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru }); var a = /*#__PURE__*/ _jsxs(_Fragment, { children: [ - /*#__PURE__*/ _jsx("p", { - }), + /*#__PURE__*/ _jsx("p", {}), "text", /*#__PURE__*/ _jsx("div", { className: "foo" diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.2.minified.js index c85593262d3..86b835e2368 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragmax_es5.2.minified.js @@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru import "./preact"; _jsxs(_Fragment, { children: [ - _jsx("p", { - }), + _jsx("p", {}), "text", _jsx("div", { className: "foo" @@ -11,8 +10,7 @@ _jsxs(_Fragment, { ] }), _jsxs(_Fragment, { children: [ - _jsx("p", { - }), + _jsx("p", {}), "text", _jsx("div", { className: "foo" diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.1.normal.js index b3eff6427e4..518353f644f 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.1.normal.js @@ -18,8 +18,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -40,24 +39,20 @@ function _objectSpread(target) { /* @jsxImportSource preact */ const props = { answer: 42 }; -const a = /*#__PURE__*/ _jsx("div", _objectSpread({ -}, props, { +const a = /*#__PURE__*/ _jsx("div", _objectSpread({}, props, { children: "text" }), "foo"); -const b = /*#__PURE__*/ _createElement("div", _objectSpread({ -}, props, { +const b = /*#__PURE__*/ _createElement("div", _objectSpread({}, props, { key: "bar", children: "text" })); const props2 = { answer: 42 }; -const a2 = /*#__PURE__*/ _jsx("div", _objectSpread({ -}, props2, { +const a2 = /*#__PURE__*/ _jsx("div", _objectSpread({}, props2, { children: "text" }), "foo"); -const b2 = /*#__PURE__*/ _createElement("div", _objectSpread({ -}, props2, { +const b2 = /*#__PURE__*/ _createElement("div", _objectSpread({}, props2, { key: "bar", children: "text" })); diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.2.minified.js index 204abca426e..38e2c4265f7 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es2015.2.minified.js @@ -11,8 +11,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -24,22 +23,18 @@ function _objectSpread(target) { const props = { answer: 42 }; -_jsx("div", _objectSpread({ -}, props, { +_jsx("div", _objectSpread({}, props, { children: "text" -}), "foo"), _createElement("div", _objectSpread({ -}, props, { +}), "foo"), _createElement("div", _objectSpread({}, props, { key: "bar", children: "text" })); const props2 = { answer: 42 }; -_jsx("div", _objectSpread({ -}, props2, { +_jsx("div", _objectSpread({}, props2, { children: "text" -}), "foo"), _createElement("div", _objectSpread({ -}, props2, { +}), "foo"), _createElement("div", _objectSpread({}, props2, { key: "bar", children: "text" })); diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.1.normal.js index 8d83cfba10c..a94693accf6 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.1.normal.js @@ -18,8 +18,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -40,24 +39,20 @@ function _objectSpread(target) { /* @jsxImportSource preact */ var props = { answer: 42 }; -var a = /*#__PURE__*/ _jsx("div", _objectSpread({ -}, props, { +var a = /*#__PURE__*/ _jsx("div", _objectSpread({}, props, { children: "text" }), "foo"); -var b = /*#__PURE__*/ _createElement("div", _objectSpread({ -}, props, { +var b = /*#__PURE__*/ _createElement("div", _objectSpread({}, props, { key: "bar", children: "text" })); var props2 = { answer: 42 }; -var a2 = /*#__PURE__*/ _jsx("div", _objectSpread({ -}, props2, { +var a2 = /*#__PURE__*/ _jsx("div", _objectSpread({}, props2, { children: "text" }), "foo"); -var b2 = /*#__PURE__*/ _createElement("div", _objectSpread({ -}, props2, { +var b2 = /*#__PURE__*/ _createElement("div", _objectSpread({}, props2, { key: "bar", children: "text" })); diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.2.minified.js index ff9cbe63995..4377bf55aee 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragmax_es5.2.minified.js @@ -11,8 +11,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -24,22 +23,18 @@ function _objectSpread(target) { var props = { answer: 42 }; -_jsx("div", _objectSpread({ -}, props, { +_jsx("div", _objectSpread({}, props, { children: "text" -}), "foo"), _createElement("div", _objectSpread({ -}, props, { +}), "foo"), _createElement("div", _objectSpread({}, props, { key: "bar", children: "text" })); var props2 = { answer: 42 }; -_jsx("div", _objectSpread({ -}, props2, { +_jsx("div", _objectSpread({}, props2, { children: "text" -}), "foo"), _createElement("div", _objectSpread({ -}, props2, { +}), "foo"), _createElement("div", _objectSpread({}, props2, { key: "bar", children: "text" })); diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.1.normal.js index 16061652143..73e6a9cf92e 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.1.normal.js @@ -23,8 +23,7 @@ const props = { const a = /*#__PURE__*/ React.createElement("div", _extends({ key: "foo" }, props), "text"); -const b = /*#__PURE__*/ React.createElement("div", _extends({ -}, props, { +const b = /*#__PURE__*/ React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.2.minified.js index ddcbb9a56e5..13861463f65 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es2015.2.minified.js @@ -12,8 +12,7 @@ const props = { }; React.createElement("div", _extends({ key: "foo" -}, props), "text"), React.createElement("div", _extends({ -}, props, { +}, props), "text"), React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.1.normal.js index 64b09cf27ff..b2a8111d14d 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.1.normal.js @@ -23,8 +23,7 @@ var props = { var a = /*#__PURE__*/ React.createElement("div", _extends({ key: "foo" }, props), "text"); -var b = /*#__PURE__*/ React.createElement("div", _extends({ -}, props, { +var b = /*#__PURE__*/ React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.2.minified.js index 850a82ae640..7fe7820f982 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportx_es5.2.minified.js @@ -12,8 +12,7 @@ var props = { }; React.createElement("div", _extends({ key: "foo" -}, props), "text"), React.createElement("div", _extends({ -}, props, { +}, props), "text"), React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.1.normal.js index ebb9beb9466..14b48f51fa4 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.1.normal.js @@ -22,8 +22,7 @@ const props = { const a = /*#__PURE__*/ React.createElement("div", _extends({ key: "foo" }, props), "text"); -const b = /*#__PURE__*/ React.createElement("div", _extends({ -}, props, { +const b = /*#__PURE__*/ React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.2.minified.js index ddcbb9a56e5..13861463f65 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es2015.2.minified.js @@ -12,8 +12,7 @@ const props = { }; React.createElement("div", _extends({ key: "foo" -}, props), "text"), React.createElement("div", _extends({ -}, props, { +}, props), "text"), React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.1.normal.js index 19c4b3a35fb..32821403167 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.1.normal.js @@ -22,8 +22,7 @@ var props = { var a = /*#__PURE__*/ React.createElement("div", _extends({ key: "foo" }, props), "text"); -var b = /*#__PURE__*/ React.createElement("div", _extends({ -}, props, { +var b = /*#__PURE__*/ React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.2.minified.js index 850a82ae640..7fe7820f982 100644 --- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropx_es5.2.minified.js @@ -12,8 +12,7 @@ var props = { }; React.createElement("div", _extends({ key: "foo" -}, props), "text"), React.createElement("div", _extends({ -}, props, { +}, props), "text"), React.createElement("div", _extends({}, props, { key: "bar" }), "text"); export { }; diff --git a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.1.normal.js index 3bdd5e6efcf..fd0f4b5ff19 100644 --- a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.1.normal.js @@ -39,13 +39,11 @@ var x = /*#__PURE__*/ React.createElement("div", { }); /*#__PURE__*/ React.createElement(Namespace.Component, null); /*#__PURE__*/ React.createElement(Namespace.DeepNamespace.Component, null); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x, { +/*#__PURE__*/ React.createElement(Component, _extends({}, x, { y: 2, z: true })); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, this.props, { +/*#__PURE__*/ React.createElement(Component, _extends({}, this.props, { sound: "moo" })); /*#__PURE__*/ React.createElement("font-face", null); @@ -53,14 +51,11 @@ var x = /*#__PURE__*/ React.createElement("div", { x: y }); /*#__PURE__*/ React.createElement("x-component", null); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x)); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x, { +/*#__PURE__*/ React.createElement(Component, _extends({}, x)); +/*#__PURE__*/ React.createElement(Component, _extends({}, x, { y: 2 })); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x, { +/*#__PURE__*/ React.createElement(Component, _extends({}, x, { y: 2, z: true })); diff --git a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.2.minified.js index 712308fbd8e..3ed4f13bb21 100644 --- a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es2015.2.minified.js @@ -20,21 +20,16 @@ React.createElement("div", null, React.createElement("span", null), React.create attr2: "bar" })), React.createElement("div", null, "\xa0"), React.createElement("div", null, "\xa0 "), React.createElement("hasOwnProperty", null, "testing"), React.createElement(Component, { constructor: "foo" -}), React.createElement(Namespace.Component, null), React.createElement(Namespace.DeepNamespace.Component, null), React.createElement(Component, _extends({ -}, x, { +}), React.createElement(Namespace.Component, null), React.createElement(Namespace.DeepNamespace.Component, null), React.createElement(Component, _extends({}, x, { y: 2, z: !0 -})), React.createElement(Component, _extends({ -}, this.props, { +})), React.createElement(Component, _extends({}, this.props, { sound: "moo" })), React.createElement("font-face", null), React.createElement(Component, { x: y -}), React.createElement("x-component", null), React.createElement(Component, _extends({ -}, x)), React.createElement(Component, _extends({ -}, x, { +}), React.createElement("x-component", null), React.createElement(Component, _extends({}, x)), React.createElement(Component, _extends({}, x, { y: 2 -})), React.createElement(Component, _extends({ -}, x, { +})), React.createElement(Component, _extends({}, x, { y: 2, z: !0 })), React.createElement(Component, _extends({ diff --git a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.1.normal.js index 3bdd5e6efcf..fd0f4b5ff19 100644 --- a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.1.normal.js @@ -39,13 +39,11 @@ var x = /*#__PURE__*/ React.createElement("div", { }); /*#__PURE__*/ React.createElement(Namespace.Component, null); /*#__PURE__*/ React.createElement(Namespace.DeepNamespace.Component, null); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x, { +/*#__PURE__*/ React.createElement(Component, _extends({}, x, { y: 2, z: true })); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, this.props, { +/*#__PURE__*/ React.createElement(Component, _extends({}, this.props, { sound: "moo" })); /*#__PURE__*/ React.createElement("font-face", null); @@ -53,14 +51,11 @@ var x = /*#__PURE__*/ React.createElement("div", { x: y }); /*#__PURE__*/ React.createElement("x-component", null); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x)); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x, { +/*#__PURE__*/ React.createElement(Component, _extends({}, x)); +/*#__PURE__*/ React.createElement(Component, _extends({}, x, { y: 2 })); -/*#__PURE__*/ React.createElement(Component, _extends({ -}, x, { +/*#__PURE__*/ React.createElement(Component, _extends({}, x, { y: 2, z: true })); diff --git a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.2.minified.js index 712308fbd8e..3ed4f13bb21 100644 --- a/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxReactTestSuitex_es5.2.minified.js @@ -20,21 +20,16 @@ React.createElement("div", null, React.createElement("span", null), React.create attr2: "bar" })), React.createElement("div", null, "\xa0"), React.createElement("div", null, "\xa0 "), React.createElement("hasOwnProperty", null, "testing"), React.createElement(Component, { constructor: "foo" -}), React.createElement(Namespace.Component, null), React.createElement(Namespace.DeepNamespace.Component, null), React.createElement(Component, _extends({ -}, x, { +}), React.createElement(Namespace.Component, null), React.createElement(Namespace.DeepNamespace.Component, null), React.createElement(Component, _extends({}, x, { y: 2, z: !0 -})), React.createElement(Component, _extends({ -}, this.props, { +})), React.createElement(Component, _extends({}, this.props, { sound: "moo" })), React.createElement("font-face", null), React.createElement(Component, { x: y -}), React.createElement("x-component", null), React.createElement(Component, _extends({ -}, x)), React.createElement(Component, _extends({ -}, x, { +}), React.createElement("x-component", null), React.createElement(Component, _extends({}, x)), React.createElement(Component, _extends({}, x, { y: 2 -})), React.createElement(Component, _extends({ -}, x, { +})), React.createElement(Component, _extends({}, x, { y: 2, z: !0 })), React.createElement(Component, _extends({ diff --git a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.1.normal.js index 76472451285..25f9f504fdd 100644 --- a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.1.normal.js @@ -26,8 +26,7 @@ const props = { const Foo = (props1)=>/*#__PURE__*/ React.createElement("div", null, props1.a) ; // ok -const a1 = /*#__PURE__*/ React.createElement(Foo, _extends({ -}, props)); +const a1 = /*#__PURE__*/ React.createElement(Foo, _extends({}, props)); const a2 = /*#__PURE__*/ React.createElement(Foo, _extends({ d: 1 }, props)); diff --git a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.2.minified.js index 4346271192d..93ac1a73150 100644 --- a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es2015.2.minified.js @@ -12,8 +12,7 @@ const React = require("react"), props = { b: 1 }, Foo = (props1)=>React.createElement("div", null, props1.a) ; -React.createElement(Foo, _extends({ -}, props)), React.createElement(Foo, _extends({ +React.createElement(Foo, _extends({}, props)), React.createElement(Foo, _extends({ d: 1 }, props)), React.createElement(Foo, _extends({ a: 1 diff --git a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.1.normal.js index 1e2fede91a2..adcfea63531 100644 --- a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.1.normal.js @@ -27,8 +27,7 @@ var Foo = function(props1) { /*#__PURE__*/ return React.createElement("div", null, props1.a); }; // ok -var a1 = /*#__PURE__*/ React.createElement(Foo, _extends({ -}, props)); +var a1 = /*#__PURE__*/ React.createElement(Foo, _extends({}, props)); var a2 = /*#__PURE__*/ React.createElement(Foo, _extends({ d: 1 }, props)); diff --git a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.2.minified.js index ea2f505afb3..9ecd2809442 100644 --- a/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxSpreadOverwritesAttributeStrictx_es5.2.minified.js @@ -13,8 +13,7 @@ var React = require("react"), props = { }, Foo = function(props1) { return React.createElement("div", null, props1.a); }; -React.createElement(Foo, _extends({ -}, props)), React.createElement(Foo, _extends({ +React.createElement(Foo, _extends({}, props)), React.createElement(Foo, _extends({ d: 1 }, props)), React.createElement(Foo, _extends({ a: 1 diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.1.normal.js index 80c8946002a..8aafd2d19fd 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.1.normal.js @@ -13,8 +13,7 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); function getProperty(obj, key) { return obj[key]; } @@ -123,13 +122,11 @@ function f53(obj, k, s, n) { const x3 = obj[k]; } function f54(obj, key) { - for(let s in obj[key]){ - } + for(let s in obj[key]){} const b = "foo" in obj[key]; } function f55(obj, key) { - for(let s in obj[key]){ - } + for(let s in obj[key]){} const b = "foo" in obj[key]; } function f60(source, target) { @@ -333,16 +330,13 @@ function f1(thing) { // Repro from comment in #12114 const assignTo2 = (object, key1, key2)=>(value)=>object[key1][key2] = value ; -var empty = one(()=>{ -}) // inferred as {}, expected +var empty = one(()=>{}) // inferred as {}, expected ; var hashOfEmpty1 = on({ - test: ()=>{ - } + test: ()=>{} }); // {} var hashOfEmpty2 = on({ - test: (x)=>{ - } + test: (x)=>{} }); // { test: boolean } let c1 = new Component1({ data: { @@ -411,8 +405,7 @@ class AnotherSampleClass extends SampleClass { super(merge(props, foo)); } } -new AnotherSampleClass({ -}); +new AnotherSampleClass({}); // Positive repro from #17166 function f3(t, k, tk) { for(let key in t){ @@ -425,8 +418,7 @@ var Flag; (function(Flag) { Flag["FLAG_1"] = "flag_1"; Flag["FLAG_2"] = "flag_2"; -})(Flag || (Flag = { -})); +})(Flag || (Flag = {})); function getFlagsFromSimpleRecord(record, flags) { return record[flags[0]]; } diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.2.minified.js index 5a0f716232e..14eba47f81f 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es2015.2.minified.js @@ -1,12 +1,8 @@ var E, E, Flag, Flag; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", one(()=>{ +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", one(()=>{}), on({ + test: ()=>{} }), on({ - test: ()=>{ - } -}), on({ - test: (x)=>{ - } + test: (x)=>{} }), new Component1({ data: { hello: "" @@ -29,6 +25,4 @@ new class extends SampleClass { foo: "bar" })); } -}({ -}), (Flag = Flag || (Flag = { -})).FLAG_1 = "flag_1", Flag.FLAG_2 = "flag_2"; +}({}), (Flag = Flag || (Flag = {})).FLAG_1 = "flag_1", Flag.FLAG_2 = "flag_2"; diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.1.normal.js index 99b0b19df38..6840a420b89 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.1.normal.js @@ -88,8 +88,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -135,8 +134,7 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); function getProperty(obj, key) { return obj[key]; } @@ -261,13 +259,11 @@ function f53(obj, k, s, n) { var x3 = obj[k]; } function f54(obj, key) { - for(var s in obj[key]){ - } + for(var s in obj[key]){} var b = "foo" in obj[key]; } function f55(obj, key) { - for(var s in obj[key]){ - } + for(var s in obj[key]){} var b = "foo" in obj[key]; } function f60(source, target) { @@ -545,16 +541,13 @@ var assignTo2 = function(object, key1, key2) { return object[key1][key2] = value; }; }; -var empty = one(function() { -}) // inferred as {}, expected +var empty = one(function() {}) // inferred as {}, expected ; var hashOfEmpty1 = on({ - test: function() { - } + test: function() {} }); // {} var hashOfEmpty2 = on({ - test: function(x) { - } + test: function(x) {} }); // { test: boolean } var c1 = new Component1({ data: { @@ -673,8 +666,7 @@ var AnotherSampleClass = /*#__PURE__*/ function(SampleClass) { ]); return AnotherSampleClass; }(SampleClass); -new AnotherSampleClass({ -}); +new AnotherSampleClass({}); // Positive repro from #17166 function f3(t, k, tk) { for(var key in t){ @@ -687,8 +679,7 @@ var Flag; (function(Flag) { Flag["FLAG_1"] = "flag_1"; Flag["FLAG_2"] = "flag_2"; -})(Flag || (Flag = { -})); +})(Flag || (Flag = {})); function getFlagsFromSimpleRecord(record, flags) { return record[flags[0]]; } diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.2.minified.js index 9360fbe1ab8..530f52f217f 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -78,8 +77,7 @@ function getProperty(obj, key) { function setProperty(obj, key, value) { obj[key] = value; } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; var Component = function() { "use strict"; function Component() { @@ -176,13 +174,10 @@ var Component = function() { } ]), OtherPerson; }(); -one(function() { +one(function() {}), on({ + test: function() {} }), on({ - test: function() { - } -}), on({ - test: function(x) { - } + test: function(x) {} }), new Component1({ data: { hello: "" @@ -243,9 +238,7 @@ var A = function() { } ]), AnotherSampleClass; }(SampleClass); -new AnotherSampleClass({ -}), (Flag = Flag || (Flag = { -})).FLAG_1 = "flag_1", Flag.FLAG_2 = "flag_2"; +new AnotherSampleClass({}), (Flag = Flag || (Flag = {})).FLAG_1 = "flag_1", Flag.FLAG_2 = "flag_2"; var Unbounded = function() { "use strict"; function Unbounded() { @@ -254,8 +247,7 @@ var Unbounded = function() { return _createClass(Unbounded, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), Unbounded; }(); diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.1.normal.js index 5f99dc843ae..86ebe9a6dcb 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.1.normal.js @@ -7,8 +7,7 @@ // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype[_sym] = "ok"; F.prototype[_str] = "ok"; const inst = new F(); diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.2.minified.js index 268c7f8d87c..a5c28976569 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es2015.2.minified.js @@ -1,6 +1,5 @@ const _sym = Symbol(), _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype[_sym] = "ok", F.prototype[_str] = "ok"; const inst = new F(); inst[_str], inst[_sym], module.exports.F = F, module.exports.S = _sym; diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.1.normal.js index a4e9a3afdde..b15be796ff3 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.1.normal.js @@ -7,8 +7,7 @@ // currently unsupported var _sym = Symbol(); var _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype[_sym] = "ok"; F.prototype[_str] = "ok"; var inst = new F(); diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.2.minified.js index a81a074085b..18981c93717 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport4_es5.2.minified.js @@ -1,6 +1,5 @@ var _sym = Symbol(), _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype[_sym] = "ok", F.prototype[_str] = "ok"; var inst = new F(); inst[_str], inst[_sym], module.exports.F = F, module.exports.S = _sym; diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.1.normal.js index b4a78b23b2a..db71bf6cec6 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.1.normal.js @@ -7,8 +7,7 @@ // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype = { [_sym]: "ok", [_str]: "ok" diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.2.minified.js index 7ef2f2020da..ce57e1ef6df 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es2015.2.minified.js @@ -1,6 +1,5 @@ const _sym = Symbol(), _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype = { [_sym]: "ok", [_str]: "ok" diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.1.normal.js index a2e0c719c7d..85e3aac2c03 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.1.normal.js @@ -20,11 +20,9 @@ function _defineProperty(obj, key, value) { // currently unsupported var _sym = Symbol(); var _str = "my-fake-sym"; -function F() { -} +function F() {} var _obj; -F.prototype = (_obj = { -}, _defineProperty(_obj, _sym, "ok"), _defineProperty(_obj, _str, "ok"), _obj); +F.prototype = (_obj = {}, _defineProperty(_obj, _sym, "ok"), _defineProperty(_obj, _str, "ok"), _obj); var inst = new F(); var _y = inst[_str]; var _z = inst[_sym]; diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.2.minified.js index c30b5420ece..5dd83586666 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport5_es5.2.minified.js @@ -7,10 +7,8 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } var _obj, _sym = Symbol(), _str = "my-fake-sym"; -function F() { -} -F.prototype = (_defineProperty(_obj = { -}, _sym, "ok"), _defineProperty(_obj, _str, "ok"), _obj); +function F() {} +F.prototype = (_defineProperty(_obj = {}, _sym, "ok"), _defineProperty(_obj, _str, "ok"), _obj); var inst = new F(); inst[_str], inst[_sym], module.exports.F = F, module.exports.S = _sym; var x = require("./lateBoundAssignmentDeclarationSupport5.js"), inst = new x.F(); diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.1.normal.js index 6ade6a023f1..d8bff7c06c9 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.1.normal.js @@ -7,8 +7,7 @@ // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype.defsAClass = true; Object.defineProperty(F.prototype, _str, { value: "ok" diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.2.minified.js index 0dea580e215..a97e28e1493 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es2015.2.minified.js @@ -1,6 +1,5 @@ const _sym = Symbol(), _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype.defsAClass = !0, Object.defineProperty(F.prototype, _str, { value: "ok" }), Object.defineProperty(F.prototype, _sym, { diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.1.normal.js index b3b6b662b3b..1168a9892bf 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.1.normal.js @@ -7,8 +7,7 @@ // currently unsupported var _sym = Symbol(); var _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype.defsAClass = true; Object.defineProperty(F.prototype, _str, { value: "ok" diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.2.minified.js index 79dc101ec9f..4a78a566500 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport6_es5.2.minified.js @@ -1,6 +1,5 @@ var _sym = Symbol(), _str = "my-fake-sym"; -function F() { -} +function F() {} F.prototype.defsAClass = !0, Object.defineProperty(F.prototype, _str, { value: "ok" }), Object.defineProperty(F.prototype, _sym, { diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.1.normal.js index 60d33c2552e..345fd1ad0e0 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.1.normal.js @@ -6,8 +6,7 @@ // @filename: lateBoundAssignmentDeclarationSupport7.js const _sym = Symbol(); const _str = "my-fake-sym"; -function F() { -} +function F() {} F[_sym] = "ok"; F[_str] = "ok"; module.exports.F = F; diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.2.minified.js index ac4072fe019..c334d0e96e6 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es2015.2.minified.js @@ -1,6 +1,5 @@ const _sym = Symbol(); -function F() { -} +function F() {} F[_sym] = "ok", F["my-fake-sym"] = "ok", module.exports.F = F, module.exports.S = _sym; const x = require("./lateBoundAssignmentDeclarationSupport7.js"); x.F["my-fake-sym"], x.F[x.S]; diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.1.normal.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.1.normal.js index 41742349b8e..ab92afe3e57 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.1.normal.js @@ -6,8 +6,7 @@ // @filename: lateBoundAssignmentDeclarationSupport7.js var _sym = Symbol(); var _str = "my-fake-sym"; -function F() { -} +function F() {} F[_sym] = "ok"; F[_str] = "ok"; module.exports.F = F; diff --git a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.2.minified.js b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.2.minified.js index b95cdd18c3b..d5cc2ec8d70 100644 --- a/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/lateBoundAssignmentDeclarationSupport7_es5.2.minified.js @@ -1,6 +1,5 @@ var _sym = Symbol(); -function F() { -} +function F() {} F[_sym] = "ok", F["my-fake-sym"] = "ok", module.exports.F = F, module.exports.S = _sym; var x = require("./lateBoundAssignmentDeclarationSupport7.js"); x.F["my-fake-sym"], x.F[x.S]; diff --git a/crates/swc/tests/tsc-references/library-reference-6_es2015.1.normal.js b/crates/swc/tests/tsc-references/library-reference-6_es2015.1.normal.js index de5c519868e..f39e55bf004 100644 --- a/crates/swc/tests/tsc-references/library-reference-6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/library-reference-6_es2015.1.normal.js @@ -2,5 +2,4 @@ /// var x = alpha.a; // @filename: /tsconfig.json -{ -} +{} diff --git a/crates/swc/tests/tsc-references/library-reference-6_es5.1.normal.js b/crates/swc/tests/tsc-references/library-reference-6_es5.1.normal.js index de5c519868e..f39e55bf004 100644 --- a/crates/swc/tests/tsc-references/library-reference-6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/library-reference-6_es5.1.normal.js @@ -2,5 +2,4 @@ /// var x = alpha.a; // @filename: /tsconfig.json -{ -} +{} diff --git a/crates/swc/tests/tsc-references/literalTypeWidening_es2015.1.normal.js b/crates/swc/tests/tsc-references/literalTypeWidening_es2015.1.normal.js index a30759fccca..5af1c67dfdf 100644 --- a/crates/swc/tests/tsc-references/literalTypeWidening_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypeWidening_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -44,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -143,8 +139,7 @@ function onMouseOver() { let x = onMouseOver(); // Repro from #23649 export function Set(...keys1) { - const result3 = { - }; + const result3 = {}; keys1.forEach((key)=>result3[key] = true ); return result3; @@ -171,7 +166,6 @@ var E; (function(E) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; -})(E || (E = { -})); +})(E || (E = {})); const a = f(E.A); const b = a; diff --git a/crates/swc/tests/tsc-references/literalTypeWidening_es2015.2.minified.js b/crates/swc/tests/tsc-references/literalTypeWidening_es2015.2.minified.js index 6f309f919cf..2a0fd351499 100644 --- a/crates/swc/tests/tsc-references/literalTypeWidening_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypeWidening_es2015.2.minified.js @@ -1,7 +1,6 @@ var E, E; export function Set(...keys1) { - const result = { - }; + const result = {}; return keys1.forEach((key)=>result[key] = !0 ), result; } @@ -13,5 +12,4 @@ export const langCodes = keys(langCodeSet); langCodes.map((code)=>({ code }) -), (E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", f(E.A); +), (E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", f(E.A); diff --git a/crates/swc/tests/tsc-references/literalTypeWidening_es5.1.normal.js b/crates/swc/tests/tsc-references/literalTypeWidening_es5.1.normal.js index 02e2b372a25..299026c76e6 100644 --- a/crates/swc/tests/tsc-references/literalTypeWidening_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypeWidening_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -44,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -146,8 +142,7 @@ export function Set() { for(var _len = arguments.length, keys1 = new Array(_len), _key = 0; _key < _len; _key++){ keys1[_key] = arguments[_key]; } - var result3 = { - }; + var result3 = {}; keys1.forEach(function(key) { return result3[key] = true; }); @@ -176,7 +171,6 @@ var E; (function(E) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; -})(E || (E = { -})); +})(E || (E = {})); var a = f(E.A); var b = a; diff --git a/crates/swc/tests/tsc-references/literalTypeWidening_es5.2.minified.js b/crates/swc/tests/tsc-references/literalTypeWidening_es5.2.minified.js index 638ceed53d6..8742c4a8505 100644 --- a/crates/swc/tests/tsc-references/literalTypeWidening_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypeWidening_es5.2.minified.js @@ -1,8 +1,7 @@ var E, E; export function Set() { for(var _len = arguments.length, keys1 = new Array(_len), _key = 0; _key < _len; _key++)keys1[_key] = arguments[_key]; - var result = { - }; + var result = {}; return keys1.forEach(function(key) { return result[key] = !0; }), result; @@ -16,5 +15,4 @@ langCodes.map(function(code) { return { code: code }; -}), (E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", f(E.A); +}), (E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", f(E.A); diff --git a/crates/swc/tests/tsc-references/literalTypes2_es2015.1.normal.js b/crates/swc/tests/tsc-references/literalTypes2_es2015.1.normal.js index dc242d433a1..df3816b08c3 100644 --- a/crates/swc/tests/tsc-references/literalTypes2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypes2_es2015.1.normal.js @@ -3,8 +3,7 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); let cond; function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { var v1 = 1; diff --git a/crates/swc/tests/tsc-references/literalTypes2_es2015.2.minified.js b/crates/swc/tests/tsc-references/literalTypes2_es2015.2.minified.js index 2a4ce99f2a7..d5e5bce5dc5 100644 --- a/crates/swc/tests/tsc-references/literalTypes2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypes2_es2015.2.minified.js @@ -1,6 +1,5 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; const a = [ 1, 2 diff --git a/crates/swc/tests/tsc-references/literalTypes2_es5.1.normal.js b/crates/swc/tests/tsc-references/literalTypes2_es5.1.normal.js index d29572b0f83..77afda4d6de 100644 --- a/crates/swc/tests/tsc-references/literalTypes2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypes2_es5.1.normal.js @@ -22,8 +22,7 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); var cond; function f1() { var p1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, p2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "abc", p3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true, p4 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : E.A; diff --git a/crates/swc/tests/tsc-references/literalTypes2_es5.2.minified.js b/crates/swc/tests/tsc-references/literalTypes2_es5.2.minified.js index faea7e352b3..1566455c0ed 100644 --- a/crates/swc/tests/tsc-references/literalTypes2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypes2_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; var E, E, cond, C1 = function() { "use strict"; _classCallCheck(this, C1), this.x1 = 1, this.x2 = -123, this.x3 = 7, this.x4 = "abc", this.x5 = "", this.x6 = "abcdef", this.x7 = !0, this.x8 = E.A, this.c1 = 1, this.c2 = -123, this.c3 = 7, this.c4 = "abc", this.c5 = "", this.c6 = "abcdef", this.c7 = !0, this.c8 = E.A; diff --git a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.1.normal.js b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.1.normal.js index b4cd8c6b794..0c8cc9f1ad6 100644 --- a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.1.normal.js @@ -9,6 +9,5 @@ var _a1; let b3 = (_a1 = x.a) !== null && _a1 !== void 0 ? _a1 : 2; var _a2; let b4 = (_a2 = x.a) !== null && _a2 !== void 0 ? _a2 : 2; -let { bar ='yo' } = { -}; +let { bar ='yo' } = {}; bar; // "yo" | "ha" diff --git a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.2.minified.js b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.2.minified.js index 96fa9fa834c..05333bbf3b6 100644 --- a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es2015.2.minified.js @@ -1,5 +1,4 @@ var _a, _a1, _a2; let { a: a1 } = x, { a: a2 = 0 } = x, { a: a3 = 2 } = x, { a: a4 = 2 } = x; null !== (_a = x.a) && void 0 !== _a, null !== (_a1 = x.a) && void 0 !== _a1, null !== (_a2 = x.a) && void 0 !== _a2; -let { bar ="yo" } = { -}; +let { bar ="yo" } = {}; diff --git a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.1.normal.js b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.1.normal.js index fbccc4af370..babbeeb6640 100644 --- a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.1.normal.js @@ -9,6 +9,5 @@ var _a1; var b3 = (_a1 = x.a) !== null && _a1 !== void 0 ? _a1 : 2; var _a2; var b4 = (_a2 = x.a) !== null && _a2 !== void 0 ? _a2 : 2; -var ref = { -}, _bar = ref.bar, bar = _bar === void 0 ? 'yo' : _bar; +var ref = {}, _bar = ref.bar, bar = _bar === void 0 ? 'yo' : _bar; bar; // "yo" | "ha" diff --git a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.2.minified.js b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.2.minified.js index ef7afe723e2..c7b905bca31 100644 --- a/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypesAndDestructuring_es5.2.minified.js @@ -1,3 +1,2 @@ var _a, _a1, _a2; -null !== (_a = x.a) && void 0 !== _a, null !== (_a1 = x.a) && void 0 !== _a1, null !== (_a2 = x.a) && void 0 !== _a2, ({ -}).bar; +null !== (_a = x.a) && void 0 !== _a, null !== (_a1 = x.a) && void 0 !== _a1, null !== (_a2 = x.a) && void 0 !== _a2, ({}).bar; diff --git a/crates/swc/tests/tsc-references/localTypes1_es2015.1.normal.js b/crates/swc/tests/tsc-references/localTypes1_es2015.1.normal.js index ce538ae40cd..784c849b6e2 100644 --- a/crates/swc/tests/tsc-references/localTypes1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/localTypes1_es2015.1.normal.js @@ -5,8 +5,7 @@ function f1() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } let a = [ @@ -22,8 +21,7 @@ function f2() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } let a = [ @@ -41,8 +39,7 @@ function f3(b) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); if (b) { class C { } @@ -69,8 +66,7 @@ function f5() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } return new C(); @@ -81,8 +77,7 @@ function f5() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } return new C(); @@ -95,8 +90,7 @@ class A { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } return new C(); @@ -107,8 +101,7 @@ class A { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } return new C(); @@ -119,8 +112,7 @@ class A { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); class C { } } diff --git a/crates/swc/tests/tsc-references/localTypes1_es5.1.normal.js b/crates/swc/tests/tsc-references/localTypes1_es5.1.normal.js index 16d01bd68ab..9527ff5a931 100644 --- a/crates/swc/tests/tsc-references/localTypes1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/localTypes1_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -90,8 +89,7 @@ function f1() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { "use strict"; _classCallCheck(this, C); @@ -109,8 +107,7 @@ function f2() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { "use strict"; _classCallCheck(this, C); @@ -130,8 +127,7 @@ function f3(b) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); if (b) { var C = function C() { "use strict"; @@ -162,8 +158,7 @@ function f5() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { "use strict"; _classCallCheck(this, C); @@ -176,8 +171,7 @@ function f5() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { "use strict"; _classCallCheck(this, C); @@ -194,8 +188,7 @@ var A = /*#__PURE__*/ function() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { _classCallCheck(this, C); }; @@ -209,8 +202,7 @@ var A = /*#__PURE__*/ function() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { _classCallCheck(this, C); }; @@ -225,8 +217,7 @@ var A = /*#__PURE__*/ function() { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; - })(E || (E = { - })); + })(E || (E = {})); var C = function C() { _classCallCheck(this, C); }; diff --git a/crates/swc/tests/tsc-references/localTypes1_es5.2.minified.js b/crates/swc/tests/tsc-references/localTypes1_es5.2.minified.js index 933f5a4ec4b..d3ae5a8c73c 100644 --- a/crates/swc/tests/tsc-references/localTypes1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/localTypes1_es5.2.minified.js @@ -22,8 +22,7 @@ var A = function() { var Constructor, protoProps, staticProps; function A() { var E; - _classCallCheck(this, A), (E = E || (E = { - }))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; + _classCallCheck(this, A), (E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; var E, C = function() { _classCallCheck(this, C); }; @@ -33,8 +32,7 @@ var A = function() { key: "m", value: function() { var E, E; - (E = E || (E = { - }))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; + (E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; var C = function() { _classCallCheck(this, C); }; @@ -45,8 +43,7 @@ var A = function() { key: "p", get: function() { var E, E; - (E = E || (E = { - }))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; + (E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; var C = function() { _classCallCheck(this, C); }; diff --git a/crates/swc/tests/tsc-references/logicalAssignment10_es2015.1.normal.js b/crates/swc/tests/tsc-references/logicalAssignment10_es2015.1.normal.js index efecd61bdcd..17cd45f71fa 100644 --- a/crates/swc/tests/tsc-references/logicalAssignment10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalAssignment10_es2015.1.normal.js @@ -1,8 +1,7 @@ var _obj, _ref; // @target: esnext, es2020, es2015 var count = 0; -var obj = { -}; +var obj = {}; function incr() { return ++count; } diff --git a/crates/swc/tests/tsc-references/logicalAssignment10_es2015.2.minified.js b/crates/swc/tests/tsc-references/logicalAssignment10_es2015.2.minified.js index ae7422e1ba3..f52fd8e1ed9 100644 --- a/crates/swc/tests/tsc-references/logicalAssignment10_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalAssignment10_es2015.2.minified.js @@ -1,5 +1,4 @@ -var _obj, _ref, ref, ref1, count = 0, obj = { -}; +var _obj, _ref, ref, ref1, count = 0, obj = {}; function incr() { return ++count; } diff --git a/crates/swc/tests/tsc-references/logicalAssignment10_es5.1.normal.js b/crates/swc/tests/tsc-references/logicalAssignment10_es5.1.normal.js index 3ac941e878b..680dde614fa 100644 --- a/crates/swc/tests/tsc-references/logicalAssignment10_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalAssignment10_es5.1.normal.js @@ -1,8 +1,7 @@ var _obj, _ref; // @target: esnext, es2020, es2015 var count = 0; -var obj = { -}; +var obj = {}; function incr() { return ++count; } diff --git a/crates/swc/tests/tsc-references/logicalAssignment10_es5.2.minified.js b/crates/swc/tests/tsc-references/logicalAssignment10_es5.2.minified.js index b4a98444cd1..fe3245b293b 100644 --- a/crates/swc/tests/tsc-references/logicalAssignment10_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalAssignment10_es5.2.minified.js @@ -1,5 +1,4 @@ -var _obj, _ref, ref, ref1, count = 0, obj = { -}; +var _obj, _ref, ref, ref1, count = 0, obj = {}; function incr() { return ++count; } diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.1.normal.js index ce707eb4723..2cf0bdbab2a 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.1.normal.js @@ -8,8 +8,7 @@ var ANY2 = [ var obj; var obj1 = { x: "", - y: ()=>{ - } + y: ()=>{} }; function foo() { var a; @@ -25,8 +24,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsBoolean1 = !ANY1; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.2.minified.js index 222320df5be..2ccdcda4aca 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es2015.2.minified.js @@ -3,17 +3,14 @@ var M, ANY2 = [ "" ], obj1 = { x: "", - y: ()=>{ - } + y: ()=>{} }; class A { - static foo() { - } + static foo() {} } !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.1.normal.js index 6fb68145226..ad6b178fc1b 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.1.normal.js @@ -27,8 +27,7 @@ var ANY2 = [ var obj; var obj1 = { x: "", - y: function() { - } + y: function() {} }; function foo() { var a; @@ -54,8 +53,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsBoolean1 = !ANY1; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.2.minified.js index 8c8a5f7dd46..d307a31dc3a 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithAnyOtherType_es5.2.minified.js @@ -3,8 +3,7 @@ var M, ANY2 = [ "" ], obj1 = { x: "", - y: function() { - } + y: function() {} }, A = function() { "use strict"; var Constructor; @@ -21,15 +20,13 @@ var M, ANY2 = [ })(Constructor = A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(); !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.1.normal.js index 536b4e978f6..bfaea5c4df7 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.1.normal.js @@ -12,8 +12,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsBoolean1 = !BOOLEAN; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.2.minified.js index 65b9f6c5a71..294503578a1 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es2015.2.minified.js @@ -9,7 +9,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var M, objA = new A(); objA.a, foo(), A.foo(), foo(), objA.a; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.1.normal.js index 74cc4a28168..265eac8e0a8 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.1.normal.js @@ -41,8 +41,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsBoolean1 = !BOOLEAN; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.2.minified.js index c6311cece82..823b28e436b 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithBooleanType_es5.2.minified.js @@ -26,7 +26,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.1.normal.js index a0720e3bcb1..3d4f3b9620c 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.1.normal.js @@ -4,12 +4,9 @@ ENUM; ENUM[ENUM["A"] = 0] = "A"; ENUM[ENUM["B"] = 1] = "B"; ENUM[ENUM["C"] = 2] = "C"; -})(ENUM || (ENUM = { -})); +})(ENUM || (ENUM = {})); var ENUM1; -(function(ENUM1) { -})(ENUM1 || (ENUM1 = { -})); +(function(ENUM1) {})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsBoolean1 = !ENUM; // enum type expressions diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.2.minified.js index b742cfac511..000ecb41e19 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM, ENUM; -(ENUM = ENUM || (ENUM = { -}))[ENUM.A = 0] = "A", ENUM[ENUM.B = 1] = "B", ENUM[ENUM.C = 2] = "C", ENUM.B, ENUM.B + ENUM.C, ENUM.B + ENUM.C, ENUM.B; +(ENUM = ENUM || (ENUM = {}))[ENUM.A = 0] = "A", ENUM[ENUM.B = 1] = "B", ENUM[ENUM.C = 2] = "C", ENUM.B, ENUM.B + ENUM.C, ENUM.B + ENUM.C, ENUM.B; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.1.normal.js index a0720e3bcb1..3d4f3b9620c 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.1.normal.js @@ -4,12 +4,9 @@ ENUM; ENUM[ENUM["A"] = 0] = "A"; ENUM[ENUM["B"] = 1] = "B"; ENUM[ENUM["C"] = 2] = "C"; -})(ENUM || (ENUM = { -})); +})(ENUM || (ENUM = {})); var ENUM1; -(function(ENUM1) { -})(ENUM1 || (ENUM1 = { -})); +(function(ENUM1) {})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsBoolean1 = !ENUM; // enum type expressions diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.2.minified.js index b742cfac511..000ecb41e19 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM, ENUM; -(ENUM = ENUM || (ENUM = { -}))[ENUM.A = 0] = "A", ENUM[ENUM.B = 1] = "B", ENUM[ENUM.C = 2] = "C", ENUM.B, ENUM.B + ENUM.C, ENUM.B + ENUM.C, ENUM.B; +(ENUM = ENUM || (ENUM = {}))[ENUM.A = 0] = "A", ENUM[ENUM.B = 1] = "B", ENUM[ENUM.C = 2] = "C", ENUM.B, ENUM.B + ENUM.C, ENUM.B + ENUM.C, ENUM.B; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.1.normal.js index d7d77966058..72a4b6e3e61 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsBoolean1 = !NUMBER; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.2.minified.js index e9a7fe8a25d..483281d8468 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es2015.2.minified.js @@ -7,7 +7,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.1.normal.js index ad805e92ef0..0c9f8ede9f2 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsBoolean1 = !NUMBER; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.2.minified.js index a0266fa2414..5782b25902c 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithNumberType_es5.2.minified.js @@ -23,7 +23,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.1.normal.js index a7190b27c13..8e06acb64f8 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsBoolean1 = !STRING; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.2.minified.js index 582da0d7546..8d3ce9882d7 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es2015.2.minified.js @@ -10,7 +10,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.1.normal.js index c195942ba1d..9270e98aa0f 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsBoolean1 = !STRING; diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.2.minified.js index 9a048b7824d..8e87a47ca9a 100644 --- a/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/logicalNotOperatorWithStringType_es5.2.minified.js @@ -26,7 +26,6 @@ var STRING, M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/mappedTypeConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeConstraints_es2015.1.normal.js index 68f4982d7e9..ac6a74112ef 100644 --- a/crates/swc/tests/tsc-references/mappedTypeConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeConstraints_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/mappedTypeConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeConstraints_es5.1.normal.js index ee067fc6fd2..3b22119ab38 100644 --- a/crates/swc/tests/tsc-references/mappedTypeConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeConstraints_es5.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.1.normal.js index 35125faf937..c8b45221125 100644 --- a/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.1.normal.js @@ -91,8 +91,7 @@ setState(foo, { setState(foo, { b: undefined }); -setState(foo, { -}); +setState(foo, {}); setState(foo, foo); setState(foo, { a: undefined @@ -118,8 +117,7 @@ c.setState({ c.setState({ b: undefined }); -c.setState({ -}); +c.setState({}); c.setState(foo); c.setState({ a: undefined diff --git a/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.2.minified.js index d5c7febc1b9..467f2c4514c 100644 --- a/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mappedTypeErrors_es2015.2.minified.js @@ -12,8 +12,7 @@ setState(foo, { a: "hi" }), setState(foo, { b: void 0 -}), setState(foo, { -}), setState(foo, foo), setState(foo, { +}), setState(foo, {}), setState(foo, foo), setState(foo, { a: void 0 }), setState(foo, { c: !0 @@ -30,8 +29,7 @@ c.setState({ a: "hi" }), c.setState({ b: void 0 -}), c.setState({ -}), c.setState(foo), c.setState({ +}), c.setState({}), c.setState(foo), c.setState({ a: void 0 }), c.setState({ c: !0 diff --git a/crates/swc/tests/tsc-references/mappedTypeErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeErrors_es5.1.normal.js index 910dc5a3d73..b66bbcce231 100644 --- a/crates/swc/tests/tsc-references/mappedTypeErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeErrors_es5.1.normal.js @@ -110,8 +110,7 @@ setState(foo, { setState(foo, { b: undefined }); -setState(foo, { -}); +setState(foo, {}); setState(foo, foo); setState(foo, { a: undefined @@ -147,8 +146,7 @@ c.setState({ c.setState({ b: undefined }); -c.setState({ -}); +c.setState({}); c.setState(foo); c.setState({ a: undefined diff --git a/crates/swc/tests/tsc-references/mappedTypeErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/mappedTypeErrors_es5.2.minified.js index 856be76966d..15003363bc7 100644 --- a/crates/swc/tests/tsc-references/mappedTypeErrors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mappedTypeErrors_es5.2.minified.js @@ -18,8 +18,7 @@ setState(foo, { a: "hi" }), setState(foo, { b: void 0 -}), setState(foo, { -}), setState(foo, foo), setState(foo, { +}), setState(foo, {}), setState(foo, foo), setState(foo, { a: void 0 }), setState(foo, { c: !0 @@ -48,8 +47,7 @@ c.setState({ a: "hi" }), c.setState({ b: void 0 -}), c.setState({ -}), c.setState(foo), c.setState({ +}), c.setState({}), c.setState(foo), c.setState({ a: void 0 }), c.setState({ c: !0 diff --git a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.1.normal.js index 06bd6aa230e..510ada29283 100644 --- a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.1.normal.js @@ -3,13 +3,11 @@ TerrestrialAnimalTypes; (function(TerrestrialAnimalTypes) { TerrestrialAnimalTypes["CAT"] = "cat"; TerrestrialAnimalTypes["DOG"] = "dog"; -})(TerrestrialAnimalTypes || (TerrestrialAnimalTypes = { -})); +})(TerrestrialAnimalTypes || (TerrestrialAnimalTypes = {})); var AlienAnimalTypes; (function(AlienAnimalTypes) { AlienAnimalTypes["CAT"] = "cat"; -})(AlienAnimalTypes || (AlienAnimalTypes = { -})); +})(AlienAnimalTypes || (AlienAnimalTypes = {})); const catMap = { cat: [ { diff --git a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.2.minified.js b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.2.minified.js index 377ac6bacea..5a143de2505 100644 --- a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es2015.2.minified.js @@ -1,4 +1,2 @@ var TerrestrialAnimalTypes, AlienAnimalTypes, TerrestrialAnimalTypes, AlienAnimalTypes; -(TerrestrialAnimalTypes = TerrestrialAnimalTypes || (TerrestrialAnimalTypes = { -})).CAT = "cat", TerrestrialAnimalTypes.DOG = "dog", (AlienAnimalTypes = AlienAnimalTypes || (AlienAnimalTypes = { -})).CAT = "cat", TerrestrialAnimalTypes.CAT, AlienAnimalTypes.CAT; +(TerrestrialAnimalTypes = TerrestrialAnimalTypes || (TerrestrialAnimalTypes = {})).CAT = "cat", TerrestrialAnimalTypes.DOG = "dog", (AlienAnimalTypes = AlienAnimalTypes || (AlienAnimalTypes = {})).CAT = "cat", TerrestrialAnimalTypes.CAT, AlienAnimalTypes.CAT; diff --git a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.1.normal.js index e7539ccc2d3..bd0aac5dca7 100644 --- a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.1.normal.js @@ -3,13 +3,11 @@ TerrestrialAnimalTypes; (function(TerrestrialAnimalTypes) { TerrestrialAnimalTypes["CAT"] = "cat"; TerrestrialAnimalTypes["DOG"] = "dog"; -})(TerrestrialAnimalTypes || (TerrestrialAnimalTypes = { -})); +})(TerrestrialAnimalTypes || (TerrestrialAnimalTypes = {})); var AlienAnimalTypes; (function(AlienAnimalTypes) { AlienAnimalTypes["CAT"] = "cat"; -})(AlienAnimalTypes || (AlienAnimalTypes = { -})); +})(AlienAnimalTypes || (AlienAnimalTypes = {})); var catMap = { cat: [ { diff --git a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.2.minified.js b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.2.minified.js index 377ac6bacea..5a143de2505 100644 --- a/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mappedTypeOverlappingStringEnumKeys_es5.2.minified.js @@ -1,4 +1,2 @@ var TerrestrialAnimalTypes, AlienAnimalTypes, TerrestrialAnimalTypes, AlienAnimalTypes; -(TerrestrialAnimalTypes = TerrestrialAnimalTypes || (TerrestrialAnimalTypes = { -})).CAT = "cat", TerrestrialAnimalTypes.DOG = "dog", (AlienAnimalTypes = AlienAnimalTypes || (AlienAnimalTypes = { -})).CAT = "cat", TerrestrialAnimalTypes.CAT, AlienAnimalTypes.CAT; +(TerrestrialAnimalTypes = TerrestrialAnimalTypes || (TerrestrialAnimalTypes = {})).CAT = "cat", TerrestrialAnimalTypes.DOG = "dog", (AlienAnimalTypes = AlienAnimalTypes || (AlienAnimalTypes = {})).CAT = "cat", TerrestrialAnimalTypes.CAT, AlienAnimalTypes.CAT; diff --git a/crates/swc/tests/tsc-references/mappedTypes2_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypes2_es2015.1.normal.js index 92586f38839..056284ca976 100644 --- a/crates/swc/tests/tsc-references/mappedTypes2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypes2_es2015.1.normal.js @@ -27,8 +27,7 @@ function f1(shape) { function f2(shape) { var partial; var partial; - var partial = { - }; + var partial = {}; } function f3(shape) { const x = pick(shape, "name", "location"); // { name: string, location: Point } diff --git a/crates/swc/tests/tsc-references/mappedTypes2_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypes2_es5.1.normal.js index 606def8165f..7c3e09211da 100644 --- a/crates/swc/tests/tsc-references/mappedTypes2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypes2_es5.1.normal.js @@ -27,8 +27,7 @@ function f1(shape) { function f2(shape) { var partial; var partial; - var partial = { - }; + var partial = {}; } function f3(shape) { var x = pick(shape, "name", "location"); // { name: string, location: Point } diff --git a/crates/swc/tests/tsc-references/mappedTypes4_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypes4_es2015.1.normal.js index 1247470bfa3..8c69d8a69c5 100644 --- a/crates/swc/tests/tsc-references/mappedTypes4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypes4_es2015.1.normal.js @@ -1,7 +1,6 @@ function boxify(obj) { if (typeof obj === "object") { - let result = { - }; + let result = {}; for(let k in obj){ result[k] = { value: obj[k] diff --git a/crates/swc/tests/tsc-references/mappedTypes4_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypes4_es5.1.normal.js index 11de083890f..d7e843f4eb8 100644 --- a/crates/swc/tests/tsc-references/mappedTypes4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypes4_es5.1.normal.js @@ -1,7 +1,6 @@ function boxify(obj) { if (typeof obj === "object") { - var result = { - }; + var result = {}; for(var k in obj){ result[k] = { value: obj[k] diff --git a/crates/swc/tests/tsc-references/mappedTypes6_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypes6_es2015.1.normal.js index 630aa9479f0..9d3ed1b5e3f 100644 --- a/crates/swc/tests/tsc-references/mappedTypes6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypes6_es2015.1.normal.js @@ -28,14 +28,10 @@ function f2(w, x, y, z) { z = z; } function f3(w, x, y, z) { - w = { - }; // Error - x = { - }; // Error - y = { - }; // Error - z = { - }; + w = {}; // Error + x = {}; // Error + y = {}; // Error + z = {}; } function f10(x, y, z) { x = x; diff --git a/crates/swc/tests/tsc-references/mappedTypes6_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypes6_es5.1.normal.js index 630aa9479f0..9d3ed1b5e3f 100644 --- a/crates/swc/tests/tsc-references/mappedTypes6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypes6_es5.1.normal.js @@ -28,14 +28,10 @@ function f2(w, x, y, z) { z = z; } function f3(w, x, y, z) { - w = { - }; // Error - x = { - }; // Error - y = { - }; // Error - z = { - }; + w = {}; // Error + x = {}; // Error + y = {}; // Error + z = {}; } function f10(x, y, z) { x = x; diff --git a/crates/swc/tests/tsc-references/mappedTypesAndObjects_es2015.1.normal.js b/crates/swc/tests/tsc-references/mappedTypesAndObjects_es2015.1.normal.js index f513874defc..6c21a3c7b1c 100644 --- a/crates/swc/tests/tsc-references/mappedTypesAndObjects_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypesAndObjects_es2015.1.normal.js @@ -11,13 +11,11 @@ function f2(x, y) { obj = y; } function f3(x) { - x = { - }; + x = {}; } // Repro from #13747 class Form { constructor(){ - this.values = { - }; + this.values = {}; } } diff --git a/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.1.normal.js b/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.1.normal.js index 2cfc1f8c85d..7004f899be7 100644 --- a/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.1.normal.js @@ -16,13 +16,11 @@ function f2(x, y) { obj = y; } function f3(x) { - x = { - }; + x = {}; } var Form = function Form() { "use strict"; _classCallCheck(this, Form); // Repro from #13747 - this.values = { - }; + this.values = {}; }; diff --git a/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.2.minified.js b/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.2.minified.js index 86dffb001f6..2b77b6a284d 100644 --- a/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mappedTypesAndObjects_es5.2.minified.js @@ -2,6 +2,5 @@ var Form = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, Form), this.values = { - }; + }(this, Form), this.values = {}; }; diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.1.normal.js index 399600b1b22..4d001325162 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.1.normal.js @@ -1,22 +1,14 @@ class C { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + static bar(x, y) {} } class D { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + static bar(x, y) {} } var c; var r = c.foo(1); // error diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.2.minified.js b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.2.minified.js index 41f55820f9a..a2e1cd97552 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es2015.2.minified.js @@ -1,20 +1,12 @@ var d; (void 0).foo(1), d.foo(2), (class { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + static bar(x, y) {} }).foo(1), (class { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + static bar(x, y) {} }).bar(""); diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.1.normal.js index 87ee7388f28..88a517a6734 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.1.normal.js @@ -25,24 +25,20 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ], [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ]); return C; @@ -55,24 +51,20 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ], [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.2.minified.js b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.2.minified.js index 228aa175c5b..8e7b4c9b1b5 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads_es5.2.minified.js @@ -18,24 +18,20 @@ var c, d, C = function() { return _createClass(C, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ], [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ]), C; }(), D = function() { @@ -46,24 +42,20 @@ var c, d, C = function() { return _createClass(D, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ], [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es2015.1.normal.js index e3b9bcebf9f..cd54987f535 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es2015.1.normal.js @@ -1,20 +1,12 @@ class C { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + static bar(x, y) {} } class D { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + static bar(x, y) {} } diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.1.normal.js index 2caba820d56..efece457ee7 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.1.normal.js @@ -25,24 +25,20 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ], [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ]); return C; @@ -55,24 +51,20 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ], [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.2.minified.js b/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.2.minified.js index 6fde4439e3e..a3c2e122bdd 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPublicOverloads_es5.2.minified.js @@ -18,24 +18,20 @@ var C = function() { return _createClass(C, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ], [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ]), C; }(), D = function() { @@ -46,24 +42,20 @@ var C = function() { return _createClass(D, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ], [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es2015.1.normal.js index bfa4791c1f3..248d1c0dcea 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es2015.1.normal.js @@ -1,30 +1,18 @@ class C { - foo(x, y) { - } - bar(x, y) { - } - static foo(x, y) { - } - baz(x, y) { - } - static bar(x, y) { - } - static baz(x, y) { - } + foo(x, y) {} + bar(x, y) {} + static foo(x, y) {} + baz(x, y) {} + static bar(x, y) {} + static baz(x, y) {} } class D { - foo(x, y) { - } - bar(x, y) { - } - baz(x, y) { - } - static foo(x, y) { - } - static bar(x, y) { - } - static baz(x, y) { - } + foo(x, y) {} + bar(x, y) {} + baz(x, y) {} + static foo(x, y) {} + static bar(x, y) {} + static baz(x, y) {} } var c; var r = c.foo(1); // error diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.1.normal.js index 596e4848d5b..d4e7760779d 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.1.normal.js @@ -25,34 +25,28 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} }, { key: "baz", - value: function baz(x, y) { - } + value: function baz(x, y) {} } ], [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} }, { key: "baz", - value: function baz(x, y) { - } + value: function baz(x, y) {} } ]); return C; @@ -65,34 +59,28 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} }, { key: "baz", - value: function baz(x, y) { - } + value: function baz(x, y) {} } ], [ { key: "foo", - value: function foo(x, y) { - } + value: function foo(x, y) {} }, { key: "bar", - value: function bar(x, y) { - } + value: function bar(x, y) {} }, { key: "baz", - value: function baz(x, y) { - } + value: function baz(x, y) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.2.minified.js b/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.2.minified.js index d70f37be011..3d142f539e5 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPublicPrivateOverloads_es5.2.minified.js @@ -18,34 +18,28 @@ var c, d, C = function() { return _createClass(C, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "baz", - value: function(x, y) { - } + value: function(x, y) {} } ], [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "baz", - value: function(x, y) { - } + value: function(x, y) {} } ]), C; }(), D = function() { @@ -56,34 +50,28 @@ var c, d, C = function() { return _createClass(D, [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "baz", - value: function(x, y) { - } + value: function(x, y) {} } ], [ { key: "foo", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "bar", - value: function(x, y) { - } + value: function(x, y) {} }, { key: "baz", - value: function(x, y) { - } + value: function(x, y) {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.1.normal.js index 49e1bd70723..dad2efa3790 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.1.normal.js @@ -5,25 +5,21 @@ var M2; var a; var r1 = a.foo; var r2 = a.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M2) { var a; var r1 = a.foo; var r2 = a.bar; var r3 = a.baz; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M21) { let M3; (function(M3) { var a; var r1 = a.foo; var r2 = a.bar; - })(M3 = M21.M3 || (M21.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M21.M3 || (M21.M3 = {})); +})(M2 || (M2 = {})); (function(M22) { let M3; (function(M3) { @@ -31,10 +27,8 @@ var M2; var r1 = a.foo; var r2 = a.bar; var r3 = a.baz; - })(M3 = M22.M3 || (M22.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M22.M3 || (M22.M3 = {})); +})(M2 || (M2 = {})); (function(M23) { let M3; (function(M3) { @@ -42,7 +36,5 @@ var M2; var r1 = a.foo; var r2 = a.bar; var r3 = a.baz; - })(M3 = M23.M3 || (M23.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M23.M3 || (M23.M3 = {})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.2.minified.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.2.minified.js index 2056b9047ce..58c338d1d4c 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es2015.2.minified.js @@ -2,24 +2,16 @@ var M2; !function(M2) { var a; a.foo, a.bar; -}(M2 || (M2 = { -})), (function(M2) { +}(M2 || (M2 = {})), (function(M2) { var a; a.foo, a.bar, a.baz; -})(M2 || (M2 = { -})), (function(M21) { +})(M2 || (M2 = {})), (function(M21) { var a; - M21.M3 || (M21.M3 = { - }), a.foo, a.bar; -})(M2 || (M2 = { -})), (function(M22) { + M21.M3 || (M21.M3 = {}), a.foo, a.bar; +})(M2 || (M2 = {})), (function(M22) { var a; - M22.M3 || (M22.M3 = { - }), a.foo, a.bar, a.baz; -})(M2 || (M2 = { -})), (function(M23) { + M22.M3 || (M22.M3 = {}), a.foo, a.bar, a.baz; +})(M2 || (M2 = {})), (function(M23) { var a; - M23.M3 || (M23.M3 = { - }), a.foo, a.bar, a.baz; -})(M2 || (M2 = { -})); + M23.M3 || (M23.M3 = {}), a.foo, a.bar, a.baz; +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.1.normal.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.1.normal.js index be704f46dc6..f8d317d0aa9 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.1.normal.js @@ -5,25 +5,21 @@ var M2; var a; var r1 = a.foo; var r2 = a.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M2) { var a; var r1 = a.foo; var r2 = a.bar; var r3 = a.baz; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M21) { var M3; (function(M3) { var a; var r1 = a.foo; var r2 = a.bar; - })(M3 = M21.M3 || (M21.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M21.M3 || (M21.M3 = {})); +})(M2 || (M2 = {})); (function(M22) { var M3; (function(M3) { @@ -31,10 +27,8 @@ var M2; var r1 = a.foo; var r2 = a.bar; var r3 = a.baz; - })(M3 = M22.M3 || (M22.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M22.M3 || (M22.M3 = {})); +})(M2 || (M2 = {})); (function(M23) { var M3; (function(M3) { @@ -42,7 +36,5 @@ var M2; var r1 = a.foo; var r2 = a.bar; var r3 = a.baz; - })(M3 = M23.M3 || (M23.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M23.M3 || (M23.M3 = {})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.2.minified.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.2.minified.js index 2056b9047ce..58c338d1d4c 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces2_es5.2.minified.js @@ -2,24 +2,16 @@ var M2; !function(M2) { var a; a.foo, a.bar; -}(M2 || (M2 = { -})), (function(M2) { +}(M2 || (M2 = {})), (function(M2) { var a; a.foo, a.bar, a.baz; -})(M2 || (M2 = { -})), (function(M21) { +})(M2 || (M2 = {})), (function(M21) { var a; - M21.M3 || (M21.M3 = { - }), a.foo, a.bar; -})(M2 || (M2 = { -})), (function(M22) { + M21.M3 || (M21.M3 = {}), a.foo, a.bar; +})(M2 || (M2 = {})), (function(M22) { var a; - M22.M3 || (M22.M3 = { - }), a.foo, a.bar, a.baz; -})(M2 || (M2 = { -})), (function(M23) { + M22.M3 || (M22.M3 = {}), a.foo, a.bar, a.baz; +})(M2 || (M2 = {})), (function(M23) { var a; - M23.M3 || (M23.M3 = { - }), a.foo, a.bar, a.baz; -})(M2 || (M2 = { -})); + M23.M3 || (M23.M3 = {}), a.foo, a.bar, a.baz; +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.1.normal.js index 8a13c42ba29..379038ea3f8 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.1.normal.js @@ -21,5 +21,4 @@ var M; var r5 = b1.bar; // any, should be number // BUG 856491 var r6 = b1.baz; // any, should be boolean -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.2.minified.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.2.minified.js index bbdbe390a99..1c1baac8ea5 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es2015.2.minified.js @@ -2,5 +2,4 @@ var a, b, M; a.foo, a.bar, a.baz, b.foo, b.bar, b.baz, (function(M) { var a1, b1; a1.foo, a1.bar, a1.baz, b1.foo, b1.bar, b1.baz; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.1.normal.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.1.normal.js index 8a13c42ba29..379038ea3f8 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.1.normal.js @@ -21,5 +21,4 @@ var M; var r5 = b1.bar; // any, should be number // BUG 856491 var r6 = b1.baz; // any, should be boolean -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.2.minified.js b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.2.minified.js index bbdbe390a99..1c1baac8ea5 100644 --- a/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeThreeInterfaces_es5.2.minified.js @@ -2,5 +2,4 @@ var a, b, M; a.foo, a.bar, a.baz, b.foo, b.bar, b.baz, (function(M) { var a1, b1; a1.foo, a1.bar, a1.baz, b1.foo, b1.bar, b1.baz; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.1.normal.js index eeab46bc8d2..7c66df7ee7e 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.1.normal.js @@ -5,31 +5,25 @@ var M2; var a; var r1 = a.foo; var r2 = a.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M2) { var a; var r1 = a.foo; var r2 = a.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M21) { let M3; (function(M3) { var a; var r1 = a.foo; var r2 = a.bar; - })(M3 = M21.M3 || (M21.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M21.M3 || (M21.M3 = {})); +})(M2 || (M2 = {})); (function(M22) { let M3; (function(M3) { var a; var r1 = a.foo; var r2 = a.bar; - })(M3 = M22.M3 || (M22.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M22.M3 || (M22.M3 = {})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.2.minified.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.2.minified.js index a96352e8a2e..9e5cae31f72 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es2015.2.minified.js @@ -2,19 +2,13 @@ var M2; !function(M2) { var a; a.foo, a.bar; -}(M2 || (M2 = { -})), (function(M2) { +}(M2 || (M2 = {})), (function(M2) { var a; a.foo, a.bar; -})(M2 || (M2 = { -})), (function(M21) { +})(M2 || (M2 = {})), (function(M21) { var a; - M21.M3 || (M21.M3 = { - }), a.foo, a.bar; -})(M2 || (M2 = { -})), (function(M22) { + M21.M3 || (M21.M3 = {}), a.foo, a.bar; +})(M2 || (M2 = {})), (function(M22) { var a; - M22.M3 || (M22.M3 = { - }), a.foo, a.bar; -})(M2 || (M2 = { -})); + M22.M3 || (M22.M3 = {}), a.foo, a.bar; +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.1.normal.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.1.normal.js index 00ca2aba355..e6049cd095d 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.1.normal.js @@ -5,31 +5,25 @@ var M2; var a; var r1 = a.foo; var r2 = a.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M2) { var a; var r1 = a.foo; var r2 = a.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); (function(M21) { var M3; (function(M3) { var a; var r1 = a.foo; var r2 = a.bar; - })(M3 = M21.M3 || (M21.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M21.M3 || (M21.M3 = {})); +})(M2 || (M2 = {})); (function(M22) { var M3; (function(M3) { var a; var r1 = a.foo; var r2 = a.bar; - })(M3 = M22.M3 || (M22.M3 = { - })); -})(M2 || (M2 = { -})); + })(M3 = M22.M3 || (M22.M3 = {})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.2.minified.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.2.minified.js index a96352e8a2e..9e5cae31f72 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces2_es5.2.minified.js @@ -2,19 +2,13 @@ var M2; !function(M2) { var a; a.foo, a.bar; -}(M2 || (M2 = { -})), (function(M2) { +}(M2 || (M2 = {})), (function(M2) { var a; a.foo, a.bar; -})(M2 || (M2 = { -})), (function(M21) { +})(M2 || (M2 = {})), (function(M21) { var a; - M21.M3 || (M21.M3 = { - }), a.foo, a.bar; -})(M2 || (M2 = { -})), (function(M22) { + M21.M3 || (M21.M3 = {}), a.foo, a.bar; +})(M2 || (M2 = {})), (function(M22) { var a; - M22.M3 || (M22.M3 = { - }), a.foo, a.bar; -})(M2 || (M2 = { -})); + M22.M3 || (M22.M3 = {}), a.foo, a.bar; +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.1.normal.js index 974ab4b5f41..98ad23db306 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.1.normal.js @@ -15,5 +15,4 @@ var M; var r3 = b1.foo; // BUG 856491 var r4 = b1.bar; // any, should be string -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.2.minified.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.2.minified.js index 41d2665506a..11c9a0e8a2e 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es2015.2.minified.js @@ -2,5 +2,4 @@ var a, b, M; a.foo, a.bar, b.foo, b.bar, (function(M) { var a1, b1; a1.foo, a1.bar, b1.foo, b1.bar; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.1.normal.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.1.normal.js index 974ab4b5f41..98ad23db306 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.1.normal.js @@ -15,5 +15,4 @@ var M; var r3 = b1.foo; // BUG 856491 var r4 = b1.bar; // any, should be string -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.2.minified.js b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.2.minified.js index 41d2665506a..11c9a0e8a2e 100644 --- a/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergeTwoInterfaces_es5.2.minified.js @@ -2,5 +2,4 @@ var a, b, M; a.foo, a.bar, b.foo, b.bar, (function(M) { var a1, b1; a1.foo, a1.bar, b1.foo, b1.bar; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es2015.1.normal.js index c7555526300..be26955d1a9 100644 --- a/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es2015.1.normal.js @@ -1,14 +1,11 @@ class BaseClass { - baseMethod() { - } + baseMethod() {} } class Child extends BaseClass { - method() { - } + method() {} } class ChildNoBaseClass { - method2() { - } + method2() {} } class Grandchild extends ChildNoBaseClass { } diff --git a/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.1.normal.js index ed9038c22be..e4826f67f48 100644 --- a/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,8 +90,7 @@ var BaseClass = /*#__PURE__*/ function() { _createClass(BaseClass, [ { key: "baseMethod", - value: function baseMethod() { - } + value: function baseMethod() {} } ]); return BaseClass; @@ -108,8 +106,7 @@ var Child = /*#__PURE__*/ function(BaseClass) { _createClass(Child, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return Child; @@ -122,8 +119,7 @@ var ChildNoBaseClass = /*#__PURE__*/ function() { _createClass(ChildNoBaseClass, [ { key: "method2", - value: function method2() { - } + value: function method2() {} } ]); return ChildNoBaseClass; diff --git a/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.2.minified.js b/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.2.minified.js index 8adbbbd4bc6..b53cdf5f853 100644 --- a/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInheritedClassInterface_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var child, grandchild, BaseClass = function() { return _createClass(BaseClass, [ { key: "baseMethod", - value: function() { - } + value: function() {} } ]), BaseClass; }(), Child = function(BaseClass) { @@ -76,8 +74,7 @@ var child, grandchild, BaseClass = function() { return _createClass(Child, [ { key: "method", - value: function() { - } + value: function() {} } ]), Child; }(BaseClass), ChildNoBaseClass = function() { @@ -88,8 +85,7 @@ var child, grandchild, BaseClass = function() { return _createClass(ChildNoBaseClass, [ { key: "method2", - value: function() { - } + value: function() {} } ]), ChildNoBaseClass; }(), Grandchild = function(ChildNoBaseClass) { diff --git a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.1.normal.js index be2f0d8cd62..00d28bc0bc0 100644 --- a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.2.minified.js b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.2.minified.js index 73974aa17e7..5f97ce2b11a 100644 --- a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.1.normal.js index b58d033696d..8c4244662cf 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.2.minified.js index cd5f8109127..e62040a75ad 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es2015.1.normal.js index 4b2c6dddfa6..aaa4997ac57 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es2015.1.normal.js @@ -10,5 +10,4 @@ var M; } class C2 { } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.1.normal.js index 0e928b64942..32055047ee2 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -97,5 +96,4 @@ var M; "use strict"; _classCallCheck(this, C2); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.2.minified.js index 1533395f170..3fef70b911f 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3_es5.2.minified.js @@ -35,8 +35,7 @@ var M, C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -66,5 +65,4 @@ var M, C = function() { "use strict"; _classCallCheck(this, C21); }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es2015.1.normal.js index 6a34c65d38a..7717a6024f7 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es2015.1.normal.js @@ -25,5 +25,4 @@ var M; } class D { } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.1.normal.js index 17f621e3c3b..78edf1d17c0 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.1.normal.js @@ -48,5 +48,4 @@ var M; "use strict"; _classCallCheck(this, D); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.2.minified.js index 6a82becc25a..b3ed77f8cb7 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases2_es5.2.minified.js @@ -34,5 +34,4 @@ a.a, (function(M) { "use strict"; _classCallCheck(this, D1); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es2015.1.normal.js index b7d20032424..717fe46a0ef 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es2015.1.normal.js @@ -17,5 +17,4 @@ var M; } class D { } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.1.normal.js index 66cab1512a5..323f36935a9 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.1.normal.js @@ -32,5 +32,4 @@ var M; "use strict"; _classCallCheck(this, D); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.2.minified.js index 2ccc104971f..28509bfbf6d 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithMultipleBases_es5.2.minified.js @@ -22,5 +22,4 @@ a.a, (function(M) { "use strict"; _classCallCheck(this, D1); }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/methodsReturningThis_es2015.1.normal.js b/crates/swc/tests/tsc-references/methodsReturningThis_es2015.1.normal.js index 7aaf328bc45..15fad0465e4 100644 --- a/crates/swc/tests/tsc-references/methodsReturningThis_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/methodsReturningThis_es2015.1.normal.js @@ -1,8 +1,7 @@ // @filename: input.js // @out: output.js // @allowJs: true -function Class() { -} +function Class() {} // error: 'Class' doesn't have property 'notPresent' Class.prototype.containsError = function() { return this.notPresent; diff --git a/crates/swc/tests/tsc-references/methodsReturningThis_es2015.2.minified.js b/crates/swc/tests/tsc-references/methodsReturningThis_es2015.2.minified.js index 8c12ae9c154..b705b16c5e5 100644 --- a/crates/swc/tests/tsc-references/methodsReturningThis_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/methodsReturningThis_es2015.2.minified.js @@ -1,5 +1,4 @@ -function Class() { -} +function Class() {} Class.prototype.containsError = function() { return this.notPresent; }, Class.prototype.m1 = function(a, b, c, d, tx, ty) { diff --git a/crates/swc/tests/tsc-references/methodsReturningThis_es5.1.normal.js b/crates/swc/tests/tsc-references/methodsReturningThis_es5.1.normal.js index 7aaf328bc45..15fad0465e4 100644 --- a/crates/swc/tests/tsc-references/methodsReturningThis_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/methodsReturningThis_es5.1.normal.js @@ -1,8 +1,7 @@ // @filename: input.js // @out: output.js // @allowJs: true -function Class() { -} +function Class() {} // error: 'Class' doesn't have property 'notPresent' Class.prototype.containsError = function() { return this.notPresent; diff --git a/crates/swc/tests/tsc-references/methodsReturningThis_es5.2.minified.js b/crates/swc/tests/tsc-references/methodsReturningThis_es5.2.minified.js index 8c12ae9c154..b705b16c5e5 100644 --- a/crates/swc/tests/tsc-references/methodsReturningThis_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/methodsReturningThis_es5.2.minified.js @@ -1,5 +1,4 @@ -function Class() { -} +function Class() {} Class.prototype.containsError = function() { return this.notPresent; }, Class.prototype.m1 = function(a, b, c, d, tx, ty) { diff --git a/crates/swc/tests/tsc-references/missingAndExcessProperties_es2015.1.normal.js b/crates/swc/tests/tsc-references/missingAndExcessProperties_es2015.1.normal.js index 80338ae991a..3c143028eac 100644 --- a/crates/swc/tests/tsc-references/missingAndExcessProperties_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/missingAndExcessProperties_es2015.1.normal.js @@ -1,25 +1,17 @@ // Missing properties function f1() { - var { x , y } = { - }; - var { x =1 , y } = { - }; - var { x , y =1 } = { - }; - var { x =1 , y =1 } = { - }; + var { x , y } = {}; + var { x =1 , y } = {}; + var { x , y =1 } = {}; + var { x =1 , y =1 } = {}; } // Missing properties function f2() { var x, y; - ({ x , y } = { - }); - ({ x: x = 1 , y } = { - }); - ({ x , y: y = 1 } = { - }); - ({ x: x = 1 , y: y = 1 } = { - }); + ({ x , y } = {}); + ({ x: x = 1 , y } = {}); + ({ x , y: y = 1 } = {}); + ({ x: x = 1 , y: y = 1 } = {}); } // Excess properties function f3() { diff --git a/crates/swc/tests/tsc-references/missingAndExcessProperties_es5.1.normal.js b/crates/swc/tests/tsc-references/missingAndExcessProperties_es5.1.normal.js index 6b7c737f21a..fafcfcb9197 100644 --- a/crates/swc/tests/tsc-references/missingAndExcessProperties_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/missingAndExcessProperties_es5.1.normal.js @@ -3,30 +3,22 @@ function _throw(e) { } // Missing properties function f1() { - var ref = { - }, x = ref.x, y = ref.y; - var ref1 = { - }, _x = ref1.x, x = _x === void 0 ? 1 : _x, y = ref1.y; - var ref2 = { - }, x = ref2.x, _y = ref2.y, y = _y === void 0 ? 1 : _y; - var ref3 = { - }, _x1 = ref3.x, x = _x1 === void 0 ? 1 : _x1, _y1 = ref3.y, y = _y1 === void 0 ? 1 : _y1; + var ref = {}, x = ref.x, y = ref.y; + var ref1 = {}, _x = ref1.x, x = _x === void 0 ? 1 : _x, y = ref1.y; + var ref2 = {}, x = ref2.x, _y = ref2.y, y = _y === void 0 ? 1 : _y; + var ref3 = {}, _x1 = ref3.x, x = _x1 === void 0 ? 1 : _x1, _y1 = ref3.y, y = _y1 === void 0 ? 1 : _y1; } // Missing properties function f2() { var x, y; var ref; - ref = { - }, x = ref.x, y = ref.y, ref; + ref = {}, x = ref.x, y = ref.y, ref; var ref4, ref5; - ref4 = { - }, ref5 = ref4.x, x = ref5 === void 0 ? 1 : ref5, y = ref4.y, ref4; + ref4 = {}, ref5 = ref4.x, x = ref5 === void 0 ? 1 : ref5, y = ref4.y, ref4; var ref6, ref7; - ref6 = { - }, x = ref6.x, ref7 = ref6.y, y = ref7 === void 0 ? 1 : ref7, ref6; + ref6 = {}, x = ref6.x, ref7 = ref6.y, y = ref7 === void 0 ? 1 : ref7, ref6; var ref8, ref9, ref10; - ref8 = { - }, ref9 = ref8.x, x = ref9 === void 0 ? 1 : ref9, ref10 = ref8.y, y = ref10 === void 0 ? 1 : ref10, ref8; + ref8 = {}, ref9 = ref8.x, x = ref9 === void 0 ? 1 : ref9, ref10 = ref8.y, y = ref10 === void 0 ? 1 : ref10, ref8; } // Excess properties function f3() { diff --git a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.1.normal.js index a3ca522da3b..8dd13383df0 100644 --- a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.1.normal.js @@ -1,4 +1,3 @@ // Should not crash: #34642 var arr = []; -arr[0].prop[2] = { -}; +arr[0].prop[2] = {}; diff --git a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.2.minified.js index a00c771dd56..2589dacd576 100644 --- a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es2015.2.minified.js @@ -1,2 +1 @@ -[][0].prop[2] = { -}; +[][0].prop[2] = {}; diff --git a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.1.normal.js index a3ca522da3b..8dd13383df0 100644 --- a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.1.normal.js @@ -1,4 +1,3 @@ // Should not crash: #34642 var arr = []; -arr[0].prop[2] = { -}; +arr[0].prop[2] = {}; diff --git a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.2.minified.js index a00c771dd56..2589dacd576 100644 --- a/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mixedPropertyElementAccessAssignmentDeclaration_es5.2.minified.js @@ -1,2 +1 @@ -[][0].prop[2] = { -}; +[][0].prop[2] = {}; diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.1.normal.js b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.1.normal.js index ded9e26fa77..b191a5058ba 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.1.normal.js @@ -1,8 +1,7 @@ function Mixin(baseClass) { // error expected: A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'. class MixinClass extends baseClass { - mixinMethod() { - } + mixinMethod() {} } return MixinClass; } diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.2.minified.js b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.2.minified.js index d98ad7df641..bc718902407 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es2015.2.minified.js @@ -1,6 +1,5 @@ const MixedBase = class extends class { } { - mixinMethod() { - } + mixinMethod() {} }; new MixedBase(); diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.1.normal.js b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.1.normal.js index 1816a36f800..5bf7edb30b6 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -96,8 +95,7 @@ function Mixin(baseClass1) { _createClass(MixinClass, [ { key: "mixinMethod", - value: function mixinMethod() { - } + value: function mixinMethod() {} } ]); return MixinClass; diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.2.minified.js b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.2.minified.js index aa32e5ce212..6be9cbbe25a 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses.2_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,8 +64,7 @@ var AbstractBase = function() { return protoProps = [ { key: "mixinMethod", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = MixinClass).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), MixinClass; }(baseClass1); diff --git a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.1.normal.js index d0302b47f54..45924bcdafd 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.1.normal.js @@ -4,14 +4,11 @@ function Mixin2(baseClass) { // must be `abstract` because we cannot know *all* of the possible abstract members that need to be // implemented for this to be concrete. class MixinClass extends baseClass { - mixinMethod() { - } - static staticMixinMethod() { - } + mixinMethod() {} + static staticMixinMethod() {} } return MixinClass; } class DerivedFromAbstract2 extends Mixin2(AbstractBase) { - abstractBaseMethod() { - } + abstractBaseMethod() {} } diff --git a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.2.minified.js index 9793ada4eef..130d9f706af 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es2015.2.minified.js @@ -2,13 +2,10 @@ class AbstractBase { } function Mixin2(baseClass) { return class extends baseClass { - mixinMethod() { - } - static staticMixinMethod() { - } + mixinMethod() {} + static staticMixinMethod() {} }; } class DerivedFromAbstract2 extends Mixin2(AbstractBase) { - abstractBaseMethod() { - } + abstractBaseMethod() {} } diff --git a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.1.normal.js b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.1.normal.js index bc8546a1afc..c3d9a36a91a 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -101,14 +100,12 @@ function Mixin2(baseClass1) { _createClass(MixinClass, [ { key: "mixinMethod", - value: function mixinMethod() { - } + value: function mixinMethod() {} } ], [ { key: "staticMixinMethod", - value: function staticMixinMethod() { - } + value: function staticMixinMethod() {} } ]); return MixinClass; @@ -126,8 +123,7 @@ var DerivedFromAbstract2 = /*#__PURE__*/ function(_super) { _createClass(DerivedFromAbstract2, [ { key: "abstractBaseMethod", - value: function abstractBaseMethod() { - } + value: function abstractBaseMethod() {} } ]); return DerivedFromAbstract2; diff --git a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.2.minified.js b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.2.minified.js index d345b0c0548..133f0dcc20a 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClassesReturnTypeInference_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -67,8 +66,7 @@ var AbstractBase = function() { return _createClass(DerivedFromAbstract2, [ { key: "abstractBaseMethod", - value: function() { - } + value: function() {} } ]), DerivedFromAbstract2; }(function(baseClass1) { @@ -82,14 +80,12 @@ var AbstractBase = function() { return _createClass(MixinClass, [ { key: "mixinMethod", - value: function() { - } + value: function() {} } ], [ { key: "staticMixinMethod", - value: function() { - } + value: function() {} } ]), MixinClass; }(baseClass1); diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.1.normal.js b/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.1.normal.js index 1178892679e..8de71245012 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.1.normal.js @@ -1,13 +1,11 @@ function Mixin(baseClass) { class MixinClass extends baseClass { - mixinMethod() { - } + mixinMethod() {} } return MixinClass; } class ConcreteBase { - baseMethod() { - } + baseMethod() {} } class AbstractBase { } @@ -17,8 +15,7 @@ const wasConcrete = new DerivedFromConcrete(); wasConcrete.baseMethod(); wasConcrete.mixinMethod(); class DerivedFromAbstract extends Mixin(AbstractBase) { - abstractBaseMethod() { - } + abstractBaseMethod() {} } const wasAbstract = new DerivedFromAbstract(); wasAbstract.abstractBaseMethod(); diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.2.minified.js b/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.2.minified.js index ad1aee781e0..a73f7f67ff7 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses_es2015.2.minified.js @@ -1,12 +1,10 @@ function Mixin(baseClass) { return class extends baseClass { - mixinMethod() { - } + mixinMethod() {} }; } class ConcreteBase { - baseMethod() { - } + baseMethod() {} } class AbstractBase { } @@ -15,8 +13,7 @@ class DerivedFromConcrete extends Mixin(ConcreteBase) { const wasConcrete = new DerivedFromConcrete(); wasConcrete.baseMethod(), wasConcrete.mixinMethod(); class DerivedFromAbstract extends Mixin(AbstractBase) { - abstractBaseMethod() { - } + abstractBaseMethod() {} } const wasAbstract = new DerivedFromAbstract(); wasAbstract.abstractBaseMethod(), wasAbstract.mixinMethod(); diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.1.normal.js b/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.1.normal.js index a9b8ae72873..dd317c14418 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -95,8 +94,7 @@ function Mixin(baseClass1) { _createClass(MixinClass, [ { key: "mixinMethod", - value: function mixinMethod() { - } + value: function mixinMethod() {} } ]); return MixinClass; @@ -111,8 +109,7 @@ var ConcreteBase = /*#__PURE__*/ function() { _createClass(ConcreteBase, [ { key: "baseMethod", - value: function baseMethod() { - } + value: function baseMethod() {} } ]); return ConcreteBase; @@ -145,8 +142,7 @@ var DerivedFromAbstract = /*#__PURE__*/ function(_super) { _createClass(DerivedFromAbstract, [ { key: "abstractBaseMethod", - value: function abstractBaseMethod() { - } + value: function abstractBaseMethod() {} } ]); return DerivedFromAbstract; diff --git a/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.2.minified.js b/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.2.minified.js index a7b85ebb71a..9f9108f18c2 100644 --- a/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinAbstractClasses_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,8 +64,7 @@ function Mixin(baseClass1) { return _createClass(MixinClass, [ { key: "mixinMethod", - value: function() { - } + value: function() {} } ]), MixinClass; }(baseClass1); @@ -80,8 +78,7 @@ var ConcreteBase = function() { return _createClass(ConcreteBase, [ { key: "baseMethod", - value: function() { - } + value: function() {} } ]), ConcreteBase; }(), AbstractBase = function() { @@ -107,8 +104,7 @@ var DerivedFromAbstract = function(_super) { return _createClass(DerivedFromAbstract, [ { key: "abstractBaseMethod", - value: function() { - } + value: function() {} } ]), DerivedFromAbstract; }(Mixin(AbstractBase)), wasAbstract = new DerivedFromAbstract(); diff --git a/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es2015.1.normal.js index ffbdbc32538..43e00277076 100644 --- a/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es2015.1.normal.js @@ -1,10 +1,8 @@ // @declaration: true function f() { class C { - static foo() { - } - bar() { - } + static foo() {} + bar() {} constructor(){ this.baz = 1; } diff --git a/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es5.1.normal.js index 3b286f46c2c..41386d69c31 100644 --- a/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/modifierOnClassDeclarationMemberInFunction_es5.1.normal.js @@ -28,14 +28,12 @@ function f() { _createClass(C, [ { key: "bar", - value: function bar() { - } + value: function bar() {} } ], [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es2015.1.normal.js index d59b7c21f4c..87bf7a1ef9c 100644 --- a/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es2015.1.normal.js @@ -3,8 +3,7 @@ var _class; // @declaration: true function g() { var x = (_class = class C { - foo() { - } + foo() {} constructor(){ this.prop1 = 1; } diff --git a/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es5.1.normal.js index 387fce08558..4ced496164c 100644 --- a/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/modifierOnClassExpressionMemberInFunction_es5.1.normal.js @@ -30,8 +30,7 @@ function g() { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.1.normal.js index d7758785f90..9a25f2db05a 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.1.normal.js @@ -3,8 +3,7 @@ // @noEmit: true // @Filename: bug24754.js // #24754 -const webpack = function() { -}; +const webpack = function() {}; exports = module.exports = webpack; exports.version = 1001; webpack.WebpackOptionsDefaulter = 1111; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.2.minified.js index 30ebb9fa78b..35ade53ee26 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias5_es2015.2.minified.js @@ -1,3 +1,2 @@ -const webpack = function() { -}; +const webpack = function() {}; (exports = module.exports = webpack).version = 1001, webpack.WebpackOptionsDefaulter = 1111; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias5_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias5_es5.1.normal.js index cb671f56ceb..44c70e8662d 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias5_es5.1.normal.js @@ -3,8 +3,7 @@ // @noEmit: true // @Filename: bug24754.js // #24754 -var webpack = function webpack() { -}; +var webpack = function webpack() {}; exports = module.exports = webpack; exports.version = 1001; webpack.WebpackOptionsDefaulter = 1111; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias5_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias5_es5.2.minified.js index a416b5e6e43..3e170b0018a 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias5_es5.2.minified.js @@ -1,3 +1,2 @@ -var webpack = function() { -}; +var webpack = function() {}; (exports = module.exports = webpack).version = 1001, webpack.WebpackOptionsDefaulter = 1111; diff --git a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.1.normal.js index 047c907f101..c970a2b53cb 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.1.normal.js @@ -2,8 +2,7 @@ // @checkJs: true // @filename: moduleExportAliasElementAccessExpression.js // @outdir: out -function D() { -} +function D() {} exports["D"] = D; // (the only package I could find that uses spaces in identifiers is webidl-conversions) exports["Does not work yet"] = D; diff --git a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.2.minified.js index 584757b0132..b41a373563c 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es2015.2.minified.js @@ -1,3 +1,2 @@ -function D() { -} +function D() {} exports.D = D, exports["Does not work yet"] = D; diff --git a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.1.normal.js index 047c907f101..c970a2b53cb 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.1.normal.js @@ -2,8 +2,7 @@ // @checkJs: true // @filename: moduleExportAliasElementAccessExpression.js // @outdir: out -function D() { -} +function D() {} exports["D"] = D; // (the only package I could find that uses spaces in identifiers is webidl-conversions) exports["Does not work yet"] = D; diff --git a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.2.minified.js index 584757b0132..b41a373563c 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasElementAccessExpression_es5.2.minified.js @@ -1,3 +1,2 @@ -function D() { -} +function D() {} exports.D = D, exports["Does not work yet"] = D; diff --git a/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.1.normal.js index 51f3fda1f3f..77f9be0e23a 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.1.normal.js @@ -5,8 +5,7 @@ // @module: esnext // @Filename: bug28014.js exports.version = 1; -function alias() { -} +function alias() {} module.exports = alias; // @Filename: importer.js import('./bug28014'); diff --git a/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js index 0e2e248097b..a55e7012189 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js @@ -1,2 +1 @@ -exports.version = 1, module.exports = function() { -}, import("./bug28014"); +exports.version = 1, module.exports = function() {}, import("./bug28014"); diff --git a/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.1.normal.js index 51f3fda1f3f..77f9be0e23a 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.1.normal.js @@ -5,8 +5,7 @@ // @module: esnext // @Filename: bug28014.js exports.version = 1; -function alias() { -} +function alias() {} module.exports = alias; // @Filename: importer.js import('./bug28014'); diff --git a/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js index 0e2e248097b..a55e7012189 100644 --- a/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js @@ -1,2 +1 @@ -exports.version = 1, module.exports = function() { -}, import("./bug28014"); +exports.version = 1, module.exports = function() {}, import("./bug28014"); diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js index 8726bc5a2e5..3bbb36705d4 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js @@ -24,70 +24,40 @@ b.func19; b.func20; // @filename: b.js var exportsAlias = exports; -exportsAlias.func1 = function() { -}; -exports.func2 = function() { -}; +exportsAlias.func1 = function() {}; +exports.func2 = function() {}; var moduleExportsAlias = module.exports; -moduleExportsAlias.func3 = function() { -}; -module.exports.func4 = function() { -}; +moduleExportsAlias.func3 = function() {}; +module.exports.func4 = function() {}; var multipleDeclarationAlias1 = exports = module.exports; -multipleDeclarationAlias1.func5 = function() { -}; +multipleDeclarationAlias1.func5 = function() {}; var multipleDeclarationAlias2 = module.exports = exports; -multipleDeclarationAlias2.func6 = function() { -}; +multipleDeclarationAlias2.func6 = function() {}; var someOtherVariable; var multipleDeclarationAlias3 = someOtherVariable = exports; -multipleDeclarationAlias3.func7 = function() { -}; +multipleDeclarationAlias3.func7 = function() {}; var multipleDeclarationAlias4 = someOtherVariable = module.exports; -multipleDeclarationAlias4.func8 = function() { -}; -var multipleDeclarationAlias5 = module.exports = exports = { -}; -multipleDeclarationAlias5.func9 = function() { -}; -var multipleDeclarationAlias6 = exports = module.exports = { -}; -multipleDeclarationAlias6.func10 = function() { -}; -exports = module.exports = someOtherVariable = { -}; -exports.func11 = function() { -}; -module.exports.func12 = function() { -}; -exports = module.exports = someOtherVariable = { -}; -exports.func11 = function() { -}; -module.exports.func12 = function() { -}; -exports = module.exports = { -}; -exports.func13 = function() { -}; -module.exports.func14 = function() { -}; -exports = module.exports = { -}; -exports.func15 = function() { -}; -module.exports.func16 = function() { -}; -module.exports = exports = { -}; -exports.func17 = function() { -}; -module.exports.func18 = function() { -}; -module.exports = { -}; -exports.func19 = function() { -}; -module.exports.func20 = function() { -}; +multipleDeclarationAlias4.func8 = function() {}; +var multipleDeclarationAlias5 = module.exports = exports = {}; +multipleDeclarationAlias5.func9 = function() {}; +var multipleDeclarationAlias6 = exports = module.exports = {}; +multipleDeclarationAlias6.func10 = function() {}; +exports = module.exports = someOtherVariable = {}; +exports.func11 = function() {}; +module.exports.func12 = function() {}; +exports = module.exports = someOtherVariable = {}; +exports.func11 = function() {}; +module.exports.func12 = function() {}; +exports = module.exports = {}; +exports.func13 = function() {}; +module.exports.func14 = function() {}; +exports = module.exports = {}; +exports.func15 = function() {}; +module.exports.func16 = function() {}; +module.exports = exports = {}; +exports.func17 = function() {}; +module.exports.func18 = function() {}; +module.exports = {}; +exports.func19 = function() {}; +module.exports.func20 = function() {}; export { }; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js index 324e0074203..a0ae8c93595 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js @@ -1,33 +1,3 @@ const b = require("./b.js"); -b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20, exports.func1 = function() { -}, exports.func2 = function() { -}, module.exports.func3 = function() { -}, module.exports.func4 = function() { -}, (exports = module.exports).func5 = function() { -}, (module.exports = exports).func6 = function() { -}, exports.func7 = function() { -}, module.exports.func8 = function() { -}, (module.exports = exports = { -}).func9 = function() { -}, (exports = module.exports = { -}).func10 = function() { -}, (exports = module.exports = { -}).func11 = function() { -}, module.exports.func12 = function() { -}, (exports = module.exports = { -}).func11 = function() { -}, module.exports.func12 = function() { -}, (exports = module.exports = { -}).func13 = function() { -}, module.exports.func14 = function() { -}, (exports = module.exports = { -}).func15 = function() { -}, module.exports.func16 = function() { -}, module.exports = exports = { -}, exports.func17 = function() { -}, module.exports.func18 = function() { -}, module.exports = { -}, exports.func19 = function() { -}, module.exports.func20 = function() { -}; +b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20, exports.func1 = function() {}, exports.func2 = function() {}, module.exports.func3 = function() {}, module.exports.func4 = function() {}, (exports = module.exports).func5 = function() {}, (module.exports = exports).func6 = function() {}, exports.func7 = function() {}, module.exports.func8 = function() {}, (module.exports = exports = {}).func9 = function() {}, (exports = module.exports = {}).func10 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func13 = function() {}, module.exports.func14 = function() {}, (exports = module.exports = {}).func15 = function() {}, module.exports.func16 = function() {}, module.exports = exports = {}, exports.func17 = function() {}, module.exports.func18 = function() {}, module.exports = {}, exports.func19 = function() {}, module.exports.func20 = function() {}; export { }; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js index 5ccd6e037e9..848dbd467fc 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js @@ -24,70 +24,40 @@ b.func19; b.func20; // @filename: b.js var exportsAlias = exports; -exportsAlias.func1 = function() { -}; -exports.func2 = function() { -}; +exportsAlias.func1 = function() {}; +exports.func2 = function() {}; var moduleExportsAlias = module.exports; -moduleExportsAlias.func3 = function() { -}; -module.exports.func4 = function() { -}; +moduleExportsAlias.func3 = function() {}; +module.exports.func4 = function() {}; var multipleDeclarationAlias1 = exports = module.exports; -multipleDeclarationAlias1.func5 = function() { -}; +multipleDeclarationAlias1.func5 = function() {}; var multipleDeclarationAlias2 = module.exports = exports; -multipleDeclarationAlias2.func6 = function() { -}; +multipleDeclarationAlias2.func6 = function() {}; var someOtherVariable; var multipleDeclarationAlias3 = someOtherVariable = exports; -multipleDeclarationAlias3.func7 = function() { -}; +multipleDeclarationAlias3.func7 = function() {}; var multipleDeclarationAlias4 = someOtherVariable = module.exports; -multipleDeclarationAlias4.func8 = function() { -}; -var multipleDeclarationAlias5 = module.exports = exports = { -}; -multipleDeclarationAlias5.func9 = function() { -}; -var multipleDeclarationAlias6 = exports = module.exports = { -}; -multipleDeclarationAlias6.func10 = function() { -}; -exports = module.exports = someOtherVariable = { -}; -exports.func11 = function() { -}; -module.exports.func12 = function() { -}; -exports = module.exports = someOtherVariable = { -}; -exports.func11 = function() { -}; -module.exports.func12 = function() { -}; -exports = module.exports = { -}; -exports.func13 = function() { -}; -module.exports.func14 = function() { -}; -exports = module.exports = { -}; -exports.func15 = function() { -}; -module.exports.func16 = function() { -}; -module.exports = exports = { -}; -exports.func17 = function() { -}; -module.exports.func18 = function() { -}; -module.exports = { -}; -exports.func19 = function() { -}; -module.exports.func20 = function() { -}; +multipleDeclarationAlias4.func8 = function() {}; +var multipleDeclarationAlias5 = module.exports = exports = {}; +multipleDeclarationAlias5.func9 = function() {}; +var multipleDeclarationAlias6 = exports = module.exports = {}; +multipleDeclarationAlias6.func10 = function() {}; +exports = module.exports = someOtherVariable = {}; +exports.func11 = function() {}; +module.exports.func12 = function() {}; +exports = module.exports = someOtherVariable = {}; +exports.func11 = function() {}; +module.exports.func12 = function() {}; +exports = module.exports = {}; +exports.func13 = function() {}; +module.exports.func14 = function() {}; +exports = module.exports = {}; +exports.func15 = function() {}; +module.exports.func16 = function() {}; +module.exports = exports = {}; +exports.func17 = function() {}; +module.exports.func18 = function() {}; +module.exports = {}; +exports.func19 = function() {}; +module.exports.func20 = function() {}; export { }; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js index df506f2c6ff..254e938cbcf 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js @@ -1,33 +1,3 @@ var b = require("./b.js"); -b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20, exports.func1 = function() { -}, exports.func2 = function() { -}, module.exports.func3 = function() { -}, module.exports.func4 = function() { -}, (exports = module.exports).func5 = function() { -}, (module.exports = exports).func6 = function() { -}, exports.func7 = function() { -}, module.exports.func8 = function() { -}, (module.exports = exports = { -}).func9 = function() { -}, (exports = module.exports = { -}).func10 = function() { -}, (exports = module.exports = { -}).func11 = function() { -}, module.exports.func12 = function() { -}, (exports = module.exports = { -}).func11 = function() { -}, module.exports.func12 = function() { -}, (exports = module.exports = { -}).func13 = function() { -}, module.exports.func14 = function() { -}, (exports = module.exports = { -}).func15 = function() { -}, module.exports.func16 = function() { -}, module.exports = exports = { -}, exports.func17 = function() { -}, module.exports.func18 = function() { -}, module.exports = { -}, exports.func19 = function() { -}, module.exports.func20 = function() { -}; +b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20, exports.func1 = function() {}, exports.func2 = function() {}, module.exports.func3 = function() {}, module.exports.func4 = function() {}, (exports = module.exports).func5 = function() {}, (module.exports = exports).func6 = function() {}, exports.func7 = function() {}, module.exports.func8 = function() {}, (module.exports = exports = {}).func9 = function() {}, (exports = module.exports = {}).func10 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func13 = function() {}, module.exports.func14 = function() {}, (exports = module.exports = {}).func15 = function() {}, module.exports.func16 = function() {}, module.exports = exports = {}, exports.func17 = function() {}, module.exports.func18 = function() {}, module.exports = {}, exports.func19 = function() {}, module.exports.func20 = function() {}; export { }; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.1.normal.js index 6591448e0fa..b27580cc0c9 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: npm.js -var npm = module.exports = function(tree) { -}; +var npm = module.exports = function(tree) {}; module.exports.asReadInstalled = function(tree) { npm(tree) // both references should be callable ; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.2.minified.js index 8c12cdde128..1ae3fb6123f 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment2_es2015.2.minified.js @@ -1,5 +1,4 @@ -var npm = module.exports = function(tree) { -}; +var npm = module.exports = function(tree) {}; module.exports.asReadInstalled = function(tree) { npm(tree), module.exports(tree); }; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.1.normal.js index b21bc387a5d..2ef07c7459e 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: npm.js -var npm = module.exports = function npm(tree) { -}; +var npm = module.exports = function npm(tree) {}; module.exports.asReadInstalled = function(tree) { npm(tree) // both references should be callable ; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.2.minified.js index 8c12cdde128..1ae3fb6123f 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment2_es5.2.minified.js @@ -1,5 +1,4 @@ -var npm = module.exports = function(tree) { -}; +var npm = module.exports = function(tree) {}; module.exports.asReadInstalled = function(tree) { npm(tree), module.exports(tree); }; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.1.normal.js index 33236c591c8..620b9c574b2 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: mod.js -module.exports = function x() { -}; +module.exports = function x() {}; module.exports() // should be callable ; // @Filename: npm.js diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js index 166cf9df2e7..ed063c2dbaf 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js @@ -1,3 +1,2 @@ -module.exports = function() { -}, module.exports(), require("./mod")() // should be callable from here too +module.exports = function() {}, module.exports(), require("./mod")() // should be callable from here too ; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.1.normal.js index 33236c591c8..620b9c574b2 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: mod.js -module.exports = function x() { -}; +module.exports = function x() {}; module.exports() // should be callable ; // @Filename: npm.js diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js index 166cf9df2e7..ed063c2dbaf 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js @@ -1,3 +1,2 @@ -module.exports = function() { -}, module.exports(), require("./mod")() // should be callable from here too +module.exports = function() {}, module.exports(), require("./mod")() // should be callable from here too ; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.1.normal.js index f20e77aad22..b22a2c4f2c6 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.1.normal.js @@ -3,10 +3,8 @@ // @checkJs: true // @Filename: axios.js class Axios { - m() { - } - constructor(){ - } + m() {} + constructor(){} } var axios = new Axios(); // none of the 3 references should have a use-before-def error diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.2.minified.js index bb71e863674..517a0189ef4 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment5_es2015.2.minified.js @@ -1,7 +1,5 @@ var axios = new class { - m() { - } - constructor(){ - } + m() {} + constructor(){} }(); axios.m(), module.exports = axios, module.exports.default = axios; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.1.normal.js index 43b62ed1f7b..165ee2ce9d5 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.1.normal.js @@ -29,8 +29,7 @@ var Axios = // @noEmit: true _createClass(Axios, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return Axios; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.2.minified.js index 7d85adeca80..461025f68c7 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment5_es5.2.minified.js @@ -15,8 +15,7 @@ var Axios = function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Axios).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Axios; }(), axios = new Axios(); diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.1.normal.js index ec7a851f00d..69449fbbe36 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.1.normal.js @@ -3,8 +3,7 @@ // @checkJs: true // @Filename: npmlog.js class EE { - /** @param {string} s */ on(s) { - } + /** @param {string} s */ on(s) {} } var npmlog = module.exports = new EE(); npmlog.on('hi') // both references should see EE.on diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.2.minified.js index 0775dda3811..2cf272598a2 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment_es2015.2.minified.js @@ -1,6 +1,5 @@ var npmlog = module.exports = new class { - on(s) { - } + on(s) {} }(); npmlog.on("hi"), module.exports.on("hi"), npmlog.x = 1, module.exports.y = 2, npmlog.y, module.exports.x; var npmlog = require("./npmlog"); diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment_es5.1.normal.js index d9de5018ab9..b3217f715b7 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment_es5.1.normal.js @@ -29,8 +29,7 @@ var EE = // @noEmit: true _createClass(EE, [ { /** @param {string} s */ key: "on", - value: function on(s) { - } + value: function on(s) {} } ]); return EE; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment_es5.2.minified.js index 645b1535f09..42445829433 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment_es5.2.minified.js @@ -15,8 +15,7 @@ var EE = function() { return Constructor = EE, protoProps = [ { key: "on", - value: function(s) { - } + value: function(s) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), EE; }(), npmlog = module.exports = new EE(); diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.1.normal.js index 5d7e747c1f6..017017e2fe0 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.1.normal.js @@ -3,6 +3,5 @@ // @filename: moduleExportAliasDuplicateAlias.js // @outdir: out exports.apply = undefined; -function a() { -} +function a() {} exports.apply = a; diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.2.minified.js index b150f40b33e..47de46db05a 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es2015.2.minified.js @@ -1,2 +1 @@ -exports.apply = void 0, exports.apply = function() { -}; +exports.apply = void 0, exports.apply = function() {}; diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.1.normal.js index 5d7e747c1f6..017017e2fe0 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.1.normal.js @@ -3,6 +3,5 @@ // @filename: moduleExportAliasDuplicateAlias.js // @outdir: out exports.apply = undefined; -function a() { -} +function a() {} exports.apply = a; diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js index b150f40b33e..47de46db05a 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js @@ -1,2 +1 @@ -exports.apply = void 0, exports.apply = function() { -}; +exports.apply = void 0, exports.apply = function() {}; diff --git a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.1.normal.js index c3d53ce1754..8af31246d8b 100644 --- a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.1.normal.js @@ -4,8 +4,7 @@ import * as s from './mod'; // @checkJs: true // @noEmit: true // @Filename: mod.js -module.exports.n = { -}; +module.exports.n = {}; module.exports.n.K = function C() { this.x = 10; }; diff --git a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.2.minified.js index 14f76e243b4..b9b6e288f6e 100644 --- a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es2015.2.minified.js @@ -1,6 +1,5 @@ import * as s from "./mod"; -module.exports.n = { -}, module.exports.n.K = function() { +module.exports.n = {}, module.exports.n.K = function() { this.x = 10; }, module.exports.Classic = class { constructor(){ diff --git a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.1.normal.js index 6489d93f943..8b5a7732f45 100644 --- a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.1.normal.js @@ -9,8 +9,7 @@ function _classCallCheck(instance, Constructor) { // @checkJs: true // @noEmit: true // @Filename: mod.js -module.exports.n = { -}; +module.exports.n = {}; module.exports.n.K = function C() { this.x = 10; }; diff --git a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.2.minified.js index 0df5c7118af..6e1dd8e5e4c 100644 --- a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces_es5.2.minified.js @@ -1,6 +1,5 @@ import * as s from "./mod"; -module.exports.n = { -}, module.exports.n.K = function() { +module.exports.n = {}, module.exports.n.K = function() { this.x = 10; }, module.exports.Classic = function _class() { "use strict"; diff --git a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.1.normal.js index 7ac8fc9d8b1..2c1fd669ba2 100644 --- a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: axios.js -var axios = { -}; +var axios = {}; module.exports = axios // both assignments should be ok ; module.exports.default = axios; diff --git a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.2.minified.js index 9e0de8ce824..ed3febe6944 100644 --- a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es2015.2.minified.js @@ -1,3 +1,2 @@ -var axios = { -}; +var axios = {}; module.exports = axios, module.exports.default = axios; diff --git a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.1.normal.js index 7ac8fc9d8b1..2c1fd669ba2 100644 --- a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: axios.js -var axios = { -}; +var axios = {}; module.exports = axios // both assignments should be ok ; module.exports.default = axios; diff --git a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.2.minified.js index 9e0de8ce824..ed3febe6944 100644 --- a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault_es5.2.minified.js @@ -1,3 +1,2 @@ -var axios = { -}; +var axios = {}; module.exports = axios, module.exports.default = axios; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.1.normal.js index c6eab10625d..296db1569f4 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.1.normal.js @@ -1,8 +1,7 @@ // @Filename: mod1.js /// module.exports = 1; -module.exports.f = function() { -}; +module.exports.f = function() {}; // @Filename: a.js /// var mod1 = require('./mod1'); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.2.minified.js index 17f1348da76..be3241acaac 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es2015.2.minified.js @@ -1,5 +1,4 @@ -module.exports = 1, module.exports.f = function() { -}; +module.exports = 1, module.exports.f = function() {}; 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_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.1.normal.js index c6eab10625d..296db1569f4 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.1.normal.js @@ -1,8 +1,7 @@ // @Filename: mod1.js /// module.exports = 1; -module.exports.f = function() { -}; +module.exports.f = function() {}; // @Filename: a.js /// var mod1 = require('./mod1'); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.2.minified.js index 17f1348da76..be3241acaac 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2_es5.2.minified.js @@ -1,5 +1,4 @@ -module.exports = 1, module.exports.f = function() { -}; +module.exports = 1, module.exports.f = function() {}; 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/moduleExportWithExportPropertyAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.1.normal.js index 38099934bb6..5cdd40fcc30 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.1.normal.js @@ -1,9 +1,7 @@ // @Filename: mod1.js /// -module.exports = function() { -}; -/** @param {number} a */ module.exports.f = function(a) { -}; +module.exports = function() {}; +/** @param {number} a */ module.exports.f = function(a) {}; // @Filename: a.js /// var mod1 = require('./mod1'); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.2.minified.js index 8142ade9034..0a5433ffcc1 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es2015.2.minified.js @@ -1,6 +1,4 @@ -module.exports = function() { -}, module.exports.f = function(a) { -}; +module.exports = function() {}, module.exports.f = function(a) {}; var mod1 = require("./mod1"); mod1(), mod1.f() // error, not enough arguments ; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.1.normal.js index 38099934bb6..5cdd40fcc30 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.1.normal.js @@ -1,9 +1,7 @@ // @Filename: mod1.js /// -module.exports = function() { -}; -/** @param {number} a */ module.exports.f = function(a) { -}; +module.exports = function() {}; +/** @param {number} a */ module.exports.f = function(a) {}; // @Filename: a.js /// var mod1 = require('./mod1'); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.2.minified.js index 8142ade9034..0a5433ffcc1 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment_es5.2.minified.js @@ -1,6 +1,4 @@ -module.exports = function() { -}, module.exports.f = function(a) { -}; +module.exports = function() {}, module.exports.f = function(a) {}; var mod1 = require("./mod1"); mod1(), mod1.f() // error, not enough arguments ; diff --git a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.1.normal.js index e2cb864d1af..6cbafe9cb03 100644 --- a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.1.normal.js @@ -16,8 +16,7 @@ exports["default"] = { module.exports["c"] = { x: "x" }; -module["exports"]["d"] = { -}; +module["exports"]["d"] = {}; module["exports"]["d"].e = 0; // @filename: mod2.js const mod1 = require("./mod1"); diff --git a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.2.minified.js index fd0c8c9616c..fd00331d2dc 100644 --- a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es2015.2.minified.js @@ -6,7 +6,6 @@ exports.a = { x: "x" }, module.exports.c = { x: "x" -}, module.exports.d = { -}, module.exports.d.e = 0; +}, module.exports.d = {}, module.exports.d.e = 0; const mod1 = require("./mod1"); mod1.a, mod1.b, mod1.c, mod1.d, mod1.d.e, mod1.default; diff --git a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.1.normal.js index 6459dc7ebd7..f130160b014 100644 --- a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.1.normal.js @@ -16,8 +16,7 @@ exports["default"] = { module.exports["c"] = { x: "x" }; -module["exports"]["d"] = { -}; +module["exports"]["d"] = {}; module["exports"]["d"].e = 0; // @filename: mod2.js var mod1 = require("./mod1"); diff --git a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.2.minified.js index 288fefcc6b6..ea7f0cafb00 100644 --- a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment_es5.2.minified.js @@ -6,7 +6,6 @@ exports.a = { x: "x" }, module.exports.c = { x: "x" -}, module.exports.d = { -}, module.exports.d.e = 0; +}, module.exports.d = {}, module.exports.d.e = 0; var mod1 = require("./mod1"); mod1.a, mod1.b, mod1.c, mod1.d, mod1.d.e, mod1.default; diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.1.normal.js index 6de8969b20b..55160592e65 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.1.normal.js @@ -12,14 +12,12 @@ var A; (function(Module) { class A { } - })(Module || (Module = { - })); + })(Module || (Module = {})); let Color; (function(Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Red"] = 1] = "Red"; - })(Color || (Color = { - })); + })(Color || (Color = {})); var x = 12; function F(s) { return 2; @@ -33,8 +31,7 @@ var A; id: 2, isvalid: true }; -})(A || (A = { -})); +})(A || (A = {})); var Y; (function(Y1) { class A2 { @@ -53,14 +50,12 @@ var Y; (function(Module) { class A { } - })(Module = Y1.Module || (Y1.Module = { - })); + })(Module = Y1.Module || (Y1.Module = {})); let Color; (function(Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Red"] = 1] = "Red"; - })(Color = Y1.Color || (Y1.Color = { - })); + })(Color = Y1.Color || (Y1.Color = {})); var x = Y1.x = 12; function F(s) { return 2; @@ -75,5 +70,4 @@ var Y; id: 2, isvalid: true }; -})(Y || (Y = { -})); +})(Y || (Y = {})); diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.2.minified.js index 55336138a55..2480be76243 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es2015.2.minified.js @@ -2,10 +2,8 @@ var A, Y; !function(A) { var Color; let Color; - (Color = Color || (Color = { - }))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; -}(A || (A = { -})), (function(Y1) { + (Color = Color || (Color = {}))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; +}(A || (A = {})), (function(Y1) { var Color; class A1 { } @@ -16,8 +14,7 @@ var A, Y; }, Y1.BB = class extends A1 { }; let Color; - (Color = Color = Y1.Color || (Y1.Color = { - }))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red", Y1.x = 12, Y1.F = function(s) { + (Color = Color = Y1.Color || (Y1.Color = {}))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red", Y1.x = 12, Y1.F = function(s) { return 2; }, Y1.array = null, Y1.fn = (s)=>"hello " + s , Y1.ol = { @@ -25,5 +22,4 @@ var A, Y; id: 2, isvalid: !0 }; -})(Y || (Y = { -})); +})(Y || (Y = {})); diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.1.normal.js index b1ea0dc6d8e..084d95e8074 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -108,14 +107,12 @@ var A; "use strict"; _classCallCheck(this, A4); }; - })(Module || (Module = { - })); + })(Module || (Module = {})); var Color; (function(Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Red"] = 1] = "Red"; - })(Color || (Color = { - })); + })(Color || (Color = {})); var x = 12; var array = null; var fn = function(s) { @@ -126,8 +123,7 @@ var A; id: 2, isvalid: true }; -})(A || (A = { -})); +})(A || (A = {})); var Y; (function(Y1) { var F = function F(s) { @@ -171,14 +167,12 @@ var Y; "use strict"; _classCallCheck(this, A7); }; - })(Module = Y1.Module || (Y1.Module = { - })); + })(Module = Y1.Module || (Y1.Module = {})); var Color; (function(Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Red"] = 1] = "Red"; - })(Color = Y1.Color || (Y1.Color = { - })); + })(Color = Y1.Color || (Y1.Color = {})); var x = Y1.x = 12; Y1.F = F; var array = Y1.array = null; @@ -190,5 +184,4 @@ var Y; id: 2, isvalid: true }; -})(Y || (Y = { -})); +})(Y || (Y = {})); diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.2.minified.js index d59867364fb..912975e3236 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -70,14 +69,11 @@ function _createSuper(Derived) { } return BB; }(A2); - Module || (Module = { - }), A1 = function() { + Module || (Module = {}), A1 = function() { "use strict"; _classCallCheck(this, A1); - }, (Color = Color || (Color = { - }))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; -}(A || (A = { -})), (function(Y1) { + }, (Color = Color || (Color = {}))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red"; +}(A || (A = {})), (function(Y1) { var Color, A6 = function() { "use strict"; _classCallCheck(this, A6); @@ -107,12 +103,10 @@ function _createSuper(Derived) { } return BB; }(A6); - Y1.BB = BB, Y1.Module || (Y1.Module = { - }), A5 = function() { + Y1.BB = BB, Y1.Module || (Y1.Module = {}), A5 = function() { "use strict"; _classCallCheck(this, A5); - }, (Color = Color = Y1.Color || (Y1.Color = { - }))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red", Y1.x = 12, Y1.F = function(s) { + }, (Color = Color = Y1.Color || (Y1.Color = {}))[Color.Blue = 0] = "Blue", Color[Color.Red = 1] = "Red", Y1.x = 12, Y1.F = function(s) { return 2; }, Y1.array = null, Y1.fn = function(s) { return "hello " + s; @@ -121,5 +115,4 @@ function _createSuper(Derived) { id: 2, isvalid: !0 }; -})(Y || (Y = { -})); +})(Y || (Y = {})); diff --git a/crates/swc/tests/tsc-references/multipleDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDeclarations_es2015.1.normal.js index fa8189d58bc..7e1e9f28a1e 100644 --- a/crates/swc/tests/tsc-references/multipleDeclarations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDeclarations_es2015.1.normal.js @@ -8,10 +8,8 @@ C.prototype.m = function() { this.nothing(); }; class X { - m() { - } - mistake() { - } + m() {} + mistake() {} constructor(){ this.m = this.m.bind(this); this.mistake = 'frankly, complete nonsense'; @@ -22,10 +20,8 @@ X.prototype.mistake = false; x.m(); x.mistake; class Y { - mistake() { - } - m() { - } + mistake() {} + m() {} constructor(){ this.m = this.m.bind(this); this.mistake = 'even more nonsense'; diff --git a/crates/swc/tests/tsc-references/multipleDeclarations_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDeclarations_es2015.2.minified.js index 904dbf26546..67fa10b52f6 100644 --- a/crates/swc/tests/tsc-references/multipleDeclarations_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDeclarations_es2015.2.minified.js @@ -4,10 +4,8 @@ this.nothing(); }; class X { - m() { - } - mistake() { - } + m() {} + mistake() {} constructor(){ this.m = this.m.bind(this), this.mistake = "frankly, complete nonsense"; } @@ -15,10 +13,8 @@ class X { let x = new X(); X.prototype.mistake = !1, x.m(), x.mistake; class Y { - mistake() { - } - m() { - } + mistake() {} + m() {} constructor(){ this.m = this.m.bind(this), this.mistake = "even more nonsense"; } diff --git a/crates/swc/tests/tsc-references/multipleDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDeclarations_es5.1.normal.js index 556159ca0a5..350c117663a 100644 --- a/crates/swc/tests/tsc-references/multipleDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDeclarations_es5.1.normal.js @@ -36,13 +36,11 @@ var X = /*#__PURE__*/ function() { _createClass(X, [ { key: "m", - value: function m() { - } + value: function m() {} }, { key: "mistake", - value: function mistake() { - } + value: function mistake() {} } ]); return X; @@ -61,13 +59,11 @@ var Y = /*#__PURE__*/ function() { _createClass(Y, [ { key: "mistake", - value: function mistake() { - } + value: function mistake() {} }, { key: "m", - value: function m() { - } + value: function m() {} } ]); return Y; diff --git a/crates/swc/tests/tsc-references/multipleDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDeclarations_es5.2.minified.js index 0bd80dc036b..d44e82a23ab 100644 --- a/crates/swc/tests/tsc-references/multipleDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDeclarations_es5.2.minified.js @@ -23,13 +23,11 @@ var X = function() { return _createClass(X, [ { key: "m", - value: function() { - } + value: function() {} }, { key: "mistake", - value: function() { - } + value: function() {} } ]), X; }(), x = new X(); @@ -42,13 +40,11 @@ var Y = function() { return _createClass(Y, [ { key: "mistake", - value: function() { - } + value: function() {} }, { key: "m", - value: function() { - } + value: function() {} } ]), Y; }(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js index d374ccd0ef9..1c2b8e11170 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js @@ -6,8 +6,7 @@ class foo { // @target: ES5 // @filename: m1.ts export { foo as default }; -export default function bar() { -}; +export default function bar() {}; var x = 10; export default x; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js index 2b40b356124..ff2ace4f48e 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js @@ -2,7 +2,6 @@ import Entity from "./m1"; class foo { } export { foo as default }; -export default function bar() { -}; +export default function bar() {}; export default 10; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js index 62fdb831bd1..6e1f4e92135 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js @@ -13,8 +13,7 @@ var foo = function foo() { // @target: ES5 // @filename: m1.ts export { foo as default }; -export default function bar() { -}; +export default function bar() {}; var x = 10; export default x; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js index 32265bc1e7c..41d2f87d61b 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js @@ -6,7 +6,6 @@ var foo = function() { }(this, foo); }; export { foo as default }; -export default function bar() { -}; +export default function bar() {}; export default 10; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js index 6f13b1c5814..d1a898c3bd7 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js @@ -3,8 +3,6 @@ import Entity from "./m1"; // @module: commonjs // @target: ES5 // @filename: m1.ts -export default function foo() { -}; -export default function bar() { -}; +export default function foo() {}; +export default function bar() {}; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js index d5342813196..718b65e534a 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js @@ -1,6 +1,4 @@ import Entity from "./m1"; -export default function foo() { -}; -export default function bar() { -}; +export default function foo() {}; +export default function bar() {}; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js index 6f13b1c5814..d1a898c3bd7 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js @@ -3,8 +3,6 @@ import Entity from "./m1"; // @module: commonjs // @target: ES5 // @filename: m1.ts -export default function foo() { -}; -export default function bar() { -}; +export default function foo() {}; +export default function bar() {}; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js index d5342813196..718b65e534a 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js @@ -1,6 +1,4 @@ import Entity from "./m1"; -export default function foo() { -}; -export default function bar() { -}; +export default function foo() {}; +export default function bar() {}; Entity(); diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js index 9d25547b9e3..1f0c7f71846 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js @@ -1,6 +1,4 @@ // @module: commonjs // @target: ES5 -export default function f() { -}; -export default function f() { -}; +export default function f() {}; +export default function f() {}; diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js index 2eba405a051..9ec4772c02a 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js @@ -1,4 +1,2 @@ -export default function f() { -}; -export default function f() { -}; +export default function f() {}; +export default function f() {}; diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js index 9d25547b9e3..1f0c7f71846 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js @@ -1,6 +1,4 @@ // @module: commonjs // @target: ES5 -export default function f() { -}; -export default function f() { -}; +export default function f() {}; +export default function f() {}; diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js index 2eba405a051..9ec4772c02a 100644 --- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js @@ -1,4 +1,2 @@ -export default function f() { -}; -export default function f() { -}; +export default function f() {}; +export default function f() {}; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js index 4cdbc48aaeb..ed59f54944c 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js @@ -1,5 +1,4 @@ -export default function Foo() { -}; +export default function Foo() {}; export default { uhoh: "another default" }; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js index 4cdbc48aaeb..ed59f54944c 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js @@ -1,5 +1,4 @@ -export default function Foo() { -}; +export default function Foo() {}; export default { uhoh: "another default" }; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js index 4cdbc48aaeb..ed59f54944c 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js @@ -1,5 +1,4 @@ -export default function Foo() { -}; +export default function Foo() {}; export default { uhoh: "another default" }; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js index 4cdbc48aaeb..ed59f54944c 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js @@ -1,5 +1,4 @@ -export default function Foo() { -}; +export default function Foo() {}; export default { uhoh: "another default" }; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js index 14c8a8d85ec..4233c2c30b1 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js @@ -1,5 +1,4 @@ export default { uhoh: "another default" }; -export default function Foo() { -}; +export default function Foo() {}; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js index 14c8a8d85ec..4233c2c30b1 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js @@ -1,5 +1,4 @@ export default { uhoh: "another default" }; -export default function Foo() { -}; +export default function Foo() {}; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js index 14c8a8d85ec..4233c2c30b1 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js @@ -1,5 +1,4 @@ export default { uhoh: "another default" }; -export default function Foo() { -}; +export default function Foo() {}; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js index 14c8a8d85ec..4233c2c30b1 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js @@ -1,5 +1,4 @@ export default { uhoh: "another default" }; -export default function Foo() { -}; +export default function Foo() {}; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js index 17f65edcccb..fec952a5444 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js @@ -1,5 +1,4 @@ -export default function bar() { -}; +export default function bar() {}; class C { } export { C as default }; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js index 17f65edcccb..fec952a5444 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js @@ -1,5 +1,4 @@ -export default function bar() { -}; +export default function bar() {}; class C { } export { C as default }; diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js index 2e6c2e45a8d..ee385743c0f 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js @@ -3,8 +3,7 @@ function _classCallCheck(instance, Constructor) { throw new TypeError("Cannot call a class as a function"); } } -export default function bar() { -}; +export default function bar() {}; var C = function C() { "use strict"; _classCallCheck(this, C); diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js index 3fbb364bbf1..39a0219a649 100644 --- a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js @@ -1,5 +1,4 @@ -export default function bar() { -}; +export default function bar() {}; var C = function() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/nameCollision_es2015.1.normal.js b/crates/swc/tests/tsc-references/nameCollision_es2015.1.normal.js index 7dbb9ae7ef9..c4a0c1ecc19 100644 --- a/crates/swc/tests/tsc-references/nameCollision_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nameCollision_es2015.1.normal.js @@ -4,20 +4,17 @@ var A; // in the generated function call. var A1 = 12; var _A = ''; -})(A || (A = { -})); +})(A || (A = {})); var B; (function(B) { var A = 12; -})(B || (B = { -})); +})(B || (B = {})); (function(B) { // re-opened module with colliding name // this should add an underscore. class B1 { } -})(B || (B = { -})); +})(B || (B = {})); var X; (function(X2) { var X1 = 13; @@ -29,12 +26,9 @@ var X; var X = 12; var Y = 12; var Z1 = 12; - })(Z = Y3.Z || (Y3.Z = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z = Y3.Z || (Y3.Z = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); var Y; (function(Y5) { let Y4; @@ -43,16 +37,12 @@ var Y; (function(Y4) { Y4[Y4["Red"] = 0] = "Red"; Y4[Y4["Blue"] = 1] = "Blue"; - })(Y4 = Y6.Y || (Y6.Y = { - })); - })(Y4 = Y5.Y || (Y5.Y = { - })); -})(Y || (Y = { -})); + })(Y4 = Y6.Y || (Y6.Y = {})); + })(Y4 = Y5.Y || (Y5.Y = {})); +})(Y || (Y = {})); // no collision, since interface doesn't // generate code. var D; (function(D1) { var E = D1.E = 'hello'; -})(D || (D = { -})); +})(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/nameCollision_es2015.2.minified.js b/crates/swc/tests/tsc-references/nameCollision_es2015.2.minified.js index 9fd33d295f5..d71910149d7 100644 --- a/crates/swc/tests/tsc-references/nameCollision_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nameCollision_es2015.2.minified.js @@ -1,12 +1,6 @@ var X, Y, D, X1; -(X1 = X || (X = { -})).Y || (X1.Y = { -}), (function(Y3) { +(X1 = X || (X = {})).Y || (X1.Y = {}), (function(Y3) { var Y1, Y2; let Y2, Y2; - (Y2 = Y2 = (Y1 = Y2 = Y3.Y || (Y3.Y = { - })).Y || (Y1.Y = { - }))[Y2.Red = 0] = "Red", Y2[Y2.Blue = 1] = "Blue"; -})(Y || (Y = { -})), (D || (D = { -})).E = "hello"; + (Y2 = Y2 = (Y1 = Y2 = Y3.Y || (Y3.Y = {})).Y || (Y1.Y = {}))[Y2.Red = 0] = "Red", Y2[Y2.Blue = 1] = "Blue"; +})(Y || (Y = {})), (D || (D = {})).E = "hello"; diff --git a/crates/swc/tests/tsc-references/nameCollision_es5.1.normal.js b/crates/swc/tests/tsc-references/nameCollision_es5.1.normal.js index 4eced3f2f81..01a90db2804 100644 --- a/crates/swc/tests/tsc-references/nameCollision_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nameCollision_es5.1.normal.js @@ -9,20 +9,17 @@ var A; // in the generated function call. var A1 = 12; var _A = ''; -})(A || (A = { -})); +})(A || (A = {})); var B; (function(B) { var A = 12; -})(B || (B = { -})); +})(B || (B = {})); (function(B) { var B1 = function B1() { "use strict"; _classCallCheck(this, B1); }; -})(B || (B = { -})); +})(B || (B = {})); var X; (function(X2) { var X1 = 13; @@ -34,12 +31,9 @@ var X; var X = 12; var Y = 12; var Z1 = 12; - })(Z = Y3.Z || (Y3.Z = { - })); - })(Y2 = X2.Y || (X2.Y = { - })); -})(X || (X = { -})); + })(Z = Y3.Z || (Y3.Z = {})); + })(Y2 = X2.Y || (X2.Y = {})); +})(X || (X = {})); var Y; (function(Y5) { var Y4; @@ -48,16 +42,12 @@ var Y; (function(Y4) { Y4[Y4["Red"] = 0] = "Red"; Y4[Y4["Blue"] = 1] = "Blue"; - })(Y4 = Y6.Y || (Y6.Y = { - })); - })(Y4 = Y5.Y || (Y5.Y = { - })); -})(Y || (Y = { -})); + })(Y4 = Y6.Y || (Y6.Y = {})); + })(Y4 = Y5.Y || (Y5.Y = {})); +})(Y || (Y = {})); // no collision, since interface doesn't // generate code. var D; (function(D1) { var E = D1.E = 'hello'; -})(D || (D = { -})); +})(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/nameCollision_es5.2.minified.js b/crates/swc/tests/tsc-references/nameCollision_es5.2.minified.js index 1a58f07aead..7479ca33d00 100644 --- a/crates/swc/tests/tsc-references/nameCollision_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nameCollision_es5.2.minified.js @@ -6,14 +6,7 @@ var B, X, Y, D, X1; if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, B1); }; -}(B || (B = { -})), (X1 = X || (X = { -})).Y || (X1.Y = { -}), (function(Y3) { +}(B || (B = {})), (X1 = X || (X = {})).Y || (X1.Y = {}), (function(Y3) { var Y1, Y2, Y1, Y1; - (Y1 = Y1 = (Y2 = Y1 = Y3.Y || (Y3.Y = { - })).Y || (Y2.Y = { - }))[Y1.Red = 0] = "Red", Y1[Y1.Blue = 1] = "Blue"; -})(Y || (Y = { -})), (D || (D = { -})).E = "hello"; + (Y1 = Y1 = (Y2 = Y1 = Y3.Y || (Y3.Y = {})).Y || (Y2.Y = {}))[Y1.Red = 0] = "Red", Y1[Y1.Blue = 1] = "Blue"; +})(Y || (Y = {})), (D || (D = {})).E = "hello"; diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js index df7e41e3b82..6aac8d4051a 100644 --- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js @@ -9,8 +9,7 @@ export function f() { export var M2; (function(M21) { var x = M21.x = true; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); // @Filename: test/foo_3.ts const foo0 = require('../foo_0'); const foo1 = require('./test/foo_1'); diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js index e11e9689147..be9f15e28f5 100644 --- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js @@ -2,7 +2,6 @@ export var M2, foo = 42; export function f() { return 42; } -(M2 || (M2 = { -})).x = !0; +(M2 || (M2 = {})).x = !0; const foo0 = require("../foo_0"), foo1 = require("./test/foo_1"), foo2 = require("./.././test/foo_2"); foo2.M2.x && foo0.foo + foo1.f(); diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js index 15d4e1bb4b1..8ce023a3f4b 100644 --- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js @@ -9,8 +9,7 @@ export function f() { export var M2; (function(M21) { var x = M21.x = true; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); // @Filename: test/foo_3.ts var foo0 = require('../foo_0'); var foo1 = require('./test/foo_1'); diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js index 53035d37315..84e19ffb8cd 100644 --- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js @@ -2,7 +2,6 @@ export var M2, foo = 42; export function f() { return 42; } -(M2 || (M2 = { -})).x = !0; +(M2 || (M2 = {})).x = !0; var foo0 = require("../foo_0"), foo1 = require("./test/foo_1"), foo2 = require("./.././test/foo_2"); foo2.M2.x && foo0.foo + foo1.f(); diff --git a/crates/swc/tests/tsc-references/namedTupleMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/namedTupleMembers_es2015.1.normal.js index 9dec6f39199..5b4504bc5ef 100644 --- a/crates/swc/tests/tsc-references/namedTupleMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/namedTupleMembers_es2015.1.normal.js @@ -14,8 +14,7 @@ export const func = null; export function useState(initial) { return null; } -export function readSegment([length, count]) { -} +export function readSegment([length, count]) {} // documenting binding pattern behavior (currently does _not_ generate tuple names) export const val = null; q = r; diff --git a/crates/swc/tests/tsc-references/namedTupleMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/namedTupleMembers_es2015.2.minified.js index e7fb0f6af13..0c2cf3d4392 100644 --- a/crates/swc/tests/tsc-references/namedTupleMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/namedTupleMembers_es2015.2.minified.js @@ -3,8 +3,7 @@ export const func = null; export function useState() { return null; } -export function readSegment([length, count]) { -} +export function readSegment([length, count]) {} export const val = null; r = q = r, y = x = y; export const argumentsOfGAsFirstArgument = f(getArgsForInjection(g)); diff --git a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.1.normal.js index 741771cf5ea..a039414f434 100644 --- a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.1.normal.js @@ -4,8 +4,7 @@ // @outDir: out // @declaration: true // @filename: node_modules/untyped/index.js -module.exports = { -}; +module.exports = {}; // @filename: bug40140.js const u = require('untyped'); u.assignment.nested = true; diff --git a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.2.minified.js index 347aae6d668..5b3d01882eb 100644 --- a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es2015.2.minified.js @@ -1,4 +1,3 @@ -module.exports = { -}; +module.exports = {}; const u = require("untyped"); u.assignment.nested = !0, u.noError(); diff --git a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.1.normal.js index e755ef8a769..c00bac80f1b 100644 --- a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.1.normal.js @@ -4,8 +4,7 @@ // @outDir: out // @declaration: true // @filename: node_modules/untyped/index.js -module.exports = { -}; +module.exports = {}; // @filename: bug40140.js var u = require('untyped'); u.assignment.nested = true; diff --git a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.2.minified.js index f5486bb0843..c6b5c157b19 100644 --- a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias_es5.2.minified.js @@ -1,4 +1,3 @@ -module.exports = { -}; +module.exports = {}; var u = require("untyped"); u.assignment.nested = !0, u.noError(); diff --git a/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es2015.1.normal.js b/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es2015.1.normal.js index 08ea24e54ab..d27e069aaad 100644 --- a/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es2015.1.normal.js @@ -5,10 +5,8 @@ class A { } class B { } -function acceptA(a) { -} -function acceptB(b) { -} +function acceptA(a) {} +function acceptB(b) {} function test(x) { if (x instanceof B) { acceptA(x); diff --git a/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es5.1.normal.js b/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es5.1.normal.js index b2fe8e412fe..d88cf5db2e1 100644 --- a/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/narrowingGenericTypeFromInstanceof01_es5.1.normal.js @@ -19,10 +19,8 @@ var B = function B() { "use strict"; _classCallCheck(this, B); }; -function acceptA(a) { -} -function acceptB(b) { -} +function acceptA(a) {} +function acceptB(b) {} function test(x) { if (_instanceof(x, B)) { acceptA(x); diff --git a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.1.normal.js index c49267f9280..a4aa57fd504 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.1.normal.js @@ -8,8 +8,7 @@ var ANY2 = [ var obj; var obj1 = { x: "", - y: ()=>{ - } + y: ()=>{} }; function foo() { var a; @@ -25,8 +24,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsNumber1 = -ANY1; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.2.minified.js index 222320df5be..2ccdcda4aca 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es2015.2.minified.js @@ -3,17 +3,14 @@ var M, ANY2 = [ "" ], obj1 = { x: "", - y: ()=>{ - } + y: ()=>{} }; class A { - static foo() { - } + static foo() {} } !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.1.normal.js index 06252da7f81..87999dfbded 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.1.normal.js @@ -27,8 +27,7 @@ var ANY2 = [ var obj; var obj1 = { x: "", - y: function() { - } + y: function() {} }; function foo() { var a; @@ -54,8 +53,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsNumber1 = -ANY1; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.2.minified.js index 8c8a5f7dd46..d307a31dc3a 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType_es5.2.minified.js @@ -3,8 +3,7 @@ var M, ANY2 = [ "" ], obj1 = { x: "", - y: function() { - } + y: function() {} }, A = function() { "use strict"; var Constructor; @@ -21,15 +20,13 @@ var M, ANY2 = [ })(Constructor = A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(); !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.1.normal.js index effef6eb84b..7b84c687324 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.1.normal.js @@ -12,8 +12,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsNumber1 = -BOOLEAN; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.2.minified.js index 65b9f6c5a71..294503578a1 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es2015.2.minified.js @@ -9,7 +9,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var M, objA = new A(); objA.a, foo(), A.foo(), foo(), objA.a; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.1.normal.js index db6e548f6c4..4e06c72a38f 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.1.normal.js @@ -41,8 +41,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsNumber1 = -BOOLEAN; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.2.minified.js index c6311cece82..823b28e436b 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithBooleanType_es5.2.minified.js @@ -26,7 +26,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.1.normal.js index 9c045bb61f2..bd053c1e5bc 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.1.normal.js @@ -1,15 +1,12 @@ var // - operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = -ENUM; // expressions diff --git a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.2.minified.js index 75c3bfb4e56..10518a6b384 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.B, ENUM1.B + ENUM1[""], ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.B, ENUM1.B + ENUM1[""], ENUM1.B; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.1.normal.js index 9c045bb61f2..bd053c1e5bc 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.1.normal.js @@ -1,15 +1,12 @@ var // - operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = -ENUM; // expressions diff --git a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.2.minified.js index 75c3bfb4e56..10518a6b384 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.B, ENUM1.B + ENUM1[""], ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.B, ENUM1.B + ENUM1[""], ENUM1.B; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.1.normal.js index 3eedd658d15..9588babff7d 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = -NUMBER; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.2.minified.js index e9a7fe8a25d..483281d8468 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es2015.2.minified.js @@ -7,7 +7,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.1.normal.js index a8fbe8d8a7f..aabebc0751f 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = -NUMBER; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.2.minified.js index a0266fa2414..5782b25902c 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithNumberType_es5.2.minified.js @@ -23,7 +23,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.1.normal.js index f88d07e4d90..afb84046519 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsNumber1 = -STRING; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.2.minified.js index 582da0d7546..8d3ce9882d7 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es2015.2.minified.js @@ -10,7 +10,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.1.normal.js index 6d8ce24a717..a940e16e0a3 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsNumber1 = -STRING; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.2.minified.js index 9a048b7824d..8e87a47ca9a 100644 --- a/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/negateOperatorWithStringType_es5.2.minified.js @@ -26,7 +26,6 @@ var STRING, M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.1.normal.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.1.normal.js index 9bfbc445563..d30796d739d 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.1.normal.js @@ -4,8 +4,7 @@ // @declaration: true // @filename: mod1.js const chalk = { - grey: { - } + grey: {} }; module.exports.chalk = chalk; // @filename: main.js diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js index 76b3d06b28c..6afa8638dd6 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js @@ -1,5 +1,4 @@ module.exports.chalk = { - grey: { - } + grey: {} }; const { chalk: { grey } } = require("./mod1"); diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.1.normal.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.1.normal.js index b77d1bae4d6..6eb265a501b 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.1.normal.js @@ -4,8 +4,7 @@ // @declaration: true // @filename: mod1.js var chalk = { - grey: { - } + grey: {} }; module.exports.chalk = chalk; // @filename: main.js diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js index 5fd7e41d736..5292e4905a0 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js @@ -1,4 +1,3 @@ module.exports.chalk = { - grey: { - } + grey: {} }, require("./mod1").chalk.grey; diff --git a/crates/swc/tests/tsc-references/nestedModules_es2015.1.normal.js b/crates/swc/tests/tsc-references/nestedModules_es2015.1.normal.js index 76118d96f02..0fb2d9d867d 100644 --- a/crates/swc/tests/tsc-references/nestedModules_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedModules_es2015.1.normal.js @@ -5,19 +5,15 @@ x: 0, y: 0 }; // bug 832088: could not find module 'C' - })(B = A.B || (A.B = { - })); -})(A || (A = { -})); + })(B = A.B || (A.B = {})); +})(A || (A = {})); (function(M2) { let X1; (function(X) { var Point; X.Point = Point; - })(X1 = M2.X || (M2.X = { - })); -})(M2 || (M2 = { -})); + })(X1 = M2.X || (M2.X = {})); +})(M2 || (M2 = {})); var m = M2.X; var point; var point = m.Point; diff --git a/crates/swc/tests/tsc-references/nestedModules_es2015.2.minified.js b/crates/swc/tests/tsc-references/nestedModules_es2015.2.minified.js index a9a899055b5..680504f47f9 100644 --- a/crates/swc/tests/tsc-references/nestedModules_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedModules_es2015.2.minified.js @@ -1,6 +1,4 @@ !function(M2) { var Point; - (M2.X || (M2.X = { - })).Point = Point; -}(M2 || (M2 = { -})), M2.X.Point; + (M2.X || (M2.X = {})).Point = Point; +}(M2 || (M2 = {})), M2.X.Point; diff --git a/crates/swc/tests/tsc-references/nestedModules_es5.1.normal.js b/crates/swc/tests/tsc-references/nestedModules_es5.1.normal.js index 880cb98a553..21b00c2342e 100644 --- a/crates/swc/tests/tsc-references/nestedModules_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedModules_es5.1.normal.js @@ -5,19 +5,15 @@ x: 0, y: 0 }; // bug 832088: could not find module 'C' - })(B = A.B || (A.B = { - })); -})(A || (A = { -})); + })(B = A.B || (A.B = {})); +})(A || (A = {})); (function(M2) { var X1; (function(X) { var Point; X.Point = Point; - })(X1 = M2.X || (M2.X = { - })); -})(M2 || (M2 = { -})); + })(X1 = M2.X || (M2.X = {})); +})(M2 || (M2 = {})); var m = M2.X; var point; var point = m.Point; diff --git a/crates/swc/tests/tsc-references/nestedModules_es5.2.minified.js b/crates/swc/tests/tsc-references/nestedModules_es5.2.minified.js index a9a899055b5..680504f47f9 100644 --- a/crates/swc/tests/tsc-references/nestedModules_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedModules_es5.2.minified.js @@ -1,6 +1,4 @@ !function(M2) { var Point; - (M2.X || (M2.X = { - })).Point = Point; -}(M2 || (M2 = { -})), M2.X.Point; + (M2.X || (M2.X = {})).Point = Point; +}(M2 || (M2 = {})), M2.X.Point; diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js b/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js index f30eccf1a3c..3820d15d83d 100644 --- a/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js @@ -4,5 +4,4 @@ export var types; class A { } types1.A = A; -})(types || (types = { -})); +})(types || (types = {})); diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js b/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js index 9602da8483f..22793367da7 100644 --- a/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js @@ -1,4 +1,3 @@ var types; -(types || (types = { -})).A = class { +(types || (types = {})).A = class { }; diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js b/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js index b552e947de7..1646de52b0d 100644 --- a/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js @@ -11,5 +11,4 @@ export var types; _classCallCheck(this, A); }; types1.A = A; -})(types || (types = { -})); +})(types || (types = {})); diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js b/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js index 00b4f94e860..be8b66736e7 100644 --- a/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js @@ -7,5 +7,4 @@ export var types; }(this, A); }; types1.A = A; -}(types || (types = { -})); +}(types || (types = {})); diff --git a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.1.normal.js index d405be2cb5c..c1c609cd1b6 100644 --- a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.1.normal.js @@ -4,7 +4,5 @@ // @noImplicitAny: true // @Filename: mod.js // #24111 -- shouldn't assert -C.prototype = { -}; -C.prototype.bar.foo = { -}; +C.prototype = {}; +C.prototype.bar.foo = {}; diff --git a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.2.minified.js index 9065d71ef4e..adc1dd532f7 100644 --- a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es2015.2.minified.js @@ -1,3 +1 @@ -C.prototype = { -}, C.prototype.bar.foo = { -}; +C.prototype = {}, C.prototype.bar.foo = {}; diff --git a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.1.normal.js index d405be2cb5c..c1c609cd1b6 100644 --- a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.1.normal.js @@ -4,7 +4,5 @@ // @noImplicitAny: true // @Filename: mod.js // #24111 -- shouldn't assert -C.prototype = { -}; -C.prototype.bar.foo = { -}; +C.prototype = {}; +C.prototype.bar.foo = {}; diff --git a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.2.minified.js index 9065d71ef4e..adc1dd532f7 100644 --- a/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedPrototypeAssignment_es5.2.minified.js @@ -1,3 +1 @@ -C.prototype = { -}, C.prototype.bar.foo = { -}; +C.prototype = {}, C.prototype.bar.foo = {}; diff --git a/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.1.normal.js b/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.1.normal.js index 59551627050..03c80bbce5b 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.1.normal.js @@ -5,8 +5,7 @@ function f1() { x = false; x = undefined; x = null; - x = { - }; + x = {}; x(); } function f2() { @@ -15,9 +14,6 @@ function f2() { function f3() { return 1; } -function f4() { -} -for (const n of f4()){ -} -for(const n1 in f4()){ -} +function f4() {} +for (const n of f4()){} +for(const n1 in f4()){} diff --git a/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.2.minified.js b/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.2.minified.js index 247e5d24d87..a748f946b59 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors1_es2015.2.minified.js @@ -1,4 +1,3 @@ -function f4() { -} +function f4() {} for (const n of f4()); for(const n1 in f4()); diff --git a/crates/swc/tests/tsc-references/neverTypeErrors1_es5.1.normal.js b/crates/swc/tests/tsc-references/neverTypeErrors1_es5.1.normal.js index 88c583196ed..e21cb1434af 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors1_es5.1.normal.js @@ -5,8 +5,7 @@ function f1() { x = false; x = undefined; x = null; - x = { - }; + x = {}; x(); } function f2() { @@ -15,8 +14,7 @@ function f2() { function f3() { return 1; } -function f4() { -} +function f4() {} var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = f4()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ @@ -36,5 +34,4 @@ try { } } } -for(var n1 in f4()){ -} +for(var n1 in f4()){} diff --git a/crates/swc/tests/tsc-references/neverTypeErrors1_es5.2.minified.js b/crates/swc/tests/tsc-references/neverTypeErrors1_es5.2.minified.js index 85df506bcc7..5c9b6b1e2be 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors1_es5.2.minified.js @@ -1,5 +1,4 @@ -function f4() { -} +function f4() {} var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for(var _step, _iterator = f4()[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_step.value; diff --git a/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.1.normal.js b/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.1.normal.js index ffe78d6561c..0649514e34e 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.1.normal.js @@ -6,8 +6,7 @@ function f1() { x = false; x = undefined; x = null; - x = { - }; + x = {}; x(); } function f2() { @@ -16,9 +15,6 @@ function f2() { function f3() { return 1; } -function f4() { -} -for (const n of f4()){ -} -for(const n1 in f4()){ -} +function f4() {} +for (const n of f4()){} +for(const n1 in f4()){} diff --git a/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.2.minified.js b/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.2.minified.js index 247e5d24d87..a748f946b59 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors2_es2015.2.minified.js @@ -1,4 +1,3 @@ -function f4() { -} +function f4() {} for (const n of f4()); for(const n1 in f4()); diff --git a/crates/swc/tests/tsc-references/neverTypeErrors2_es5.1.normal.js b/crates/swc/tests/tsc-references/neverTypeErrors2_es5.1.normal.js index 6c3d9cbc730..4d99c11cc21 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors2_es5.1.normal.js @@ -6,8 +6,7 @@ function f1() { x = false; x = undefined; x = null; - x = { - }; + x = {}; x(); } function f2() { @@ -16,8 +15,7 @@ function f2() { function f3() { return 1; } -function f4() { -} +function f4() {} var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = f4()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ @@ -37,5 +35,4 @@ try { } } } -for(var n1 in f4()){ -} +for(var n1 in f4()){} diff --git a/crates/swc/tests/tsc-references/neverTypeErrors2_es5.2.minified.js b/crates/swc/tests/tsc-references/neverTypeErrors2_es5.2.minified.js index 85df506bcc7..5c9b6b1e2be 100644 --- a/crates/swc/tests/tsc-references/neverTypeErrors2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/neverTypeErrors2_es5.2.minified.js @@ -1,5 +1,4 @@ -function f4() { -} +function f4() {} var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for(var _step, _iterator = f4()[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_step.value; diff --git a/crates/swc/tests/tsc-references/neverType_es2015.1.normal.js b/crates/swc/tests/tsc-references/neverType_es2015.1.normal.js index c9ac0afd703..1a306f28db0 100644 --- a/crates/swc/tests/tsc-references/neverType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/neverType_es2015.1.normal.js @@ -16,12 +16,10 @@ function failOrThrow(shouldFail) { throw new Error(); } function infiniteLoop1() { - while(true){ - } + while(true){} } function infiniteLoop2() { - while(true){ - } + while(true){} } function move1(direction) { switch(direction){ @@ -43,15 +41,13 @@ class C { throw new Error(); } void2() { - while(true){ - } + while(true){} } never1() { throw new Error(); } never2() { - while(true){ - } + while(true){} } } function f1(x) { diff --git a/crates/swc/tests/tsc-references/neverType_es5.1.normal.js b/crates/swc/tests/tsc-references/neverType_es5.1.normal.js index eff84583c26..86fd414626c 100644 --- a/crates/swc/tests/tsc-references/neverType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/neverType_es5.1.normal.js @@ -35,12 +35,10 @@ function failOrThrow(shouldFail) { throw new Error(); } function infiniteLoop1() { - while(true){ - } + while(true){} } function infiniteLoop2() { - while(true){ - } + while(true){} } function move1(direction) { switch(direction){ @@ -72,8 +70,7 @@ var C = /*#__PURE__*/ function() { { key: "void2", value: function void2() { - while(true){ - } + while(true){} } }, { @@ -85,8 +82,7 @@ var C = /*#__PURE__*/ function() { { key: "never2", value: function never2() { - while(true){ - } + while(true){} } } ]); diff --git a/crates/swc/tests/tsc-references/newOperatorConformance_es2015.1.normal.js b/crates/swc/tests/tsc-references/newOperatorConformance_es2015.1.normal.js index e44001f0be5..49e07ab84d2 100644 --- a/crates/swc/tests/tsc-references/newOperatorConformance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/newOperatorConformance_es2015.1.normal.js @@ -1,12 +1,10 @@ class C0 { } class C1 { - constructor(n, s){ - } + constructor(n, s){} } class T { - constructor(n){ - } + constructor(n){} } var anyCtor; var anyCtor1; @@ -33,8 +31,7 @@ function newFn2(s) { var p; } // Construct expression of void returning function -function fnVoid() { -} +function fnVoid() {} var t = new fnVoid(); var t; // Chained new expressions diff --git a/crates/swc/tests/tsc-references/newOperatorConformance_es2015.2.minified.js b/crates/swc/tests/tsc-references/newOperatorConformance_es2015.2.minified.js index 6a334811a25..3a90c4e6297 100644 --- a/crates/swc/tests/tsc-references/newOperatorConformance_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/newOperatorConformance_es2015.2.minified.js @@ -1,9 +1,7 @@ var anyCtor, anyCtor1, nestedCtor; new class { }, new class { - constructor(n){ - } -}, new anyCtor, new anyCtor1(void 0), new function() { -}(); + constructor(n){} +}, new anyCtor, new anyCtor1(void 0), new function() {}(); var nested = new new new nestedCtor()()(); new nested(), new nested(); diff --git a/crates/swc/tests/tsc-references/newOperatorConformance_es5.1.normal.js b/crates/swc/tests/tsc-references/newOperatorConformance_es5.1.normal.js index 3d80de62272..9dd4f850a11 100644 --- a/crates/swc/tests/tsc-references/newOperatorConformance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newOperatorConformance_es5.1.normal.js @@ -40,8 +40,7 @@ function newFn2(s) { var p; } // Construct expression of void returning function -function fnVoid() { -} +function fnVoid() {} var t = new fnVoid(); var t; // Chained new expressions diff --git a/crates/swc/tests/tsc-references/newOperatorConformance_es5.2.minified.js b/crates/swc/tests/tsc-references/newOperatorConformance_es5.2.minified.js index c7217eb38ff..18972300b19 100644 --- a/crates/swc/tests/tsc-references/newOperatorConformance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newOperatorConformance_es5.2.minified.js @@ -11,7 +11,6 @@ var anyCtor, anyCtor1, nestedCtor, C0 = function() { "use strict"; _classCallCheck(this, T); }; -new C0, new T, new anyCtor, new anyCtor1(void 0), new function() { -}(); +new C0, new T, new anyCtor, new anyCtor1(void 0), new function() {}(); var nested = new new new nestedCtor()()(); new nested(), new nested(); diff --git a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.1.normal.js index ae5319aa0ac..f843eddada3 100644 --- a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.1.normal.js @@ -3,9 +3,7 @@ function fnNumber() { return 90; } new fnNumber(); // Error -function fnVoid() { -} +function fnVoid() {} new fnVoid(); // Error -function functionVoidNoThis() { -} +function functionVoidNoThis() {} new functionVoidNoThis(); // Error diff --git a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.2.minified.js b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.2.minified.js index 6c72f0ee150..7ca5d5b5b13 100644 --- a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es2015.2.minified.js @@ -1,5 +1,3 @@ new function() { return 90; -}(), new function() { -}(), new function() { -}(); +}(), new function() {}(), new function() {}(); diff --git a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.1.normal.js b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.1.normal.js index ae5319aa0ac..f843eddada3 100644 --- a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.1.normal.js @@ -3,9 +3,7 @@ function fnNumber() { return 90; } new fnNumber(); // Error -function fnVoid() { -} +function fnVoid() {} new fnVoid(); // Error -function functionVoidNoThis() { -} +function functionVoidNoThis() {} new functionVoidNoThis(); // Error diff --git a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.2.minified.js b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.2.minified.js index 6c72f0ee150..7ca5d5b5b13 100644 --- a/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newOperatorErrorCases_noImplicitAny_es5.2.minified.js @@ -1,5 +1,3 @@ new function() { return 90; -}(), new function() { -}(), new function() { -}(); +}(), new function() {}(), new function() {}(); diff --git a/crates/swc/tests/tsc-references/newTarget.es5_es5.1.normal.js b/crates/swc/tests/tsc-references/newTarget.es5_es5.1.normal.js index 81d02d5cfb9..1881d596e88 100644 --- a/crates/swc/tests/tsc-references/newTarget.es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newTarget.es5_es5.1.normal.js @@ -56,8 +56,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/newTarget.es5_es5.2.minified.js b/crates/swc/tests/tsc-references/newTarget.es5_es5.2.minified.js index d80c321d072..1441ea253c9 100644 --- a/crates/swc/tests/tsc-references/newTarget.es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newTarget.es5_es5.2.minified.js @@ -41,8 +41,7 @@ var B = function(A1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/newTarget.es6_es5.1.normal.js b/crates/swc/tests/tsc-references/newTarget.es6_es5.1.normal.js index da30be55b8f..dae7747485c 100644 --- a/crates/swc/tests/tsc-references/newTarget.es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newTarget.es6_es5.1.normal.js @@ -56,8 +56,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/newTarget.es6_es5.2.minified.js b/crates/swc/tests/tsc-references/newTarget.es6_es5.2.minified.js index d80c321d072..1441ea253c9 100644 --- a/crates/swc/tests/tsc-references/newTarget.es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newTarget.es6_es5.2.minified.js @@ -41,8 +41,7 @@ var B = function(A1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.1.normal.js index c07f8384cd4..1368f762b9e 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.1.normal.js @@ -1,11 +1,8 @@ //@target: ES5 -function f(x, y, ...z) { -} -function f2(...x) { -} +function f(x, y, ...z) {} +function f2(...x) {} class B { - constructor(x, y, ...z){ - } + constructor(x, y, ...z){} } var a; var b; diff --git a/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.2.minified.js index 7ab836cd7cb..bb704cc0e64 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES5_es2015.2.minified.js @@ -1,9 +1,6 @@ var a, b, c, d, e, g, h, i; -function f(x, y, ...z) { -} +function f(x, y, ...z) {} class B { - constructor(x, y, ...z){ - } + constructor(x, y, ...z){} } -new f(1, 2, "string"), new f(1, 2, ...a), new f(1, 2, ...a, "string"), new function(...x) { -}(...a, ...a), new f(1, 2, ...a, ...a), new f(1, 2, "string")(), new f(1, 2, ...a)(), new f(1, 2, ...a, "string")(), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new d[1].f(1, 2, "string"), new d[1].f(1, 2, ...a), new d[1].f(1, 2, ...a, "string"), new e["a-b"].f(1, 2, "string"), new e["a-b"].f(1, 2, ...a), new e["a-b"].f(1, 2, ...a, "string"), new B(1, 2, "string"), new B(1, 2, ...a), new B(1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new g[1]["a-b"](1, 2, "string"), new g[1]["a-b"](1, 2, ...a), new g[1]["a-b"](1, 2, ...a, "string"), new h["a-b"]["a-b"](1, 2, "string"), new h["a-b"]["a-b"](1, 2, ...a), new h["a-b"]["a-b"](1, 2, ...a, "string"), new i["a-b"][1](1, 2, "string"), new i["a-b"][1](1, 2, ...a), new i["a-b"][1](1, 2, ...a, "string"); +new f(1, 2, "string"), new f(1, 2, ...a), new f(1, 2, ...a, "string"), new function(...x) {}(...a, ...a), new f(1, 2, ...a, ...a), new f(1, 2, "string")(), new f(1, 2, ...a)(), new f(1, 2, ...a, "string")(), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new d[1].f(1, 2, "string"), new d[1].f(1, 2, ...a), new d[1].f(1, 2, ...a, "string"), new e["a-b"].f(1, 2, "string"), new e["a-b"].f(1, 2, ...a), new e["a-b"].f(1, 2, ...a, "string"), new B(1, 2, "string"), new B(1, 2, ...a), new B(1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new g[1]["a-b"](1, 2, "string"), new g[1]["a-b"](1, 2, ...a), new g[1]["a-b"](1, 2, ...a, "string"), new h["a-b"]["a-b"](1, 2, "string"), new h["a-b"]["a-b"](1, 2, ...a), new h["a-b"]["a-b"](1, 2, ...a, "string"), new i["a-b"][1](1, 2, "string"), new i["a-b"][1](1, 2, ...a), new i["a-b"][1](1, 2, ...a, "string"); diff --git a/crates/swc/tests/tsc-references/newWithSpreadES5_es5.1.normal.js b/crates/swc/tests/tsc-references/newWithSpreadES5_es5.1.normal.js index 3b45865b167..8ee20d05f63 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES5_es5.1.normal.js @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/newWithSpreadES5_es5.2.minified.js b/crates/swc/tests/tsc-references/newWithSpreadES5_es5.2.minified.js index a694e566b37..43ab04c6eb8 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES5_es5.2.minified.js @@ -9,8 +9,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.1.normal.js index 4edc95c59ae..fe1142874ea 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.1.normal.js @@ -1,11 +1,8 @@ //@target: ES6 -function f(x, y, ...z) { -} -function f2(...x) { -} +function f(x, y, ...z) {} +function f2(...x) {} class B { - constructor(x, y, ...z){ - } + constructor(x, y, ...z){} } var a; var b; diff --git a/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.2.minified.js index 7ab836cd7cb..bb704cc0e64 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES6_es2015.2.minified.js @@ -1,9 +1,6 @@ var a, b, c, d, e, g, h, i; -function f(x, y, ...z) { -} +function f(x, y, ...z) {} class B { - constructor(x, y, ...z){ - } + constructor(x, y, ...z){} } -new f(1, 2, "string"), new f(1, 2, ...a), new f(1, 2, ...a, "string"), new function(...x) { -}(...a, ...a), new f(1, 2, ...a, ...a), new f(1, 2, "string")(), new f(1, 2, ...a)(), new f(1, 2, ...a, "string")(), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new d[1].f(1, 2, "string"), new d[1].f(1, 2, ...a), new d[1].f(1, 2, ...a, "string"), new e["a-b"].f(1, 2, "string"), new e["a-b"].f(1, 2, ...a), new e["a-b"].f(1, 2, ...a, "string"), new B(1, 2, "string"), new B(1, 2, ...a), new B(1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new g[1]["a-b"](1, 2, "string"), new g[1]["a-b"](1, 2, ...a), new g[1]["a-b"](1, 2, ...a, "string"), new h["a-b"]["a-b"](1, 2, "string"), new h["a-b"]["a-b"](1, 2, ...a), new h["a-b"]["a-b"](1, 2, ...a, "string"), new i["a-b"][1](1, 2, "string"), new i["a-b"][1](1, 2, ...a), new i["a-b"][1](1, 2, ...a, "string"); +new f(1, 2, "string"), new f(1, 2, ...a), new f(1, 2, ...a, "string"), new function(...x) {}(...a, ...a), new f(1, 2, ...a, ...a), new f(1, 2, "string")(), new f(1, 2, ...a)(), new f(1, 2, ...a, "string")(), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new d[1].f(1, 2, "string"), new d[1].f(1, 2, ...a), new d[1].f(1, 2, ...a, "string"), new e["a-b"].f(1, 2, "string"), new e["a-b"].f(1, 2, ...a), new e["a-b"].f(1, 2, ...a, "string"), new B(1, 2, "string"), new B(1, 2, ...a), new B(1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new g[1]["a-b"](1, 2, "string"), new g[1]["a-b"](1, 2, ...a), new g[1]["a-b"](1, 2, ...a, "string"), new h["a-b"]["a-b"](1, 2, "string"), new h["a-b"]["a-b"](1, 2, ...a), new h["a-b"]["a-b"](1, 2, ...a, "string"), new i["a-b"][1](1, 2, "string"), new i["a-b"][1](1, 2, ...a), new i["a-b"][1](1, 2, ...a, "string"); diff --git a/crates/swc/tests/tsc-references/newWithSpreadES6_es5.1.normal.js b/crates/swc/tests/tsc-references/newWithSpreadES6_es5.1.normal.js index 6da53c2c889..cd36b77cbe5 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES6_es5.1.normal.js @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/newWithSpreadES6_es5.2.minified.js b/crates/swc/tests/tsc-references/newWithSpreadES6_es5.2.minified.js index a694e566b37..43ab04c6eb8 100644 --- a/crates/swc/tests/tsc-references/newWithSpreadES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newWithSpreadES6_es5.2.minified.js @@ -9,8 +9,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/newWithSpread_es2015.1.normal.js b/crates/swc/tests/tsc-references/newWithSpread_es2015.1.normal.js index 1c6440f9cab..592e337729b 100644 --- a/crates/swc/tests/tsc-references/newWithSpread_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/newWithSpread_es2015.1.normal.js @@ -1,10 +1,7 @@ -function f(x, y, ...z) { -} -function f2(...x) { -} +function f(x, y, ...z) {} +function f2(...x) {} class B { - constructor(x, y, ...z){ - } + constructor(x, y, ...z){} } var a; var b; diff --git a/crates/swc/tests/tsc-references/newWithSpread_es2015.2.minified.js b/crates/swc/tests/tsc-references/newWithSpread_es2015.2.minified.js index 7ab836cd7cb..bb704cc0e64 100644 --- a/crates/swc/tests/tsc-references/newWithSpread_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/newWithSpread_es2015.2.minified.js @@ -1,9 +1,6 @@ var a, b, c, d, e, g, h, i; -function f(x, y, ...z) { -} +function f(x, y, ...z) {} class B { - constructor(x, y, ...z){ - } + constructor(x, y, ...z){} } -new f(1, 2, "string"), new f(1, 2, ...a), new f(1, 2, ...a, "string"), new function(...x) { -}(...a, ...a), new f(1, 2, ...a, ...a), new f(1, 2, "string")(), new f(1, 2, ...a)(), new f(1, 2, ...a, "string")(), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new d[1].f(1, 2, "string"), new d[1].f(1, 2, ...a), new d[1].f(1, 2, ...a, "string"), new e["a-b"].f(1, 2, "string"), new e["a-b"].f(1, 2, ...a), new e["a-b"].f(1, 2, ...a, "string"), new B(1, 2, "string"), new B(1, 2, ...a), new B(1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new g[1]["a-b"](1, 2, "string"), new g[1]["a-b"](1, 2, ...a), new g[1]["a-b"](1, 2, ...a, "string"), new h["a-b"]["a-b"](1, 2, "string"), new h["a-b"]["a-b"](1, 2, ...a), new h["a-b"]["a-b"](1, 2, ...a, "string"), new i["a-b"][1](1, 2, "string"), new i["a-b"][1](1, 2, ...a), new i["a-b"][1](1, 2, ...a, "string"); +new f(1, 2, "string"), new f(1, 2, ...a), new f(1, 2, ...a, "string"), new function(...x) {}(...a, ...a), new f(1, 2, ...a, ...a), new f(1, 2, "string")(), new f(1, 2, ...a)(), new f(1, 2, ...a, "string")(), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new b.f(1, 2, "string"), new b.f(1, 2, ...a), new b.f(1, 2, ...a, "string"), new d[1].f(1, 2, "string"), new d[1].f(1, 2, ...a), new d[1].f(1, 2, ...a, "string"), new e["a-b"].f(1, 2, "string"), new e["a-b"].f(1, 2, ...a), new e["a-b"].f(1, 2, ...a, "string"), new B(1, 2, "string"), new B(1, 2, ...a), new B(1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new c["a-b"](1, 2, "string"), new c["a-b"](1, 2, ...a), new c["a-b"](1, 2, ...a, "string"), new g[1]["a-b"](1, 2, "string"), new g[1]["a-b"](1, 2, ...a), new g[1]["a-b"](1, 2, ...a, "string"), new h["a-b"]["a-b"](1, 2, "string"), new h["a-b"]["a-b"](1, 2, ...a), new h["a-b"]["a-b"](1, 2, ...a, "string"), new i["a-b"][1](1, 2, "string"), new i["a-b"][1](1, 2, ...a), new i["a-b"][1](1, 2, ...a, "string"); diff --git a/crates/swc/tests/tsc-references/newWithSpread_es5.1.normal.js b/crates/swc/tests/tsc-references/newWithSpread_es5.1.normal.js index c8f80817869..182938b5a34 100644 --- a/crates/swc/tests/tsc-references/newWithSpread_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/newWithSpread_es5.1.normal.js @@ -16,8 +16,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/newWithSpread_es5.2.minified.js b/crates/swc/tests/tsc-references/newWithSpread_es5.2.minified.js index a694e566b37..43ab04c6eb8 100644 --- a/crates/swc/tests/tsc-references/newWithSpread_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/newWithSpread_es5.2.minified.js @@ -9,8 +9,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.1.normal.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.1.normal.js index f452a4a07c6..22fcaa64b27 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.1.normal.js @@ -13,8 +13,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -29,10 +28,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -54,8 +51,7 @@ const [, , ...s3] = strArray; s3.push(undefined); // Should error, 'undefined' not part of s2's element type const { t1 } = strMap; t1.toString(); // Should error, t1 possibly undefined -const t2 = _extends({ -}, strMap); +const t2 = _extends({}, strMap); t2.z.toString(); // Should error { const { x , y , z } = numMapPoint; diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.2.minified.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.2.minified.js index 56800b06f61..c1ca46bcf4a 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es2015.2.minified.js @@ -15,21 +15,17 @@ const [, , ...s3] = strArray; s3.push(void 0); const { t1 } = strMap; t1.toString(); -const t2 = _extends({ -}, strMap); +const t2 = _extends({}, strMap); t2.z.toString(); { const { x , y , z } = numMapPoint; x.toFixed(), y.toFixed(), z.toFixed(); }{ const { x } = numMapPoint, q = function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.1.normal.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.1.normal.js index b74884d44db..316b935f761 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.1.normal.js @@ -51,8 +51,7 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -67,10 +66,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -106,8 +103,7 @@ var _strArray2 = _toArray(strArray), s3 = _strArray2.slice(2); s3.push(undefined); // Should error, 'undefined' not part of s2's element type var t1 = strMap.t1; t1.toString(); // Should error, t1 possibly undefined -var t2 = _extends({ -}, strMap); +var t2 = _extends({}, strMap); t2.z.toString(); // Should error { var x = numMapPoint.x, y = numMapPoint.y, z = numMapPoint.z; diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.2.minified.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.2.minified.js index 385521fea23..d377fbe7136 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring_es5.2.minified.js @@ -51,18 +51,14 @@ function _unsupportedIterableToArray(o, minLen) { if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } } -_slicedToArray(strArray, 1)[0].toString(), _toArray(strArray).slice(0).push(void 0), _toArray(strArray).slice(2).push(void 0), strMap.t1.toString(), _extends({ -}, strMap).z.toString(); +_slicedToArray(strArray, 1)[0].toString(), _toArray(strArray).slice(0).push(void 0), _toArray(strArray).slice(2).push(void 0), strMap.t1.toString(), _extends({}, strMap).z.toString(); var ref, x = numMapPoint.x, y = numMapPoint.y, z = numMapPoint.z; x.toFixed(), y.toFixed(), z.toFixed(); var x1 = numMapPoint.x, q = function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.1.normal.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.1.normal.js index 7851add33df..516454fb1bc 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.1.normal.js @@ -3,21 +3,18 @@ var NumericEnum1; NumericEnum1[NumericEnum1["A"] = 0] = "A"; NumericEnum1[NumericEnum1["B"] = 1] = "B"; NumericEnum1[NumericEnum1["C"] = 2] = "C"; -})(NumericEnum1 || (NumericEnum1 = { -})); +})(NumericEnum1 || (NumericEnum1 = {})); var NumericEnum2; (function(NumericEnum2) { NumericEnum2[NumericEnum2["A"] = 0] = "A"; NumericEnum2[NumericEnum2["B"] = 1] = "B"; NumericEnum2[NumericEnum2["C"] = 2] = "C"; -})(NumericEnum2 || (NumericEnum2 = { -})); +})(NumericEnum2 || (NumericEnum2 = {})); var StringEnum1; (function(StringEnum1) { StringEnum1["A"] = "Alpha"; StringEnum1["B"] = "Beta"; -})(StringEnum1 || (StringEnum1 = { -})); +})(StringEnum1 || (StringEnum1 = {})); // All of these should be errors const e1 = strMap["foo"]; const e2 = strMap.bar; diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.2.minified.js index 178cb1dacfb..8957c77cb15 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es2015.2.minified.js @@ -1,5 +1,2 @@ var NumericEnum1, NumericEnum2, StringEnum1, NumericEnum1, NumericEnum2, StringEnum1; -(NumericEnum1 = NumericEnum1 || (NumericEnum1 = { -}))[NumericEnum1.A = 0] = "A", NumericEnum1[NumericEnum1.B = 1] = "B", NumericEnum1[NumericEnum1.C = 2] = "C", (NumericEnum2 = NumericEnum2 || (NumericEnum2 = { -}))[NumericEnum2.A = 0] = "A", NumericEnum2[NumericEnum2.B = 1] = "B", NumericEnum2[NumericEnum2.C = 2] = "C", (StringEnum1 = StringEnum1 || (StringEnum1 = { -})).A = "Alpha", StringEnum1.B = "Beta", strMap[0], strMap[0], strMap[0], strMap[0], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[StringEnum1.A], strMap[StringEnum1.A], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[null], strMap.baz = void 0, strMap.qua = void 0, strMap[0] = void 0, strMap[null] = void 0, numMap[0], numMap[0], numMap[0], numMap[NumericEnum1.A], numMap[NumericEnum2.A], symbolMap[s], symbolMap[s] = void 0, nonEmptyStringArray[0], nonEmptyStringArray[1]; +(NumericEnum1 = NumericEnum1 || (NumericEnum1 = {}))[NumericEnum1.A = 0] = "A", NumericEnum1[NumericEnum1.B = 1] = "B", NumericEnum1[NumericEnum1.C = 2] = "C", (NumericEnum2 = NumericEnum2 || (NumericEnum2 = {}))[NumericEnum2.A = 0] = "A", NumericEnum2[NumericEnum2.B = 1] = "B", NumericEnum2[NumericEnum2.C = 2] = "C", (StringEnum1 = StringEnum1 || (StringEnum1 = {})).A = "Alpha", StringEnum1.B = "Beta", strMap[0], strMap[0], strMap[0], strMap[0], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[StringEnum1.A], strMap[StringEnum1.A], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[null], strMap.baz = void 0, strMap.qua = void 0, strMap[0] = void 0, strMap[null] = void 0, numMap[0], numMap[0], numMap[0], numMap[NumericEnum1.A], numMap[NumericEnum2.A], symbolMap[s], symbolMap[s] = void 0, nonEmptyStringArray[0], nonEmptyStringArray[1]; diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.1.normal.js index 2da5d54272e..7f2023c674a 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.1.normal.js @@ -3,21 +3,18 @@ var NumericEnum1; NumericEnum1[NumericEnum1["A"] = 0] = "A"; NumericEnum1[NumericEnum1["B"] = 1] = "B"; NumericEnum1[NumericEnum1["C"] = 2] = "C"; -})(NumericEnum1 || (NumericEnum1 = { -})); +})(NumericEnum1 || (NumericEnum1 = {})); var NumericEnum2; (function(NumericEnum2) { NumericEnum2[NumericEnum2["A"] = 0] = "A"; NumericEnum2[NumericEnum2["B"] = 1] = "B"; NumericEnum2[NumericEnum2["C"] = 2] = "C"; -})(NumericEnum2 || (NumericEnum2 = { -})); +})(NumericEnum2 || (NumericEnum2 = {})); var StringEnum1; (function(StringEnum1) { StringEnum1["A"] = "Alpha"; StringEnum1["B"] = "Beta"; -})(StringEnum1 || (StringEnum1 = { -})); +})(StringEnum1 || (StringEnum1 = {})); // All of these should be errors var e1 = strMap["foo"]; var e2 = strMap.bar; diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.2.minified.js index 178cb1dacfb..8957c77cb15 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccess_es5.2.minified.js @@ -1,5 +1,2 @@ var NumericEnum1, NumericEnum2, StringEnum1, NumericEnum1, NumericEnum2, StringEnum1; -(NumericEnum1 = NumericEnum1 || (NumericEnum1 = { -}))[NumericEnum1.A = 0] = "A", NumericEnum1[NumericEnum1.B = 1] = "B", NumericEnum1[NumericEnum1.C = 2] = "C", (NumericEnum2 = NumericEnum2 || (NumericEnum2 = { -}))[NumericEnum2.A = 0] = "A", NumericEnum2[NumericEnum2.B = 1] = "B", NumericEnum2[NumericEnum2.C = 2] = "C", (StringEnum1 = StringEnum1 || (StringEnum1 = { -})).A = "Alpha", StringEnum1.B = "Beta", strMap[0], strMap[0], strMap[0], strMap[0], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[StringEnum1.A], strMap[StringEnum1.A], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[null], strMap.baz = void 0, strMap.qua = void 0, strMap[0] = void 0, strMap[null] = void 0, numMap[0], numMap[0], numMap[0], numMap[NumericEnum1.A], numMap[NumericEnum2.A], symbolMap[s], symbolMap[s] = void 0, nonEmptyStringArray[0], nonEmptyStringArray[1]; +(NumericEnum1 = NumericEnum1 || (NumericEnum1 = {}))[NumericEnum1.A = 0] = "A", NumericEnum1[NumericEnum1.B = 1] = "B", NumericEnum1[NumericEnum1.C = 2] = "C", (NumericEnum2 = NumericEnum2 || (NumericEnum2 = {}))[NumericEnum2.A = 0] = "A", NumericEnum2[NumericEnum2.B = 1] = "B", NumericEnum2[NumericEnum2.C = 2] = "C", (StringEnum1 = StringEnum1 || (StringEnum1 = {})).A = "Alpha", StringEnum1.B = "Beta", strMap[0], strMap[0], strMap[0], strMap[0], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[StringEnum1.A], strMap[StringEnum1.A], strMap[NumericEnum1.A], strMap[NumericEnum2.A], strMap[null], strMap.baz = void 0, strMap.qua = void 0, strMap[0] = void 0, strMap[null] = void 0, numMap[0], numMap[0], numMap[0], numMap[NumericEnum1.A], numMap[NumericEnum2.A], symbolMap[s], symbolMap[s] = void 0, nonEmptyStringArray[0], nonEmptyStringArray[1]; diff --git a/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es2015.1.normal.js index a453efa20de..f064f683fd3 100644 --- a/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es2015.1.normal.js @@ -2,9 +2,7 @@ class C { } var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); var v1; var v2; var v3; @@ -13,9 +11,7 @@ function f() { class C { } let E; - (function(E) { - })(E || (E = { - })); + (function(E) {})(E || (E = {})); var v1; var v2; var v3; diff --git a/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es5.1.normal.js b/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es5.1.normal.js index e0259dd90d1..45a4aab8734 100644 --- a/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonGenericTypeReferenceWithTypeArguments_es5.1.normal.js @@ -8,9 +8,7 @@ var C = function C() { _classCallCheck(this, C); }; var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); var v1; var v2; var v3; @@ -21,9 +19,7 @@ function f() { _classCallCheck(this, C); }; var E; - (function(E) { - })(E || (E = { - })); + (function(E) {})(E || (E = {})); var v1; var v2; var v3; diff --git a/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.1.normal.js index ee4713f014b..9ea0c4f6db8 100644 --- a/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.1.normal.js @@ -1,8 +1,7 @@ var M; (function(M1) { var a = M1.a = 1; -})(M || (M = { -})); +})(M || (M = {})); // primary expression var m; var m = M; @@ -21,10 +20,8 @@ var M2; }; } Point.Origin = Origin; - })(Point1 = M21.Point || (M21.Point = { - })); -})(M2 || (M2 = { -})); + })(Point1 = M21.Point || (M21.Point = {})); +})(M2 || (M2 = {})); var p; var p; var p2; @@ -34,5 +31,4 @@ var M3; class Utils { } M31.Utils = Utils; -})(M3 || (M3 = { -})); +})(M3 || (M3 = {})); diff --git a/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.2.minified.js index 1d079588f1a..6ea39dd9d53 100644 --- a/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonInstantiatedModule_es2015.2.minified.js @@ -1,13 +1,9 @@ -(M || (M = { -})).a = 1; +(M || (M = {})).a = 1; var M, m, M2, M3, M21, m = M; -m.a, ((M21 = M2 || (M2 = { -})).Point || (M21.Point = { -})).Origin = function() { +m.a, ((M21 = M2 || (M2 = {})).Point || (M21.Point = {})).Origin = function() { return { x: 0, y: 0 }; -}, (M3 || (M3 = { -})).Utils = class { +}, (M3 || (M3 = {})).Utils = class { }; diff --git a/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.1.normal.js b/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.1.normal.js index 435e52e6bb7..fbd03cf8732 100644 --- a/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.1.normal.js @@ -6,8 +6,7 @@ function _classCallCheck(instance, Constructor) { var M; (function(M1) { var a = M1.a = 1; -})(M || (M = { -})); +})(M || (M = {})); // primary expression var m; var m = M; @@ -26,10 +25,8 @@ var M2; }; } Point.Origin = Origin; - })(Point1 = M21.Point || (M21.Point = { - })); -})(M2 || (M2 = { -})); + })(Point1 = M21.Point || (M21.Point = {})); +})(M2 || (M2 = {})); var p; var p; var p2; @@ -41,5 +38,4 @@ var M3; _classCallCheck(this, Utils); }; M31.Utils = Utils; -})(M3 || (M3 = { -})); +})(M3 || (M3 = {})); diff --git a/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.2.minified.js b/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.2.minified.js index f1e9dbdb943..461781f436e 100644 --- a/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nonInstantiatedModule_es5.2.minified.js @@ -1,9 +1,6 @@ -(M || (M = { -})).a = 1; +(M || (M = {})).a = 1; var M, m, M2, M3, M21, m = M; -m.a, ((M21 = M2 || (M2 = { -})).Point || (M21.Point = { -})).Origin = function() { +m.a, ((M21 = M2 || (M2 = {})).Point || (M21.Point = {})).Origin = function() { return { x: 0, y: 0 @@ -16,5 +13,4 @@ m.a, ((M21 = M2 || (M2 = { }(this, Utils); }; M31.Utils = Utils; -})(M3 || (M3 = { -})); +})(M3 || (M3 = {})); diff --git a/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.1.normal.js index 04ebf227884..e554a3987b8 100644 --- a/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.1.normal.js @@ -1,5 +1,4 @@ -var c = { -}; +var c = {}; [...c] = [ "", 0 diff --git a/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.2.minified.js index 04ebf227884..e554a3987b8 100644 --- a/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonIterableRestElement1_es2015.2.minified.js @@ -1,5 +1,4 @@ -var c = { -}; +var c = {}; [...c] = [ "", 0 diff --git a/crates/swc/tests/tsc-references/nonIterableRestElement1_es5.1.normal.js b/crates/swc/tests/tsc-references/nonIterableRestElement1_es5.1.normal.js index 20d569d8f42..a40a891c4cf 100644 --- a/crates/swc/tests/tsc-references/nonIterableRestElement1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonIterableRestElement1_es5.1.normal.js @@ -1,5 +1,4 @@ -var c = { -}; +var c = {}; c = [ "", 0 diff --git a/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.1.normal.js index c52731f4426..8576d2896d8 100644 --- a/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -var c = { -}; +var c = {}; [...c] = [ "", 0 diff --git a/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.2.minified.js index 04ebf227884..e554a3987b8 100644 --- a/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonIterableRestElement2_es2015.2.minified.js @@ -1,5 +1,4 @@ -var c = { -}; +var c = {}; [...c] = [ "", 0 diff --git a/crates/swc/tests/tsc-references/nonIterableRestElement2_es5.1.normal.js b/crates/swc/tests/tsc-references/nonIterableRestElement2_es5.1.normal.js index 565bfaf3565..1cbef15234b 100644 --- a/crates/swc/tests/tsc-references/nonIterableRestElement2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonIterableRestElement2_es5.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 -var c = { -}; +var c = {}; c = [ "", 0 diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.1.normal.js index 48ad702c0e4..3e4d3cdb990 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.1.normal.js @@ -16,5 +16,4 @@ var a; a.toString(); a.nonExist(); // error var { destructuring } = a; // error -var rest = _extends({ -}, a); // ok +var rest = _extends({}, a); // ok diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.2.minified.js index 8e4abffa66c..f891b4e08ac 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es2015.2.minified.js @@ -9,5 +9,4 @@ function _extends() { } a.toString(), a.nonExist(); var a, { destructuring } = a; -_extends({ -}, a); +_extends({}, a); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.1.normal.js index 3fb52790c96..04696730e08 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.1.normal.js @@ -16,5 +16,4 @@ var a; a.toString(); a.nonExist(); // error var destructuring = a.destructuring; // error -var rest = _extends({ -}, a); // ok +var rest = _extends({}, a); // ok diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.2.minified.js index fab0880d98f..423537b8831 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAccessProperty_es5.2.minified.js @@ -8,5 +8,4 @@ function _extends() { return target; }).apply(this, arguments); } -a.toString(), a.nonExist(), a.destructuring, _extends({ -}, a); +a.toString(), a.nonExist(), a.destructuring, _extends({}, a); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.1.normal.js index ef3a891a381..4838c7b0d8b 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.1.normal.js @@ -1,5 +1,4 @@ -var x = { -}; +var x = {}; var y = { foo: "bar" }; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.2.minified.js index d916fe3e104..7093b062a24 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es2015.2.minified.js @@ -1,5 +1,4 @@ -var a, x = { -}, y = { +var a, x = {}, y = { foo: "bar" }; x = a, y = a, a = x, a = y; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.1.normal.js index ef3a891a381..4838c7b0d8b 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.1.normal.js @@ -1,5 +1,4 @@ -var x = { -}; +var x = {}; var y = { foo: "bar" }; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.2.minified.js index d916fe3e104..7093b062a24 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveAssignError_es5.2.minified.js @@ -1,5 +1,4 @@ -var a, x = { -}, y = { +var a, x = {}, y = { foo: "bar" }; x = a, y = a, a = x, a = y; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.1.normal.js index 7effed9d9fc..5ec6b7536a2 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.1.normal.js @@ -1,9 +1,7 @@ // @declaration: true -function takeObject(o) { -} +function takeObject(o) {} function returnObject() { - return { - }; + return {}; } var nonPrimitive; var primitive; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.2.minified.js index fa875d90c03..abc06266213 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es2015.2.minified.js @@ -1,8 +1,6 @@ var nonPrimitive, primitive; -function takeObject(o) { -} +function takeObject(o) {} function returnObject() { - return { - }; + return {}; } takeObject(nonPrimitive), nonPrimitive = returnObject(), takeObject(primitive), primitive = returnObject(); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.1.normal.js index 7effed9d9fc..5ec6b7536a2 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.1.normal.js @@ -1,9 +1,7 @@ // @declaration: true -function takeObject(o) { -} +function takeObject(o) {} function returnObject() { - return { - }; + return {}; } var nonPrimitive; var primitive; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.2.minified.js index fa875d90c03..abc06266213 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInFunction_es5.2.minified.js @@ -1,8 +1,6 @@ var nonPrimitive, primitive; -function takeObject(o) { -} +function takeObject(o) {} function returnObject() { - return { - }; + return {}; } takeObject(nonPrimitive), nonPrimitive = returnObject(), takeObject(primitive), primitive = returnObject(); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.1.normal.js index ce46411f710..7676d16b7e8 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.1.normal.js @@ -2,24 +2,20 @@ function generic(t) { var o = t; // expect error } -var a = { -}; +var a = {}; var b = "42"; -generic({ -}); +generic({}); generic(a); generic(123); // expect error generic(b); // expect error function bound(t) { var o = t; // ok } -bound({ -}); +bound({}); bound(a); bound(123); // expect error bound(b); // expect error -function bound2() { -} +function bound2() {} bound2(); bound2(); bound2(); // expect error diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.2.minified.js index 8b400b8b812..5a366ff34a0 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es2015.2.minified.js @@ -1,11 +1,5 @@ -function generic(t) { -} -var a = { -}; -function bound(t) { -} -function bound2() { -} -generic({ -}), generic(a), generic(123), generic("42"), bound({ -}), bound(a), bound(123), bound("42"), bound2(), bound2(), bound2(), bound2(); +function generic(t) {} +var a = {}; +function bound(t) {} +function bound2() {} +generic({}), generic(a), generic(123), generic("42"), bound({}), bound(a), bound(123), bound("42"), bound2(), bound2(), bound2(), bound2(); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.1.normal.js index ce46411f710..7676d16b7e8 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.1.normal.js @@ -2,24 +2,20 @@ function generic(t) { var o = t; // expect error } -var a = { -}; +var a = {}; var b = "42"; -generic({ -}); +generic({}); generic(a); generic(123); // expect error generic(b); // expect error function bound(t) { var o = t; // ok } -bound({ -}); +bound({}); bound(a); bound(123); // expect error bound(b); // expect error -function bound2() { -} +function bound2() {} bound2(); bound2(); bound2(); // expect error diff --git a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.2.minified.js index 8b400b8b812..5a366ff34a0 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveInGeneric_es5.2.minified.js @@ -1,11 +1,5 @@ -function generic(t) { -} -var a = { -}; -function bound(t) { -} -function bound2() { -} -generic({ -}), generic(a), generic(123), generic("42"), bound({ -}), bound(a), bound(123), bound("42"), bound2(), bound2(), bound2(), bound2(); +function generic(t) {} +var a = {}; +function bound(t) {} +function bound2() {} +generic({}), generic(a), generic(123), generic("42"), bound({}), bound(a), bound(123), bound("42"), bound2(), bound2(), bound2(), bound2(); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es2015.1.normal.js index c9b0d817aee..f6d45d00db2 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es2015.1.normal.js @@ -1,8 +1,6 @@ -let o = { -}; +let o = {}; function f() { - return { - }; + return {}; } const b1 = "foo" in o; const b2 = "bar" in f(); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es5.1.normal.js index 110b53cb7e1..d94214b8438 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveRhsSideOfInExpression_es5.1.normal.js @@ -1,8 +1,6 @@ -var o = { -}; +var o = {}; function f() { - return { - }; + return {}; } var b1 = "foo" in o; var b2 = "bar" in f(); diff --git a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.1.normal.js index cf34e4601c7..98942e76788 100644 --- a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.1.normal.js @@ -5,8 +5,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b = null; var c = null; diff --git a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.1.normal.js index 0ac07f2cda3..f99069b4bcf 100644 --- a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.1.normal.js @@ -12,8 +12,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b = null; var c = null; diff --git a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.2.minified.js index b3226de6741..f70e6cc54e8 100644 --- a/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nullAssignableToEveryType_es5.2.minified.js @@ -4,5 +4,4 @@ var E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.1.normal.js index 2c83114b59c..83cba86cc67 100644 --- a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.1.normal.js @@ -20,10 +20,8 @@ var r6 = true ? { var r6 = true ? null : { foo: 1 }; -var r7 = true ? ()=>{ -} : null; -var r7 = true ? null : ()=>{ -}; +var r7 = true ? ()=>{} : null; +var r7 = true ? null : ()=>{}; var r8 = true ? (x)=>{ return x; } : null; @@ -46,18 +44,15 @@ var r12 = true ? null : c2; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var r13 = true ? E : null; var r13 = true ? null : E; var r14 = true ? E.A : null; var r14 = true ? null : E.A; -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var af; var r15 = true ? af : null; var r15 = true ? null : af; @@ -65,8 +60,7 @@ class c { } (function(c3) { var bar = c3.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); var ac; var r16 = true ? ac : null; var r16 = true ? null : ac; @@ -84,7 +78,5 @@ function f18(x) { //} var r19 = true ? new Object() : null; var r19 = true ? null : new Object(); -var r20 = true ? { -} : null; -var r20 = true ? null : { -}; +var r20 = true ? {} : null; +var r20 = true ? null : {}; diff --git a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.2.minified.js b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.2.minified.js index ef919fe3a0e..01db8f87ba9 100644 --- a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -new Date(), (E = E || (E = { -}))[E.A = 0] = "A", E.A, (f || (f = { -})).bar = 1; +function f() {} +new Date(), (E = E || (E = {}))[E.A = 0] = "A", E.A, (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1, new Object(); +(c || (c = {})).bar = 1, new Object(); diff --git a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.1.normal.js b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.1.normal.js index 376f50b8c4e..e37d3694e15 100644 --- a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.1.normal.js @@ -25,10 +25,8 @@ var r6 = true ? { var r6 = true ? null : { foo: 1 }; -var r7 = true ? function() { -} : null; -var r7 = true ? null : function() { -}; +var r7 = true ? function() {} : null; +var r7 = true ? null : function() {}; var r8 = true ? function(x) { return x; } : null; @@ -55,18 +53,15 @@ var r12 = true ? null : c2; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var r13 = true ? E : null; var r13 = true ? null : E; var r14 = true ? E.A : null; var r14 = true ? null : E.A; -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var af; var r15 = true ? af : null; var r15 = true ? null : af; @@ -76,8 +71,7 @@ var c = function c() { }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); var ac; var r16 = true ? ac : null; var r16 = true ? null : ac; @@ -95,7 +89,5 @@ function f18(x) { //} var r19 = true ? new Object() : null; var r19 = true ? null : new Object(); -var r20 = true ? { -} : null; -var r20 = true ? null : { -}; +var r20 = true ? {} : null; +var r20 = true ? null : {}; diff --git a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.2.minified.js b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.2.minified.js index a0b43bfe47e..58d742adcdd 100644 --- a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined_es5.2.minified.js @@ -9,14 +9,10 @@ var C1 = function() { "use strict"; _classCallCheck(this, C2); }; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; var E, E, c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1, new Object(); +(c || (c = {})).bar = 1, new Object(); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator12_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator12_es2015.1.normal.js index 2feac4113d6..ddefa10e8d5 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator12_es2015.1.normal.js @@ -4,5 +4,4 @@ const obj = { arr: [] }; var ref; -for (const i of (ref = obj === null || obj === void 0 ? void 0 : obj.arr) !== null && ref !== void 0 ? ref : []){ -} +for (const i of (ref = obj === null || obj === void 0 ? void 0 : obj.arr) !== null && ref !== void 0 ? ref : []){} diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator6_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator6_es2015.1.normal.js index 11fb3d85c92..842aa089ed1 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator6_es2015.1.normal.js @@ -1,3 +1,2 @@ // @strict: true -function foo(foo1, bar = foo1 !== null && foo1 !== void 0 ? foo1 : "bar") { -} +function foo(foo1, bar = foo1 !== null && foo1 !== void 0 ? foo1 : "bar") {} diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern.2_es5.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern.2_es5.2.minified.js index 81ab572f308..7c6a8af60c5 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern.2_es5.2.minified.js @@ -1,3 +1,2 @@ -var ref, ref1, param, a = function() { -}; +var ref, ref1, param, a = function() {}; (void 0)[null !== (ref = a()) && void 0 !== ref ? ref : "d"], param[null !== (ref1 = a()) && void 0 !== ref1 ? ref1 : "d"], param.d; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern_es2015.1.normal.js index 7a08966bb92..dc0d78a9e5a 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterBindingPattern_es2015.1.normal.js @@ -4,5 +4,4 @@ const a = ()=>undefined ; var ref; -(({ [(ref = a()) !== null && ref !== void 0 ? ref : "d"]: c = "" })=>{ -})(); +(({ [(ref = a()) !== null && ref !== void 0 ? ref : "d"]: c = "" })=>{})(); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer.2_es5.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer.2_es5.2.minified.js index 5790c6a8318..e925fa542ac 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer.2_es5.2.minified.js @@ -1,5 +1,4 @@ -var ref, ref1, a = function() { -}; +var ref, ref1, a = function() {}; !function() { arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null !== (ref = a()) && void 0 !== ref; }(), (function() { diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es2015.1.normal.js index 6bd8f4da7f8..166d96ff368 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es2015.1.normal.js @@ -4,5 +4,4 @@ const a = ()=>undefined ; var ref; -((b = (ref = a()) !== null && ref !== void 0 ? ref : "d")=>{ -})(); +((b = (ref = a()) !== null && ref !== void 0 ? ref : "d")=>{})(); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es5.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es5.2.minified.js index 9801756bd43..f276fc19494 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInParameterInitializer_es5.2.minified.js @@ -1,5 +1,4 @@ -var ref, a = function() { -}; +var ref, a = function() {}; !function() { arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null !== (ref = a()) && void 0 !== ref; }(); diff --git a/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.1.normal.js b/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.1.normal.js index cefe0f1649e..d96c71c01d8 100644 --- a/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.1.normal.js @@ -1,8 +1,7 @@ var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var n; var e; e = n; diff --git a/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.2.minified.js b/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.2.minified.js index d582b5a4a25..86a14832585 100644 --- a/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/numberAssignableToEnum_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, n, E; -(E = E || (E = { -}))[E.A = 0] = "A", n = n; +(E = E || (E = {}))[E.A = 0] = "A", n = n; diff --git a/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.1.normal.js b/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.1.normal.js index cefe0f1649e..d96c71c01d8 100644 --- a/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.1.normal.js @@ -1,8 +1,7 @@ var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var n; var e; e = n; diff --git a/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.2.minified.js b/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.2.minified.js index d582b5a4a25..86a14832585 100644 --- a/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/numberAssignableToEnum_es5.2.minified.js @@ -1,3 +1,2 @@ var E, n, E; -(E = E || (E = { -}))[E.A = 0] = "A", n = n; +(E = E || (E = {}))[E.A = 0] = "A", n = n; diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.1.normal.js index c22375054ae..42049b14158 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.2.minified.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.2.minified.js index 58451e62926..a0ee4278adf 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2_es5.2.minified.js @@ -51,8 +51,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es2015.1.normal.js index 5b786899840..0aff8b71e52 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es2015.1.normal.js @@ -2,26 +2,22 @@ class C { get X() { return ''; } - set X(v) { - } + set X(v) {} foo() { return ''; } - static foo() { - } + static foo() {} static get X() { return 1; } - constructor(){ - } + constructor(){} } var a; // error var b = { a: '', b: 1, - c: ()=>{ - }, + c: ()=>{}, "d": '', "e": 1, 1: '', @@ -32,8 +28,7 @@ var b = { get X () { return ''; }, - set X (v){ - }, + set X (v){}, foo () { return ''; } diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.1.normal.js index 829a165f514..6022d7b7767 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.1.normal.js @@ -28,8 +28,7 @@ var C = /*#__PURE__*/ function() { get: function get() { return ''; }, - set: function set(v) { - } // ok + set: function set(v) {} // ok }, { key: "foo", @@ -40,8 +39,7 @@ var C = /*#__PURE__*/ function() { ], [ { key: "foo", - value: function foo() { - } // ok + value: function foo() {} // ok }, { key: "X", @@ -57,8 +55,7 @@ var a; var b = { a: '', b: 1, - c: function() { - }, + c: function() {}, "d": '', "e": 1, 1: '', @@ -69,8 +66,7 @@ var b = { get X () { return ''; }, - set X (v){ - }, + set X (v){}, foo: function foo() { return ''; } diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.2.minified.js index 8b1d728f945..63805daf36b 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, staticProps = [ { key: "foo", - value: function() { - } + value: function() {} }, { key: "X", @@ -30,8 +29,7 @@ var C = function() { get: function() { return ""; }, - set: function(v) { - } + set: function(v) {} }, { key: "foo", diff --git a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.1.normal.js index bb457cd9d23..9d1a894a3b3 100644 --- a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.1.normal.js @@ -16,6 +16,5 @@ var w = foo({ a: 10 }); var w; -var b = bar({ -}); +var b = bar({}); var b; diff --git a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.2.minified.js index ed955aed7c0..2f93244d731 100644 --- a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es2015.2.minified.js @@ -8,5 +8,4 @@ foo({ description: !1 }), foo({ a: 10 -}), bar({ -}); +}), bar({}); diff --git a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.1.normal.js index bb457cd9d23..9d1a894a3b3 100644 --- a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.1.normal.js @@ -16,6 +16,5 @@ var w = foo({ a: 10 }); var w; -var b = bar({ -}); +var b = bar({}); var b; diff --git a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.2.minified.js index ed955aed7c0..2f93244d731 100644 --- a/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralContextualTyping_es5.2.minified.js @@ -8,5 +8,4 @@ foo({ description: !1 }), foo({ a: 10 -}), bar({ -}); +}), bar({}); diff --git a/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es2015.1.normal.js index c29f86961d6..19cedb58b0f 100644 --- a/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es2015.1.normal.js @@ -5,13 +5,11 @@ var e1 = { } }; var e2 = { - set a (n){ - } + set a (n){} }; var e3 = { get a () { return ''; }, - set a (n){ - } + set a (n){} }; diff --git a/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es5.1.normal.js index c29f86961d6..19cedb58b0f 100644 --- a/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralErrorsES3_es5.1.normal.js @@ -5,13 +5,11 @@ var e1 = { } }; var e2 = { - set a (n){ - } + set a (n){} }; var e3 = { get a () { return ''; }, - set a (n){ - } + set a (n){} }; diff --git a/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es2015.1.normal.js index fc3b317239f..ef197af6c18 100644 --- a/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es2015.1.normal.js @@ -86,14 +86,12 @@ var getter2 = { var getter2; // Set accessor only, type of the property is the param type of the set accessor var setter1 = { - set x (n){ - } + set x (n){} }; var setter1; // Set accessor only, type of the property is Any for an unannotated set accessor var setter2 = { - set x (n){ - } + set x (n){} }; var setter2; var anyVar; @@ -102,34 +100,29 @@ var sameType1 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; var sameType2 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; var sameType3 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; var sameType4 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; // Type of unannotated get accessor return type is the type annotation of the set accessor param var setParamType1 = { - set n (x){ - }, + set n (x){}, get n () { return (t)=>{ var p; @@ -144,8 +137,7 @@ var setParamType2 = { var p = t; }; }, - set n (x){ - } + set n (x){} }; // Type of unannotated set accessor parameter is the return type annotation of the get accessor var getParamType1 = { diff --git a/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es5.1.normal.js index 1cd6f61e73f..8fee96ac113 100644 --- a/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters_es5.1.normal.js @@ -88,14 +88,12 @@ var getter2 = { var getter2; // Set accessor only, type of the property is the param type of the set accessor var setter1 = { - set x (n){ - } + set x (n){} }; var setter1; // Set accessor only, type of the property is Any for an unannotated set accessor var setter2 = { - set x (n){ - } + set x (n){} }; var setter2; var anyVar; @@ -104,34 +102,29 @@ var sameType1 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; var sameType2 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; var sameType3 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; var sameType4 = { get x () { return undefined; }, - set x (n){ - } + set x (n){} }; // Type of unannotated get accessor return type is the type annotation of the set accessor param var setParamType1 = { - set n (x){ - }, + set n (x){}, get n () { return function(t) { var p; @@ -146,8 +139,7 @@ var setParamType2 = { var p = t; }; }, - set n (x){ - } + set n (x){} }; // Type of unannotated set accessor parameter is the return type annotation of the get accessor var getParamType1 = { diff --git a/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.1.normal.js index 910a87f213e..dc114dcbcb2 100644 --- a/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -68,8 +67,7 @@ let a2 = [ { a: "abc" }, - { - } + {} ][0]; a2.a; // string | number | undefined a2.b; // number | undefined @@ -80,8 +78,7 @@ a2 = { a2 = { a: "def" }; -a2 = { -}; +a2 = {}; a2 = { a: "def", b: 20 @@ -89,23 +86,17 @@ a2 = { a2 = { a: 1 }; // Error -let b2 = _objectSpread({ -}, b1, { +let b2 = _objectSpread({}, b1, { z: 55 }); -let b3 = _objectSpread({ -}, b2); -let c1 = !true ? { -} : opts; -let c2 = !true ? opts : { -}; +let b3 = _objectSpread({}, b2); +let c1 = !true ? {} : opts; +let c2 = !true ? opts : {}; let c3 = !true ? { a: 0, b: 0 -} : { -}; -let c4 = !true ? { -} : { +} : {}; +let c4 = !true ? {} : { a: 0, b: 0 }; @@ -139,10 +130,8 @@ let e1 = f({ b: 2 }, { a: "abc" -}, { -}); -let e2 = f({ -}, { +}, {}); +let e2 = f({}, { a: "abc" }, { a: 1, diff --git a/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.2.minified.js index b05a3f97cca..eccdfe35a58 100644 --- a/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralNormalization_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -40,19 +39,16 @@ a2.a, a2.b, a2 = { b: 20 }, a2 = { a: "def" -}, a2 = { -}, a2 = { +}, a2 = {}, a2 = { a: "def", b: 20 }, a2 = { a: 1 }; -let b2 = _objectSpread({ -}, b1, { +let b2 = _objectSpread({}, b1, { z: 55 }); -_objectSpread({ -}, b2); +_objectSpread({}, b2); let d1 = { kind: "a", pos: { @@ -65,9 +61,7 @@ d1.kind, d1.pos, d1.pos.x, d1.pos.y, d1.pos.a, d1.pos.b, f({ b: 2 }, { a: "abc" -}, { -}), f({ -}, { +}, {}), f({}, { a: "abc" }, { a: 1, diff --git a/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.1.normal.js index 176b50da5b1..5e2b9cc1452 100644 --- a/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -68,8 +67,7 @@ var a2 = [ { a: "abc" }, - { - } + {} ][0]; a2.a; // string | number | undefined a2.b; // number | undefined @@ -80,8 +78,7 @@ a2 = { a2 = { a: "def" }; -a2 = { -}; +a2 = {}; a2 = { a: "def", b: 20 @@ -89,23 +86,17 @@ a2 = { a2 = { a: 1 }; // Error -var b2 = _objectSpread({ -}, b1, { +var b2 = _objectSpread({}, b1, { z: 55 }); -var b3 = _objectSpread({ -}, b2); -var c1 = !true ? { -} : opts; -var c2 = !true ? opts : { -}; +var b3 = _objectSpread({}, b2); +var c1 = !true ? {} : opts; +var c2 = !true ? opts : {}; var c3 = !true ? { a: 0, b: 0 -} : { -}; -var c4 = !true ? { -} : { +} : {}; +var c4 = !true ? {} : { a: 0, b: 0 }; @@ -139,10 +130,8 @@ var e1 = f({ b: 2 }, { a: "abc" -}, { -}); -var e2 = f({ -}, { +}, {}); +var e2 = f({}, { a: "abc" }, { a: 1, diff --git a/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.2.minified.js index e5a56ad67e3..30613efb5a1 100644 --- a/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralNormalization_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -40,19 +39,16 @@ a2.a, a2.b, a2 = { b: 20 }, a2 = { a: "def" -}, a2 = { -}, a2 = { +}, a2 = {}, a2 = { a: "def", b: 20 }, a2 = { a: 1 }; -var b2 = _objectSpread({ -}, b1, { +var b2 = _objectSpread({}, b1, { z: 55 }); -_objectSpread({ -}, b2); +_objectSpread({}, b2); var d1 = { kind: "a", pos: { @@ -65,9 +61,7 @@ d1.kind, d1.pos, d1.pos.x, d1.pos.y, d1.pos.a, d1.pos.b, f({ b: 2 }, { a: "abc" -}, { -}), f({ -}, { +}, {}), f({}, { a: "abc" }, { a: 1, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es2015.1.normal.js index 07d65abd4af..e5810d829eb 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es2015.1.normal.js @@ -6,8 +6,7 @@ var person = { name, id }; -function foo(obj) { -} +function foo(obj) {} function bar(name1, id1) { return { name: name1, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es5.1.normal.js index bdca2756984..ecaf6765b1d 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentES6_es5.1.normal.js @@ -6,8 +6,7 @@ var person = { name: name, id: id }; -function foo(obj) { -} +function foo(obj) {} function bar(name1, id1) { return { name: name1, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es2015.1.normal.js index 15720f467c7..a49eb162f3f 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es2015.1.normal.js @@ -12,8 +12,7 @@ function foo(name1, id1) { id: id1 }; } // error -function bar(obj) { -} +function bar(obj) {} bar({ name, id diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es5.1.normal.js index 6d61c8895eb..249d813c29e 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignmentError_es5.1.normal.js @@ -12,8 +12,7 @@ function foo(name1, id1) { id: id1 }; } // error -function bar(obj) { -} +function bar(obj) {} bar({ name: name, id: id diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es2015.1.normal.js index bbea81ce669..7be1eb2c084 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es2015.1.normal.js @@ -5,8 +5,7 @@ var person = { name, id }; -function foo(obj) { -} +function foo(obj) {} function bar(name1, id1) { return { name: name1, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es5.1.normal.js index 810ce154ec0..44ca3b3d768 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesAssignment_es5.1.normal.js @@ -5,8 +5,7 @@ var person = { name: name, id: id }; -function foo(obj) { -} +function foo(obj) {} function bar(name1, id1) { return { name: name1, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.1.normal.js index d16d8c3dbd4..813f54a7a44 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.1.normal.js @@ -10,8 +10,7 @@ var x3 = { a: 0, b, c, - d () { - }, + d () {}, x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.2.minified.js index e0285e972b1..d413e52bdc0 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es2015.2.minified.js @@ -2,8 +2,7 @@ var b, c, x3 = { a: 0, b, c, - d () { - }, + d () {}, x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.1.normal.js index abe42484e8f..aff6072103f 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.1.normal.js @@ -10,8 +10,7 @@ var x3 = { a: 0, b: b, c: c, - d: function d() { - }, + d: function d() {}, x3: x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.2.minified.js index 92356a05534..c0fdb2cd7b5 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesES6_es5.2.minified.js @@ -2,8 +2,7 @@ var x3 = { a: 0, b: void 0, c: void 0, - d: function() { - }, + d: function() {}, x3: x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es2015.1.normal.js index 7f3bb1c799b..652bd3f30db 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es2015.1.normal.js @@ -5,6 +5,5 @@ var person = { name, id }; -function foo(p) { -} +function foo(p) {} foo(person); // error diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es5.1.normal.js index c9bbfd556a6..9c9ebb6aa88 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument2_es5.1.normal.js @@ -5,6 +5,5 @@ var person = { name: name, id: id }; -function foo(p) { -} +function foo(p) {} foo(person); // error diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es2015.1.normal.js index 3ef10cff545..76ec74e203e 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es2015.1.normal.js @@ -5,8 +5,7 @@ var person = { name, id }; -function foo(p) { -} +function foo(p) {} foo(person); var obj = { name: name, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es5.1.normal.js index dd251657244..b3f82d5e43a 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesFunctionArgument_es5.1.normal.js @@ -5,8 +5,7 @@ var person = { name: name, id: id }; -function foo(p) { -} +function foo(p) {} foo(person); var obj = { name: name, diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.1.normal.js index 79cb914da69..6b24f4b23d9 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.1.normal.js @@ -3,13 +3,11 @@ var m; (function(m1) { var x; m1.x = x; -})(m || (m = { -})); +})(m || (m = {})); (function(m) { var z = x; var y = { a: x, x }; -})(m || (m = { -})); +})(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.2.minified.js index c2515bacbf8..22df19d2ee5 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es2015.2.minified.js @@ -2,5 +2,4 @@ var m; !function(m1) { var x; m1.x = x; -}(m || (m = { -})); +}(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.1.normal.js index 315fe889a36..8c68b08af19 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.1.normal.js @@ -3,13 +3,11 @@ var m; (function(m1) { var x; m1.x = x; -})(m || (m = { -})); +})(m || (m = {})); (function(m) { var z = x; var y = { a: x, x: x }; -})(m || (m = { -})); +})(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.2.minified.js index c2515bacbf8..22df19d2ee5 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6_es5.2.minified.js @@ -2,5 +2,4 @@ var m; !function(m1) { var x; m1.x = x; -}(m || (m = { -})); +}(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.1.normal.js index b63951641d3..afa1390bba8 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.1.normal.js @@ -3,13 +3,11 @@ var m; (function(m1) { var x; m1.x = x; -})(m || (m = { -})); +})(m || (m = {})); (function(m) { var z = x; var y = { a: x, x }; -})(m || (m = { -})); +})(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.2.minified.js index c2515bacbf8..22df19d2ee5 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es2015.2.minified.js @@ -2,5 +2,4 @@ var m; !function(m1) { var x; m1.x = x; -}(m || (m = { -})); +}(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.1.normal.js index 287b70f2010..770357756da 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.1.normal.js @@ -3,13 +3,11 @@ var m; (function(m1) { var x; m1.x = x; -})(m || (m = { -})); +})(m || (m = {})); (function(m) { var z = x; var y = { a: x, x: x }; -})(m || (m = { -})); +})(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.2.minified.js index c2515bacbf8..22df19d2ee5 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule_es5.2.minified.js @@ -2,5 +2,4 @@ var m; !function(m1) { var x; m1.x = x; -}(m || (m = { -})); +}(m || (m = {})); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.1.normal.js index 1a15bbf3f0e..0c3c05abc0b 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.1.normal.js @@ -10,8 +10,7 @@ var x3 = { a: 0, b, c, - d () { - }, + d () {}, x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.2.minified.js index e0285e972b1..d413e52bdc0 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es2015.2.minified.js @@ -2,8 +2,7 @@ var b, c, x3 = { a: 0, b, c, - d () { - }, + d () {}, x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.1.normal.js index fd464ee8448..935b37a36b1 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.1.normal.js @@ -10,8 +10,7 @@ var x3 = { a: 0, b: b, c: c, - d: function d() { - }, + d: function d() {}, x3: x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.2.minified.js index 92356a05534..c0fdb2cd7b5 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandProperties_es5.2.minified.js @@ -2,8 +2,7 @@ var x3 = { a: 0, b: void 0, c: void 0, - d: function() { - }, + d: function() {}, x3: x3, parent: x3 }; diff --git a/crates/swc/tests/tsc-references/objectRest2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRest2_es2015.1.normal.js index f3d1ebad4f0..36d014d25ad 100644 --- a/crates/swc/tests/tsc-references/objectRest2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRest2_es2015.1.normal.js @@ -42,8 +42,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -62,8 +61,7 @@ function rootConnection(name) { const { objects } = yield { objects: 12 }; - return _objectSpread({ - }, connectionFromArray(objects, args)); + return _objectSpread({}, connectionFromArray(objects, args)); }) }; } diff --git a/crates/swc/tests/tsc-references/objectRest2_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRest2_es2015.2.minified.js index 70bd2d3b528..bb7e29f2656 100644 --- a/crates/swc/tests/tsc-references/objectRest2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRest2_es2015.2.minified.js @@ -37,8 +37,7 @@ function _defineProperty(obj, key, value) { }; return (function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -46,8 +45,7 @@ function _defineProperty(obj, key, value) { }); } return target; - })({ - }, connectionFromArray(objects, args)); + })({}, connectionFromArray(objects, args)); }) }; }("test"); diff --git a/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js index 01d7c570cf1..6adf4fc1146 100644 --- a/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js @@ -43,8 +43,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -70,8 +69,7 @@ function rootConnection(name) { }; case 2: objects = _ctx.sent.objects; - return _ctx.abrupt("return", _objectSpread({ - }, connectionFromArray(objects, args))); + return _ctx.abrupt("return", _objectSpread({}, connectionFromArray(objects, args))); case 4: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/objectRest2_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRest2_es5.2.minified.js index 1d76908a129..16327c10b1a 100644 --- a/crates/swc/tests/tsc-references/objectRest2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRest2_es5.2.minified.js @@ -18,8 +18,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -53,8 +52,7 @@ function _objectSpread(target) { objects: 12 }; case 2: - return objects = _ctx.sent.objects, _ctx.abrupt("return", _objectSpread({ - }, connectionFromArray(objects, args))); + return objects = _ctx.sent.objects, _ctx.abrupt("return", _objectSpread({}, connectionFromArray(objects, args))); case 4: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/objectRestAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRestAssignment_es2015.1.normal.js index ee93f27150e..1320215f842 100644 --- a/crates/swc/tests/tsc-references/objectRestAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestAssignment_es2015.1.normal.js @@ -13,8 +13,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -29,10 +28,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -58,16 +55,14 @@ _complex = complex, nested = _objectWithoutProperties(_complex.x, [ // should be: let overEmit; // var _g = overEmit.a, [_h, ...y] = _g, nested2 = __rest(_h, []), _j = overEmit.b, { z } = _j, c = __rest(_j, ["z"]), rest2 = __rest(overEmit, ["a", "b"]); -var { a: [{}, ...y] , b: { z } } = overEmit, nested2 = _extends({ -}, overEmit.a[0]), c = _objectWithoutProperties(overEmit.b, [ +var { a: [{}, ...y] , b: { z } } = overEmit, nested2 = _extends({}, overEmit.a[0]), c = _objectWithoutProperties(overEmit.b, [ "z" ]), rest2 = _objectWithoutProperties(overEmit, [ "a", "b" ]); var _overEmit; -_overEmit = overEmit, nested2 = _extends({ -}, _overEmit.a[0]), c = _objectWithoutProperties(_overEmit.b, [ +_overEmit = overEmit, nested2 = _extends({}, _overEmit.a[0]), c = _objectWithoutProperties(_overEmit.b, [ "z" ]), rest2 = _objectWithoutProperties(_overEmit, [ "a", diff --git a/crates/swc/tests/tsc-references/objectRestAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRestAssignment_es2015.2.minified.js index 5e830f299ee..ff5295799de 100644 --- a/crates/swc/tests/tsc-references/objectRestAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestAssignment_es2015.2.minified.js @@ -8,8 +8,7 @@ function _extends() { }).apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -18,10 +17,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -34,14 +31,12 @@ _objectWithoutProperties((_complex = void 0).x, [ ]), { x: { ka } , y: other } = _complex; let overEmit; var _complex, _overEmit, { a: [{}, ...y] , b: { z } } = overEmit; -_extends({ -}, overEmit.a[0]), _objectWithoutProperties(overEmit.b, [ +_extends({}, overEmit.a[0]), _objectWithoutProperties(overEmit.b, [ "z" ]), _objectWithoutProperties(overEmit, [ "a", "b" -]), _extends({ -}, (_overEmit = overEmit).a[0]), _objectWithoutProperties(_overEmit.b, [ +]), _extends({}, (_overEmit = overEmit).a[0]), _objectWithoutProperties(_overEmit.b, [ "z" ]), _objectWithoutProperties(_overEmit, [ "a", diff --git a/crates/swc/tests/tsc-references/objectRestAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRestAssignment_es5.1.normal.js index 9e74bd75790..54d57751c03 100644 --- a/crates/swc/tests/tsc-references/objectRestAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestAssignment_es5.1.normal.js @@ -27,8 +27,7 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -43,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -87,8 +84,7 @@ _complex = complex, nested = _objectWithoutProperties(_complex.x, [ // should be: var overEmit; // var _g = overEmit.a, [_h, ...y] = _g, nested2 = __rest(_h, []), _j = overEmit.b, { z } = _j, c = __rest(_j, ["z"]), rest2 = __rest(overEmit, ["a", "b"]); -var _a = _toArray(overEmit.a), ref1 = _a[0], ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")), y = _a.slice(1), z = overEmit.b.z, nested2 = _extends({ -}, overEmit.a[0]), c = _objectWithoutProperties(overEmit.b, [ +var _a = _toArray(overEmit.a), ref1 = _a[0], ref1 = ref1 !== null ? ref1 : _throw(new TypeError("Cannot destructure undefined")), y = _a.slice(1), z = overEmit.b.z, nested2 = _extends({}, overEmit.a[0]), c = _objectWithoutProperties(overEmit.b, [ "z" ]), rest2 = _objectWithoutProperties(overEmit, [ "a", @@ -96,8 +92,7 @@ var _a = _toArray(overEmit.a), ref1 = _a[0], ref1 = ref1 !== null ? ref1 : _thro ]); var _overEmit; var ref2, ref3, ref4; -_overEmit = overEmit, nested2 = _extends({ -}, _overEmit.a[0]), c = _objectWithoutProperties(_overEmit.b, [ +_overEmit = overEmit, nested2 = _extends({}, _overEmit.a[0]), c = _objectWithoutProperties(_overEmit.b, [ "z" ]), rest2 = _objectWithoutProperties(_overEmit, [ "a", diff --git a/crates/swc/tests/tsc-references/objectRestAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRestAssignment_es5.2.minified.js index e2fa81adac1..d59a554bb0a 100644 --- a/crates/swc/tests/tsc-references/objectRestAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestAssignment_es5.2.minified.js @@ -13,8 +13,7 @@ function _extends() { }).apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -23,10 +22,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -56,14 +53,12 @@ _objectWithoutProperties((_complex = complex).x, [ var complex, _complex, overEmit, _overEmit, ref, ref1, _a = _toArray(overEmit.a), ref2 = _a[0], ref2 = null !== ref2 ? ref2 : function(e) { throw e; }(new TypeError("Cannot destructure undefined")); -_a.slice(1), overEmit.b.z, _extends({ -}, overEmit.a[0]), _objectWithoutProperties(overEmit.b, [ +_a.slice(1), overEmit.b.z, _extends({}, overEmit.a[0]), _objectWithoutProperties(overEmit.b, [ "z" ]), _objectWithoutProperties(overEmit, [ "a", "b" -]), _extends({ -}, (_overEmit = overEmit).a[0]), _objectWithoutProperties(_overEmit.b, [ +]), _extends({}, (_overEmit = overEmit).a[0]), _objectWithoutProperties(_overEmit.b, [ "z" ]), _objectWithoutProperties(_overEmit, [ "a", diff --git a/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.1.normal.js index 22c28679127..d4cbe0369e1 100644 --- a/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -29,8 +26,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { return target; } let a = 1, b = 2; -try { -} catch (_param) { +try {} catch (_param) { var { a: a1 } = _param, b1 = _objectWithoutProperties(_param, [ "a" ]); diff --git a/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.2.minified.js index 6efdc9aee00..5c08e00d907 100644 --- a/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestCatchES5_es2015.2.minified.js @@ -1,14 +1,10 @@ -try { -} catch (_param) { +try {} catch (_param) { var { a } = _param; !function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/objectRestCatchES5_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRestCatchES5_es5.1.normal.js index 0967a384d53..e0485e1cb02 100644 --- a/crates/swc/tests/tsc-references/objectRestCatchES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestCatchES5_es5.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -29,8 +26,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { return target; } var a = 1, b = 2; -try { -} catch (_param) { +try {} catch (_param) { var a1 = _param.a, b1 = _objectWithoutProperties(_param, [ "a" ]); diff --git a/crates/swc/tests/tsc-references/objectRestCatchES5_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRestCatchES5_es5.2.minified.js index 4858b9edbcf..a928a990318 100644 --- a/crates/swc/tests/tsc-references/objectRestCatchES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestCatchES5_es5.2.minified.js @@ -1,13 +1,9 @@ -try { -} catch (_param) { +try {} catch (_param) { !function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/objectRestForOf_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRestForOf_es2015.1.normal.js index e667ee565ac..a0139cd82b3 100644 --- a/crates/swc/tests/tsc-references/objectRestForOf_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestForOf_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -44,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -79,8 +75,7 @@ for (var _ref1 of array){ rrestOff ]; } -for (const norest of array.map((a)=>_objectSpread({ - }, a, { +for (const norest of array.map((a)=>_objectSpread({}, a, { x: 'a string' }) )){ diff --git a/crates/swc/tests/tsc-references/objectRestForOf_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRestForOf_es2015.2.minified.js index 1fa0d8de966..faf883c44f3 100644 --- a/crates/swc/tests/tsc-references/objectRestForOf_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestForOf_es2015.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -17,10 +16,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -33,8 +30,7 @@ for (const norest of (_objectWithoutProperties(_ref1, [ "x" ]), array.map((a)=>(function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -42,8 +38,7 @@ for (const norest of (_objectWithoutProperties(_ref1, [ }); } return target; - })({ - }, a, { + })({}, a, { x: "a string" }) )))norest.x, norest.y; diff --git a/crates/swc/tests/tsc-references/objectRestForOf_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRestForOf_es5.1.normal.js index 23a9cbbce7b..ea413e5f7ef 100644 --- a/crates/swc/tests/tsc-references/objectRestForOf_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestForOf_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -44,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -116,8 +112,7 @@ try { var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined; try { for(var _iterator2 = array.map(function(a) { - return _objectSpread({ - }, a, { + return _objectSpread({}, a, { x: 'a string' }); })[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){ diff --git a/crates/swc/tests/tsc-references/objectRestForOf_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRestForOf_es5.2.minified.js index 8a914c72acd..28577edf87f 100644 --- a/crates/swc/tests/tsc-references/objectRestForOf_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestForOf_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -17,10 +16,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -59,8 +56,7 @@ try { for(var _step2, _iterator2 = array.map(function(a) { return (function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -68,8 +64,7 @@ try { }); } return target; - })({ - }, a, { + })({}, a, { x: "a string" }); })[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0){ diff --git a/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.1.normal.js index 1997342bc75..f058f735522 100644 --- a/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -68,10 +65,8 @@ class C { // actually, never mind, don't clone } } -function foobar(_param = { -}) { - var { bar ={ - } } = _param, opts = _objectWithoutProperties(_param, [ +function foobar(_param = {}) { + var { bar ={} } = _param, opts = _objectWithoutProperties(_param, [ "bar" ]); } diff --git a/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.2.minified.js index a0a47d9f482..5a9bc310dbd 100644 --- a/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestParameterES5_es2015.2.minified.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -9,17 +8,13 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } -function foobar(_param = { -}) { - var { bar ={ - } } = _param; +function foobar(_param = {}) { + var { bar ={} } = _param; _objectWithoutProperties(_param, [ "bar" ]); diff --git a/crates/swc/tests/tsc-references/objectRestParameterES5_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRestParameterES5_es5.1.normal.js index adae7173e33..94029f603aa 100644 --- a/crates/swc/tests/tsc-references/objectRestParameterES5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestParameterES5_es5.1.normal.js @@ -18,8 +18,7 @@ function _createClass(Constructor, protoProps, staticProps) { return Constructor; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -34,10 +33,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -102,10 +99,8 @@ var C = /*#__PURE__*/ function() { return C; }(); function foobar() { - var _param = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - }; - var _bar = _param.bar, bar = _bar === void 0 ? { - } : _bar, opts = _objectWithoutProperties(_param, [ + var _param = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var _bar = _param.bar, bar = _bar === void 0 ? {} : _bar, opts = _objectWithoutProperties(_param, [ "bar" ]); } diff --git a/crates/swc/tests/tsc-references/objectRestParameterES5_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRestParameterES5_es5.2.minified.js index 36fa98e8e6d..a23f458f214 100644 --- a/crates/swc/tests/tsc-references/objectRestParameterES5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestParameterES5_es5.2.minified.js @@ -5,8 +5,7 @@ function _defineProperties(target, props) { } } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -68,8 +65,7 @@ var C = function() { ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); function foobar() { - var _param = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { - }; + var _param = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; _param.bar, _objectWithoutProperties(_param, [ "bar" ]); diff --git a/crates/swc/tests/tsc-references/objectRestParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRestParameter_es2015.1.normal.js index 48c214c5e37..4ad9b220758 100644 --- a/crates/swc/tests/tsc-references/objectRestParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestParameter_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -68,10 +65,8 @@ class C { // actually, never mind, don't clone } } -function foobar(_param = { -}) { - var { bar ={ - } } = _param, opts = _objectWithoutProperties(_param, [ +function foobar(_param = {}) { + var { bar ={} } = _param, opts = _objectWithoutProperties(_param, [ "bar" ]); } diff --git a/crates/swc/tests/tsc-references/objectRestParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRestParameter_es2015.2.minified.js index a0a47d9f482..5a9bc310dbd 100644 --- a/crates/swc/tests/tsc-references/objectRestParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestParameter_es2015.2.minified.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -9,17 +8,13 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } -function foobar(_param = { -}) { - var { bar ={ - } } = _param; +function foobar(_param = {}) { + var { bar ={} } = _param; _objectWithoutProperties(_param, [ "bar" ]); diff --git a/crates/swc/tests/tsc-references/objectRestParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRestParameter_es5.1.normal.js index cda936f68c2..8051525ab6d 100644 --- a/crates/swc/tests/tsc-references/objectRestParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestParameter_es5.1.normal.js @@ -18,8 +18,7 @@ function _createClass(Constructor, protoProps, staticProps) { return Constructor; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -34,10 +33,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -102,10 +99,8 @@ var C = /*#__PURE__*/ function() { return C; }(); function foobar() { - var _param = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - }; - var _bar = _param.bar, bar = _bar === void 0 ? { - } : _bar, opts = _objectWithoutProperties(_param, [ + var _param = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var _bar = _param.bar, bar = _bar === void 0 ? {} : _bar, opts = _objectWithoutProperties(_param, [ "bar" ]); } diff --git a/crates/swc/tests/tsc-references/objectRestParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRestParameter_es5.2.minified.js index 36fa98e8e6d..a23f458f214 100644 --- a/crates/swc/tests/tsc-references/objectRestParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestParameter_es5.2.minified.js @@ -5,8 +5,7 @@ function _defineProperties(target, props) { } } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -68,8 +65,7 @@ var C = function() { ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); function foobar() { - var _param = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { - }; + var _param = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; _param.bar, _objectWithoutProperties(_param, [ "bar" ]); diff --git a/crates/swc/tests/tsc-references/objectRestReadonly_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRestReadonly_es2015.1.normal.js index 7d62b0fa43f..334050349a6 100644 --- a/crates/swc/tests/tsc-references/objectRestReadonly_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestReadonly_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/objectRestReadonly_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRestReadonly_es2015.2.minified.js index aea36e341d3..f6b246fb675 100644 --- a/crates/swc/tests/tsc-references/objectRestReadonly_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestReadonly_es2015.2.minified.js @@ -3,13 +3,10 @@ const obj = { baz: "qux", quux: "quuz" }, { foo } = obj, rest = function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/objectRestReadonly_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRestReadonly_es5.1.normal.js index c4d190629ea..9f5f4ef991c 100644 --- a/crates/swc/tests/tsc-references/objectRestReadonly_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestReadonly_es5.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/objectRestReadonly_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRestReadonly_es5.2.minified.js index d6ce4a3fa07..e6bda861f4b 100644 --- a/crates/swc/tests/tsc-references/objectRestReadonly_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestReadonly_es5.2.minified.js @@ -4,13 +4,10 @@ var obj = { quux: "quuz" }; obj.foo, delete function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/objectRest_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectRest_es2015.1.normal.js index c679ecb9b58..3287d6ba7e1 100644 --- a/crates/swc/tests/tsc-references/objectRest_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRest_es2015.1.normal.js @@ -13,8 +13,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i1; if (Object.getOwnPropertySymbols) { @@ -29,10 +28,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i1; for(i1 = 0; i1 < sourceKeys.length; i1++){ @@ -64,8 +61,7 @@ var o = { a: 1, b: 'no' }; -var clone = _extends({ -}, o); +var clone = _extends({}, o); var { a } = o, justB = _objectWithoutProperties(o, [ "a" ]); @@ -90,8 +86,7 @@ var { d: renamed } = o2, d = _objectWithoutProperties(o2, [ "d" ]); let nestedrest; -var { x , n1: { y , n2: { z } } } = nestedrest, nr = _extends({ -}, nestedrest.n1.n2.n3), restrest = _objectWithoutProperties(nestedrest, [ +var { x , n1: { y , n2: { z } } } = nestedrest, nr = _extends({}, nestedrest.n1.n2.n3), restrest = _objectWithoutProperties(nestedrest, [ "x", "n1" ]); @@ -123,15 +118,12 @@ _tmp = { "x" ]), ({ x } = _tmp), _tmp; class Removable { - set z(value) { - } + set z(value) {} get both() { return 12; } - set both(value) { - } - m() { - } + set both(value) {} + m() {} } var removable = new Removable(); var { removed } = removable, removableRest = _objectWithoutProperties(removable, [ diff --git a/crates/swc/tests/tsc-references/objectRest_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectRest_es2015.2.minified.js index b049cbed2a1..1f9cf5f54d2 100644 --- a/crates/swc/tests/tsc-references/objectRest_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRest_es2015.2.minified.js @@ -8,8 +8,7 @@ function _extends() { }).apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i1, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -18,10 +17,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i1, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i1, target = {}, sourceKeys = Object.keys(source); for(i1 = 0; i1 < sourceKeys.length; i1++)key = sourceKeys[i1], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -44,8 +41,7 @@ var _complex, _tmp, _o, _typeof = function(obj) { a: 1, b: "no" }; -_extends({ -}, o); +_extends({}, o); var { a } = o; _objectWithoutProperties(o, [ "a" @@ -77,8 +73,7 @@ _objectWithoutProperties(o2, [ ]); let nestedrest; var { x , n1: { y , n2: { z } } } = nestedrest; -_extends({ -}, nestedrest.n1.n2.n3), _objectWithoutProperties(nestedrest, [ +_extends({}, nestedrest.n1.n2.n3), _objectWithoutProperties(nestedrest, [ "x", "n1" ]); @@ -108,15 +103,12 @@ _objectWithoutProperties(_ref, [ "x" ]), { x } = _tmp; var removable = new class { - set z(value) { - } + set z(value) {} get both() { return 12; } - set both(value) { - } - m() { - } + set both(value) {} + m() {} }(), { removed } = removable; _objectWithoutProperties(removable, [ "removed" diff --git a/crates/swc/tests/tsc-references/objectRest_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRest_es5.1.normal.js index 6b1cadf5901..40394e014f5 100644 --- a/crates/swc/tests/tsc-references/objectRest_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRest_es5.1.normal.js @@ -32,8 +32,7 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i1; if (Object.getOwnPropertySymbols) { @@ -48,10 +47,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i1; for(i1 = 0; i1 < sourceKeys.length; i1++){ @@ -83,8 +80,7 @@ var o = { a: 1, b: 'no' }; -var clone = _extends({ -}, o); +var clone = _extends({}, o); var a = o.a, justB = _objectWithoutProperties(o, [ "a" ]); @@ -109,8 +105,7 @@ var renamed = o2.d, d = _objectWithoutProperties(o2, [ "d" ]); var nestedrest; -var x = nestedrest.x, _n1 = nestedrest.n1, y = _n1.y, z = _n1.n2.z, nr = _extends({ -}, nestedrest.n1.n2.n3), restrest = _objectWithoutProperties(nestedrest, [ +var x = nestedrest.x, _n1 = nestedrest.n1, y = _n1.y, z = _n1.n2.z, nr = _extends({}, nestedrest.n1.n2.n3), restrest = _objectWithoutProperties(nestedrest, [ "x", "n1" ]); @@ -150,21 +145,18 @@ var Removable = /*#__PURE__*/ function() { _createClass(Removable, [ { key: "z", - set: function set(value) { - } + set: function set(value) {} }, { key: "both", get: function get() { return 12; }, - set: function set(value) { - } + set: function set(value) {} }, { key: "m", - value: function m() { - } + value: function m() {} } ]); return Removable; diff --git a/crates/swc/tests/tsc-references/objectRest_es5.2.minified.js b/crates/swc/tests/tsc-references/objectRest_es5.2.minified.js index bc7c8790efa..e95d5b48ddf 100644 --- a/crates/swc/tests/tsc-references/objectRest_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRest_es5.2.minified.js @@ -14,8 +14,7 @@ function _extends() { }).apply(this, arguments); } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i1, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -24,10 +23,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i1, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i1, target = {}, sourceKeys = Object.keys(source); for(i1 = 0; i1 < sourceKeys.length; i1++)key = sourceKeys[i1], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -50,8 +47,7 @@ var nestedrest, complex, _complex, ref, _tmp, _o, ref1, _typeof = function(obj) a: 1, b: "no" }; -_extends({ -}, o), o.a, _objectWithoutProperties(o, [ +_extends({}, o), o.a, _objectWithoutProperties(o, [ "a" ]), o.a, o.b, _objectWithoutProperties(o, [ "a", @@ -73,8 +69,7 @@ o2.d, _objectWithoutProperties(o2, [ "d" ]), nestedrest.x; var _n1 = nestedrest.n1; -_n1.y, _n1.n2.z, _extends({ -}, nestedrest.n1.n2.n3), _objectWithoutProperties(nestedrest, [ +_n1.y, _n1.n2.z, _extends({}, nestedrest.n1.n2.n3), _objectWithoutProperties(nestedrest, [ "x", "n1" ]), complex.x.ka, complex.y, _objectWithoutProperties(complex.x, [ @@ -111,21 +106,18 @@ var Removable = function() { return Constructor = Removable, protoProps = [ { key: "z", - set: function(value) { - } + set: function(value) {} }, { key: "both", get: function() { return 12; }, - set: function(value) { - } + set: function(value) {} }, { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Removable; }(), removable = new Removable(); diff --git a/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es2015.1.normal.js index cbb7f72ee9f..a30d535e9ee 100644 --- a/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -32,23 +31,17 @@ function f() { let n = 12; let m = 13; let a = null; - const o1 = _objectSpread({ - }, { - }, { + const o1 = _objectSpread({}, {}, { [n]: n }); - const o2 = _objectSpread({ - }, { - }, { + const o2 = _objectSpread({}, {}, { [a]: n }); const o3 = _objectSpread({ [a]: n - }, { - }, { + }, {}, { [n]: n - }, { - }, { + }, {}, { [m]: m }); } diff --git a/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es5.1.normal.js index 25f5a21f485..60a562fecd3 100644 --- a/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadComputedProperty_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -32,18 +31,7 @@ function f() { var n = 12; var m = 13; var a = null; - var o1 = _objectSpread({ - }, { - }, _defineProperty({ - }, n, n)); - var o2 = _objectSpread({ - }, { - }, _defineProperty({ - }, a, n)); - var o3 = _objectSpread(_defineProperty({ - }, a, n), { - }, _defineProperty({ - }, n, n), { - }, _defineProperty({ - }, m, m)); + var o1 = _objectSpread({}, {}, _defineProperty({}, n, n)); + var o2 = _objectSpread({}, {}, _defineProperty({}, a, n)); + var o3 = _objectSpread(_defineProperty({}, a, n), {}, _defineProperty({}, n, n), {}, _defineProperty({}, m, m)); } diff --git a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.1.normal.js index c321b90d09d..39420505e49 100644 --- a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = arguments[i1] != null ? arguments[i1] : { - }; + var source = arguments[i1] != null ? arguments[i1] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -27,18 +26,14 @@ function _objectSpread(target) { } return target; } -let i = _objectSpread({ -}, indexed1, { +let i = _objectSpread({}, indexed1, { b: 11 }); // only indexed has indexer, so i[101]: any i[101]; -let ii = _objectSpread({ -}, indexed1, indexed2); +let ii = _objectSpread({}, indexed1, indexed2); // both have indexer, so i[1001]: number | boolean ii[1001]; -indexed3 = _objectSpread({ -}, b ? indexed3 : undefined); -var writable = _objectSpread({ -}, roindex); +indexed3 = _objectSpread({}, b ? indexed3 : undefined); +var writable = _objectSpread({}, roindex); writable.a = 0; // should be ok. diff --git a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.2.minified.js index 3170b07c225..e0cc2ffe6e2 100644 --- a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,12 +17,8 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, indexed1, { +_objectSpread({}, indexed1, { b: 11 -})[101], _objectSpread({ -}, indexed1, indexed2)[1001], indexed3 = _objectSpread({ -}, b ? indexed3 : void 0); -var writable = _objectSpread({ -}, roindex); +})[101], _objectSpread({}, indexed1, indexed2)[1001], indexed3 = _objectSpread({}, b ? indexed3 : void 0); +var writable = _objectSpread({}, roindex); writable.a = 0; diff --git a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.1.normal.js index 1befcbeac26..3ebc16dc023 100644 --- a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = arguments[i1] != null ? arguments[i1] : { - }; + var source = arguments[i1] != null ? arguments[i1] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -27,18 +26,14 @@ function _objectSpread(target) { } return target; } -var i = _objectSpread({ -}, indexed1, { +var i = _objectSpread({}, indexed1, { b: 11 }); // only indexed has indexer, so i[101]: any i[101]; -var ii = _objectSpread({ -}, indexed1, indexed2); +var ii = _objectSpread({}, indexed1, indexed2); // both have indexer, so i[1001]: number | boolean ii[1001]; -indexed3 = _objectSpread({ -}, b ? indexed3 : undefined); -var writable = _objectSpread({ -}, roindex); +indexed3 = _objectSpread({}, b ? indexed3 : undefined); +var writable = _objectSpread({}, roindex); writable.a = 0; // should be ok. diff --git a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.2.minified.js index 3170b07c225..e0cc2ffe6e2 100644 --- a/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadIndexSignature_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,12 +17,8 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, indexed1, { +_objectSpread({}, indexed1, { b: 11 -})[101], _objectSpread({ -}, indexed1, indexed2)[1001], indexed3 = _objectSpread({ -}, b ? indexed3 : void 0); -var writable = _objectSpread({ -}, roindex); +})[101], _objectSpread({}, indexed1, indexed2)[1001], indexed3 = _objectSpread({}, b ? indexed3 : void 0); +var writable = _objectSpread({}, roindex); writable.a = 0; diff --git a/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.1.normal.js index 32f831fcbfd..5bcefba1502 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj1, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -38,13 +37,10 @@ class PrivateOptionalX { } class PublicX { } -let o2 = _objectSpread({ -}, publicX, privateOptionalX); +let o2 = _objectSpread({}, publicX, privateOptionalX); let sn = o2.x; // error, x is private -let allOptional = _objectSpread({ -}, optionalString, optionalNumber); -let spread = _objectSpread({ -}, { +let allOptional = _objectSpread({}, optionalString, optionalNumber); +let spread = _objectSpread({}, { b: true }, { s: "foo" @@ -64,8 +60,7 @@ let duplicated = _objectSpread({ }, o2, { b: 'bad' }); -let duplicatedSpread = _objectSpread({ -}, o, o); +let duplicatedSpread = _objectSpread({}, o, o); // Note: ignore changes the order that properties are printed let ignore = _objectSpread({ b: 'ignored' @@ -81,12 +76,10 @@ let o4 = { let combinedBefore = _objectSpread({ b: 'ok' }, o3, o4); -let combinedMid = _objectSpread({ -}, o3, { +let combinedMid = _objectSpread({}, o3, { b: 'ok' }, o4); -let combinedNested = _objectSpread({ -}, _objectSpread({ +let combinedNested = _objectSpread({}, _objectSpread({ a: 4 }, { b: false, @@ -100,54 +93,41 @@ let combinedNested = _objectSpread({ let changeTypeBefore = _objectSpread({ a: 'wrong type?' }, o3); -let computedMiddle = _objectSpread({ -}, o3, { +let computedMiddle = _objectSpread({}, o3, { ['in the middle']: 13, b: 'maybe?' }, o4); // primitives are not allowed, except for falsy ones -let spreadNum = _objectSpread({ -}, 12); -let spreadSum = _objectSpread({ -}, 1 + 1); -let spreadZero = _objectSpread({ -}, 0); +let spreadNum = _objectSpread({}, 12); +let spreadSum = _objectSpread({}, 1 + 1); +let spreadZero = _objectSpread({}, 0); spreadZero.toFixed(); // error, no methods even from a falsy number -let spreadBool = _objectSpread({ -}, true); +let spreadBool = _objectSpread({}, true); spreadBool.valueOf(); -let spreadStr = _objectSpread({ -}, 'foo'); +let spreadStr = _objectSpread({}, 'foo'); spreadStr.length; // error, no 'length' spreadStr.charAt(1); // error, no methods either // functions are skipped -let spreadFunc = _objectSpread({ -}, function() { -}); +let spreadFunc = _objectSpread({}, function() {}); spreadFunc(); // error, no call signature // write-only properties get skipped -let setterOnly = _objectSpread({ -}, { - set b (bad){ - } +let setterOnly = _objectSpread({}, { + set b (bad){} }); setterOnly.b = 12; // error, 'b' does not exist // methods are skipped because they aren't enumerable class C { - m() { - } + m() {} constructor(){ this.p = 1; } } let c = new C(); -let spreadC = _objectSpread({ -}, c); +let spreadC = _objectSpread({}, c); spreadC.m(); // error 'm' is not in '{ ... c }' // non primitive let obj = { a: 123 }; -let spreadObj = _objectSpread({ -}, obj); +let spreadObj = _objectSpread({}, obj); spreadObj.a; // error 'a' is not in {} diff --git a/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.2.minified.js index 845bbd7e997..2e1a49e30ed 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadNegative_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -21,11 +20,8 @@ function _objectSpread(target) { let o = { a: 1, b: "no" -}, o2 = _objectSpread({ -}, publicX, privateOptionalX); -o2.x, _objectSpread({ -}, optionalString, optionalNumber), _objectSpread({ -}, { +}, o2 = _objectSpread({}, publicX, privateOptionalX); +o2.x, _objectSpread({}, optionalString, optionalNumber), _objectSpread({}, { b: !0 }, { s: "foo" @@ -35,8 +31,7 @@ o2.x, _objectSpread({ b: "bad" }, o2, { b: "bad" -}), _objectSpread({ -}, o, o), _objectSpread({ +}), _objectSpread({}, o, o), _objectSpread({ b: "ignored" }, o); let o3 = { @@ -48,11 +43,9 @@ let o3 = { }; _objectSpread({ b: "ok" -}, o3, o4), _objectSpread({ -}, o3, { +}, o3, o4), _objectSpread({}, o3, { b: "ok" -}, o4), _objectSpread({ -}, _objectSpread({ +}, o4), _objectSpread({}, _objectSpread({ a: 4 }, { b: !1, @@ -64,31 +57,18 @@ _objectSpread({ d: "maybe new" }), _objectSpread({ a: "wrong type?" -}, o3), _objectSpread({ -}, o3, { +}, o3), _objectSpread({}, o3, { ["in the middle"]: 13, b: "maybe?" -}, o4), _objectSpread({ -}, 12), _objectSpread({ -}, 2), _objectSpread({ -}, 0).toFixed(), _objectSpread({ -}, !0).valueOf(); -let spreadStr = _objectSpread({ -}, "foo"); -spreadStr.length, spreadStr.charAt(1), _objectSpread({ -}, function() { -})(), _objectSpread({ -}, { - set b (bad){ - } -}).b = 12, _objectSpread({ -}, new class { - m() { - } +}, o4), _objectSpread({}, 12), _objectSpread({}, 2), _objectSpread({}, 0).toFixed(), _objectSpread({}, !0).valueOf(); +let spreadStr = _objectSpread({}, "foo"); +spreadStr.length, spreadStr.charAt(1), _objectSpread({}, function() {})(), _objectSpread({}, { + set b (bad){} +}).b = 12, _objectSpread({}, new class { + m() {} constructor(){ this.p = 1; } -}()).m(), _objectSpread({ -}, { +}()).m(), _objectSpread({}, { a: 123 }).a; diff --git a/crates/swc/tests/tsc-references/objectSpreadNegative_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadNegative_es5.1.normal.js index 4a8d6c10875..c86fc602bcd 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNegative_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadNegative_es5.1.normal.js @@ -32,8 +32,7 @@ function _defineProperty(obj1, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -60,13 +59,10 @@ var PublicX = function PublicX() { "use strict"; _classCallCheck(this, PublicX); }; -var o2 = _objectSpread({ -}, publicX, privateOptionalX); +var o2 = _objectSpread({}, publicX, privateOptionalX); var sn = o2.x; // error, x is private -var allOptional = _objectSpread({ -}, optionalString, optionalNumber); -var spread = _objectSpread({ -}, { +var allOptional = _objectSpread({}, optionalString, optionalNumber); +var spread = _objectSpread({}, { b: true }, { s: "foo" @@ -86,8 +82,7 @@ var duplicated = _objectSpread({ }, o2, { b: 'bad' }); -var duplicatedSpread = _objectSpread({ -}, o, o); +var duplicatedSpread = _objectSpread({}, o, o); // Note: ignore changes the order that properties are printed var ignore = _objectSpread({ b: 'ignored' @@ -103,12 +98,10 @@ var o4 = { var combinedBefore = _objectSpread({ b: 'ok' }, o3, o4); -var combinedMid = _objectSpread({ -}, o3, { +var combinedMid = _objectSpread({}, o3, { b: 'ok' }, o4); -var combinedNested = _objectSpread({ -}, _objectSpread({ +var combinedNested = _objectSpread({}, _objectSpread({ a: 4 }, { b: false, @@ -123,34 +116,23 @@ var changeTypeBefore = _objectSpread({ a: 'wrong type?' }, o3); var _obj; -var computedMiddle = _objectSpread({ -}, o3, (_obj = { -}, _defineProperty(_obj, 'in the middle', 13), _defineProperty(_obj, "b", 'maybe?'), _obj), o4); +var computedMiddle = _objectSpread({}, o3, (_obj = {}, _defineProperty(_obj, 'in the middle', 13), _defineProperty(_obj, "b", 'maybe?'), _obj), o4); // primitives are not allowed, except for falsy ones -var spreadNum = _objectSpread({ -}, 12); -var spreadSum = _objectSpread({ -}, 1 + 1); -var spreadZero = _objectSpread({ -}, 0); +var spreadNum = _objectSpread({}, 12); +var spreadSum = _objectSpread({}, 1 + 1); +var spreadZero = _objectSpread({}, 0); spreadZero.toFixed(); // error, no methods even from a falsy number -var spreadBool = _objectSpread({ -}, true); +var spreadBool = _objectSpread({}, true); spreadBool.valueOf(); -var spreadStr = _objectSpread({ -}, 'foo'); +var spreadStr = _objectSpread({}, 'foo'); spreadStr.length; // error, no 'length' spreadStr.charAt(1); // error, no methods either // functions are skipped -var spreadFunc = _objectSpread({ -}, function() { -}); +var spreadFunc = _objectSpread({}, function() {}); spreadFunc(); // error, no call signature // write-only properties get skipped -var setterOnly = _objectSpread({ -}, { - set b (bad){ - } +var setterOnly = _objectSpread({}, { + set b (bad){} }); setterOnly.b = 12; // error, 'b' does not exist var C = // methods are skipped because they aren't enumerable @@ -163,20 +145,17 @@ var C = // methods are skipped because they aren't enumerable _createClass(C, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return C; }(); var c = new C(); -var spreadC = _objectSpread({ -}, c); +var spreadC = _objectSpread({}, c); spreadC.m(); // error 'm' is not in '{ ... c }' // non primitive var obj = { a: 123 }; -var spreadObj = _objectSpread({ -}, obj); +var spreadObj = _objectSpread({}, obj); spreadObj.a; // error 'a' is not in {} diff --git a/crates/swc/tests/tsc-references/objectSpreadNegative_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadNegative_es5.2.minified.js index 5d1906ba4fb..eba31b3d416 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNegative_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadNegative_es5.2.minified.js @@ -17,8 +17,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -36,11 +35,8 @@ var _obj, o = { }, PublicX = function() { "use strict"; _classCallCheck(this, PublicX); -}, o2 = _objectSpread({ -}, publicX, privateOptionalX); -o2.x, _objectSpread({ -}, optionalString, optionalNumber), _objectSpread({ -}, { +}, o2 = _objectSpread({}, publicX, privateOptionalX); +o2.x, _objectSpread({}, optionalString, optionalNumber), _objectSpread({}, { b: !0 }, { s: "foo" @@ -50,8 +46,7 @@ o2.x, _objectSpread({ b: "bad" }, o2, { b: "bad" -}), _objectSpread({ -}, o, o), _objectSpread({ +}), _objectSpread({}, o, o), _objectSpread({ b: "ignored" }, o); var o3 = { @@ -63,11 +58,9 @@ var o3 = { }; _objectSpread({ b: "ok" -}, o3, o4), _objectSpread({ -}, o3, { +}, o3, o4), _objectSpread({}, o3, { b: "ok" -}, o4), _objectSpread({ -}, _objectSpread({ +}, o4), _objectSpread({}, _objectSpread({ a: 4 }, { b: !1, @@ -79,21 +72,10 @@ _objectSpread({ d: "maybe new" }), _objectSpread({ a: "wrong type?" -}, o3), _objectSpread({ -}, o3, (_defineProperty(_obj = { -}, "in the middle", 13), _defineProperty(_obj, "b", "maybe?"), _obj), o4), _objectSpread({ -}, 12), _objectSpread({ -}, 2), _objectSpread({ -}, 0).toFixed(), _objectSpread({ -}, !0).valueOf(); -var spreadStr = _objectSpread({ -}, "foo"); -spreadStr.length, spreadStr.charAt(1), _objectSpread({ -}, function() { -})(), _objectSpread({ -}, { - set b (bad){ - } +}, o3), _objectSpread({}, o3, (_defineProperty(_obj = {}, "in the middle", 13), _defineProperty(_obj, "b", "maybe?"), _obj), o4), _objectSpread({}, 12), _objectSpread({}, 2), _objectSpread({}, 0).toFixed(), _objectSpread({}, !0).valueOf(); +var spreadStr = _objectSpread({}, "foo"); +spreadStr.length, spreadStr.charAt(1), _objectSpread({}, function() {})(), _objectSpread({}, { + set b (bad){} }).b = 12; var C = function() { "use strict"; @@ -104,13 +86,10 @@ var C = function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); -_objectSpread({ -}, new C()).m(), _objectSpread({ -}, { +_objectSpread({}, new C()).m(), _objectSpread({}, { a: 123 }).a; diff --git a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.1.normal.js index 0a748240149..e3a606f10ad 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -44,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.2.minified.js index fc1ad4efec5..c1dd3d388d0 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es2015.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { } const o = function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -25,13 +24,10 @@ const o = function(target) { b: "no" }); (function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); diff --git a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.1.normal.js index ed2a9229102..b15873eaf3b 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -44,10 +42,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ diff --git a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.2.minified.js index 4cd97f1c68b..b0409cf95da 100644 --- a/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadNoTransform_es5.2.minified.js @@ -8,13 +8,10 @@ function _defineProperty(obj, key, value) { }) : obj[key] = value, obj; } (function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source, excluded); @@ -24,8 +21,7 @@ function _defineProperty(obj, key, value) { } })(_o = function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { diff --git a/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es2015.1.normal.js index 117b0e9747d..819add156a5 100644 --- a/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -30,8 +29,7 @@ function _objectSpread(target) { // @strict: true function f(cnd) { // Type is a union of 2^(n-1) members, where n is the number of spread objects - return _objectSpread({ - }, cnd[1] && cnd[2] && { + return _objectSpread({}, cnd[1] && cnd[2] && { prop0: 0 }, cnd[3] && { prop3a: 1, diff --git a/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es5.1.normal.js index 117b0e9747d..819add156a5 100644 --- a/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadRepeatedComplexity_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -30,8 +29,7 @@ function _objectSpread(target) { // @strict: true function f(cnd) { // Type is a union of 2^(n-1) members, where n is the number of spread objects - return _objectSpread({ - }, cnd[1] && cnd[2] && { + return _objectSpread({}, cnd[1] && cnd[2] && { prop0: 0 }, cnd[3] && { prop3a: 1, diff --git a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.1.normal.js index 950058283f2..3118d7d0558 100644 --- a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function parseWithSpread(config) { - return _objectSpread({ - }, config.a !== undefined && { + return _objectSpread({}, config.a !== undefined && { a: config.a.toString() }, config.b !== undefined && { b: config.b.toString() diff --git a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.2.minified.js index b40a952b7ef..730e5391f5a 100644 --- a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es2015.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { !function(config) { return (function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,8 +17,7 @@ function _defineProperty(obj, key, value) { }); } return target; - })({ - }, void 0 !== config.a && { + })({}, void 0 !== config.a && { a: config.a.toString() }, void 0 !== config.b && { b: config.b.toString() diff --git a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.1.normal.js index 950058283f2..3118d7d0558 100644 --- a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,8 +27,7 @@ function _objectSpread(target) { return target; } function parseWithSpread(config) { - return _objectSpread({ - }, config.a !== undefined && { + return _objectSpread({}, config.a !== undefined && { a: config.a.toString() }, config.b !== undefined && { b: config.b.toString() diff --git a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.2.minified.js index b40a952b7ef..730e5391f5a 100644 --- a/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadRepeatedNullCheckPerf_es5.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { !function(config) { return (function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,8 +17,7 @@ function _defineProperty(obj, key, value) { }); } return target; - })({ - }, void 0 !== config.a && { + })({}, void 0 !== config.a && { a: config.a.toString() }, void 0 !== config.b && { b: config.b.toString() diff --git a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.1.normal.js index d6cc841e9d6..3c61b27d254 100644 --- a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -32,12 +31,10 @@ function _objectSpread(target) { const o1 = _objectSpread({ foo: 1 }, { - set bar (_v){ - } + set bar (_v){} }); const o2 = _objectSpread({ foo: 1 }, { - set foo (_v){ - } + set foo (_v){} }); diff --git a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.2.minified.js index 20a25e2d165..d03702abf27 100644 --- a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -21,11 +20,9 @@ function _objectSpread(target) { _objectSpread({ foo: 1 }, { - set bar (_v){ - } + set bar (_v){} }), _objectSpread({ foo: 1 }, { - set foo (_v){ - } + set foo (_v){} }); diff --git a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.1.normal.js index a9d348e8950..1f3117e124c 100644 --- a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -32,12 +31,10 @@ function _objectSpread(target) { var o1 = _objectSpread({ foo: 1 }, { - set bar (_v){ - } + set bar (_v){} }); var o2 = _objectSpread({ foo: 1 }, { - set foo (_v){ - } + set foo (_v){} }); diff --git a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.2.minified.js index 20a25e2d165..d03702abf27 100644 --- a/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadSetonlyAccessor_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -21,11 +20,9 @@ function _objectSpread(target) { _objectSpread({ foo: 1 }, { - set bar (_v){ - } + set bar (_v){} }), _objectSpread({ foo: 1 }, { - set foo (_v){ - } + set foo (_v){} }); diff --git a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.1.normal.js index 9e0adffa8a3..f17cf73942c 100644 --- a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -30,36 +29,26 @@ function _objectSpread(target) { // @strictNullChecks: true function f(definiteBoolean, definiteString, optionalString, optionalNumber, undefinedString, undefinedNumber) { // optional - let optionalUnionStops = _objectSpread({ - }, definiteBoolean, definiteString, optionalNumber); - let optionalUnionDuplicates = _objectSpread({ - }, definiteBoolean, definiteString, optionalString, optionalNumber); - let allOptional = _objectSpread({ - }, optionalString, optionalNumber); + let optionalUnionStops = _objectSpread({}, definiteBoolean, definiteString, optionalNumber); + let optionalUnionDuplicates = _objectSpread({}, definiteBoolean, definiteString, optionalString, optionalNumber); + let allOptional = _objectSpread({}, optionalString, optionalNumber); // undefined - let undefinedUnionStops = _objectSpread({ - }, definiteBoolean, definiteString, undefinedNumber); - let undefinedUnionDuplicates = _objectSpread({ - }, definiteBoolean, definiteString, undefinedString, undefinedNumber); - let allUndefined = _objectSpread({ - }, undefinedString, undefinedNumber); - let undefinedWithOptionalContinues = _objectSpread({ - }, definiteBoolean, undefinedString, optionalNumber); + let undefinedUnionStops = _objectSpread({}, definiteBoolean, definiteString, undefinedNumber); + let undefinedUnionDuplicates = _objectSpread({}, definiteBoolean, definiteString, undefinedString, undefinedNumber); + let allUndefined = _objectSpread({}, undefinedString, undefinedNumber); + let undefinedWithOptionalContinues = _objectSpread({}, definiteBoolean, undefinedString, optionalNumber); } const m = { title: "The Matrix", yearReleased: 1999 }; // should error here because title: undefined is not assignable to string -const x = _objectSpread({ -}, m, { +const x = _objectSpread({}, m, { title: undefined }); function g(fields, partialFields, nearlyPartialFields) { // ok, undefined is stripped from optional properties when spread - fields = _objectSpread({ - }, fields, partialFields); + fields = _objectSpread({}, fields, partialFields); // error: not optional, undefined remains - fields = _objectSpread({ - }, fields, nearlyPartialFields); + fields = _objectSpread({}, fields, nearlyPartialFields); } diff --git a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.2.minified.js index 86e06df5922..1b1daa07ce2 100644 --- a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } !function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -17,8 +16,7 @@ function _defineProperty(obj, key, value) { }); } return target; -}({ -}, { +}({}, { title: "The Matrix", yearReleased: 1999 }, { diff --git a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.1.normal.js index 0e8ebb1c96f..b06ef0ccab8 100644 --- a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -30,36 +29,26 @@ function _objectSpread(target) { // @strictNullChecks: true function f(definiteBoolean, definiteString, optionalString, optionalNumber, undefinedString, undefinedNumber) { // optional - var optionalUnionStops = _objectSpread({ - }, definiteBoolean, definiteString, optionalNumber); - var optionalUnionDuplicates = _objectSpread({ - }, definiteBoolean, definiteString, optionalString, optionalNumber); - var allOptional = _objectSpread({ - }, optionalString, optionalNumber); + var optionalUnionStops = _objectSpread({}, definiteBoolean, definiteString, optionalNumber); + var optionalUnionDuplicates = _objectSpread({}, definiteBoolean, definiteString, optionalString, optionalNumber); + var allOptional = _objectSpread({}, optionalString, optionalNumber); // undefined - var undefinedUnionStops = _objectSpread({ - }, definiteBoolean, definiteString, undefinedNumber); - var undefinedUnionDuplicates = _objectSpread({ - }, definiteBoolean, definiteString, undefinedString, undefinedNumber); - var allUndefined = _objectSpread({ - }, undefinedString, undefinedNumber); - var undefinedWithOptionalContinues = _objectSpread({ - }, definiteBoolean, undefinedString, optionalNumber); + var undefinedUnionStops = _objectSpread({}, definiteBoolean, definiteString, undefinedNumber); + var undefinedUnionDuplicates = _objectSpread({}, definiteBoolean, definiteString, undefinedString, undefinedNumber); + var allUndefined = _objectSpread({}, undefinedString, undefinedNumber); + var undefinedWithOptionalContinues = _objectSpread({}, definiteBoolean, undefinedString, optionalNumber); } var m = { title: "The Matrix", yearReleased: 1999 }; // should error here because title: undefined is not assignable to string -var x = _objectSpread({ -}, m, { +var x = _objectSpread({}, m, { title: undefined }); function g(fields, partialFields, nearlyPartialFields) { // ok, undefined is stripped from optional properties when spread - fields = _objectSpread({ - }, fields, partialFields); + fields = _objectSpread({}, fields, partialFields); // error: not optional, undefined remains - fields = _objectSpread({ - }, fields, nearlyPartialFields); + fields = _objectSpread({}, fields, nearlyPartialFields); } diff --git a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.2.minified.js index 86e06df5922..1b1daa07ce2 100644 --- a/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpreadStrictNull_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } !function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -17,8 +16,7 @@ function _defineProperty(obj, key, value) { }); } return target; -}({ -}, { +}({}, { title: "The Matrix", yearReleased: 1999 }, { diff --git a/crates/swc/tests/tsc-references/objectSpread_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectSpread_es2015.1.normal.js index f08e94682b6..dc2ea359872 100644 --- a/crates/swc/tests/tsc-references/objectSpread_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpread_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -41,19 +40,16 @@ let swap = { a: 'yes', b: -1 }; -let addAfter = _objectSpread({ -}, o, { +let addAfter = _objectSpread({}, o, { c: false }); let addBefore = _objectSpread({ c: false }, o); -let override = _objectSpread({ -}, o, { +let override = _objectSpread({}, o, { b: 'override' }); -let nested = _objectSpread({ -}, _objectSpread({ +let nested = _objectSpread({}, _objectSpread({ a: 3 }, { b: false, @@ -61,14 +57,11 @@ let nested = _objectSpread({ }), { c: 'whatever' }); -let combined = _objectSpread({ -}, o, o2); -let combinedAfter = _objectSpread({ -}, o, o2, { +let combined = _objectSpread({}, o, o2); +let combinedAfter = _objectSpread({}, o, o2, { b: 'ok' }); -let combinedNestedChangeType = _objectSpread({ -}, _objectSpread({ +let combinedNestedChangeType = _objectSpread({}, _objectSpread({ a: 1 }, { b: false, @@ -77,8 +70,7 @@ let combinedNestedChangeType = _objectSpread({ c: -1 }); let propertyNested = { - a: _objectSpread({ - }, o) + a: _objectSpread({}, o) }; // accessors don't copy the descriptor // (which means that readonly getters become read/write properties) @@ -87,18 +79,14 @@ let op = { return 6; } }; -let getter = _objectSpread({ -}, op, { +let getter = _objectSpread({}, op, { c: 7 }); getter.a = 12; // functions result in { } -let spreadFunc = _objectSpread({ -}, function() { -}); +let spreadFunc = _objectSpread({}, function() {}); function from16326(header, authToken) { - return _objectSpread({ - }, this.header, header, authToken && { + return _objectSpread({}, this.header, header, authToken && { authToken }); } @@ -108,12 +96,10 @@ function conditionalSpreadBoolean(b) { x: 12, y: 13 }; - o1 = _objectSpread({ - }, o1, b && { + o1 = _objectSpread({}, o1, b && { x: 14 }); - let o2 = _objectSpread({ - }, b && { + let o2 = _objectSpread({}, b && { x: 21 }); return o1; @@ -123,12 +109,10 @@ function conditionalSpreadNumber(nt) { x: 15, y: 16 }; - o3 = _objectSpread({ - }, o3, nt && { + o3 = _objectSpread({}, o3, nt && { x: nt }); - let o2 = _objectSpread({ - }, nt && { + let o2 = _objectSpread({}, nt && { x: nt }); return o3; @@ -138,80 +122,64 @@ function conditionalSpreadString(st) { x: 'hi', y: 17 }; - o4 = _objectSpread({ - }, o4, st && { + o4 = _objectSpread({}, o4, st && { x: st }); - let o2 = _objectSpread({ - }, st && { + let o2 = _objectSpread({}, st && { x: st }); return o4; } // any results in any let anything; -let spreadAny = _objectSpread({ -}, anything); +let spreadAny = _objectSpread({}, anything); // methods are not enumerable class C { - m() { - } + m() {} constructor(){ this.p = 1; } } let c = new C(); -let spreadC = _objectSpread({ -}, c); +let spreadC = _objectSpread({}, c); // own methods are enumerable -let cplus = _objectSpread({ -}, c, { +let cplus = _objectSpread({}, c, { plus () { return this.p + 1; } }); cplus.plus(); // new field's type conflicting with existing field is OK -let changeTypeAfter = _objectSpread({ -}, o, { +let changeTypeAfter = _objectSpread({}, o, { a: 'wrong type?' }); -let changeTypeBoth = _objectSpread({ -}, o, swap); +let changeTypeBoth = _objectSpread({}, o, swap); // optional function container(definiteBoolean, definiteString, optionalString, optionalNumber) { - let optionalUnionStops = _objectSpread({ - }, definiteBoolean, definiteString, optionalNumber); - let optionalUnionDuplicates = _objectSpread({ - }, definiteBoolean, definiteString, optionalString, optionalNumber); - let allOptional = _objectSpread({ - }, optionalString, optionalNumber); + let optionalUnionStops = _objectSpread({}, definiteBoolean, definiteString, optionalNumber); + let optionalUnionDuplicates = _objectSpread({}, definiteBoolean, definiteString, optionalString, optionalNumber); + let allOptional = _objectSpread({}, optionalString, optionalNumber); // computed property let computedFirst = _objectSpread({ ['before everything']: 12 }, o, { b: 'yes' }); - let computedAfter = _objectSpread({ - }, o, { + let computedAfter = _objectSpread({}, o, { b: 'yeah', ['at the end']: 14 }); } // shortcut syntax let a = 12; -let shortCutted = _objectSpread({ -}, o, { +let shortCutted = _objectSpread({}, o, { a }); // non primitive -let spreadNonPrimitive = _objectSpread({ -}, { -}); +let spreadNonPrimitive = _objectSpread({}, {}); // generic spreads function f(t, u) { - return _objectSpread({ - }, t, u, { + return _objectSpread({}, t, u, { id: 'id' }); } @@ -241,20 +209,15 @@ let overwriteId = f({ d: 'no' }); function genericSpread(t, u, v, w, obj) { - let x01 = _objectSpread({ - }, t); - let x02 = _objectSpread({ - }, t, t); - let x03 = _objectSpread({ - }, t, u); - let x04 = _objectSpread({ - }, u, t); + let x01 = _objectSpread({}, t); + let x02 = _objectSpread({}, t, t); + let x03 = _objectSpread({}, t, u); + let x04 = _objectSpread({}, u, t); let x05 = _objectSpread({ a: 5, b: 'hi' }, t); - let x06 = _objectSpread({ - }, t, { + let x06 = _objectSpread({}, t, { a: 5, b: 'hi' }); @@ -275,20 +238,12 @@ function genericSpread(t, u, v, w, obj) { }, t, { b: 'hi' }, u, obj); - let x11 = _objectSpread({ - }, v); - let x12 = _objectSpread({ - }, v, obj); - let x13 = _objectSpread({ - }, w); - let x14 = _objectSpread({ - }, w, obj); - let x15 = _objectSpread({ - }, t, v); - let x16 = _objectSpread({ - }, t, w); - let x17 = _objectSpread({ - }, t, w, obj); - let x18 = _objectSpread({ - }, t, v, w); + let x11 = _objectSpread({}, v); + let x12 = _objectSpread({}, v, obj); + let x13 = _objectSpread({}, w); + let x14 = _objectSpread({}, w, obj); + let x15 = _objectSpread({}, t, v); + let x16 = _objectSpread({}, t, w); + let x17 = _objectSpread({}, t, w, obj); + let x18 = _objectSpread({}, t, v, w); } diff --git a/crates/swc/tests/tsc-references/objectSpread_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectSpread_es2015.2.minified.js index 3ff54487ae7..e19800bd2c2 100644 --- a/crates/swc/tests/tsc-references/objectSpread_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpread_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -25,78 +24,58 @@ let o = { b: "yes", c: !0 }; -_objectSpread({ -}, o, { +_objectSpread({}, o, { c: !1 }), _objectSpread({ c: !1 -}, o), _objectSpread({ -}, o, { +}, o), _objectSpread({}, o, { b: "override" -}), _objectSpread({ -}, _objectSpread({ +}), _objectSpread({}, _objectSpread({ a: 3 }, { b: !1, c: "overriden" }), { c: "whatever" -}), _objectSpread({ -}, o, o2), _objectSpread({ -}, o, o2, { +}), _objectSpread({}, o, o2), _objectSpread({}, o, o2, { b: "ok" -}), _objectSpread({ -}, _objectSpread({ +}), _objectSpread({}, _objectSpread({ a: 1 }, { b: !1, c: "overriden" }), { c: -1 -}), _objectSpread({ -}, o), _objectSpread({ -}, { +}), _objectSpread({}, o), _objectSpread({}, { get a () { return 6; } }, { c: 7 -}).a = 12, _objectSpread({ -}, function() { -}), _objectSpread({ -}, void 0); +}).a = 12, _objectSpread({}, function() {}), _objectSpread({}, void 0); let c = new class { - m() { - } + m() {} constructor(){ this.p = 1; } }(); function f(t, u) { - return _objectSpread({ - }, t, u, { + return _objectSpread({}, t, u, { id: "id" }); } -_objectSpread({ -}, c), _objectSpread({ -}, c, { +_objectSpread({}, c), _objectSpread({}, c, { plus () { return this.p + 1; } -}).plus(), _objectSpread({ -}, o, { +}).plus(), _objectSpread({}, o, { a: "wrong type?" -}), _objectSpread({ -}, o, { +}), _objectSpread({}, o, { a: "yes", b: -1 -}), _objectSpread({ -}, o, { +}), _objectSpread({}, o, { a: 12 -}), _objectSpread({ -}, { -}), f({ +}), _objectSpread({}, {}), f({ a: 1, b: "yes" }, { diff --git a/crates/swc/tests/tsc-references/objectSpread_es5.1.normal.js b/crates/swc/tests/tsc-references/objectSpread_es5.1.normal.js index 9de5bb2863a..e41ab9bd4b0 100644 --- a/crates/swc/tests/tsc-references/objectSpread_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpread_es5.1.normal.js @@ -32,8 +32,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -60,19 +59,16 @@ var swap = { a: 'yes', b: -1 }; -var addAfter = _objectSpread({ -}, o, { +var addAfter = _objectSpread({}, o, { c: false }); var addBefore = _objectSpread({ c: false }, o); -var override = _objectSpread({ -}, o, { +var override = _objectSpread({}, o, { b: 'override' }); -var nested = _objectSpread({ -}, _objectSpread({ +var nested = _objectSpread({}, _objectSpread({ a: 3 }, { b: false, @@ -80,14 +76,11 @@ var nested = _objectSpread({ }), { c: 'whatever' }); -var combined = _objectSpread({ -}, o, o2); -var combinedAfter = _objectSpread({ -}, o, o2, { +var combined = _objectSpread({}, o, o2); +var combinedAfter = _objectSpread({}, o, o2, { b: 'ok' }); -var combinedNestedChangeType = _objectSpread({ -}, _objectSpread({ +var combinedNestedChangeType = _objectSpread({}, _objectSpread({ a: 1 }, { b: false, @@ -96,8 +89,7 @@ var combinedNestedChangeType = _objectSpread({ c: -1 }); var propertyNested = { - a: _objectSpread({ - }, o) + a: _objectSpread({}, o) }; // accessors don't copy the descriptor // (which means that readonly getters become read/write properties) @@ -106,18 +98,14 @@ var op = { return 6; } }; -var getter = _objectSpread({ -}, op, { +var getter = _objectSpread({}, op, { c: 7 }); getter.a = 12; // functions result in { } -var spreadFunc = _objectSpread({ -}, function() { -}); +var spreadFunc = _objectSpread({}, function() {}); function from16326(header, authToken) { - return _objectSpread({ - }, this.header, header, authToken && { + return _objectSpread({}, this.header, header, authToken && { authToken: authToken }); } @@ -127,12 +115,10 @@ function conditionalSpreadBoolean(b) { x: 12, y: 13 }; - o1 = _objectSpread({ - }, o1, b && { + o1 = _objectSpread({}, o1, b && { x: 14 }); - var o2 = _objectSpread({ - }, b && { + var o2 = _objectSpread({}, b && { x: 21 }); return o1; @@ -142,12 +128,10 @@ function conditionalSpreadNumber(nt) { x: 15, y: 16 }; - o3 = _objectSpread({ - }, o3, nt && { + o3 = _objectSpread({}, o3, nt && { x: nt }); - var o2 = _objectSpread({ - }, nt && { + var o2 = _objectSpread({}, nt && { x: nt }); return o3; @@ -157,20 +141,17 @@ function conditionalSpreadString(st) { x: 'hi', y: 17 }; - o4 = _objectSpread({ - }, o4, st && { + o4 = _objectSpread({}, o4, st && { x: st }); - var o2 = _objectSpread({ - }, st && { + var o2 = _objectSpread({}, st && { x: st }); return o4; } // any results in any var anything; -var spreadAny = _objectSpread({ -}, anything); +var spreadAny = _objectSpread({}, anything); var C = // methods are not enumerable /*#__PURE__*/ function() { "use strict"; @@ -181,62 +162,48 @@ var C = // methods are not enumerable _createClass(C, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return C; }(); var c = new C(); -var spreadC = _objectSpread({ -}, c); +var spreadC = _objectSpread({}, c); // own methods are enumerable -var cplus = _objectSpread({ -}, c, { +var cplus = _objectSpread({}, c, { plus: function plus() { return this.p + 1; } }); cplus.plus(); // new field's type conflicting with existing field is OK -var changeTypeAfter = _objectSpread({ -}, o, { +var changeTypeAfter = _objectSpread({}, o, { a: 'wrong type?' }); -var changeTypeBoth = _objectSpread({ -}, o, swap); +var changeTypeBoth = _objectSpread({}, o, swap); // optional function container(definiteBoolean, definiteString, optionalString, optionalNumber) { - var optionalUnionStops = _objectSpread({ - }, definiteBoolean, definiteString, optionalNumber); - var optionalUnionDuplicates = _objectSpread({ - }, definiteBoolean, definiteString, optionalString, optionalNumber); - var allOptional = _objectSpread({ - }, optionalString, optionalNumber); + var optionalUnionStops = _objectSpread({}, definiteBoolean, definiteString, optionalNumber); + var optionalUnionDuplicates = _objectSpread({}, definiteBoolean, definiteString, optionalString, optionalNumber); + var allOptional = _objectSpread({}, optionalString, optionalNumber); // computed property - var computedFirst = _objectSpread(_defineProperty({ - }, 'before everything', 12), o, { + var computedFirst = _objectSpread(_defineProperty({}, 'before everything', 12), o, { b: 'yes' }); - var computedAfter = _objectSpread({ - }, o, _defineProperty({ + var computedAfter = _objectSpread({}, o, _defineProperty({ b: 'yeah' }, 'at the end', 14)); } // shortcut syntax var a = 12; -var shortCutted = _objectSpread({ -}, o, { +var shortCutted = _objectSpread({}, o, { a: a }); // non primitive -var spreadNonPrimitive = _objectSpread({ -}, { -}); +var spreadNonPrimitive = _objectSpread({}, {}); // generic spreads function f(t, u) { - return _objectSpread({ - }, t, u, { + return _objectSpread({}, t, u, { id: 'id' }); } @@ -266,20 +233,15 @@ var overwriteId = f({ d: 'no' }); function genericSpread(t, u, v, w, obj) { - var x01 = _objectSpread({ - }, t); - var x02 = _objectSpread({ - }, t, t); - var x03 = _objectSpread({ - }, t, u); - var x04 = _objectSpread({ - }, u, t); + var x01 = _objectSpread({}, t); + var x02 = _objectSpread({}, t, t); + var x03 = _objectSpread({}, t, u); + var x04 = _objectSpread({}, u, t); var x05 = _objectSpread({ a: 5, b: 'hi' }, t); - var x06 = _objectSpread({ - }, t, { + var x06 = _objectSpread({}, t, { a: 5, b: 'hi' }); @@ -300,20 +262,12 @@ function genericSpread(t, u, v, w, obj) { }, t, { b: 'hi' }, u, obj); - var x11 = _objectSpread({ - }, v); - var x12 = _objectSpread({ - }, v, obj); - var x13 = _objectSpread({ - }, w); - var x14 = _objectSpread({ - }, w, obj); - var x15 = _objectSpread({ - }, t, v); - var x16 = _objectSpread({ - }, t, w); - var x17 = _objectSpread({ - }, t, w, obj); - var x18 = _objectSpread({ - }, t, v, w); + var x11 = _objectSpread({}, v); + var x12 = _objectSpread({}, v, obj); + var x13 = _objectSpread({}, w); + var x14 = _objectSpread({}, w, obj); + var x15 = _objectSpread({}, t, v); + var x16 = _objectSpread({}, t, w); + var x17 = _objectSpread({}, t, w, obj); + var x18 = _objectSpread({}, t, v, w); } diff --git a/crates/swc/tests/tsc-references/objectSpread_es5.2.minified.js b/crates/swc/tests/tsc-references/objectSpread_es5.2.minified.js index 374d60b849e..fbb70e5e051 100644 --- a/crates/swc/tests/tsc-references/objectSpread_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpread_es5.2.minified.js @@ -14,8 +14,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -31,46 +30,35 @@ var anything, o = { b: "yes", c: !0 }; -_objectSpread({ -}, o, { +_objectSpread({}, o, { c: !1 }), _objectSpread({ c: !1 -}, o), _objectSpread({ -}, o, { +}, o), _objectSpread({}, o, { b: "override" -}), _objectSpread({ -}, _objectSpread({ +}), _objectSpread({}, _objectSpread({ a: 3 }, { b: !1, c: "overriden" }), { c: "whatever" -}), _objectSpread({ -}, o, o2), _objectSpread({ -}, o, o2, { +}), _objectSpread({}, o, o2), _objectSpread({}, o, o2, { b: "ok" -}), _objectSpread({ -}, _objectSpread({ +}), _objectSpread({}, _objectSpread({ a: 1 }, { b: !1, c: "overriden" }), { c: -1 -}), _objectSpread({ -}, o), _objectSpread({ -}, { +}), _objectSpread({}, o), _objectSpread({}, { get a () { return 6; } }, { c: 7 -}).a = 12, _objectSpread({ -}, function() { -}), _objectSpread({ -}, anything); +}).a = 12, _objectSpread({}, function() {}), _objectSpread({}, anything); var C = function() { "use strict"; var Constructor, protoProps, staticProps; @@ -82,36 +70,27 @@ var C = function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), c = new C(); function f(t, u) { - return _objectSpread({ - }, t, u, { + return _objectSpread({}, t, u, { id: "id" }); } -_objectSpread({ -}, c), _objectSpread({ -}, c, { +_objectSpread({}, c), _objectSpread({}, c, { plus: function() { return this.p + 1; } -}).plus(), _objectSpread({ -}, o, { +}).plus(), _objectSpread({}, o, { a: "wrong type?" -}), _objectSpread({ -}, o, { +}), _objectSpread({}, o, { a: "yes", b: -1 -}), _objectSpread({ -}, o, { +}), _objectSpread({}, o, { a: 12 -}), _objectSpread({ -}, { -}), f({ +}), _objectSpread({}, {}), f({ a: 1, b: "yes" }, { diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.1.normal.js index 75fe9f00aeb..75e06f81d9a 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.1.normal.js @@ -4,8 +4,7 @@ class A { class B extends A { } class C { - valueOf() { - } + valueOf() {} } var c; var r1 = c.valueOf(); @@ -18,8 +17,7 @@ var r2b = i.data; var r2c = r2b['hm']; // should be 'Object' var r2d = i['hm']; // should be 'any' var a = { - valueOf: ()=>{ - }, + valueOf: ()=>{}, data: new B() }; var r3 = a.valueOf(); diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.2.minified.js index 26a50eb0deb..98f8508b2bf 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es2015.2.minified.js @@ -2,8 +2,7 @@ class A { } c.valueOf(), c.data.hm, i.valueOf(), i.data.hm; var c, i, b, a = { - valueOf: ()=>{ - }, + valueOf: ()=>{}, data: new class extends A { }() }; diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.1.normal.js index a06c248f106..5422f2098dc 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,8 +104,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "valueOf", - value: function valueOf() { - } + value: function valueOf() {} } ]); return C; @@ -122,8 +120,7 @@ var r2b = i.data; var r2c = r2b['hm']; // should be 'Object' var r2d = i['hm']; // should be 'any' var a = { - valueOf: function() { - }, + valueOf: function() {}, data: new B() }; var r3 = a.valueOf(); diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.2.minified.js index fb3cc564b68..c5295ce8f19 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject_es5.2.minified.js @@ -38,8 +38,7 @@ var c, i, b, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -69,15 +68,13 @@ var c, i, b, A = function() { return protoProps = [ { key: "valueOf", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); c.valueOf(), c.data.hm, c.hm, i.valueOf(), i.data.hm, i.hm; var a = { - valueOf: function() { - }, + valueOf: function() {}, data: new B() }; a.valueOf(), a.data.hm, i.hm, b.valueOf(); diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.1.normal.js index ee5dbf91fa9..b4efdd53b91 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.1.normal.js @@ -11,8 +11,7 @@ var c; o = c; // error c = o; // error var a = { - toString: ()=>{ - } + toString: ()=>{} }; o = a; // error a = o; // ok diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.2.minified.js index 255eeec480d..9153aefe599 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es2015.2.minified.js @@ -1,6 +1,5 @@ i = i, c = c; var i, c, a = { - toString: ()=>{ - } + toString: ()=>{} }; a = a; diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.1.normal.js index 115cbc4f93a..836d2d31b28 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.1.normal.js @@ -40,8 +40,7 @@ var c; o = c; // error c = o; // error var a = { - toString: function() { - } + toString: function() {} }; o = a; // error a = o; // ok diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.2.minified.js index 6d18e609e9f..eaf54c6ed7f 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat2_es5.2.minified.js @@ -24,7 +24,6 @@ var i, c, C = function() { }(); c = c; var a = { - toString: function() { - } + toString: function() {} }; a = a; // ok diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.1.normal.js index 2625a73a8c6..dca8db4198c 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.1.normal.js @@ -3,15 +3,13 @@ var o; o = i; // error i = o; // ok class C { - toString() { - } + toString() {} } var c; o = c; // error c = o; // ok var a = { - toString: ()=>{ - } + toString: ()=>{} }; o = a; // error a = o; // ok diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.2.minified.js index 255eeec480d..9153aefe599 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es2015.2.minified.js @@ -1,6 +1,5 @@ i = i, c = c; var i, c, a = { - toString: ()=>{ - } + toString: ()=>{} }; a = a; diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.1.normal.js index 123681a3d6d..dddccd11106 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.1.normal.js @@ -29,8 +29,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "toString", - value: function toString() { - } + value: function toString() {} } ]); return C; @@ -39,8 +38,7 @@ var c; o = c; // error c = o; // ok var a = { - toString: function() { - } + toString: function() {} }; o = a; // error a = o; // ok diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.2.minified.js index da6420a8391..e0f732a6c9d 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObjectAssignmentCompat_es5.2.minified.js @@ -16,14 +16,12 @@ var i, c, C = function() { return protoProps = [ { key: "toString", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); c = c; var a = { - toString: function() { - } + toString: function() {} }; a = a; // ok diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.1.normal.js index 0e69566920e..6d3cc51368a 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.1.normal.js @@ -1,15 +1,13 @@ // all of these valueOf calls should return the type shown in the overriding signatures here class C { - valueOf() { - } + valueOf() {} } var c; var r1 = c.valueOf(); var i; var r2 = i.valueOf(); var a = { - valueOf: ()=>{ - } + valueOf: ()=>{} }; var r3 = a.valueOf(); var b; diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.2.minified.js index 0b607a9c7f5..0639fe0bfb2 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.2.minified.js @@ -1,5 +1,4 @@ var i, b; (void 0).valueOf(), i.valueOf(), ({ - valueOf: ()=>{ - } + valueOf: ()=>{} }).valueOf(), b.valueOf(); diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.1.normal.js index e78c5d1ccff..b7ba8affe6e 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // all of these valueOf calls should return the type shown in the overri _createClass(C, [ { key: "valueOf", - value: function valueOf() { - } + value: function valueOf() {} } ]); return C; @@ -37,8 +36,7 @@ var r1 = c.valueOf(); var i; var r2 = i.valueOf(); var a = { - valueOf: function() { - } + valueOf: function() {} }; var r3 = a.valueOf(); var b; diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.2.minified.js index 14968a2fff0..1be192af0ba 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfObject_es5.2.minified.js @@ -15,12 +15,10 @@ var c, i, b, C = function() { return protoProps = [ { key: "valueOf", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); c.valueOf(), i.valueOf(), ({ - valueOf: function() { - } + valueOf: function() {} }).valueOf(), b.valueOf(); diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.1.normal.js index 1f25a2eb387..901f4ccfe0e 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.1.normal.js @@ -1,5 +1,4 @@ -var o = { -}; +var o = {}; var r = o['']; // should be Object class C { } diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.2.minified.js index e5fabb3d5dc..ee604f534fd 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es2015.2.minified.js @@ -1,3 +1,2 @@ var c, i, o2; -({ -})[""], c[""], i[""], o2[""]; +({})[""], c[""], i[""], o2[""]; diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.1.normal.js index bf4cd4ecbef..3764682ddfb 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.1.normal.js @@ -3,8 +3,7 @@ function _classCallCheck(instance, Constructor) { throw new TypeError("Cannot call a class as a function"); } } -var o = { -}; +var o = {}; var r = o['']; // should be Object var C = function C() { "use strict"; diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.2.minified.js index 54de1e9e81a..13d8e5151e0 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer_es5.2.minified.js @@ -1,6 +1,5 @@ var c, i, o2; -({ -})[""]; +({})[""]; var C = function() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.1.normal.js index 45d6f21011b..5fc40d69112 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.1.normal.js @@ -9,30 +9,18 @@ var a; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var b = { foo: E.A }; -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.2.minified.js index ed7528b1b1c..9b0af19df18 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity2_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A; +(E = E || (E = {}))[E.A = 0] = "A", E.A; diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.1.normal.js index 189bea9353f..9a64faf4f9f 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.1.normal.js @@ -19,30 +19,18 @@ var a; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var b = { foo: E.A }; -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.2.minified.js index c62d467d01d..1642b830254 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity2_es5.2.minified.js @@ -11,5 +11,4 @@ var E, E, A = function() { "use strict"; _classCallCheck(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A", E.A; +(E = E || (E = {}))[E.A = 0] = "A", E.A; diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es2015.1.normal.js index 009c94e886d..290d7a3bb73 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es5.1.normal.js index e2899b20b97..27dc3e5d2ec 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es2015.1.normal.js index d9d37a09626..c8980aaddd2 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es2015.1.normal.js @@ -1,15 +1,8 @@ var a; -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo13(x) {} +function foo14(x) {} +function foo14b(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es5.1.normal.js index d9d37a09626..c8980aaddd2 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures3_es5.1.normal.js @@ -1,15 +1,8 @@ var a; -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo13(x) {} +function foo14(x) {} +function foo14b(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es2015.1.normal.js index 01c29e88e45..17d43682c41 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es2015.1.normal.js @@ -1,17 +1,9 @@ var a; -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo13(x) {} +function foo14(x) {} +function foo14b(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es5.1.normal.js index 01c29e88e45..17d43682c41 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts2_es5.1.normal.js @@ -1,17 +1,9 @@ var a; -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo13(x) {} +function foo14(x) {} +function foo14b(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es2015.1.normal.js index de0c63451df..b13f0eb7b28 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es5.1.normal.js index a51c9fc01a9..21d18fe56d4 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es2015.1.normal.js index 009c94e886d..290d7a3bb73 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es5.1.normal.js index e2899b20b97..27dc3e5d2ec 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es2015.1.normal.js index 009c94e886d..290d7a3bb73 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es5.1.normal.js index e2899b20b97..27dc3e5d2ec 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es2015.1.normal.js index 43b787adea1..8c955b42f39 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es2015.1.normal.js @@ -1,2 +1 @@ -function foo(x) { -} +function foo(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es5.1.normal.js index 43b787adea1..8c955b42f39 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithComplexConstraints_es5.1.normal.js @@ -1,2 +1 @@ -function foo(x) { -} +function foo(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es2015.1.normal.js index 350fb4114d2..22845b77f0c 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es2015.1.normal.js @@ -15,31 +15,17 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es5.1.normal.js index d4da0bf9ae8..c7b261e732e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2_es5.1.normal.js @@ -19,31 +19,17 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es2015.1.normal.js index 52cb040d91a..278a69de540 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es2015.1.normal.js @@ -15,31 +15,17 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es5.1.normal.js index 22c95f1c075..9b200a986ef 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts_es5.1.normal.js @@ -19,31 +19,17 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es2015.1.normal.js index b4ca2d5bf2b..d03dfd1484d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es2015.1.normal.js @@ -1,46 +1,27 @@ // object types are identical structurally class A { - constructor(x){ - } + constructor(x){} } class B { - constructor(x){ - } + constructor(x){} } class C { - constructor(x){ - } + constructor(x){} } var a; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es5.1.normal.js index 4206450626d..af033bd465e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures_es5.1.normal.js @@ -16,35 +16,19 @@ var C = function C(x) { _classCallCheck(this, C); }; var a; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es2015.1.normal.js index e42e2627a49..f53c5cfac55 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es5.1.normal.js index c76e03ddff9..bfb067d61b9 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures2_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es2015.1.normal.js index d72c04d2c8c..7bf74f64acb 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es2015.1.normal.js @@ -27,45 +27,24 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es5.1.normal.js index d693415742a..19699f9e778 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2_es5.1.normal.js @@ -86,45 +86,24 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es2015.1.normal.js index e32a9a2258f..eb6230d54d3 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es2015.1.normal.js @@ -31,45 +31,24 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es5.1.normal.js index 607cd92eadf..ca6ab7f3e0c 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3_es5.1.normal.js @@ -91,45 +91,24 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es2015.1.normal.js index 582965b4f3c..2a465040f7f 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es2015.1.normal.js @@ -22,41 +22,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es5.1.normal.js index 7be2f25908a..ce1e196997d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints_es5.1.normal.js @@ -71,41 +71,22 @@ var b = { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es2015.1.normal.js index 7d12cfb512c..2f34417d5a9 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es2015.1.normal.js @@ -22,41 +22,22 @@ var b = { return null; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es5.1.normal.js index 2db0968a45a..a7dd452248f 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2_es5.1.normal.js @@ -71,41 +71,22 @@ var b = { return null; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es2015.1.normal.js index 7d12cfb512c..2f34417d5a9 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es2015.1.normal.js @@ -22,41 +22,22 @@ var b = { return null; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es5.1.normal.js index 2db0968a45a..a7dd452248f 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType_es5.1.normal.js @@ -71,41 +71,22 @@ var b = { return null; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es2015.1.normal.js index 81ef21ba0ab..193fd9509ed 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es2015.1.normal.js @@ -1,15 +1,8 @@ var a; -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo2(x) {} +function foo3(x) {} +function foo13(x) {} +function foo14(x) {} +function foo14b(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es5.1.normal.js index 81ef21ba0ab..193fd9509ed 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2_es5.1.normal.js @@ -1,15 +1,8 @@ var a; -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo2(x) {} +function foo3(x) {} +function foo13(x) {} +function foo14(x) {} +function foo14b(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es2015.1.normal.js index ab003f2e24d..139eabd060e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es5.1.normal.js index daf460657ce..b2451fab983 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es2015.1.normal.js index ab003f2e24d..139eabd060e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es5.1.normal.js index daf460657ce..b2451fab983 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es2015.1.normal.js index 41942ac99b0..faa34de9943 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es2015.1.normal.js @@ -22,41 +22,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es5.1.normal.js index 2e0ebe30d8d..e6c8e19094d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams2_es5.1.normal.js @@ -71,41 +71,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es2015.1.normal.js index 41942ac99b0..faa34de9943 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es2015.1.normal.js @@ -22,41 +22,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es5.1.normal.js index 2e0ebe30d8d..e6c8e19094d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams3_es5.1.normal.js @@ -71,41 +71,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es2015.1.normal.js index 41942ac99b0..faa34de9943 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es2015.1.normal.js @@ -22,41 +22,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es5.1.normal.js index 2e0ebe30d8d..e6c8e19094d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesOptionalParams_es5.1.normal.js @@ -71,41 +71,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es2015.1.normal.js index ab003f2e24d..139eabd060e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es2015.1.normal.js @@ -20,41 +20,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es5.1.normal.js index daf460657ce..b2451fab983 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignatures_es5.1.normal.js @@ -69,41 +69,22 @@ var b = { return x; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es2015.1.normal.js index 6b13892bd3d..03cead453b5 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es2015.1.normal.js @@ -22,33 +22,18 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es5.1.normal.js index 6cdfc7ebea8..71e1e0240dd 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2_es5.1.normal.js @@ -24,33 +24,18 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es2015.1.normal.js index 8eb45b969a3..cca87661b60 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es2015.1.normal.js @@ -26,33 +26,18 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es5.1.normal.js index 4f45717e2ba..cddebf76038 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3_es5.1.normal.js @@ -32,33 +32,18 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5c(x) {} +function foo6c(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es2015.1.normal.js index 4e654b69ff7..0924f99242a 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es2015.1.normal.js @@ -17,29 +17,16 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es5.1.normal.js index c17c4187620..440ed37bdfa 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints_es5.1.normal.js @@ -19,29 +19,16 @@ var b = { return ''; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es2015.1.normal.js index 1fd3274e5ed..eb458569c9e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es2015.1.normal.js @@ -17,31 +17,17 @@ var b = { return null; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es5.1.normal.js index 6704317f109..56b631a6fdb 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2_es5.1.normal.js @@ -19,31 +19,17 @@ var b = { return null; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es2015.1.normal.js index 75357229313..875939a1d39 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es2015.1.normal.js @@ -17,33 +17,18 @@ var b = { return null; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es5.1.normal.js index 53b5719cad5..56c3e811793 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType_es5.1.normal.js @@ -19,33 +19,18 @@ var b = { return null; } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es2015.1.normal.js index 6c16f383b79..5bdfa94dbd5 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es2015.1.normal.js @@ -15,29 +15,16 @@ var b = { return x; } }; -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es5.1.normal.js index 224c219ba0b..f4a2834d2f3 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts_es5.1.normal.js @@ -19,29 +19,16 @@ var b = { return x; } }; -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es2015.1.normal.js index 7c30cc8d030..f96d6266abb 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es2015.1.normal.js @@ -15,29 +15,16 @@ var b = { return new C(x); } }; -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es5.1.normal.js index e826f75bb97..35686b5b357 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames_es5.1.normal.js @@ -19,29 +19,16 @@ var b = { return new C(x); } }; -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es2015.1.normal.js index 88e1d88c8dc..f83a4c8ec95 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es2015.1.normal.js @@ -17,29 +17,16 @@ var b = { return new C(x, y); } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es5.1.normal.js index 772b1dee8fd..192be179ad6 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2_es5.1.normal.js @@ -19,29 +19,16 @@ var b = { return new C(x, y); } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es2015.1.normal.js index 88e1d88c8dc..f83a4c8ec95 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es2015.1.normal.js @@ -17,29 +17,16 @@ var b = { return new C(x, y); } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es5.1.normal.js index 772b1dee8fd..192be179ad6 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3_es5.1.normal.js @@ -19,29 +19,16 @@ var b = { return new C(x, y); } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es2015.1.normal.js index 88e1d88c8dc..f83a4c8ec95 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es2015.1.normal.js @@ -17,29 +17,16 @@ var b = { return new C(x, y); } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es5.1.normal.js index 772b1dee8fd..192be179ad6 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesOptionalParams_es5.1.normal.js @@ -19,29 +19,16 @@ var b = { return new C(x, y); } }; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo12b(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es2015.1.normal.js index 23b32e5dd69..97a749b9bdd 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es2015.1.normal.js @@ -13,49 +13,26 @@ var a; var b = { 0: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.1.normal.js index bd19cc031b4..f81b5d1758d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,49 +104,26 @@ var a; var b = { 0: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.2.minified.js index 4219e977d63..5732a758e85 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es2015.1.normal.js index 9a7c45e4d2b..119eb78b2bc 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es2015.1.normal.js @@ -17,49 +17,26 @@ var a; var b = { 0: null }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.1.normal.js index c872da98bb7..46de5165b10 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,49 +118,26 @@ var a; var b = { 0: null }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.2.minified.js index 7658303b717..3cff05393a2 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es2015.1.normal.js index 23b32e5dd69..97a749b9bdd 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es2015.1.normal.js @@ -13,49 +13,26 @@ var a; var b = { 0: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.1.normal.js index bd19cc031b4..f81b5d1758d 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,49 +104,26 @@ var a; var b = { 0: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.2.minified.js index 4219e977d63..5732a758e85 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es2015.1.normal.js index f4066921781..1a8113e239c 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es2015.1.normal.js @@ -9,21 +9,12 @@ var a; var b = { foo: '' }; -function foo2(x) { -} -function foo3(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo10(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo2(x) {} +function foo3(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo10(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es5.1.normal.js index 4e786eed09e..32e56682b9f 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality_es5.1.normal.js @@ -19,21 +19,12 @@ var a; var b = { foo: '' }; -function foo2(x) { -} -function foo3(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo10(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo2(x) {} +function foo3(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo10(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.1.normal.js index 25d35bf1fbb..5e5b0ef1bc7 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.1.normal.js @@ -3,17 +3,11 @@ class C { } class D extends C { } -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} +function foo1(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} var r = foo4(new C()); var r = foo4(new D()); -function foo5(x) { -} -function foo6(x) { -} +function foo5(x) {} +function foo6(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.2.minified.js index db5cbe07209..4bc862fed9f 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es2015.2.minified.js @@ -1,6 +1,5 @@ class C { } -function foo4(x) { -} +function foo4(x) {} foo4(new C()), foo4(new class extends C { }()); diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.1.normal.js index 2d614123679..8402e08b8db 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -83,17 +82,11 @@ var D = /*#__PURE__*/ function(C) { } return D; }(C); -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} +function foo1(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} var r = foo4(new C()); var r = foo4(new D()); -function foo5(x) { -} -function foo6(x) { -} +function foo5(x) {} +function foo6(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.2.minified.js index d0ce6de86aa..a03516e9b59 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2_es5.2.minified.js @@ -32,8 +32,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -55,6 +54,5 @@ var C = function() { } return D; }(C); -function foo4(x) { -} +function foo4(x) {} foo4(new C()), foo4(new D()); diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.1.normal.js index 47b17a2bf67..43988db76d2 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.2.minified.js index cdbeb9a3114..cfb1de25b59 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es2015.1.normal.js index 970717c4301..56c8b11c481 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es2015.1.normal.js @@ -13,49 +13,26 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.1.normal.js index 18ee9a7db7d..ca8e892d670 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,49 +104,26 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.2.minified.js index 4219e977d63..5732a758e85 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es2015.1.normal.js index c2786074b00..b3606527172 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es2015.1.normal.js @@ -9,37 +9,20 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es5.1.normal.js index 5b40fe118a8..d91ffcf8b79 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics_es5.1.normal.js @@ -19,37 +19,20 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es2015.1.normal.js index 0e0f0543dca..8a9c9b09964 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es2015.1.normal.js @@ -17,49 +17,26 @@ var a; var b = { foo: null }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.1.normal.js index 7239505855d..1305d3176c5 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -119,49 +118,26 @@ var a; var b = { foo: null }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.2.minified.js index 7658303b717..3cff05393a2 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es2015.1.normal.js index 970717c4301..56c8b11c481 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es2015.1.normal.js @@ -13,49 +13,26 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.1.normal.js index 18ee9a7db7d..ca8e892d670 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -105,49 +104,26 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo5c(x) {} +function foo5d(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo11b(x) {} +function foo11c(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} +function foo15(x) {} +function foo16(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.2.minified.js index 4219e977d63..5732a758e85 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentity_es2015.1.normal.js index c2786074b00..b3606527172 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity_es2015.1.normal.js @@ -9,37 +9,20 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentity_es5.1.normal.js index 5b40fe118a8..d91ffcf8b79 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity_es5.1.normal.js @@ -19,37 +19,20 @@ var a; var b = { foo: '' }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +function foo1(x) {} +function foo1b(x) {} +function foo1c(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} +function foo5b(x) {} +function foo6(x) {} +function foo7(x) {} +function foo8(x) {} +function foo9(x) {} +function foo10(x) {} +function foo11(x) {} +function foo12(x) {} +function foo13(x) {} +function foo14(x) {} diff --git a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.1.normal.js index bf78eb307d8..cdea920c90b 100644 --- a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.1.normal.js @@ -4,12 +4,10 @@ function createGuid() { function createSerialNo() { return 12345; } -let map1 = { -}; +let map1 = {}; let guid = createGuid(); map1[guid] = 123; // Can with tagged string -let map2 = { -}; +let map2 = {}; let serialNo = createSerialNo(); map2[serialNo] = "hello"; // Can index with tagged number const s1 = "{" + guid + "}"; diff --git a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.2.minified.js index 198be54e602..0c819ffe88b 100644 --- a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es2015.2.minified.js @@ -1,4 +1,2 @@ -let map1 = { -}, guid = "21EC2020-3AEA-4069-A2DD-08002B30309D"; -map1[guid] = 123, ({ -})[12345] = "hello", "{" + guid + "}", guid.toLowerCase(), 12345..toPrecision(0); +let map1 = {}, guid = "21EC2020-3AEA-4069-A2DD-08002B30309D"; +map1[guid] = 123, ({})[12345] = "hello", "{" + guid + "}", guid.toLowerCase(), 12345..toPrecision(0); diff --git a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.1.normal.js index 4807e84f4d0..8bba87f9d5d 100644 --- a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.1.normal.js @@ -4,12 +4,10 @@ function createGuid() { function createSerialNo() { return 12345; } -var map1 = { -}; +var map1 = {}; var guid = createGuid(); map1[guid] = 123; // Can with tagged string -var map2 = { -}; +var map2 = {}; var serialNo = createSerialNo(); map2[serialNo] = "hello"; // Can index with tagged number var s1 = "{" + guid + "}"; diff --git a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.2.minified.js index a115f02f579..96d3753264d 100644 --- a/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/operatorsAndIntersectionTypes_es5.2.minified.js @@ -1,4 +1,2 @@ -var map1 = { -}, guid = "21EC2020-3AEA-4069-A2DD-08002B30309D"; -map1[guid] = 123, ({ -})[12345] = "hello", "{" + guid + "}", guid.toLowerCase(), 12345..toPrecision(0); +var map1 = {}, guid = "21EC2020-3AEA-4069-A2DD-08002B30309D"; +map1[guid] = 123, ({})[12345] = "hello", "{" + guid + "}", guid.toLowerCase(), 12345..toPrecision(0); diff --git a/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.1.normal.js index 58abd6fe865..5e00c48123a 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo([x, y, z]) { -} +function foo([x, y, z]) {} foo([ "", 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.2.minified.js b/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.2.minified.js index 0a6fab9163f..01b90f795d0 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalBindingParameters1_es2015.2.minified.js @@ -1,5 +1,4 @@ -function foo([x, y, z]) { -} +function foo([x, y, z]) {} foo([ "", 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.1.normal.js index 163c91a1e60..495905b76b2 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo({ x , y , z }) { -} +function foo({ x , y , z }) {} foo({ x: "", y: 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.2.minified.js b/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.2.minified.js index ece30fffe2b..fe70c4c64c2 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalBindingParameters2_es2015.2.minified.js @@ -1,5 +1,4 @@ -function foo({ x , y , z }) { -} +function foo({ x , y , z }) {} foo({ x: "", y: 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.1.normal.js index 674d233d91f..4311649464d 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo(...rest) { -} +function foo(...rest) {} foo([ "", 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.2.minified.js b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.2.minified.js index c03a1c39e67..da9684ebe02 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads1_es2015.2.minified.js @@ -1,5 +1,4 @@ -function foo(...rest) { -} +function foo(...rest) {} foo([ "", 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.1.normal.js index 0aa912af276..bb1ab1cc941 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo(...rest) { -} +function foo(...rest) {} foo({ x: "", y: 0, diff --git a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.2.minified.js b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.2.minified.js index 45335d1ef6f..6f0330eb476 100644 --- a/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalBindingParametersInOverloads2_es2015.2.minified.js @@ -1,5 +1,4 @@ -function foo(...rest) { -} +function foo(...rest) {} foo({ x: "", y: 0, diff --git a/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern.2_es5.2.minified.js b/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern.2_es5.2.minified.js index 288916ea435..54802533b3f 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern.2_es5.2.minified.js @@ -1,5 +1,4 @@ -var ref, ref1, a = function() { -}; +var ref, ref1, a = function() {}; (void 0)[null === (ref = a()) || void 0 === ref ? void 0 : ref.d], (function() { (void 0)[null === (ref1 = a()) || void 0 === ref1 ? void 0 : ref1.d], arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; })(); diff --git a/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern_es2015.1.normal.js index 6200483e00f..1a0bc988b26 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalChainingInParameterBindingPattern_es2015.1.normal.js @@ -4,5 +4,4 @@ var ref; // https://github.com/microsoft/TypeScript/issues/36295 const a = ()=>undefined ; -(({ [(ref = a()) === null || ref === void 0 ? void 0 : ref.d]: c = "" })=>{ -})(); +(({ [(ref = a()) === null || ref === void 0 ? void 0 : ref.d]: c = "" })=>{})(); diff --git a/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer.2_es5.2.minified.js b/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer.2_es5.2.minified.js index 5602acb3ddc..4b084be7d7e 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer.2_es5.2.minified.js @@ -1,5 +1,4 @@ -var ref, ref1, a = function() { -}; +var ref, ref1, a = function() {}; !function() { arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null === (ref = a()) || void 0 === ref || ref.d; }(), (function() { diff --git a/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es2015.1.normal.js index 4822fa4a7e2..4e48a2f37cd 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es2015.1.normal.js @@ -4,5 +4,4 @@ var ref; // https://github.com/microsoft/TypeScript/issues/36295 const a = ()=>undefined ; -((b = (ref = a()) === null || ref === void 0 ? void 0 : ref.d)=>{ -})(); +((b = (ref = a()) === null || ref === void 0 ? void 0 : ref.d)=>{})(); diff --git a/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es5.2.minified.js b/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es5.2.minified.js index c89d8ff2b85..7dc73e7051d 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalChainingInParameterInitializer_es5.2.minified.js @@ -1,5 +1,4 @@ -var ref, a = function() { -}; +var ref, a = function() {}; !function() { arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null === (ref = a()) || void 0 === ref || ref.d; }(); diff --git a/crates/swc/tests/tsc-references/optionalMethodDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalMethodDeclarations_es2015.1.normal.js index be32ea88b95..bf4e5499b9d 100644 --- a/crates/swc/tests/tsc-references/optionalMethodDeclarations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalMethodDeclarations_es2015.1.normal.js @@ -3,6 +3,5 @@ // https://github.com/microsoft/TypeScript/issues/34952#issuecomment-552025027 class C { // ? should be removed in emit - method() { - } + method() {} } diff --git a/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.1.normal.js index 921d50df3fb..3dfcaf041a0 100644 --- a/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.1.normal.js @@ -29,8 +29,7 @@ var C = // @target: esnext,es2016 { // ? should be removed in emit key: "method", - value: function method() { - } + value: function method() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.2.minified.js index 231ea93323f..c0e1785c0dc 100644 --- a/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalMethodDeclarations_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "method", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/optionalMethod_es2015.1.normal.js b/crates/swc/tests/tsc-references/optionalMethod_es2015.1.normal.js index b2ea4d4aaac..2f37e1f9944 100644 --- a/crates/swc/tests/tsc-references/optionalMethod_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalMethod_es2015.1.normal.js @@ -1,6 +1,5 @@ // @target: esnext // @noTypesAndSymbols: true class Base { - method() { - } + method() {} } diff --git a/crates/swc/tests/tsc-references/optionalMethod_es5.1.normal.js b/crates/swc/tests/tsc-references/optionalMethod_es5.1.normal.js index df85958ad44..7547ec6f9f3 100644 --- a/crates/swc/tests/tsc-references/optionalMethod_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalMethod_es5.1.normal.js @@ -27,8 +27,7 @@ var Base = // @target: esnext _createClass(Base, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return Base; diff --git a/crates/swc/tests/tsc-references/optionalMethod_es5.2.minified.js b/crates/swc/tests/tsc-references/optionalMethod_es5.2.minified.js index e6b4989b919..04066cf406a 100644 --- a/crates/swc/tests/tsc-references/optionalMethod_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalMethod_es5.2.minified.js @@ -15,8 +15,7 @@ var Base = function() { return protoProps = [ { key: "method", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Base).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Base; }(); diff --git a/crates/swc/tests/tsc-references/optionalMethods_es5.1.normal.js b/crates/swc/tests/tsc-references/optionalMethods_es5.1.normal.js index 020eb42d75e..a010f2e2bc2 100644 --- a/crates/swc/tests/tsc-references/optionalMethods_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalMethods_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/optionalMethods_es5.2.minified.js b/crates/swc/tests/tsc-references/optionalMethods_es5.2.minified.js index 731ca0b2ece..d201885284b 100644 --- a/crates/swc/tests/tsc-references/optionalMethods_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalMethods_es5.2.minified.js @@ -61,8 +61,7 @@ var Bar = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.1.normal.js index 8c47ea748f9..863b0e9a1d0 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.1.normal.js @@ -8,17 +8,14 @@ class SomeDerived3 extends SomeBase { } // Ambiguous call picks the first overload in declaration order class fn1 { - constructor(){ - } + constructor(){} } new fn1(undefined); // No candidate overloads found -new fn1({ -}); // Error +new fn1({}); // Error // Generic and non - generic overload where generic overload is the only candidate when called with type arguments class fn2 { - constructor(){ - } + constructor(){} } var d = new fn2(0, undefined); // Generic and non - generic overload where generic overload is the only candidate when called without type arguments @@ -29,8 +26,7 @@ new fn2('', 0); // OK new fn2('', 0); // OK // Generic overloads with differing arity called without type arguments class fn3 { - constructor(){ - } + constructor(){} } new fn3(3); new fn3('', 3, ''); @@ -43,8 +39,7 @@ new fn3('', '', 3); new fn3(); // Error // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { - constructor(){ - } + constructor(){} } new fn4('', 3); new fn4(3, ''); // Error diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.2.minified.js index ce66c03b19f..b66ceb7d66a 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es2015.2.minified.js @@ -1,22 +1,17 @@ class fn1 { - constructor(){ - } + constructor(){} } -new fn1(void 0), new fn1({ -}); +new fn1(void 0), new fn1({}); class fn2 { - constructor(){ - } + constructor(){} } new fn2(0, void 0), new fn2(0, ""), new fn2("", 0), new fn2("", 0); class fn3 { - constructor(){ - } + constructor(){} } new fn3(3), new fn3("", 3, ""), new fn3(5, 5, 5), new fn3(4), new fn3("", "", ""), new fn3("", "", 3), new fn3(); class fn4 { - constructor(){ - } + constructor(){} } 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); class fn5 { diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.1.normal.js index 46a1a0ee091..0bc1393da17 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -109,8 +108,7 @@ var fn1 = function fn1() { }; new fn1(undefined); // No candidate overloads found -new fn1({ -}); // Error +new fn1({}); // Error var fn2 = function fn2() { "use strict"; _classCallCheck(this, fn2); diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.2.minified.js index 9231b2a2222..f81e35560bb 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -76,8 +75,7 @@ var SomeBase = function() { "use strict"; _classCallCheck(this, fn1); }; -new fn1(void 0), new fn1({ -}); +new fn1(void 0), new fn1({}); var fn2 = function() { "use strict"; _classCallCheck(this, fn2); diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.1.normal.js index f848e2914f8..6bfe3c04e83 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.1.normal.js @@ -11,8 +11,7 @@ var fn1; var s = new fn1(undefined); var s; // No candidate overloads found -new fn1({ -}); // Error +new fn1({}); // Error var fn2; var d = new fn2(0, undefined); var d; diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.2.minified.js index 4539d51a6a2..9a52b6e2dc3 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es2015.2.minified.js @@ -1,5 +1,4 @@ var fn1, fn2, fn3, fn4, fn5; -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((n)=>n.toFixed() +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((n)=>n.toFixed() ), new fn5((n)=>n.substr(0) ); diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.1.normal.js index dc8fd4a1002..fea6a52a705 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -108,8 +107,7 @@ var fn1; var s = new fn1(undefined); var s; // No candidate overloads found -new fn1({ -}); // Error +new fn1({}); // Error var fn2; var d = new fn2(0, undefined); var d; diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.2.minified.js index a25897ea363..0596a04afc3 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,8 +72,7 @@ var fn1, fn2, fn3, fn4, fn5, SomeBase = function() { } return SomeDerived3; }(SomeBase); -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/overloadResolution_es2015.1.normal.js b/crates/swc/tests/tsc-references/overloadResolution_es2015.1.normal.js index 920720d1478..d90a7ea3611 100644 --- a/crates/swc/tests/tsc-references/overloadResolution_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolution_es2015.1.normal.js @@ -12,8 +12,7 @@ function fn1() { var s = fn1(undefined); var s; // No candidate overloads found -fn1({ -}); // Error +fn1({}); // Error function fn2() { return undefined; } @@ -38,8 +37,7 @@ 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() { -} +function fn4() {} fn4('', 3); fn4(3, ''); // Error fn4('', 3); // Error diff --git a/crates/swc/tests/tsc-references/overloadResolution_es2015.2.minified.js b/crates/swc/tests/tsc-references/overloadResolution_es2015.2.minified.js index 781c2d9a4b9..d3d46264642 100644 --- a/crates/swc/tests/tsc-references/overloadResolution_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolution_es2015.2.minified.js @@ -1,16 +1,12 @@ function fn1() { return null; } -function fn2() { -} +function fn2() {} function fn3() { return null; } -function fn4() { -} -function fn5() { -} -fn1(void 0), fn1({ -}), fn2(0, void 0), fn2(0, ""), fn2("", 0), fn2("", 0), fn3(3), fn3("", 3, ""), fn3(5, 5, 5), fn3(4), fn3("", "", ""), fn3("", "", 3), fn3(), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4(3, void 0), fn4("", null), fn4(null, null), fn4(!0, null), fn4(null, !0), fn5((n)=>n.toFixed() +function fn4() {} +function fn5() {} +fn1(void 0), fn1({}), fn2(0, void 0), fn2(0, ""), fn2("", 0), fn2("", 0), fn3(3), fn3("", 3, ""), fn3(5, 5, 5), fn3(4), fn3("", "", ""), fn3("", "", 3), fn3(), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4(3, void 0), fn4("", null), fn4(null, null), fn4(!0, null), fn4(null, !0), fn5((n)=>n.toFixed() ), fn5((n)=>n.substr(0) ); diff --git a/crates/swc/tests/tsc-references/overloadResolution_es5.1.normal.js b/crates/swc/tests/tsc-references/overloadResolution_es5.1.normal.js index 77c46c01a4c..66963144a3b 100644 --- a/crates/swc/tests/tsc-references/overloadResolution_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolution_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -109,8 +108,7 @@ function fn1() { var s = fn1(undefined); var s; // No candidate overloads found -fn1({ -}); // Error +fn1({}); // Error function fn2() { return undefined; } @@ -135,8 +133,7 @@ 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() { -} +function fn4() {} fn4('', 3); fn4(3, ''); // Error fn4('', 3); // Error diff --git a/crates/swc/tests/tsc-references/overloadResolution_es5.2.minified.js b/crates/swc/tests/tsc-references/overloadResolution_es5.2.minified.js index 9dbd20174f8..7bc798fa07c 100644 --- a/crates/swc/tests/tsc-references/overloadResolution_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolution_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -76,17 +75,13 @@ var SomeBase = function() { function fn1() { return null; } -function fn2() { -} +function fn2() {} function fn3() { return null; } -function fn4() { -} -function fn5() { -} -fn1(void 0), fn1({ -}), fn2(0, void 0), fn2(0, ""), fn2("", 0), fn2("", 0), fn3(3), fn3("", 3, ""), fn3(5, 5, 5), fn3(4), fn3("", "", ""), fn3("", "", 3), fn3(), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4(3, void 0), fn4("", null), fn4(null, null), fn4(!0, null), fn4(null, !0), fn5(function(n) { +function fn4() {} +function fn5() {} +fn1(void 0), fn1({}), fn2(0, void 0), fn2(0, ""), fn2("", 0), fn2("", 0), fn3(3), fn3("", 3, ""), fn3(5, 5, 5), fn3(4), fn3("", "", ""), fn3("", "", 3), fn3(), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4("", 3), fn4(3, ""), fn4(3, void 0), fn4("", null), fn4(null, null), fn4(!0, null), fn4(null, !0), fn5(function(n) { return n.toFixed(); }), fn5(function(n) { return n.substr(0); diff --git a/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.1.normal.js index b44d19cba9a..0a1ed66a936 100644 --- a/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.2.minified.js index b26e1f50518..c9e337cb0df 100644 --- a/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/overrideInterfaceProperty_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es2015.2.minified.js b/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es2015.2.minified.js index 44c260e47ef..d77191eca44 100644 --- a/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es2015.2.minified.js @@ -1,3 +1,2 @@ -function f(p, q, r) { -} +function f(p, q, r) {} f(), f(void 0, void 0, void 0), f(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es5.2.minified.js b/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es5.2.minified.js index 44c260e47ef..d77191eca44 100644 --- a/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagBracketsAddOptionalUndefined_es5.2.minified.js @@ -1,3 +1,2 @@ -function f(p, q, r) { -} +function f(p, q, r) {} f(), f(void 0, void 0, void 0), f(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution2_es2015.1.normal.js b/crates/swc/tests/tsc-references/paramTagTypeResolution2_es2015.1.normal.js index d799790d17c..6f000cf6087 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution2_es2015.1.normal.js @@ -6,8 +6,7 @@ * @template T * @param {T} a * @param {{[K in keyof T]: (value: T[K]) => void }} b - */ function f(a, b) { -} + */ function f(a, b) {} f({ x: 42 }, { diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution2_es5.1.normal.js b/crates/swc/tests/tsc-references/paramTagTypeResolution2_es5.1.normal.js index b9bdbfc33a3..867b8c957d8 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution2_es5.1.normal.js @@ -6,8 +6,7 @@ * @template T * @param {T} a * @param {{[K in keyof T]: (value: T[K]) => void }} b - */ function f(a, b) { -} + */ function f(a, b) {} f({ x: 42 }, { diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.1.normal.js b/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.1.normal.js index 8425c105663..b5e29b76eef 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.1.normal.js @@ -10,5 +10,4 @@ }; // @Filename: main.js var f = require('./first'); -f(1, (n)=>{ -}); +f(1, (n)=>{}); diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js b/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js index 3d11a7b1766..0c3a67bf8dc 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js @@ -1,4 +1,3 @@ module.exports = function(x, k) { return k(x); -}, require("./first")(1, (n)=>{ -}); +}, require("./first")(1, (n)=>{}); diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.1.normal.js b/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.1.normal.js index bd01728abd5..424af142091 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.1.normal.js @@ -10,5 +10,4 @@ }; // @Filename: main.js var f = require('./first'); -f(1, function(n) { -}); +f(1, function(n) {}); diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js b/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js index e91a97ff6de..c1053e3d4a6 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js @@ -1,4 +1,3 @@ module.exports = function(x, k) { return k(x); -}, require("./first")(1, function(n) { -}); +}, require("./first")(1, function(n) {}); diff --git a/crates/swc/tests/tsc-references/paramTagWrapping_es2015.1.normal.js b/crates/swc/tests/tsc-references/paramTagWrapping_es2015.1.normal.js index a1164a13bf4..f2b283e0d80 100644 --- a/crates/swc/tests/tsc-references/paramTagWrapping_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagWrapping_es2015.1.normal.js @@ -10,8 +10,7 @@ * y Arg y. * @param {number} z * Arg z. - */ function good(x, y, z) { -} + */ function good(x, y, z) {} good(1, 2, 3); // @Filename: bad.js /** @@ -21,6 +20,5 @@ good(1, 2, 3); * * y Arg y. * @param {number} * z * Arg z. - */ function bad(x, y, z) { -} + */ function bad(x, y, z) {} bad(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/paramTagWrapping_es5.1.normal.js b/crates/swc/tests/tsc-references/paramTagWrapping_es5.1.normal.js index a1164a13bf4..f2b283e0d80 100644 --- a/crates/swc/tests/tsc-references/paramTagWrapping_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagWrapping_es5.1.normal.js @@ -10,8 +10,7 @@ * y Arg y. * @param {number} z * Arg z. - */ function good(x, y, z) { -} + */ function good(x, y, z) {} good(1, 2, 3); // @Filename: bad.js /** @@ -21,6 +20,5 @@ good(1, 2, 3); * * y Arg y. * @param {number} * z * Arg z. - */ function bad(x, y, z) { -} + */ function bad(x, y, z) {} bad(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es2015.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es2015.1.normal.js index 34efd568d3c..e7932682d48 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es2015.1.normal.js @@ -2,16 +2,13 @@ // @noEmit: true // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/38243 -function test0({ a =0 , b =a } = { -}) { +function test0({ a =0 , b =a } = {}) { return { a, b }; } -function test1({ c: { a =0 , b =a } = { -} } = { -}) { +function test1({ c: { a =0 , b =a } = {} } = {}) { return { a, b diff --git a/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es5.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es5.1.normal.js index 33df602c293..e4380665976 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersBackwardReferencing_es5.1.normal.js @@ -3,17 +3,14 @@ // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/38243 function test0() { - var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - }, _a = ref.a, a = _a === void 0 ? 0 : _a, _b = ref.b, b = _b === void 0 ? a : _b; + var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _a = ref.a, a = _a === void 0 ? 0 : _a, _b = ref.b, b = _b === void 0 ? a : _b; return { a: a, b: b }; } function test1() { - var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - }, tmp = ref.c, ref1 = tmp === void 0 ? { - } : tmp, _a = ref1.a, a = _a === void 0 ? 0 : _a, _b = ref1.b, b = _b === void 0 ? a : _b; + var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, tmp = ref.c, ref1 = tmp === void 0 ? {} : tmp, _a = ref1.a, a = _a === void 0 ? 0 : _a, _b = ref1.b, b = _b === void 0 ? a : _b; return { a: a, b: b diff --git a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es2015.1.normal.js index 0fa731bdc28..74bd151801f 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es2015.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -32,8 +29,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { // @noEmit: true // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/36295 -function a() { -} +function a() {} function b(_param = a()) { var { b =a() } = _param, x = _objectWithoutProperties(_param, [ "b" diff --git a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es5.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es5.1.normal.js index 08ea021bf43..c23334bd31d 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing.2_es5.1.normal.js @@ -1,6 +1,5 @@ function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -15,10 +14,8 @@ function _objectWithoutProperties(source, excluded) { return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -32,8 +29,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { // @noEmit: true // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/36295 -function a() { -} +function a() {} function b() { var _param = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : a(); var _b = _param.b, b = _b === void 0 ? a() : _b, x = _objectWithoutProperties(_param, [ diff --git a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es2015.1.normal.js index 9bcb8f081ba..69edd84a52c 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es2015.1.normal.js @@ -29,5 +29,4 @@ class Foo { this.y = y; } } -function f8(foo1, bar = foo1) { -} +function f8(foo1, bar = foo1) {} diff --git a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es6_es2015.1.normal.js index ed3059abd2a..fef70897658 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing1_es6_es2015.1.normal.js @@ -30,5 +30,4 @@ class Foo { this.y = y; } } -function f8(foo1, bar = foo1) { -} +function f8(foo1, bar = foo1) {} diff --git a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing_es2015.1.normal.js b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing_es2015.1.normal.js index d51124ca0eb..58f4ee0a93f 100644 --- a/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parameterInitializersForwardReferencing_es2015.1.normal.js @@ -22,16 +22,12 @@ function outside() { } function defaultArgFunction(a = function() { return b; -}, b = 1) { -} +}, b = 1) {} function defaultArgArrow(a = ()=>()=>b -, b = 3) { -} +, b = 3) {} class C { - method(a = b, b = 1) { - } - constructor(a = b, b = 1){ - } + method(a = b, b = 1) {} + constructor(a = b, b = 1){} } // Function expressions var x = (a = b, b = c, c = d)=>{ @@ -40,5 +36,4 @@ var x = (a = b, b = c, c = d)=>{ // Should not produce errors - can reference later parameters if they occur within a function expression initializer. function f(a, b = function() { return c; -}, c = b()) { -} +}, c = b()) {} diff --git a/crates/swc/tests/tsc-references/parenthesizedContexualTyping1_es5.2.minified.js b/crates/swc/tests/tsc-references/parenthesizedContexualTyping1_es5.2.minified.js index 758e008cb7d..0c5cbbab2c2 100644 --- a/crates/swc/tests/tsc-references/parenthesizedContexualTyping1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parenthesizedContexualTyping1_es5.2.minified.js @@ -27,18 +27,14 @@ fun(function(x) { return x; }, 10), fun(0.5 > Math.random() ? function(x) { return x; -} : function(x) { -}, 10), fun(0.5 > Math.random() ? function(x) { +} : function(x) {}, 10), fun(0.5 > Math.random() ? function(x) { return x; -} : function(x) { -}, 10), fun(0.5 > Math.random() ? function(x) { +} : function(x) {}, 10), fun(0.5 > Math.random() ? function(x) { return x; -} : function(x) { -}, function(x) { +} : function(x) {}, function(x) { return x; }, 10), fun(0.5 > Math.random() ? function(x) { return x; -} : function(x) { -}, function(x) { +} : function(x) {}, function(x) { return x; }, 10); diff --git a/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es2015.2.minified.js index 7a36e255ef2..472f3dc9b48 100644 --- a/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es2015.2.minified.js @@ -1,5 +1,4 @@ -function fun(...rest) { -} +function fun(...rest) {} fun((x)=>(x(void 0), x) , 10), fun((x)=>(x(void 0), x) , 10), fun((x)=>(x(void 0), x) diff --git a/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es5.2.minified.js b/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es5.2.minified.js index e502188df9f..9e14c5d4a47 100644 --- a/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parenthesizedContexualTyping2_es5.2.minified.js @@ -27,18 +27,14 @@ fun(function(x) { return x(void 0), x; }, 10), fun(0.5 > Math.random() ? function(x) { return x(void 0), x; -} : function(x) { -}, 10), fun(0.5 > Math.random() ? function(x) { +} : function(x) {}, 10), fun(0.5 > Math.random() ? function(x) { return x(void 0), x; -} : function(x) { -}, 10), fun(0.5 > Math.random() ? function(x) { +} : function(x) {}, 10), fun(0.5 > Math.random() ? function(x) { return x(void 0), x; -} : function(x) { -}, function(x) { +} : function(x) {}, function(x) { return x(void 0), x; }, 10), fun(0.5 > Math.random() ? function(x) { return x(void 0), x; -} : function(x) { -}, function(x) { +} : function(x) {}, function(x) { return x(void 0), x; }, 10); diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es2015.1.normal.js index f2ce7382f66..daa48410039 100644 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es2015.1.normal.js @@ -1,4 +1,3 @@ class Outer { - static public() { - } + static public() {} } diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.1.normal.js index 01d178c8a89..c0e0ae3d740 100644 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.1.normal.js @@ -25,8 +25,7 @@ var Outer = /*#__PURE__*/ function() { _createClass(Outer, null, [ { key: "public", - value: function _public() { - } + value: function _public() {} } ]); return Outer; diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.2.minified.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.2.minified.js index caa3dac78fe..d11bc585d18 100644 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic11_es5.2.minified.js @@ -14,8 +14,7 @@ var Outer = function() { })(Constructor = Outer, [ { key: "public", - value: function() { - } + value: function() {} } ]), Outer; }(); diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es2015.1.normal.js index f2ce7382f66..daa48410039 100644 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es2015.1.normal.js @@ -1,4 +1,3 @@ class Outer { - static public() { - } + static public() {} } diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.1.normal.js index 01d178c8a89..c0e0ae3d740 100644 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.1.normal.js @@ -25,8 +25,7 @@ var Outer = /*#__PURE__*/ function() { _createClass(Outer, null, [ { key: "public", - value: function _public() { - } + value: function _public() {} } ]); return Outer; diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.2.minified.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.2.minified.js index caa3dac78fe..d11bc585d18 100644 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic14_es5.2.minified.js @@ -14,8 +14,7 @@ var Outer = function() { })(Constructor = Outer, [ { key: "public", - value: function() { - } + value: function() {} } ]), Outer; }(); diff --git a/crates/swc/tests/tsc-references/parserAccessors1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors1_es2015.1.normal.js index aa83fff93f2..4be41540028 100644 --- a/crates/swc/tests/tsc-references/parserAccessors1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors1_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - get Foo() { - } + get Foo() {} } diff --git a/crates/swc/tests/tsc-references/parserAccessors1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors1_es5.1.normal.js index 68f6ca9983c..4acb11671bd 100644 --- a/crates/swc/tests/tsc-references/parserAccessors1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors1_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: "Foo", - get: function get() { - } + get: function get() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserAccessors1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors1_es5.2.minified.js index 6c39be1c9ca..9a56deea2f5 100644 --- a/crates/swc/tests/tsc-references/parserAccessors1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserAccessors1_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "Foo", - get: function() { - } + get: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserAccessors2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors2_es2015.1.normal.js index 2ec88687f4d..fdfa493f2f7 100644 --- a/crates/swc/tests/tsc-references/parserAccessors2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors2_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - set Foo(a) { - } + set Foo(a) {} } diff --git a/crates/swc/tests/tsc-references/parserAccessors2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors2_es5.1.normal.js index 9a00e2f3315..210799537de 100644 --- a/crates/swc/tests/tsc-references/parserAccessors2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors2_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: "Foo", - set: function set(a) { - } + set: function set(a) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserAccessors2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors2_es5.2.minified.js index 28472ffbc3d..2d39b6d30c3 100644 --- a/crates/swc/tests/tsc-references/parserAccessors2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserAccessors2_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "Foo", - set: function(a) { - } + set: function(a) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserAccessors3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors3_es2015.1.normal.js index 961e4ff2bf4..36f3fbdaf30 100644 --- a/crates/swc/tests/tsc-references/parserAccessors3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors3_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 var v = { - get Foo () { - } + get Foo () {} }; diff --git a/crates/swc/tests/tsc-references/parserAccessors3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors3_es5.1.normal.js index 961e4ff2bf4..36f3fbdaf30 100644 --- a/crates/swc/tests/tsc-references/parserAccessors3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors3_es5.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 var v = { - get Foo () { - } + get Foo () {} }; diff --git a/crates/swc/tests/tsc-references/parserAccessors4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors4_es2015.1.normal.js index 86019c8114b..192aa9810d9 100644 --- a/crates/swc/tests/tsc-references/parserAccessors4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors4_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 var v = { - set Foo (a){ - } + set Foo (a){} }; diff --git a/crates/swc/tests/tsc-references/parserAccessors4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors4_es5.1.normal.js index 86019c8114b..192aa9810d9 100644 --- a/crates/swc/tests/tsc-references/parserAccessors4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAccessors4_es5.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 var v = { - set Foo (a){ - } + set Foo (a){} }; diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es2015.1.normal.js index d1c17706a61..21f2715fd20 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es2015.1.normal.js @@ -1,5 +1,4 @@ function f1() { var a, b, c; - if (a < b || b > c + 1) { - } + if (a < b || b > c + 1) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es5.1.normal.js index d1c17706a61..21f2715fd20 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator1_es5.1.normal.js @@ -1,5 +1,4 @@ function f1() { var a, b, c; - if (a < b || b > c + 1) { - } + if (a < b || b > c + 1) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es2015.1.normal.js index d21064b20f9..48296cbc263 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es2015.1.normal.js @@ -1,5 +1,4 @@ function f() { var a, b, c; - if (a < b && b > c + 1) { - } + if (a < b && b > c + 1) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es5.1.normal.js index d21064b20f9..48296cbc263 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator2_es5.1.normal.js @@ -1,5 +1,4 @@ function f() { var a, b, c; - if (a < b && b > c + 1) { - } + if (a < b && b > c + 1) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es2015.1.normal.js index 39ba66c9ee7..a3cde6eb728 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es2015.1.normal.js @@ -1,5 +1,4 @@ function f() { var a, b, c; - if (a < b && b < c + 1) { - } + if (a < b && b < c + 1) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es5.1.normal.js index 39ba66c9ee7..a3cde6eb728 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator3_es5.1.normal.js @@ -1,5 +1,4 @@ function f() { var a, b, c; - if (a < b && b < c + 1) { - } + if (a < b && b < c + 1) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es2015.1.normal.js index d6d1b53db03..586aed1ab33 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es2015.1.normal.js @@ -1,5 +1,4 @@ function g() { var a, b, c; - if (a(c + 1)) { - } + if (a(c + 1)) {} } diff --git a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es5.1.normal.js index d6d1b53db03..586aed1ab33 100644 --- a/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAmbiguityWithBinaryOperator4_es5.1.normal.js @@ -1,5 +1,4 @@ function g() { var a, b, c; - if (a(c + 1)) { - } + if (a(c + 1)) {} } diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.1.normal.js index d221ae003e5..aba23936f93 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.1.normal.js @@ -1,2 +1 @@ -a = (()=>{ -}, a); +a = (()=>{}, a); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.2.minified.js index d221ae003e5..aba23936f93 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es2015.2.minified.js @@ -1,2 +1 @@ -a = (()=>{ -}, a); +a = (()=>{}, a); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es5.1.normal.js index 56df841c2ce..91637f52497 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4_es5.1.normal.js @@ -1,2 +1 @@ -a = (function() { -}, a); +a = (function() {}, a); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.1.normal.js index 65af20382b0..296c22ce5a4 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.1.normal.js @@ -1,3 +1 @@ -bar(x, ()=>{ -}, ()=>{ -}); +bar(x, ()=>{}, ()=>{}); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.2.minified.js index 65af20382b0..296c22ce5a4 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es2015.2.minified.js @@ -1,3 +1 @@ -bar(x, ()=>{ -}, ()=>{ -}); +bar(x, ()=>{}, ()=>{}); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.1.normal.js index fed9d529b1f..e66946f6d7d 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.1.normal.js @@ -1,3 +1 @@ -bar(x, function() { -}, function() { -}); +bar(x, function() {}, function() {}); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.2.minified.js index fed9d529b1f..e66946f6d7d 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression5_es5.2.minified.js @@ -1,3 +1 @@ -bar(x, function() { -}, function() { -}); +bar(x, function() {}, function() {}); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es2015.1.normal.js index 5d79ca327f1..8db7b1615b1 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es2015.1.normal.js @@ -1,4 +1,3 @@ function foo(q, b) { - return true ? q ? true : false : (b = q.length, function() { - }); + return true ? q ? true : false : (b = q.length, function() {}); } diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es5.1.normal.js index 5d79ca327f1..8db7b1615b1 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression6_es5.1.normal.js @@ -1,4 +1,3 @@ function foo(q, b) { - return true ? q ? true : false : (b = q.length, function() { - }); + return true ? q ? true : false : (b = q.length, function() {}); } diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es2015.1.normal.js index 7b17cf6b3ae..98c47690f40 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es2015.1.normal.js @@ -31,8 +31,7 @@ function _asyncToGenerator(fn) { ({ m () { return _asyncToGenerator(function*() { - for(;;){ - } + for(;;){} })(); } }); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js index 3fd88b8e309..31b18700e2b 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js @@ -35,8 +35,7 @@ function _asyncToGenerator(fn) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - for(;;){ - } + for(;;){} case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/parserAstSpans1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAstSpans1_es2015.1.normal.js index 4ae0293aa6e..171617db569 100644 --- a/crates/swc/tests/tsc-references/parserAstSpans1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAstSpans1_es2015.1.normal.js @@ -1,12 +1,8 @@ class c1 { - i1_f1() { - } - i1_nc_f1() { - } - /** c1_f1*/ f1() { - } - /** c1_nc_f1*/ nc_f1() { - } + i1_f1() {} + i1_nc_f1() {} + /** c1_f1*/ f1() {} + /** c1_nc_f1*/ nc_f1() {} } var i1_i; i1_i.i1_f1(); @@ -37,23 +33,19 @@ i1_i.i1_nc_l1(); i1_i.l1(); i1_i.nc_l1(); class c2 { - /** c2 c2_f1*/ c2_f1() { - } + /** c2 c2_f1*/ c2_f1() {} /** c2 c2_prop*/ get c2_prop() { return 10; } - c2_nc_f1() { - } + c2_nc_f1() {} get c2_nc_prop() { return 10; } - /** c2 f1*/ f1() { - } + /** c2 f1*/ f1() {} /** c2 prop*/ get prop() { return 10; } - nc_f1() { - } + nc_f1() {} get nc_prop() { return 10; } @@ -62,13 +54,11 @@ class c2 { } } class c3 extends c2 { - /** c3 f1*/ f1() { - } + /** c3 f1*/ f1() {} /** c3 prop*/ get prop() { return 10; } - nc_f1() { - } + nc_f1() {} get nc_prop() { return 10; } diff --git a/crates/swc/tests/tsc-references/parserAstSpans1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserAstSpans1_es2015.2.minified.js index e4d1cc66af0..5fea997f9e0 100644 --- a/crates/swc/tests/tsc-references/parserAstSpans1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserAstSpans1_es2015.2.minified.js @@ -1,33 +1,25 @@ i1_i.i1_f1(), i1_i.i1_nc_f1(), i1_i.f1(), i1_i.nc_f1(), i1_i.i1_l1(), i1_i.i1_nc_l1(), i1_i.l1(), i1_i.nc_l1(); var i1_i, i2_i, i3_i, c1_i = new class { - i1_f1() { - } - i1_nc_f1() { - } - f1() { - } - nc_f1() { - } + i1_f1() {} + i1_nc_f1() {} + f1() {} + nc_f1() {} }(); c1_i.i1_f1(), c1_i.i1_nc_f1(), c1_i.f1(), c1_i.nc_f1(), c1_i.i1_l1(), c1_i.i1_nc_l1(), c1_i.l1(), c1_i.nc_l1(), (i1_i = c1_i).i1_f1(), i1_i.i1_nc_f1(), i1_i.f1(), i1_i.nc_f1(), i1_i.i1_l1(), i1_i.i1_nc_l1(), i1_i.l1(), i1_i.nc_l1(); class c2 { - c2_f1() { - } + c2_f1() {} get c2_prop() { return 10; } - c2_nc_f1() { - } + c2_nc_f1() {} get c2_nc_prop() { return 10; } - f1() { - } + f1() {} get prop() { return 10; } - nc_f1() { - } + nc_f1() {} get nc_prop() { return 10; } @@ -36,13 +28,11 @@ class c2 { } } var c2_i = new c2(10), c3_i = new class extends c2 { - f1() { - } + f1() {} get prop() { return 10; } - nc_f1() { - } + nc_f1() {} get nc_prop() { return 10; } diff --git a/crates/swc/tests/tsc-references/parserAstSpans1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAstSpans1_es5.1.normal.js index 5c9b61a9a2c..d290a4b9c7e 100644 --- a/crates/swc/tests/tsc-references/parserAstSpans1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserAstSpans1_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -114,23 +113,19 @@ var c1 = /*#__PURE__*/ function() { _createClass(c1, [ { key: "i1_f1", - value: function i1_f1() { - } + value: function i1_f1() {} }, { key: "i1_nc_f1", - value: function i1_nc_f1() { - } + value: function i1_nc_f1() {} }, { key: "f1", - value: /** c1_f1*/ function f1() { - } + value: /** c1_f1*/ function f1() {} }, { key: "nc_f1", - value: /** c1_nc_f1*/ function nc_f1() { - } + value: /** c1_nc_f1*/ function nc_f1() {} } ]); return c1; @@ -172,8 +167,7 @@ var c2 = /*#__PURE__*/ function() { _createClass(c2, [ { key: "c2_f1", - value: /** c2 c2_f1*/ function c2_f1() { - } + value: /** c2 c2_f1*/ function c2_f1() {} }, { key: "c2_prop", @@ -183,8 +177,7 @@ var c2 = /*#__PURE__*/ function() { }, { key: "c2_nc_f1", - value: function c2_nc_f1() { - } + value: function c2_nc_f1() {} }, { key: "c2_nc_prop", @@ -194,8 +187,7 @@ var c2 = /*#__PURE__*/ function() { }, { key: "f1", - value: /** c2 f1*/ function f1() { - } + value: /** c2 f1*/ function f1() {} }, { key: "prop", @@ -205,8 +197,7 @@ var c2 = /*#__PURE__*/ function() { }, { key: "nc_f1", - value: function nc_f1() { - } + value: function nc_f1() {} }, { key: "nc_prop", @@ -231,8 +222,7 @@ var c3 = /*#__PURE__*/ function(c2) { _createClass(c3, [ { key: "f1", - value: /** c3 f1*/ function f1() { - } + value: /** c3 f1*/ function f1() {} }, { key: "prop", @@ -242,8 +232,7 @@ var c3 = /*#__PURE__*/ function(c2) { }, { key: "nc_f1", - value: function nc_f1() { - } + value: function nc_f1() {} }, { key: "nc_prop", diff --git a/crates/swc/tests/tsc-references/parserAstSpans1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserAstSpans1_es5.2.minified.js index 03559091650..2819c9f086c 100644 --- a/crates/swc/tests/tsc-references/parserAstSpans1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserAstSpans1_es5.2.minified.js @@ -53,8 +53,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -76,23 +75,19 @@ var i1_i, i2_i, i3_i, c1 = function() { return _createClass(c1, [ { key: "i1_f1", - value: function() { - } + value: function() {} }, { key: "i1_nc_f1", - value: function() { - } + value: function() {} }, { key: "f1", - value: function() { - } + value: function() {} }, { key: "nc_f1", - value: function() { - } + value: function() {} } ]), c1; }(); @@ -107,8 +102,7 @@ var c2 = function() { return _createClass(c2, [ { key: "c2_f1", - value: function() { - } + value: function() {} }, { key: "c2_prop", @@ -118,8 +112,7 @@ var c2 = function() { }, { key: "c2_nc_f1", - value: function() { - } + value: function() {} }, { key: "c2_nc_prop", @@ -129,8 +122,7 @@ var c2 = function() { }, { key: "f1", - value: function() { - } + value: function() {} }, { key: "prop", @@ -140,8 +132,7 @@ var c2 = function() { }, { key: "nc_f1", - value: function() { - } + value: function() {} }, { key: "nc_prop", @@ -161,8 +152,7 @@ var c2 = function() { return _createClass(c3, [ { key: "f1", - value: function() { - } + value: function() {} }, { key: "prop", @@ -172,8 +162,7 @@ var c2 = function() { }, { key: "nc_f1", - value: function() { - } + value: function() {} }, { key: "nc_prop", diff --git a/crates/swc/tests/tsc-references/parserClass1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClass1_es2015.1.normal.js index 1a2b50ffefb..8a0ee4ce9ca 100644 --- a/crates/swc/tests/tsc-references/parserClass1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClass1_es2015.1.normal.js @@ -14,6 +14,5 @@ export class NullLogger { fatal() { return false; } - log(s) { - } + log(s) {} } diff --git a/crates/swc/tests/tsc-references/parserClass1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserClass1_es2015.2.minified.js index 9f02985f697..528458eed3b 100644 --- a/crates/swc/tests/tsc-references/parserClass1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClass1_es2015.2.minified.js @@ -14,6 +14,5 @@ export class NullLogger { fatal() { return !1; } - log(s) { - } + log(s) {} } diff --git a/crates/swc/tests/tsc-references/parserClass1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClass1_es5.1.normal.js index f6c8dfa3d23..bd29e7c77ef 100644 --- a/crates/swc/tests/tsc-references/parserClass1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClass1_es5.1.normal.js @@ -55,8 +55,7 @@ export var NullLogger = /*#__PURE__*/ function() { }, { key: "log", - value: function log(s) { - } + value: function log(s) {} } ]); return NullLogger; diff --git a/crates/swc/tests/tsc-references/parserClass1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClass1_es5.2.minified.js index 7d65fabadc6..1201dc5ac55 100644 --- a/crates/swc/tests/tsc-references/parserClass1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClass1_es5.2.minified.js @@ -45,8 +45,7 @@ export var NullLogger = function() { }, { key: "log", - value: function(s) { - } + value: function(s) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), NullLogger; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration11_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration11_es2015.1.normal.js index 053fb02a050..38e296ba7b3 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration11_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - foo() { - } + foo() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.1.normal.js index d0e0534f98f..bc3b35ea165 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.2.minified.js index 1bdb0f736e4..e864ac919ae 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration11_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration12_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration12_es2015.1.normal.js index e86cd920f41..b1caedcd641 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration12_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - constructor(a){ - } + constructor(a){} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration13_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration13_es2015.1.normal.js index 65943e675da..55d1bc48f3e 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration13_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - bar() { - } + bar() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.1.normal.js index 9e2a602b22d..8fdf698423a 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "bar", - value: function bar() { - } + value: function bar() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.2.minified.js index d41b8eac805..4d7690b36de 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration13_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "bar", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration15_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration15_es2015.1.normal.js index e403fc5ee29..e54e9a0ede4 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration15_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration15_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration16_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration16_es2015.1.normal.js index 053fb02a050..38e296ba7b3 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration16_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration16_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - foo() { - } + foo() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.1.normal.js index d0e0534f98f..bc3b35ea165 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.2.minified.js index 1bdb0f736e4..e864ac919ae 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration16_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration19_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration19_es2015.1.normal.js index 2e54732e6f5..be05881b4cb 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration19_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration19_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - "foo"() { - } + "foo"() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.1.normal.js index d0e0534f98f..bc3b35ea165 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.2.minified.js index 1bdb0f736e4..e864ac919ae 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration19_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration20_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration20_es2015.1.normal.js index 1014a66bbbc..5a9f3ba2b09 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration20_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration20_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - "0"() { - } + "0"() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.1.normal.js index 06e123035e8..75ea0c5214f 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "0", - value: function 0() { - } + value: function 0() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.2.minified.js index d763bafb4e6..1ce25e2565d 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration20_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "0", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration21_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration21_es2015.1.normal.js index 0342faa4f02..f4784b27f93 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration21_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration21_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - 1() { - } + 1() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.1.normal.js index 3f1fe552a6b..c35e4ba741d 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: 1, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.2.minified.js index 5485e983df0..f921f0a5f1c 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration21_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: 1, - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration22_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration22_es2015.1.normal.js index 6d7fec5a808..f8a8872488c 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration22_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration22_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - "bar"() { - } + "bar"() {} } diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.1.normal.js index 9e2a602b22d..8fdf698423a 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "bar", - value: function bar() { - } + value: function bar() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.2.minified.js index d41b8eac805..4d7690b36de 100644 --- a/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserClassDeclaration22_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "bar", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.1.normal.js index a1e2182f06c..6fe929951cd 100644 --- a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.1.normal.js @@ -1,4 +1,3 @@ var s = $.extend({ workItem: this._workItem -}, { -}); +}, {}); diff --git a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.2.minified.js index ca0f780ddfb..66b8844215c 100644 --- a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es2015.2.minified.js @@ -1,4 +1,3 @@ $.extend({ workItem: this._workItem -}, { -}); +}, {}); diff --git a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.1.normal.js index a1e2182f06c..6fe929951cd 100644 --- a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.1.normal.js @@ -1,4 +1,3 @@ var s = $.extend({ workItem: this._workItem -}, { -}); +}, {}); diff --git a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.2.minified.js index ca0f780ddfb..66b8844215c 100644 --- a/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserCommaInTypeMemberList2_es5.2.minified.js @@ -1,4 +1,3 @@ $.extend({ workItem: this._workItem -}, { -}); +}, {}); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName12_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName12_es2015.1.normal.js index b574b2997f1..87da98ae9ef 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName12_es2015.1.normal.js @@ -1,6 +1,5 @@ var tmp = e; //@target: ES6 class C { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.1.normal.js index cb02537ac67..b6ffb39bbf8 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.1.normal.js @@ -27,8 +27,7 @@ var C = //@target: ES6 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.2.minified.js index aae001dffd6..755ca24ac47 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName12_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = e, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName17_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName17_es2015.1.normal.js index d198331bdbb..c1b74afc490 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName17_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName17_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES6 var v1 = { - set [e] (v){ - } + set [e] (v){} }; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.1.normal.js index ef9baed1348..b3ca52f1ecc 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.1.normal.js @@ -17,10 +17,6 @@ function _defineEnumerableProperties(obj, descs) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES6 -var v = (_obj = { -}, _mutatorMap[e] = _mutatorMap[e] || { -}, _mutatorMap[e].set = function(v) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +var v = (_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].set = function(v) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.2.minified.js index 4ee32df8b75..63a6129a8f0 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName17_es5.2.minified.js @@ -1,9 +1,5 @@ -var _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[e] = _mutatorMap[e] || { -}, _mutatorMap[e].set = function(v) { -}, (function(obj, descs) { +var _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].set = function(v) {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName24_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName24_es2015.1.normal.js index 27ef4327f04..864545c787c 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName24_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName24_es2015.1.normal.js @@ -1,6 +1,5 @@ var tmp = e; //@target: ES6 class C { - set [tmp](v) { - } + set [tmp](v) {} } diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.1.normal.js index a44f4b46a3d..58b28c2a16c 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.1.normal.js @@ -27,8 +27,7 @@ var C = //@target: ES6 _createClass(C, [ { key: tmp, - set: function set(v) { - } + set: function set(v) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.2.minified.js index a5e2a37bbe5..93bd5c8a0d0 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName24_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = e, C = function() { return Constructor = C, protoProps = [ { key: tmp, - set: function(v) { - } + set: function(v) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.1.normal.js index 44da56f4e23..c1f62b2cbcf 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } //@target: ES6 -var v = _defineProperty({ -}, e, 1); +var v = _defineProperty({}, e, 1); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.2.minified.js index 1af3b0e89f8..b8874069172 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName2_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = e) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = e) in obj ? Object.defineProperty(obj, key, { value: 1, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName3_es2015.1.normal.js index 63613bd528d..994770450ed 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName3_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES6 var v = { - [e] () { - } + [e] () {} }; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.1.normal.js index 0eb9618c0ab..a5278f08d25 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.1.normal.js @@ -12,6 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } //@target: ES6 -var v = _defineProperty({ -}, e, function() { -}); +var v = _defineProperty({}, e, function() {}); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.2.minified.js index e8b54c0367f..def2d190b6c 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName3_es5.2.minified.js @@ -5,6 +5,4 @@ configurable: !0, writable: !0 }) : obj[key] = value, obj; -}({ -}, e, function() { -}); +}({}, e, function() {}); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName40_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName40_es2015.1.normal.js index 4bf01550e79..fa2bc4d377e 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName40_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName40_es2015.1.normal.js @@ -1,6 +1,5 @@ var tmp = a ? "" : ""; //@target: ES6 class C { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.1.normal.js index d47232cbfe9..a5d52ec19b3 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.1.normal.js @@ -27,8 +27,7 @@ var C = //@target: ES6 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.2.minified.js index 21bfec9c15e..19b42045434 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName40_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.1.normal.js index f956a8f67b4..c50549b9533 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } //@target: ES6 -var v = _defineProperty({ -}, 0 in [], true); +var v = _defineProperty({}, 0 in [], true); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.2.minified.js index 2fd67389ae6..77150f01e1c 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName41_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key, value; -value = !0, (key = 0 in []) in (obj = { -}) ? Object.defineProperty(obj, key, { +value = !0, (key = 0 in []) in (obj = {}) ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName4_es2015.1.normal.js index 73cf1756f79..99504b3e9cd 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName4_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES6 var v = { - get [e] () { - } + get [e] () {} }; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.1.normal.js index 0afadb71eff..bc5a1aa586d 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.1.normal.js @@ -17,10 +17,6 @@ function _defineEnumerableProperties(obj, descs) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES6 -var v = (_obj = { -}, _mutatorMap[e] = _mutatorMap[e] || { -}, _mutatorMap[e].get = function() { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +var v = (_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].get = function() {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.2.minified.js index 636a13b0862..8439555af2b 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName4_es5.2.minified.js @@ -1,9 +1,5 @@ -var _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[e] = _mutatorMap[e] || { -}, _mutatorMap[e].get = function() { -}, (function(obj, descs) { +var _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].get = function() {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.1.normal.js index 5cca93674f6..05e65fea94e 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.1.normal.js @@ -13,5 +13,4 @@ function _defineProperty(obj, key, value) { } var _obj; //@target: ES6 -var v = (_obj = { -}, _defineProperty(_obj, e, 1), _defineProperty(_obj, e + e, 2), _obj); +var v = (_obj = {}, _defineProperty(_obj, e, 1), _defineProperty(_obj, e + e, 2), _obj); diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.2.minified.js index f70cbf15dcd..f5558badd90 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName6_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, e, 1), _defineProperty(_obj, e + e, 2); +_defineProperty(_obj = {}, e, 1), _defineProperty(_obj, e + e, 2); diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration1_es2015.1.normal.js index e403fc5ee29..e54e9a0ede4 100644 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserConstructorDeclaration1_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration5_es2015.1.normal.js index e403fc5ee29..e54e9a0ede4 100644 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserConstructorDeclaration5_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - constructor(){ - } + constructor(){} } diff --git a/crates/swc/tests/tsc-references/parserDoStatement2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserDoStatement2_es2015.1.normal.js index 7d3d83657f5..2091a0fd109 100644 --- a/crates/swc/tests/tsc-references/parserDoStatement2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserDoStatement2_es2015.1.normal.js @@ -1,3 +1,2 @@ -do { -}while (false) +do {}while (false) false; diff --git a/crates/swc/tests/tsc-references/parserDoStatement2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserDoStatement2_es5.1.normal.js index 7d3d83657f5..2091a0fd109 100644 --- a/crates/swc/tests/tsc-references/parserDoStatement2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserDoStatement2_es5.1.normal.js @@ -1,3 +1,2 @@ -do { -}while (false) +do {}while (false) false; diff --git a/crates/swc/tests/tsc-references/parserES3Accessors1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors1_es2015.1.normal.js index e7b537b9880..7500a4da860 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors1_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - get Foo() { - } + get Foo() {} } diff --git a/crates/swc/tests/tsc-references/parserES3Accessors1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors1_es5.1.normal.js index be1817f6933..f67de7a3cb8 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors1_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "Foo", - get: function get() { - } + get: function get() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserES3Accessors1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES3Accessors1_es5.2.minified.js index 6c39be1c9ca..9a56deea2f5 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors1_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "Foo", - get: function() { - } + get: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserES3Accessors2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors2_es2015.1.normal.js index d2ea7013aa3..38b099439bb 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors2_es2015.1.normal.js @@ -1,4 +1,3 @@ class C { - set Foo(a) { - } + set Foo(a) {} } diff --git a/crates/swc/tests/tsc-references/parserES3Accessors2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors2_es5.1.normal.js index 504c9834455..d89d74ba81a 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors2_es5.1.normal.js @@ -25,8 +25,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "Foo", - set: function set(a) { - } + set: function set(a) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserES3Accessors2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES3Accessors2_es5.2.minified.js index 28472ffbc3d..2d39b6d30c3 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors2_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "Foo", - set: function(a) { - } + set: function(a) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserES3Accessors3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors3_es2015.1.normal.js index a279204e618..ba7c3728ba3 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors3_es2015.1.normal.js @@ -1,4 +1,3 @@ var v = { - get Foo () { - } + get Foo () {} }; diff --git a/crates/swc/tests/tsc-references/parserES3Accessors3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors3_es5.1.normal.js index a279204e618..ba7c3728ba3 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors3_es5.1.normal.js @@ -1,4 +1,3 @@ var v = { - get Foo () { - } + get Foo () {} }; diff --git a/crates/swc/tests/tsc-references/parserES3Accessors4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors4_es2015.1.normal.js index 3c7f4c31bef..281a5014805 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors4_es2015.1.normal.js @@ -1,4 +1,3 @@ var v = { - set Foo (a){ - } + set Foo (a){} }; diff --git a/crates/swc/tests/tsc-references/parserES3Accessors4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES3Accessors4_es5.1.normal.js index 3c7f4c31bef..281a5014805 100644 --- a/crates/swc/tests/tsc-references/parserES3Accessors4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES3Accessors4_es5.1.normal.js @@ -1,4 +1,3 @@ var v = { - set Foo (a){ - } + set Foo (a){} }; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.1.normal.js index 6d2998646f4..74030dbac01 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } //@target: ES5 -var v = _defineProperty({ -}, e, 1); +var v = _defineProperty({}, e, 1); diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.2.minified.js index 1af3b0e89f8..b8874069172 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName2_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = e) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = e) in obj ? Object.defineProperty(obj, key, { value: 1, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es2015.1.normal.js index b7c2bb2d552..f7877e8eb51 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES5 var v = { - [e] () { - } + [e] () {} }; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.1.normal.js index a400e69224e..d247ae8c873 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.1.normal.js @@ -12,6 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } //@target: ES5 -var v = _defineProperty({ -}, e, function() { -}); +var v = _defineProperty({}, e, function() {}); diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.2.minified.js index e8b54c0367f..def2d190b6c 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName3_es5.2.minified.js @@ -5,6 +5,4 @@ configurable: !0, writable: !0 }) : obj[key] = value, obj; -}({ -}, e, function() { -}); +}({}, e, function() {}); diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es2015.1.normal.js index 9e0c64dcc1d..71c16ba4700 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es2015.1.normal.js @@ -1,5 +1,4 @@ //@target: ES5 var v = { - get [e] () { - } + get [e] () {} }; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.1.normal.js index d5d8a06f104..a12770856f6 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.1.normal.js @@ -17,10 +17,6 @@ function _defineEnumerableProperties(obj, descs) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES5 -var v = (_obj = { -}, _mutatorMap[e] = _mutatorMap[e] || { -}, _mutatorMap[e].get = function() { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +var v = (_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].get = function() {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.2.minified.js index 636a13b0862..8439555af2b 100644 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName4_es5.2.minified.js @@ -1,9 +1,5 @@ -var _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[e] = _mutatorMap[e] || { -}, _mutatorMap[e].get = function() { -}, (function(obj, descs) { +var _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].get = function() {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement10_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement10_es2015.1.normal.js index 43bc629fe76..62a96e52b1d 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement10_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (const v of X){ -} +for (const v of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement11_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement11_es2015.1.normal.js index 6c053afdabf..cd0a87afeaf 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement11_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (const [a, b] of X){ -} +for (const [a, b] of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement12_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement12_es2015.1.normal.js index 30d99d2c241..6bb9db7d1bc 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement12_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (const { a , b } of X){ -} +for (const { a , b } of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement13_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement13_es2015.1.normal.js index 93f1bb4e4e8..2b5ef4f1f23 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement13_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (let { a , b } of X){ -} +for (let { a , b } of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement14_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement14_es2015.1.normal.js index f82718148af..7c8fdae4804 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement14_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (let [a, b] of X){ -} +for (let [a, b] of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement15_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement15_es2015.1.normal.js index 1a358deaf68..225319912b0 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement15_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement15_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (var [a, b] of X){ -} +for (var [a, b] of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement16_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement16_es2015.1.normal.js index e0093bfb94f..cadee4a28fa 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement16_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement16_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (var { a , b } of X){ -} +for (var { a , b } of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es2015.1.normal.js index c05228e3725..e27e57ee61e 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for(var of;;){ -} +for(var of;;){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es5.1.normal.js index c05228e3725..e27e57ee61e 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement17_es5.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for(var of;;){ -} +for(var of;;){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement18_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement18_es2015.1.normal.js index 31b894add8b..fa65f3f132b 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement18_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement18_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (var of of of){ -} +for (var of of of){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es2015.1.normal.js index bc30e8beb99..1989b18afdd 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for(var of in of){ -} +for(var of in of){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es5.1.normal.js index bc30e8beb99..1989b18afdd 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement19_es5.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for(var of in of){ -} +for(var of in of){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement8_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement8_es2015.1.normal.js index a630799520f..c463a424bcf 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement8_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (var v of X){ -} +for (var v of X){} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement9_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement9_es2015.1.normal.js index cd5e3aa597b..1fdf70b98d4 100644 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement9_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES5 -for (let v of X){ -} +for (let v of X){} diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es2015.1.normal.js index cca78476ad8..f0cfaa521fe 100644 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es2015.1.normal.js @@ -1,6 +1,5 @@ var tmp = Symbol.toStringTag; //@target: ES5 class C { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.1.normal.js index f1ed76e3e77..f4c3e18f10e 100644 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.1.normal.js @@ -27,8 +27,7 @@ var C = //@target: ES5 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.2.minified.js index 1d320aa2367..9c7a53e2e48 100644 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserES5SymbolProperty7_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = Symbol.toStringTag, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserEnum1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnum1_es2015.1.normal.js index 402ed63ac7a..0b543f2e997 100644 --- a/crates/swc/tests/tsc-references/parserEnum1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum1_es2015.1.normal.js @@ -4,5 +4,4 @@ export var SignatureFlags; SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; SignatureFlags[SignatureFlags["IsStringIndexer"] = 2] = "IsStringIndexer"; SignatureFlags[SignatureFlags["IsNumberIndexer"] = 4] = "IsNumberIndexer"; -})(SignatureFlags || (SignatureFlags = { -})); +})(SignatureFlags || (SignatureFlags = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnum1_es2015.2.minified.js index 7fdb7ee7645..8f3ee507938 100644 --- a/crates/swc/tests/tsc-references/parserEnum1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnum1_es2015.2.minified.js @@ -1,3 +1,2 @@ var SignatureFlags, SignatureFlags; -(SignatureFlags = SignatureFlags || (SignatureFlags = { -}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; +(SignatureFlags = SignatureFlags || (SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; diff --git a/crates/swc/tests/tsc-references/parserEnum1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnum1_es5.1.normal.js index 402ed63ac7a..0b543f2e997 100644 --- a/crates/swc/tests/tsc-references/parserEnum1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum1_es5.1.normal.js @@ -4,5 +4,4 @@ export var SignatureFlags; SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; SignatureFlags[SignatureFlags["IsStringIndexer"] = 2] = "IsStringIndexer"; SignatureFlags[SignatureFlags["IsNumberIndexer"] = 4] = "IsNumberIndexer"; -})(SignatureFlags || (SignatureFlags = { -})); +})(SignatureFlags || (SignatureFlags = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnum1_es5.2.minified.js index 7fdb7ee7645..8f3ee507938 100644 --- a/crates/swc/tests/tsc-references/parserEnum1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnum1_es5.2.minified.js @@ -1,3 +1,2 @@ var SignatureFlags, SignatureFlags; -(SignatureFlags = SignatureFlags || (SignatureFlags = { -}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; +(SignatureFlags = SignatureFlags || (SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; diff --git a/crates/swc/tests/tsc-references/parserEnum2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnum2_es2015.1.normal.js index 402ed63ac7a..0b543f2e997 100644 --- a/crates/swc/tests/tsc-references/parserEnum2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum2_es2015.1.normal.js @@ -4,5 +4,4 @@ export var SignatureFlags; SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; SignatureFlags[SignatureFlags["IsStringIndexer"] = 2] = "IsStringIndexer"; SignatureFlags[SignatureFlags["IsNumberIndexer"] = 4] = "IsNumberIndexer"; -})(SignatureFlags || (SignatureFlags = { -})); +})(SignatureFlags || (SignatureFlags = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnum2_es2015.2.minified.js index 7fdb7ee7645..8f3ee507938 100644 --- a/crates/swc/tests/tsc-references/parserEnum2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnum2_es2015.2.minified.js @@ -1,3 +1,2 @@ var SignatureFlags, SignatureFlags; -(SignatureFlags = SignatureFlags || (SignatureFlags = { -}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; +(SignatureFlags = SignatureFlags || (SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; diff --git a/crates/swc/tests/tsc-references/parserEnum2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnum2_es5.1.normal.js index 402ed63ac7a..0b543f2e997 100644 --- a/crates/swc/tests/tsc-references/parserEnum2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum2_es5.1.normal.js @@ -4,5 +4,4 @@ export var SignatureFlags; SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; SignatureFlags[SignatureFlags["IsStringIndexer"] = 2] = "IsStringIndexer"; SignatureFlags[SignatureFlags["IsNumberIndexer"] = 4] = "IsNumberIndexer"; -})(SignatureFlags || (SignatureFlags = { -})); +})(SignatureFlags || (SignatureFlags = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnum2_es5.2.minified.js index 7fdb7ee7645..8f3ee507938 100644 --- a/crates/swc/tests/tsc-references/parserEnum2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnum2_es5.2.minified.js @@ -1,3 +1,2 @@ var SignatureFlags, SignatureFlags; -(SignatureFlags = SignatureFlags || (SignatureFlags = { -}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; +(SignatureFlags = SignatureFlags || (SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer"; diff --git a/crates/swc/tests/tsc-references/parserEnum3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnum3_es2015.1.normal.js index 3029a13a002..418cf9904e0 100644 --- a/crates/swc/tests/tsc-references/parserEnum3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum3_es2015.1.normal.js @@ -1,4 +1,2 @@ export var SignatureFlags; -(function(SignatureFlags) { -})(SignatureFlags || (SignatureFlags = { -})); +(function(SignatureFlags) {})(SignatureFlags || (SignatureFlags = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnum3_es5.1.normal.js index 3029a13a002..418cf9904e0 100644 --- a/crates/swc/tests/tsc-references/parserEnum3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum3_es5.1.normal.js @@ -1,4 +1,2 @@ export var SignatureFlags; -(function(SignatureFlags) { -})(SignatureFlags || (SignatureFlags = { -})); +(function(SignatureFlags) {})(SignatureFlags || (SignatureFlags = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnum6_es2015.1.normal.js index 857c3340038..215824cae8e 100644 --- a/crates/swc/tests/tsc-references/parserEnum6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum6_es2015.1.normal.js @@ -3,5 +3,4 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum6_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnum6_es2015.2.minified.js index bc1aac8379a..0a57c67acc3 100644 --- a/crates/swc/tests/tsc-references/parserEnum6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnum6_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; diff --git a/crates/swc/tests/tsc-references/parserEnum6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnum6_es5.1.normal.js index 857c3340038..215824cae8e 100644 --- a/crates/swc/tests/tsc-references/parserEnum6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnum6_es5.1.normal.js @@ -3,5 +3,4 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnum6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnum6_es5.2.minified.js index bc1aac8379a..0a57c67acc3 100644 --- a/crates/swc/tests/tsc-references/parserEnum6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnum6_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.1.normal.js index 59b2ce1ca0a..d93aaf1c8f6 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.1.normal.js @@ -2,5 +2,4 @@ var E; (function(E) { E[E["Foo"] = 1] = "Foo"; E[E["Bar"] = 2] = "Bar"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.2.minified.js index 665d2e372e0..3f831609d33 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.Foo = 1] = "Foo", E[E.Bar = 2] = "Bar"; +(E = E || (E = {}))[E.Foo = 1] = "Foo", E[E.Bar = 2] = "Bar"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.1.normal.js index 59b2ce1ca0a..d93aaf1c8f6 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.1.normal.js @@ -2,5 +2,4 @@ var E; (function(E) { E[E["Foo"] = 1] = "Foo"; E[E["Bar"] = 2] = "Bar"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.2.minified.js index 665d2e372e0..3f831609d33 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration1_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.Foo = 1] = "Foo", E[E.Bar = 2] = "Bar"; +(E = E || (E = {}))[E.Foo = 1] = "Foo", E[E.Bar = 2] = "Bar"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es2015.1.normal.js index b16ccd6caf3..de99cb7b8c5 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es2015.1.normal.js @@ -1,4 +1,2 @@ var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es5.1.normal.js index b16ccd6caf3..de99cb7b8c5 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration2.d_es5.1.normal.js @@ -1,4 +1,2 @@ var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.1.normal.js index ffae698b70b..ed2408965ac 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.1.normal.js @@ -1,5 +1,4 @@ var E; (function(E) { E[E["A"] = 1] = "A"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.2.minified.js index 6004f0a16a1..d9a0be6e08a 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 1] = "A"; +(E = E || (E = {}))[E.A = 1] = "A"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.1.normal.js index ffae698b70b..ed2408965ac 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.1.normal.js @@ -1,5 +1,4 @@ var E; (function(E) { E[E["A"] = 1] = "A"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.2.minified.js index 6004f0a16a1..d9a0be6e08a 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration3_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 1] = "A"; +(E = E || (E = {}))[E.A = 1] = "A"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.1.normal.js index 1891926cb24..4d7d207921c 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.1.normal.js @@ -4,5 +4,4 @@ var E; E[E["B"] = 2] = "B"; E[E["C"] = 2] = "C"; E[E["D"] = 3] = "D"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.2.minified.js index 10cd5d20bdd..80fe57ca317 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; +(E = E || (E = {}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.1.normal.js index 1891926cb24..4d7d207921c 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.1.normal.js @@ -4,5 +4,4 @@ var E; E[E["B"] = 2] = "B"; E[E["C"] = 2] = "C"; E[E["D"] = 3] = "D"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.2.minified.js index 10cd5d20bdd..80fe57ca317 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration5_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; +(E = E || (E = {}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.1.normal.js index 1891926cb24..4d7d207921c 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.1.normal.js @@ -4,5 +4,4 @@ var E; E[E["B"] = 2] = "B"; E[E["C"] = 2] = "C"; E[E["D"] = 3] = "D"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.2.minified.js index 10cd5d20bdd..80fe57ca317 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; +(E = E || (E = {}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.1.normal.js index 1891926cb24..4d7d207921c 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.1.normal.js @@ -4,5 +4,4 @@ var E; E[E["B"] = 2] = "B"; E[E["C"] = 2] = "C"; E[E["D"] = 3] = "D"; -})(E || (E = { -})); +})(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.2.minified.js index 10cd5d20bdd..80fe57ca317 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserEnumDeclaration6_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; +(E = E || (E = {}))[E.A = 1] = "A", E[E.B = 2] = "B", E[E.C = 2] = "C", E[E.D = 3] = "D"; diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.1.normal.js index 4d72d9c1b68..b84ced025e0 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.1.normal.js @@ -14,8 +14,7 @@ var Shapes; } Shapes1.Point = Point; Point.origin = new Point(0, 0); -})(Shapes || (Shapes = { -})); +})(Shapes || (Shapes = {})); // Local variables var p = new Shapes.Point(3, 4); var dist = p.getDist(); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.2.minified.js index 5f2d7845249..200f90fafdc 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es2015.2.minified.js @@ -9,5 +9,4 @@ var Shapes; } } Shapes1.Point = Point, Point.origin = new Point(0, 0); -}(Shapes || (Shapes = { -})), new Shapes.Point(3, 4).getDist(); +}(Shapes || (Shapes = {})), new Shapes.Point(3, 4).getDist(); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.1.normal.js index 9435f023800..fde92414f56 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.1.normal.js @@ -40,8 +40,7 @@ var Shapes; }(); Shapes1.Point = Point; Point.origin = new Point(0, 0); -})(Shapes || (Shapes = { -})); +})(Shapes || (Shapes = {})); // Local variables var p = new Shapes.Point(3, 4); var dist = p.getDist(); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.2.minified.js index 7590c778e14..74214f6888a 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable1_es5.2.minified.js @@ -24,5 +24,4 @@ function _defineProperties(target, props) { ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Point; }(); Shapes1.Point = Point, Point.origin = new Point(0, 0); -}(Shapes || (Shapes = { -})), new Shapes.Point(3, 4).getDist(); +}(Shapes || (Shapes = {})), new Shapes.Point(3, 4).getDist(); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es2015.1.normal.js index f83c3a64e96..5d57e2fd049 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es2015.1.normal.js @@ -1,4 +1,3 @@ class Foo { - banana(x) { - } + banana(x) {} } diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.1.normal.js index 342ef25d602..062e353c36f 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.1.normal.js @@ -25,8 +25,7 @@ var Foo = /*#__PURE__*/ function() { _createClass(Foo, [ { key: "banana", - value: function banana(x) { - } + value: function banana(x) {} } ]); return Foo; diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.2.minified.js index 8763fe090cd..79626e9ce16 100644 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserErrorRecovery_ParameterList6_es5.2.minified.js @@ -15,8 +15,7 @@ var Foo = function() { return Constructor = Foo, protoProps = [ { key: "banana", - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Foo; }(); diff --git a/crates/swc/tests/tsc-references/parserForOfStatement10_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement10_es2015.1.normal.js index 9e12715ce6f..98f0a3e3820 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement10_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (const v of X){ -} +for (const v of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement11_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement11_es2015.1.normal.js index 598be55a227..ddde6d417ee 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement11_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (const [a, b] of X){ -} +for (const [a, b] of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement12_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement12_es2015.1.normal.js index e54d010276f..21614f65d03 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement12_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (const { a , b } of X){ -} +for (const { a , b } of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement13_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement13_es2015.1.normal.js index 7c71caf183e..10692aef0b6 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement13_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (let { a , b } of X){ -} +for (let { a , b } of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement14_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement14_es2015.1.normal.js index 78496f9d296..0791275405e 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement14_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (let [a, b] of X){ -} +for (let [a, b] of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement15_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement15_es2015.1.normal.js index 464b4250a72..c20467e348a 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement15_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement15_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (var [a, b] of X){ -} +for (var [a, b] of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement16_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement16_es2015.1.normal.js index ddf9c0bdb78..6eaf77970e1 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement16_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement16_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (var { a , b } of X){ -} +for (var { a , b } of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement17_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement17_es2015.1.normal.js index fb887338233..7c9bc17f422 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement17_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement17_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for(var of;;){ -} +for(var of;;){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement17_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement17_es5.1.normal.js index fb887338233..7c9bc17f422 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement17_es5.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for(var of;;){ -} +for(var of;;){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement18_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement18_es2015.1.normal.js index f570ea4eba5..dc73d763a3b 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement18_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement18_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (var of of of){ -} +for (var of of of){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement19_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement19_es2015.1.normal.js index 2df8f1b9a44..a594fc74846 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement19_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement19_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for(var of in of){ -} +for(var of in of){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement19_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement19_es5.1.normal.js index 2df8f1b9a44..a594fc74846 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement19_es5.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for(var of in of){ -} +for(var of in of){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement8_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement8_es2015.1.normal.js index 094d247fa4c..d15bad06be6 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement8_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (var v of X){ -} +for (var v of X){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement9_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement9_es2015.1.normal.js index 00186206651..8abfc92bb11 100644 --- a/crates/swc/tests/tsc-references/parserForOfStatement9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForOfStatement9_es2015.1.normal.js @@ -1,3 +1,2 @@ //@target: ES6 -for (let v of X){ -} +for (let v of X){} diff --git a/crates/swc/tests/tsc-references/parserForStatement2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement2_es2015.1.normal.js index 89babd4d71e..892a833d2dc 100644 --- a/crates/swc/tests/tsc-references/parserForStatement2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForStatement2_es2015.1.normal.js @@ -1,5 +1,4 @@ var a; var b = []; var c; -for(a in b[c] = b[c] || [], d){ -} +for(a in b[c] = b[c] || [], d){} diff --git a/crates/swc/tests/tsc-references/parserForStatement2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement2_es5.1.normal.js index 89babd4d71e..892a833d2dc 100644 --- a/crates/swc/tests/tsc-references/parserForStatement2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForStatement2_es5.1.normal.js @@ -1,5 +1,4 @@ var a; var b = []; var c; -for(a in b[c] = b[c] || [], d){ -} +for(a in b[c] = b[c] || [], d){} diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es2015.1.normal.js index a1e0907cf54..585b645dca6 100644 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es2015.1.normal.js @@ -1,2 +1 @@ -function bar() { -} +function bar() {} diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es5.1.normal.js index a1e0907cf54..585b645dca6 100644 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionDeclaration4_es5.1.normal.js @@ -1,2 +1 @@ -function bar() { -} +function bar() {} diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es2015.1.normal.js index 6940729e9eb..b0400ee9b26 100644 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es2015.1.normal.js @@ -1,2 +1 @@ -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es5.1.normal.js index 6940729e9eb..b0400ee9b26 100644 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionDeclaration5_es5.1.normal.js @@ -1,2 +1 @@ -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es2015.1.normal.js index 4681c747026..9581aca490e 100644 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es2015.1.normal.js @@ -1,4 +1,3 @@ { - function bar() { - } + function bar() {} } diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es5.1.normal.js index aa0d705e88d..c7d64caeb18 100644 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionDeclaration6_es5.1.normal.js @@ -1,4 +1,3 @@ { - var bar = function bar() { - }; + var bar = function bar() {}; } diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es2015.1.normal.js index 0005735f49e..c736fb9350f 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es2015.1.normal.js @@ -1,4 +1,3 @@ var v = { - foo () { - } + foo () {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es5.1.normal.js index c77f08ecc28..d091e5e3aa1 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment1_es5.1.normal.js @@ -1,4 +1,3 @@ var v = { - foo: function foo() { - } + foo: function foo() {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es2015.1.normal.js index 29d05fdbdd7..4381ef28f0c 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es2015.1.normal.js @@ -1,4 +1,3 @@ var v = { - 0 () { - } + 0 () {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es5.1.normal.js index 8f9f8a04b04..d6731d11c3c 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment2_es5.1.normal.js @@ -1,4 +1,3 @@ var v = { - 0: function() { - } + 0: function() {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es2015.1.normal.js index 59760b435d6..3523fb014be 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es2015.1.normal.js @@ -1,4 +1,3 @@ var v = { - "foo" () { - } + "foo" () {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es5.1.normal.js index 33cb3691638..12d784db3c5 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment3_es5.1.normal.js @@ -1,4 +1,3 @@ var v = { - "foo": function() { - } + "foo": function() {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es2015.1.normal.js index 29d05fdbdd7..4381ef28f0c 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es2015.1.normal.js @@ -1,4 +1,3 @@ var v = { - 0 () { - } + 0 () {} }; diff --git a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es5.1.normal.js index 8f9f8a04b04..d6731d11c3c 100644 --- a/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserFunctionPropertyAssignment4_es5.1.normal.js @@ -1,4 +1,3 @@ var v = { - 0: function() { - } + 0: function() {} }; diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es2015.1.normal.js index 958a35e9a91..1e802d395e0 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es2015.1.normal.js @@ -5,7 +5,5 @@ var v2 = null; var v3; var v3; var v6; -function f1(a) { -} -function f2() { -} +function f1(a) {} +function f2() {} diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.1.normal.js index 1d623ca058f..3d8e1a957cd 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -84,7 +83,5 @@ var v2 = null; var v3; var v3; var v6; -function f1(a) { -} -function f2() { -} +function f1(a) {} +function f2() {} diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.2.minified.js index e0259d45350..17f853b77b0 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function(A) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es2015.1.normal.js index 5ef5907172b..22c554830ae 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es2015.1.normal.js @@ -5,7 +5,5 @@ var v2 = null; var v3; var v4; var v6; -function f1(a) { -} -function f2() { -} +function f1(a) {} +function f2() {} diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.1.normal.js index e1dd4fa3473..f9a2aa82e90 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -84,7 +83,5 @@ var v2 = null; var v3; var v4; var v6; -function f1(a) { -} -function f2() { -} +function f1(a) {} +function f2() {} diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.2.minified.js index e0259d45350..17f853b77b0 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function(A) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/parserIfStatement2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserIfStatement2_es2015.1.normal.js index 1e58192f68c..9b22a0a9f26 100644 --- a/crates/swc/tests/tsc-references/parserIfStatement2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserIfStatement2_es2015.1.normal.js @@ -1,2 +1 @@ -if (a) { -} +if (a) {} diff --git a/crates/swc/tests/tsc-references/parserIfStatement2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserIfStatement2_es5.1.normal.js index 1e58192f68c..9b22a0a9f26 100644 --- a/crates/swc/tests/tsc-references/parserIfStatement2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserIfStatement2_es5.1.normal.js @@ -1,2 +1 @@ -if (a) { -} +if (a) {} diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.1.normal.js index bd2bebdf439..d59befc87a2 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.1.normal.js @@ -2,5 +2,4 @@ var Bar; (function(Bar) { Bar[Bar["interface"] = 0] = "interface"; -})(Bar || (Bar = { -})); +})(Bar || (Bar = {})); diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.2.minified.js index df32fdf02de..79c7ae0d4af 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es2015.2.minified.js @@ -1,4 +1,3 @@ "use strict"; var Bar, Bar; -(Bar = Bar || (Bar = { -}))[Bar.interface = 0] = "interface"; +(Bar = Bar || (Bar = {}))[Bar.interface = 0] = "interface"; diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.1.normal.js index bd2bebdf439..d59befc87a2 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.1.normal.js @@ -2,5 +2,4 @@ var Bar; (function(Bar) { Bar[Bar["interface"] = 0] = "interface"; -})(Bar || (Bar = { -})); +})(Bar || (Bar = {})); diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.2.minified.js index df32fdf02de..79c7ae0d4af 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum1_es5.2.minified.js @@ -1,4 +1,3 @@ "use strict"; var Bar, Bar; -(Bar = Bar || (Bar = { -}))[Bar.interface = 0] = "interface"; +(Bar = Bar || (Bar = {}))[Bar.interface = 0] = "interface"; diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.1.normal.js index 9b2f1b678c4..ef3233d2988 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.1.normal.js @@ -1,5 +1,4 @@ var Bar; (function(Bar) { Bar[Bar["interface"] = 0] = "interface"; -})(Bar || (Bar = { -})); +})(Bar || (Bar = {})); diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.2.minified.js index 27fde13f748..984ffc40d78 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es2015.2.minified.js @@ -1,3 +1,2 @@ var Bar, Bar; -(Bar = Bar || (Bar = { -}))[Bar.interface = 0] = "interface"; +(Bar = Bar || (Bar = {}))[Bar.interface = 0] = "interface"; diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.1.normal.js index 9b2f1b678c4..ef3233d2988 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.1.normal.js @@ -1,5 +1,4 @@ var Bar; (function(Bar) { Bar[Bar["interface"] = 0] = "interface"; -})(Bar || (Bar = { -})); +})(Bar || (Bar = {})); diff --git a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.2.minified.js index 27fde13f748..984ffc40d78 100644 --- a/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserInterfaceKeywordInEnum_es5.2.minified.js @@ -1,3 +1,2 @@ var Bar, Bar; -(Bar = Bar || (Bar = { -}))[Bar.interface = 0] = "interface"; +(Bar = Bar || (Bar = {}))[Bar.interface = 0] = "interface"; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessor1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessor1_es2015.1.normal.js index 623c35c7194..bf55754bb23 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessor1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessor1_es2015.1.normal.js @@ -1,7 +1,5 @@ // @target: es5 class C { - get foo() { - } - set foo(a) { - } + get foo() {} + set foo(a) {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.1.normal.js index b3b128cd53f..81e1dcbeeff 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.1.normal.js @@ -26,10 +26,8 @@ var C = // @target: es5 _createClass(C, [ { key: "foo", - get: function get() { - }, - set: function set(a) { - } + get: function get() {}, + set: function set(a) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.2.minified.js index 02999d000f5..db45c8012ea 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessor1_es5.2.minified.js @@ -15,10 +15,8 @@ var C = function() { return Constructor = C, protoProps = [ { key: "foo", - get: function() { - }, - set: function(a) { - } + get: function() {}, + set: function(a) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es2015.1.normal.js index fb1a03f8de6..81941fc90e2 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - get a() { - } + get a() {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.1.normal.js index 3c139b9b897..359b6981308 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: "a", - get: function get() { - } + get: function get() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.2.minified.js index 5c685a1ccb8..5f78c8d015d 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration1_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "a", - get: function() { - } + get: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es2015.1.normal.js index eaddf0c63ce..160620c4814 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - get "b"() { - } + get "b"() {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.1.normal.js index 1401e983b46..c6efa73b016 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: "b", - get: function get() { - } + get: function get() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.2.minified.js index b4cd045beef..ea13a0f2f6d 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration2_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: "b", - get: function() { - } + get: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es2015.1.normal.js index b9586a3ae98..56e978b3c09 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - get 0() { - } + get 0() {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.1.normal.js index e657f757258..22bb93ca948 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: 0, - get: function get() { - } + get: function get() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.2.minified.js index 5753531aa40..2b18756379d 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration3_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return protoProps = [ { key: 0, - get: function() { - } + get: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es2015.1.normal.js index e492faae702..ca007da59a4 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - set a(i) { - } + set a(i) {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.1.normal.js index 90695ff9cfd..8c783f65021 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: "a", - set: function set(i) { - } + set: function set(i) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.2.minified.js index 26b58198784..c746cf2081a 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration4_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "a", - set: function(i) { - } + set: function(i) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es2015.1.normal.js index 8eb16245028..bd5b7466d78 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - set "a"(i) { - } + set "a"(i) {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.1.normal.js index 90695ff9cfd..8c783f65021 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: "a", - set: function set(i) { - } + set: function set(i) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.2.minified.js index 26b58198784..c746cf2081a 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration5_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "a", - set: function(i) { - } + set: function(i) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es2015.1.normal.js index cc73d103170..be3f5f6f4b1 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es2015.1.normal.js @@ -1,5 +1,4 @@ // @target: es5 class C { - set 0(i) { - } + set 0(i) {} } diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.1.normal.js index 012bcb4f2cd..997e7844b53 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // @target: es5 _createClass(C, [ { key: 0, - set: function set(i) { - } + set: function set(i) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.2.minified.js index b7f9425b983..a0ad746db04 100644 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration6_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: 0, - set: function(i) { - } + set: function(i) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es2015.1.normal.js index 5b6c04bd0cf..315f29f7f31 100644 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es2015.1.normal.js @@ -1,18 +1,10 @@ class C { - public() { - } - static() { - } - public() { - } - static() { - } - static public() { - } - static static() { - } - static public() { - } - static static() { - } + public() {} + static() {} + public() {} + static() {} + static public() {} + static static() {} + static public() {} + static static() {} } diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.1.normal.js index 1cd44529ee1..f136fe88b85 100644 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.1.normal.js @@ -25,24 +25,20 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "public", - value: function _public() { - } + value: function _public() {} }, { key: "static", - value: function _static() { - } + value: function _static() {} } ], [ { key: "public", - value: function _public() { - } + value: function _public() {} }, { key: "static", - value: function _static() { - } + value: function _static() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.2.minified.js index ad7822fa740..5e376fc8dc1 100644 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserMemberFunctionDeclarationAmbiguities1_es5.2.minified.js @@ -15,24 +15,20 @@ var C = function() { return staticProps = [ { key: "public", - value: function() { - } + value: function() {} }, { key: "static", - value: function() { - } + value: function() {} } ], protoProps = [ { key: "public", - value: function() { - } + value: function() {} }, { key: "static", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserModule1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserModule1_es2015.1.normal.js index 7494187ae0d..a1e5aab5339 100644 --- a/crates/swc/tests/tsc-references/parserModule1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserModule1_es2015.1.normal.js @@ -23,5 +23,4 @@ export var CompilerDiagnostics; } } CompilerDiagnostics1.assert = assert; -})(CompilerDiagnostics || (CompilerDiagnostics = { -})); +})(CompilerDiagnostics || (CompilerDiagnostics = {})); diff --git a/crates/swc/tests/tsc-references/parserModule1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserModule1_es2015.2.minified.js index 44920355a7f..e98e2a887bd 100644 --- a/crates/swc/tests/tsc-references/parserModule1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserModule1_es2015.2.minified.js @@ -9,5 +9,4 @@ export var CompilerDiagnostics; }, CompilerDiagnostics1.assert = function(condition, s) { debug && (condition || Alert(s)); }; -}(CompilerDiagnostics || (CompilerDiagnostics = { -})); +}(CompilerDiagnostics || (CompilerDiagnostics = {})); diff --git a/crates/swc/tests/tsc-references/parserModule1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserModule1_es5.1.normal.js index ac194a62422..5f9dbd3bede 100644 --- a/crates/swc/tests/tsc-references/parserModule1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserModule1_es5.1.normal.js @@ -23,5 +23,4 @@ export var CompilerDiagnostics; CompilerDiagnostics1.Alert = Alert; CompilerDiagnostics1.debugPrint = debugPrint; CompilerDiagnostics1.assert = assert; -})(CompilerDiagnostics || (CompilerDiagnostics = { -})); +})(CompilerDiagnostics || (CompilerDiagnostics = {})); diff --git a/crates/swc/tests/tsc-references/parserModule1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserModule1_es5.2.minified.js index 576afcde96a..59593626526 100644 --- a/crates/swc/tests/tsc-references/parserModule1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserModule1_es5.2.minified.js @@ -8,5 +8,4 @@ export var CompilerDiagnostics; }, CompilerDiagnostics1.assert = function(condition, s) { debug && (condition || Alert(s)); }; -}(CompilerDiagnostics || (CompilerDiagnostics = { -})); +}(CompilerDiagnostics || (CompilerDiagnostics = {})); diff --git a/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es2015.1.normal.js index 4169d551271..b1a90d85359 100644 --- a/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es2015.1.normal.js @@ -1,2 +1 @@ -var x = function() { -}(window).foo; +var x = function() {}(window).foo; diff --git a/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es5.1.normal.js index 4169d551271..b1a90d85359 100644 --- a/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1_es5.1.normal.js @@ -1,2 +1 @@ -var x = function() { -}(window).foo; +var x = function() {}(window).foo; diff --git a/crates/swc/tests/tsc-references/parserNotRegex2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserNotRegex2_es2015.1.normal.js index bb5d39c5f02..ad03c128473 100644 --- a/crates/swc/tests/tsc-references/parserNotRegex2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserNotRegex2_es2015.1.normal.js @@ -1,4 +1,2 @@ const x = A / 2; -B(C(), ()=>{ -}, ()=>{ -}); +B(C(), ()=>{}, ()=>{}); diff --git a/crates/swc/tests/tsc-references/parserNotRegex2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserNotRegex2_es2015.2.minified.js index a4bbfcd1df7..46eea566a86 100644 --- a/crates/swc/tests/tsc-references/parserNotRegex2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserNotRegex2_es2015.2.minified.js @@ -1,3 +1 @@ -B(C(), ()=>{ -}, ()=>{ -}); +B(C(), ()=>{}, ()=>{}); diff --git a/crates/swc/tests/tsc-references/parserNotRegex2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserNotRegex2_es5.1.normal.js index 99d16813966..cde446a1cf5 100644 --- a/crates/swc/tests/tsc-references/parserNotRegex2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserNotRegex2_es5.1.normal.js @@ -1,4 +1,2 @@ var x = A / 2; -B(C(), function() { -}, function() { -}); +B(C(), function() {}, function() {}); diff --git a/crates/swc/tests/tsc-references/parserNotRegex2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserNotRegex2_es5.2.minified.js index b42df13e953..da74ad6f471 100644 --- a/crates/swc/tests/tsc-references/parserNotRegex2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserNotRegex2_es5.2.minified.js @@ -1,3 +1 @@ -B(C(), function() { -}, function() { -}); +B(C(), function() {}, function() {}); diff --git a/crates/swc/tests/tsc-references/parserParameterList12_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList12_es2015.1.normal.js index 9870650742f..03d2db97b62 100644 --- a/crates/swc/tests/tsc-references/parserParameterList12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserParameterList12_es2015.1.normal.js @@ -1,2 +1 @@ -function F(a) { -} +function F(a) {} diff --git a/crates/swc/tests/tsc-references/parserParameterList12_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList12_es5.1.normal.js index 9870650742f..03d2db97b62 100644 --- a/crates/swc/tests/tsc-references/parserParameterList12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserParameterList12_es5.1.normal.js @@ -1,2 +1 @@ -function F(a) { -} +function F(a) {} diff --git a/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es2015.1.normal.js index 53715497aee..cd48465cc3b 100644 --- a/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es2015.1.normal.js @@ -1,3 +1,2 @@ let a; -const c = true ? a : function() { -}; +const c = true ? a : function() {}; diff --git a/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es5.1.normal.js index fef89fce32c..e2f67550a3c 100644 --- a/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserParenthesizedVariableAndFunctionInTernary_es5.1.normal.js @@ -1,3 +1,2 @@ var a; -var c = true ? a : function c() { -}; +var c = true ? a : function c() {}; diff --git a/crates/swc/tests/tsc-references/parserRealSource12_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource12_es2015.1.normal.js index 3a20bd9ae13..84cb0306afd 100644 --- a/crates/swc/tests/tsc-references/parserRealSource12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource12_es2015.1.normal.js @@ -488,7 +488,5 @@ var TypeScript; } } ChildrenWalkers.walkLabeledStatementChildren = walkLabeledStatementChildren; - })(ChildrenWalkers1 || (ChildrenWalkers1 = { - })); -})(TypeScript || (TypeScript = { -})); + })(ChildrenWalkers1 || (ChildrenWalkers1 = {})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource12_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource12_es2015.2.minified.js index 4f00a397818..c95282c3aa5 100644 --- a/crates/swc/tests/tsc-references/parserRealSource12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource12_es2015.2.minified.js @@ -53,8 +53,7 @@ var TypeScript; function walkNamedTypeChildren(preAst, parent, walker) { walkRecordChildren(preAst, parent, walker); } - ChildrenWalkers.walkNone = function(preAst, parent, walker) { - }, ChildrenWalkers.walkListChildren = function(preAst, parent, walker) { + ChildrenWalkers.walkNone = function(preAst, parent, walker) {}, ChildrenWalkers.walkListChildren = function(preAst, parent, walker) { var len = preAst.members.length; if (walker.options.reverseSiblings) for(var i = len - 1; i >= 0; i--)walker.options.goNextSibling && (preAst.members[i] = walker.walk(preAst.members[i], preAst)); else for(var i = 0; i < len; i++)walker.options.goNextSibling && (preAst.members[i] = walker.walk(preAst.members[i], preAst)); @@ -112,11 +111,8 @@ var TypeScript; preAst.id && (preAst.id = walker.walk(preAst.id, preAst)), preAst.alias && (preAst.alias = walker.walk(preAst.alias, preAst)); }, ChildrenWalkers.walkWithStatementChildren = function(preAst, parent, walker) { preAst.expr && (preAst.expr = walker.walk(preAst.expr, preAst)), preAst.body && walker.options.goNextSibling && (preAst.body = walker.walk(preAst.body, preAst)); - }, ChildrenWalkers.walkLabelChildren = function(preAst, parent, walker) { - }, ChildrenWalkers.walkLabeledStatementChildren = function(preAst, parent, walker) { + }, ChildrenWalkers.walkLabelChildren = function(preAst, parent, walker) {}, ChildrenWalkers.walkLabeledStatementChildren = function(preAst, parent, walker) { preAst.labels = walker.walk(preAst.labels, preAst), walker.options.goNextSibling && (preAst.stmt = walker.walk(preAst.stmt, preAst)); }; - }(ChildrenWalkers1 || (ChildrenWalkers1 = { - })); -}(TypeScript || (TypeScript = { -})); + }(ChildrenWalkers1 || (ChildrenWalkers1 = {})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource12_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource12_es5.1.normal.js index 6f1e4150c5b..7de0b5d80cf 100644 --- a/crates/swc/tests/tsc-references/parserRealSource12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource12_es5.1.normal.js @@ -541,7 +541,5 @@ var TypeScript; } } ChildrenWalkers.walkLabeledStatementChildren = walkLabeledStatementChildren; - })(ChildrenWalkers1 || (ChildrenWalkers1 = { - })); -})(TypeScript || (TypeScript = { -})); + })(ChildrenWalkers1 || (ChildrenWalkers1 = {})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource12_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource12_es5.2.minified.js index 225331d3a8d..9958c58cdab 100644 --- a/crates/swc/tests/tsc-references/parserRealSource12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource12_es5.2.minified.js @@ -89,8 +89,7 @@ function _createClass(Constructor, protoProps, staticProps) { function walkNamedTypeChildren(preAst, parent, walker) { walkRecordChildren(preAst, parent, walker); } - ChildrenWalkers.walkNone = function(preAst, parent, walker) { - }, ChildrenWalkers.walkListChildren = function(preAst, parent, walker) { + ChildrenWalkers.walkNone = function(preAst, parent, walker) {}, ChildrenWalkers.walkListChildren = function(preAst, parent, walker) { var len = preAst.members.length; if (walker.options.reverseSiblings) for(var i = len - 1; i >= 0; i--)walker.options.goNextSibling && (preAst.members[i] = walker.walk(preAst.members[i], preAst)); else for(var i = 0; i < len; i++)walker.options.goNextSibling && (preAst.members[i] = walker.walk(preAst.members[i], preAst)); @@ -148,11 +147,8 @@ function _createClass(Constructor, protoProps, staticProps) { preAst.id && (preAst.id = walker.walk(preAst.id, preAst)), preAst.alias && (preAst.alias = walker.walk(preAst.alias, preAst)); }, ChildrenWalkers.walkWithStatementChildren = function(preAst, parent, walker) { preAst.expr && (preAst.expr = walker.walk(preAst.expr, preAst)), preAst.body && walker.options.goNextSibling && (preAst.body = walker.walk(preAst.body, preAst)); - }, ChildrenWalkers.walkLabelChildren = function(preAst, parent, walker) { - }, ChildrenWalkers.walkLabeledStatementChildren = function(preAst, parent, walker) { + }, ChildrenWalkers.walkLabelChildren = function(preAst, parent, walker) {}, ChildrenWalkers.walkLabeledStatementChildren = function(preAst, parent, walker) { preAst.labels = walker.walk(preAst.labels, preAst), walker.options.goNextSibling && (preAst.stmt = walker.walk(preAst.stmt, preAst)); }; - })(ChildrenWalkers1 || (ChildrenWalkers1 = { - })); -}(TypeScript || (TypeScript = { -})); + })(ChildrenWalkers1 || (ChildrenWalkers1 = {})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource13_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource13_es2015.1.normal.js index 6757a0488c1..6379748d486 100644 --- a/crates/swc/tests/tsc-references/parserRealSource13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource13_es2015.1.normal.js @@ -30,7 +30,5 @@ var TypeScript; } return true; } - })(AstWalkerWithDetailCallback1 = TypeScript1.AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = { - })); -})(TypeScript || (TypeScript = { -})); + })(AstWalkerWithDetailCallback1 = TypeScript1.AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = {})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource13_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource13_es2015.2.minified.js index 6566f2ee97e..bb82c939908 100644 --- a/crates/swc/tests/tsc-references/parserRealSource13_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource13_es2015.2.minified.js @@ -10,6 +10,4 @@ var TypeScript, TypeScript1; ); walker.walk(script, null); }; -}((TypeScript1 = TypeScript || (TypeScript = { -})).AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = { -})); +}((TypeScript1 = TypeScript || (TypeScript = {})).AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource13_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource13_es5.1.normal.js index bf854ca9554..d21acf23b3f 100644 --- a/crates/swc/tests/tsc-references/parserRealSource13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource13_es5.1.normal.js @@ -30,7 +30,5 @@ var TypeScript; } return true; } - })(AstWalkerWithDetailCallback1 = TypeScript1.AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = { - })); -})(TypeScript || (TypeScript = { -})); + })(AstWalkerWithDetailCallback1 = TypeScript1.AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = {})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource13_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource13_es5.2.minified.js index 46b66a77eeb..11ed7073d2a 100644 --- a/crates/swc/tests/tsc-references/parserRealSource13_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource13_es5.2.minified.js @@ -12,6 +12,4 @@ var TypeScript, TypeScript1; }); walker.walk(script, null); }; -}((TypeScript1 = TypeScript || (TypeScript = { -})).AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = { -})); +}((TypeScript1 = TypeScript || (TypeScript = {})).AstWalkerWithDetailCallback || (TypeScript1.AstWalkerWithDetailCallback = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource14_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource14_es2015.1.normal.js index d9633e09067..8aac382ef59 100644 --- a/crates/swc/tests/tsc-references/parserRealSource14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource14_es2015.1.normal.js @@ -255,8 +255,7 @@ var TypeScript; // we don't find the "precomment" attached to the errorneous empty stmt. //TODO: It would be nice to be able to get rid of this. "DontPruneSearchBasedOnPosition"] = 2] = "DontPruneSearchBasedOnPosition"; - })(GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = { - })); + })(GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = {})); function getAstPathToPosition(script, pos, options = GetAstPathOptions.Default) { var lookInComments = (comments)=>{ if (comments && comments.length > 0) { @@ -348,5 +347,4 @@ var TypeScript; TypeScript.getAstWalkerFactory().walk(ast, pre, post, null, path1); } TypeScript1.walkAST = walkAST; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource14_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource14_es2015.2.minified.js index 9d6f9e14046..764827314b5 100644 --- a/crates/swc/tests/tsc-references/parserRealSource14_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource14_es2015.2.minified.js @@ -218,8 +218,7 @@ var TypeScript; } TypeScript1.AstPathContext = AstPathContext; let GetAstPathOptions; - (GetAstPathOptions = GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = { - }))[GetAstPathOptions.Default = 0] = "Default", GetAstPathOptions[GetAstPathOptions.EdgeInclusive = 1] = "EdgeInclusive", GetAstPathOptions[GetAstPathOptions.DontPruneSearchBasedOnPosition = 2] = "DontPruneSearchBasedOnPosition", TypeScript1.getAstPathToPosition = function(script, pos, options = GetAstPathOptions.Default) { + (GetAstPathOptions = GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = {}))[GetAstPathOptions.Default = 0] = "Default", GetAstPathOptions[GetAstPathOptions.EdgeInclusive = 1] = "EdgeInclusive", GetAstPathOptions[GetAstPathOptions.DontPruneSearchBasedOnPosition = 2] = "DontPruneSearchBasedOnPosition", TypeScript1.getAstPathToPosition = function(script, pos, options = GetAstPathOptions.Default) { var lookInComments = (comments)=>{ if (comments && comments.length > 0) for(var i = 0; i < comments.length; i++){ var minChar = comments[i].minChar, limChar = comments[i].limChar; @@ -250,5 +249,4 @@ var TypeScript; return walker.state.pop(), cur; }, null, path1); }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource14_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource14_es5.1.normal.js index 71adc688b09..64f73ad1515 100644 --- a/crates/swc/tests/tsc-references/parserRealSource14_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource14_es5.1.normal.js @@ -549,10 +549,8 @@ var TypeScript; // we don't find the "precomment" attached to the errorneous empty stmt. //TODO: It would be nice to be able to get rid of this. "DontPruneSearchBasedOnPosition"] = 2] = "DontPruneSearchBasedOnPosition"; - })(GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = { - })); + })(GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = {})); TypeScript1.getAstPathToPosition = getAstPathToPosition; TypeScript1.getTokenizationOffset = getTokenizationOffset; TypeScript1.walkAST = walkAST; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource14_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource14_es5.2.minified.js index b1ae03dda98..d5fd3b99fbd 100644 --- a/crates/swc/tests/tsc-references/parserRealSource14_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource14_es5.2.minified.js @@ -438,7 +438,5 @@ function _defineProperties(target, props) { "use strict"; _classCallCheck(this, AstPathContext), this.path = new TypeScript.AstPath(); }; - TypeScript1.AstPathContext = AstPathContext, (GetAstPathOptions = GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = { - }))[GetAstPathOptions.Default = 0] = "Default", GetAstPathOptions[GetAstPathOptions.EdgeInclusive = 1] = "EdgeInclusive", GetAstPathOptions[GetAstPathOptions.DontPruneSearchBasedOnPosition = 2] = "DontPruneSearchBasedOnPosition", TypeScript1.getAstPathToPosition = getAstPathToPosition, TypeScript1.getTokenizationOffset = getTokenizationOffset, TypeScript1.walkAST = walkAST; -}(TypeScript || (TypeScript = { -})); + TypeScript1.AstPathContext = AstPathContext, (GetAstPathOptions = GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = {}))[GetAstPathOptions.Default = 0] = "Default", GetAstPathOptions[GetAstPathOptions.EdgeInclusive = 1] = "EdgeInclusive", GetAstPathOptions[GetAstPathOptions.DontPruneSearchBasedOnPosition = 2] = "DontPruneSearchBasedOnPosition", TypeScript1.getAstPathToPosition = getAstPathToPosition, TypeScript1.getTokenizationOffset = getTokenizationOffset, TypeScript1.walkAST = walkAST; +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource1_es2015.1.normal.js index f66c36db112..639cbfbd69f 100644 --- a/crates/swc/tests/tsc-references/parserRealSource1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource1_es2015.1.normal.js @@ -28,8 +28,7 @@ var TypeScript; } } CompilerDiagnostics.assert = assert; - })(CompilerDiagnostics1 = TypeScript1.CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = { - })); + })(CompilerDiagnostics1 = TypeScript1.CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = {})); class NullLogger { information() { return false; @@ -46,8 +45,7 @@ var TypeScript; fatal() { return false; } - log(s) { - } + log(s) {} } TypeScript1.NullLogger = NullLogger; class LoggerAdapter { @@ -157,5 +155,4 @@ var TypeScript; return result; } TypeScript1.stringToLiteral = stringToLiteral; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource1_es2015.2.minified.js index 647aaced67d..966bb82cbf9 100644 --- a/crates/swc/tests/tsc-references/parserRealSource1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource1_es2015.2.minified.js @@ -9,9 +9,7 @@ var TypeScript, TypeScript1; }, CompilerDiagnostics.assert = function(condition, s) { debug && (condition || Alert(s)); }; -})((TypeScript1 = TypeScript || (TypeScript = { -})).CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = { -})), TypeScript1.NullLogger = class { +})((TypeScript1 = TypeScript || (TypeScript = {})).CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = {})), TypeScript1.NullLogger = class { information() { return !1; } @@ -27,8 +25,7 @@ var TypeScript, TypeScript1; fatal() { return !1; } - log(s) { - } + log(s) {} }, TypeScript1.LoggerAdapter = class { information() { return this._information; diff --git a/crates/swc/tests/tsc-references/parserRealSource1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource1_es5.1.normal.js index 39b22d02df1..38c59511e9e 100644 --- a/crates/swc/tests/tsc-references/parserRealSource1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource1_es5.1.normal.js @@ -99,8 +99,7 @@ var TypeScript; } } CompilerDiagnostics.assert = assert; - })(CompilerDiagnostics1 = TypeScript1.CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = { - })); + })(CompilerDiagnostics1 = TypeScript1.CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = {})); var NullLogger = /*#__PURE__*/ function() { "use strict"; function NullLogger() { @@ -139,8 +138,7 @@ var TypeScript; }, { key: "log", - value: function log(s) { - } + value: function log(s) {} } ]); return NullLogger; @@ -247,5 +245,4 @@ var TypeScript; TypeScript1.BufferedLogger = BufferedLogger; TypeScript1.timeFunction = timeFunction; TypeScript1.stringToLiteral = stringToLiteral; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource1_es5.2.minified.js index 2dc5527a272..d7234102ca9 100644 --- a/crates/swc/tests/tsc-references/parserRealSource1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource1_es5.2.minified.js @@ -22,8 +22,7 @@ function _createClass(Constructor, protoProps, staticProps) { }, CompilerDiagnostics.assert = function(condition, s) { debug && (condition || Alert(s)); }; - }(TypeScript1.CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = { - })); + }(TypeScript1.CompilerDiagnostics || (TypeScript1.CompilerDiagnostics = {})); var NullLogger = function() { "use strict"; function NullLogger() { @@ -62,8 +61,7 @@ function _createClass(Constructor, protoProps, staticProps) { }, { key: "log", - value: function(s) { - } + value: function(s) {} } ]), NullLogger; }(); @@ -202,5 +200,4 @@ function _createClass(Constructor, protoProps, staticProps) { } return result; }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource2_es2015.1.normal.js index d9289a29260..c0d827db4a6 100644 --- a/crates/swc/tests/tsc-references/parserRealSource2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource2_es2015.1.normal.js @@ -47,8 +47,7 @@ var TypeScript; ErrorRecoverySet[ErrorRecoverySet["ExprStart"] = 520158210] = "ExprStart"; ErrorRecoverySet[ErrorRecoverySet["StmtStart"] = 1608580098] = "StmtStart"; ErrorRecoverySet[ErrorRecoverySet["Postfix"] = 49280] = "Postfix"; - })(ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = { - })); + })(ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = {})); let AllowedElements; (function(AllowedElements) { AllowedElements[AllowedElements["None"] = 0] = "None"; @@ -59,8 +58,7 @@ var TypeScript; AllowedElements[AllowedElements["Properties"] = 2048] = "Properties"; AllowedElements[AllowedElements["Global"] = 1052] = "Global"; AllowedElements[AllowedElements["QuickParse"] = 3100] = "QuickParse"; - })(AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = { - })); + })(AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = {})); let Modifiers; (function(Modifiers) { Modifiers[Modifiers["None"] = 0] = "None"; @@ -72,8 +70,7 @@ var TypeScript; Modifiers[Modifiers["Getter"] = 32] = "Getter"; Modifiers[Modifiers["Setter"] = 64] = "Setter"; Modifiers[Modifiers["Static"] = 128] = "Static"; - })(Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = { - })); + })(Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = {})); let ASTFlags; (function(ASTFlags) { ASTFlags[ASTFlags["None"] = 0] = "None"; @@ -92,8 +89,7 @@ var TypeScript; // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. // Once we have a better way to associate information with nodes, this flag should not be used. "SkipNextRParen"] = 2048] = "SkipNextRParen"; - })(ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = { - })); + })(ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = {})); let DeclFlags; (function(DeclFlags) { DeclFlags[DeclFlags["None"] = 0] = "None"; @@ -105,8 +101,7 @@ var TypeScript; DeclFlags[DeclFlags["LocalStatic"] = 32] = "LocalStatic"; DeclFlags[DeclFlags["GetAccessor"] = 64] = "GetAccessor"; DeclFlags[DeclFlags["SetAccessor"] = 128] = "SetAccessor"; - })(DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = { - })); + })(DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = {})); let ModuleFlags; (function(ModuleFlags) { ModuleFlags[ModuleFlags["None"] = 0] = "None"; @@ -123,8 +118,7 @@ var TypeScript; ModuleFlags[ModuleFlags["IsWholeFile"] = 1024] = "IsWholeFile"; ModuleFlags[ModuleFlags["IsDynamic"] = 2048] = "IsDynamic"; ModuleFlags[ModuleFlags["MustCaptureThis"] = 4096] = "MustCaptureThis"; - })(ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = { - })); + })(ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = {})); let SymbolFlags; (function(SymbolFlags) { SymbolFlags[SymbolFlags["None"] = 0] = "None"; @@ -148,8 +142,7 @@ var TypeScript; SymbolFlags[SymbolFlags["RecursivelyReferenced"] = 131072] = "RecursivelyReferenced"; SymbolFlags[SymbolFlags["Bound"] = 262144] = "Bound"; SymbolFlags[SymbolFlags["CompilerGenerated"] = 524288] = "CompilerGenerated"; - })(SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = { - })); + })(SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = {})); let VarFlags; (function(VarFlags) { VarFlags[VarFlags["None"] = 0] = "None"; @@ -171,8 +164,7 @@ var TypeScript; VarFlags[VarFlags["ClassSuperMustBeFirstCallInConstructor"] = 32768] = "ClassSuperMustBeFirstCallInConstructor"; VarFlags[VarFlags["Constant"] = 65536] = "Constant"; VarFlags[VarFlags["MustCaptureThis"] = 131072] = "MustCaptureThis"; - })(VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = { - })); + })(VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = {})); let FncFlags; (function(FncFlags) { FncFlags[FncFlags["None"] = 0] = "None"; @@ -196,16 +188,14 @@ var TypeScript; FncFlags[FncFlags["IsFunctionExpression"] = 131072] = "IsFunctionExpression"; FncFlags[FncFlags["ClassMethod"] = 262144] = "ClassMethod"; FncFlags[FncFlags["ClassPropertyMethodExported"] = 524288] = "ClassPropertyMethodExported"; - })(FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = { - })); + })(FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = {})); let SignatureFlags; (function(SignatureFlags) { SignatureFlags[SignatureFlags["None"] = 0] = "None"; SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; SignatureFlags[SignatureFlags["IsStringIndexer"] = 2] = "IsStringIndexer"; SignatureFlags[SignatureFlags["IsNumberIndexer"] = 4] = "IsNumberIndexer"; - })(SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = { - })); + })(SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = {})); function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags) { return fncOrVarOrSymbolOrModuleFlags; } @@ -221,8 +211,7 @@ var TypeScript; TypeFlags[TypeFlags["HasBaseType"] = 32] = "HasBaseType"; TypeFlags[TypeFlags["HasBaseTypeOfObject"] = 64] = "HasBaseTypeOfObject"; TypeFlags[TypeFlags["IsClass"] = 128] = "IsClass"; - })(TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = { - })); + })(TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = {})); let TypeRelationshipFlags; (function(TypeRelationshipFlags) { TypeRelationshipFlags[TypeRelationshipFlags["SuccessfulComparison"] = 0] = "SuccessfulComparison"; @@ -233,21 +222,18 @@ var TypeScript; TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleReturnTypes"] = 16] = "IncompatibleReturnTypes"; TypeRelationshipFlags[TypeRelationshipFlags["IncompatiblePropertyTypes"] = 32] = "IncompatiblePropertyTypes"; TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleParameterTypes"] = 64] = "IncompatibleParameterTypes"; - })(TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = { - })); + })(TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = {})); let CodeGenTarget; (function(CodeGenTarget) { CodeGenTarget[CodeGenTarget["ES3"] = 0] = "ES3"; CodeGenTarget[CodeGenTarget["ES5"] = 1] = "ES5"; - })(CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = { - })); + })(CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = {})); let ModuleGenTarget; (function(ModuleGenTarget) { ModuleGenTarget[ModuleGenTarget["Synchronous"] = 0] = "Synchronous"; ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 1] = "Asynchronous"; ModuleGenTarget[ModuleGenTarget["Local"] = 2] = "Local"; - })(ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = { - })); + })(ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = {})); var codeGenTarget = TypeScript1.codeGenTarget = CodeGenTarget.ES3; var moduleGenTarget = TypeScript1.moduleGenTarget = ModuleGenTarget.Synchronous; var optimizeModuleCodeGen = TypeScript1.optimizeModuleCodeGen = true; @@ -269,5 +255,4 @@ var TypeScript; return builder; } TypeScript1.flagsToString = flagsToString; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource2_es2015.2.minified.js index 9bd7160c97c..482dfdbeca7 100644 --- a/crates/swc/tests/tsc-references/parserRealSource2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource2_es2015.2.minified.js @@ -5,49 +5,35 @@ var TypeScript; return (val & flag) != 0; }; let ErrorRecoverySet; - (ErrorRecoverySet = ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = { - }))[ErrorRecoverySet.None = 0] = "None", ErrorRecoverySet[ErrorRecoverySet.Comma = 1] = "Comma", ErrorRecoverySet[ErrorRecoverySet.SColon = 2] = "SColon", ErrorRecoverySet[ErrorRecoverySet.Asg = 4] = "Asg", ErrorRecoverySet[ErrorRecoverySet.BinOp = 8] = "BinOp", ErrorRecoverySet[ErrorRecoverySet.RBrack = 16] = "RBrack", ErrorRecoverySet[ErrorRecoverySet.RCurly = 32] = "RCurly", ErrorRecoverySet[ErrorRecoverySet.RParen = 64] = "RParen", ErrorRecoverySet[ErrorRecoverySet.Dot = 128] = "Dot", ErrorRecoverySet[ErrorRecoverySet.Colon = 256] = "Colon", ErrorRecoverySet[ErrorRecoverySet.PrimType = 512] = "PrimType", ErrorRecoverySet[ErrorRecoverySet.AddOp = 1024] = "AddOp", ErrorRecoverySet[ErrorRecoverySet.LCurly = 2048] = "LCurly", ErrorRecoverySet[ErrorRecoverySet.PreOp = 4096] = "PreOp", ErrorRecoverySet[ErrorRecoverySet.RegExp = 8192] = "RegExp", ErrorRecoverySet[ErrorRecoverySet.LParen = 16384] = "LParen", ErrorRecoverySet[ErrorRecoverySet.LBrack = 32768] = "LBrack", ErrorRecoverySet[ErrorRecoverySet.Scope = 65536] = "Scope", ErrorRecoverySet[ErrorRecoverySet.In = 131072] = "In", ErrorRecoverySet[ErrorRecoverySet.SCase = 262144] = "SCase", ErrorRecoverySet[ErrorRecoverySet.Else = 524288] = "Else", ErrorRecoverySet[ErrorRecoverySet.Catch = 1048576] = "Catch", ErrorRecoverySet[ErrorRecoverySet.Var = 2097152] = "Var", ErrorRecoverySet[ErrorRecoverySet.Stmt = 4194304] = "Stmt", ErrorRecoverySet[ErrorRecoverySet.While = 8388608] = "While", ErrorRecoverySet[ErrorRecoverySet.ID = 16777216] = "ID", ErrorRecoverySet[ErrorRecoverySet.Prefix = 33554432] = "Prefix", ErrorRecoverySet[ErrorRecoverySet.Literal = 67108864] = "Literal", ErrorRecoverySet[ErrorRecoverySet.RLit = 134217728] = "RLit", ErrorRecoverySet[ErrorRecoverySet.Func = 268435456] = "Func", ErrorRecoverySet[ErrorRecoverySet.EOF = 536870912] = "EOF", ErrorRecoverySet[ErrorRecoverySet.TypeScriptS = 1073741824] = "TypeScriptS", ErrorRecoverySet[ErrorRecoverySet.ExprStart = 520158210] = "ExprStart", ErrorRecoverySet[ErrorRecoverySet.StmtStart = 1608580098] = "StmtStart", ErrorRecoverySet[ErrorRecoverySet.Postfix = 49280] = "Postfix"; + (ErrorRecoverySet = ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = {}))[ErrorRecoverySet.None = 0] = "None", ErrorRecoverySet[ErrorRecoverySet.Comma = 1] = "Comma", ErrorRecoverySet[ErrorRecoverySet.SColon = 2] = "SColon", ErrorRecoverySet[ErrorRecoverySet.Asg = 4] = "Asg", ErrorRecoverySet[ErrorRecoverySet.BinOp = 8] = "BinOp", ErrorRecoverySet[ErrorRecoverySet.RBrack = 16] = "RBrack", ErrorRecoverySet[ErrorRecoverySet.RCurly = 32] = "RCurly", ErrorRecoverySet[ErrorRecoverySet.RParen = 64] = "RParen", ErrorRecoverySet[ErrorRecoverySet.Dot = 128] = "Dot", ErrorRecoverySet[ErrorRecoverySet.Colon = 256] = "Colon", ErrorRecoverySet[ErrorRecoverySet.PrimType = 512] = "PrimType", ErrorRecoverySet[ErrorRecoverySet.AddOp = 1024] = "AddOp", ErrorRecoverySet[ErrorRecoverySet.LCurly = 2048] = "LCurly", ErrorRecoverySet[ErrorRecoverySet.PreOp = 4096] = "PreOp", ErrorRecoverySet[ErrorRecoverySet.RegExp = 8192] = "RegExp", ErrorRecoverySet[ErrorRecoverySet.LParen = 16384] = "LParen", ErrorRecoverySet[ErrorRecoverySet.LBrack = 32768] = "LBrack", ErrorRecoverySet[ErrorRecoverySet.Scope = 65536] = "Scope", ErrorRecoverySet[ErrorRecoverySet.In = 131072] = "In", ErrorRecoverySet[ErrorRecoverySet.SCase = 262144] = "SCase", ErrorRecoverySet[ErrorRecoverySet.Else = 524288] = "Else", ErrorRecoverySet[ErrorRecoverySet.Catch = 1048576] = "Catch", ErrorRecoverySet[ErrorRecoverySet.Var = 2097152] = "Var", ErrorRecoverySet[ErrorRecoverySet.Stmt = 4194304] = "Stmt", ErrorRecoverySet[ErrorRecoverySet.While = 8388608] = "While", ErrorRecoverySet[ErrorRecoverySet.ID = 16777216] = "ID", ErrorRecoverySet[ErrorRecoverySet.Prefix = 33554432] = "Prefix", ErrorRecoverySet[ErrorRecoverySet.Literal = 67108864] = "Literal", ErrorRecoverySet[ErrorRecoverySet.RLit = 134217728] = "RLit", ErrorRecoverySet[ErrorRecoverySet.Func = 268435456] = "Func", ErrorRecoverySet[ErrorRecoverySet.EOF = 536870912] = "EOF", ErrorRecoverySet[ErrorRecoverySet.TypeScriptS = 1073741824] = "TypeScriptS", ErrorRecoverySet[ErrorRecoverySet.ExprStart = 520158210] = "ExprStart", ErrorRecoverySet[ErrorRecoverySet.StmtStart = 1608580098] = "StmtStart", ErrorRecoverySet[ErrorRecoverySet.Postfix = 49280] = "Postfix"; let AllowedElements; - (AllowedElements = AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = { - }))[AllowedElements.None = 0] = "None", AllowedElements[AllowedElements.ModuleDeclarations = 4] = "ModuleDeclarations", AllowedElements[AllowedElements.ClassDeclarations = 8] = "ClassDeclarations", AllowedElements[AllowedElements.InterfaceDeclarations = 16] = "InterfaceDeclarations", AllowedElements[AllowedElements.AmbientDeclarations = 1024] = "AmbientDeclarations", AllowedElements[AllowedElements.Properties = 2048] = "Properties", AllowedElements[AllowedElements.Global = 1052] = "Global", AllowedElements[AllowedElements.QuickParse = 3100] = "QuickParse"; + (AllowedElements = AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = {}))[AllowedElements.None = 0] = "None", AllowedElements[AllowedElements.ModuleDeclarations = 4] = "ModuleDeclarations", AllowedElements[AllowedElements.ClassDeclarations = 8] = "ClassDeclarations", AllowedElements[AllowedElements.InterfaceDeclarations = 16] = "InterfaceDeclarations", AllowedElements[AllowedElements.AmbientDeclarations = 1024] = "AmbientDeclarations", AllowedElements[AllowedElements.Properties = 2048] = "Properties", AllowedElements[AllowedElements.Global = 1052] = "Global", AllowedElements[AllowedElements.QuickParse = 3100] = "QuickParse"; let Modifiers; - (Modifiers = Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = { - }))[Modifiers.None = 0] = "None", Modifiers[Modifiers.Private = 1] = "Private", Modifiers[Modifiers.Public = 2] = "Public", Modifiers[Modifiers.Readonly = 4] = "Readonly", Modifiers[Modifiers.Ambient = 8] = "Ambient", Modifiers[Modifiers.Exported = 16] = "Exported", Modifiers[Modifiers.Getter = 32] = "Getter", Modifiers[Modifiers.Setter = 64] = "Setter", Modifiers[Modifiers.Static = 128] = "Static"; + (Modifiers = Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = {}))[Modifiers.None = 0] = "None", Modifiers[Modifiers.Private = 1] = "Private", Modifiers[Modifiers.Public = 2] = "Public", Modifiers[Modifiers.Readonly = 4] = "Readonly", Modifiers[Modifiers.Ambient = 8] = "Ambient", Modifiers[Modifiers.Exported = 16] = "Exported", Modifiers[Modifiers.Getter = 32] = "Getter", Modifiers[Modifiers.Setter = 64] = "Setter", Modifiers[Modifiers.Static = 128] = "Static"; let ASTFlags; - (ASTFlags = ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = { - }))[ASTFlags.None = 0] = "None", ASTFlags[ASTFlags.ExplicitSemicolon = 1] = "ExplicitSemicolon", ASTFlags[ASTFlags.AutomaticSemicolon = 2] = "AutomaticSemicolon", ASTFlags[ASTFlags.Writeable = 4] = "Writeable", ASTFlags[ASTFlags.Error = 8] = "Error", ASTFlags[ASTFlags.DotLHSPartial = 16] = "DotLHSPartial", ASTFlags[ASTFlags.DotLHS = 32] = "DotLHS", ASTFlags[ASTFlags.IsStatement = 64] = "IsStatement", ASTFlags[ASTFlags.StrictMode = 128] = "StrictMode", ASTFlags[ASTFlags.PossibleOptionalParameter = 256] = "PossibleOptionalParameter", ASTFlags[ASTFlags.ClassBaseConstructorCall = 512] = "ClassBaseConstructorCall", ASTFlags[ASTFlags.OptionalName = 1024] = "OptionalName", ASTFlags[ASTFlags.SkipNextRParen = 2048] = "SkipNextRParen"; + (ASTFlags = ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = {}))[ASTFlags.None = 0] = "None", ASTFlags[ASTFlags.ExplicitSemicolon = 1] = "ExplicitSemicolon", ASTFlags[ASTFlags.AutomaticSemicolon = 2] = "AutomaticSemicolon", ASTFlags[ASTFlags.Writeable = 4] = "Writeable", ASTFlags[ASTFlags.Error = 8] = "Error", ASTFlags[ASTFlags.DotLHSPartial = 16] = "DotLHSPartial", ASTFlags[ASTFlags.DotLHS = 32] = "DotLHS", ASTFlags[ASTFlags.IsStatement = 64] = "IsStatement", ASTFlags[ASTFlags.StrictMode = 128] = "StrictMode", ASTFlags[ASTFlags.PossibleOptionalParameter = 256] = "PossibleOptionalParameter", ASTFlags[ASTFlags.ClassBaseConstructorCall = 512] = "ClassBaseConstructorCall", ASTFlags[ASTFlags.OptionalName = 1024] = "OptionalName", ASTFlags[ASTFlags.SkipNextRParen = 2048] = "SkipNextRParen"; let DeclFlags; - (DeclFlags = DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = { - }))[DeclFlags.None = 0] = "None", DeclFlags[DeclFlags.Exported = 1] = "Exported", DeclFlags[DeclFlags.Private = 2] = "Private", DeclFlags[DeclFlags.Public = 4] = "Public", DeclFlags[DeclFlags.Ambient = 8] = "Ambient", DeclFlags[DeclFlags.Static = 16] = "Static", DeclFlags[DeclFlags.LocalStatic = 32] = "LocalStatic", DeclFlags[DeclFlags.GetAccessor = 64] = "GetAccessor", DeclFlags[DeclFlags.SetAccessor = 128] = "SetAccessor"; + (DeclFlags = DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = {}))[DeclFlags.None = 0] = "None", DeclFlags[DeclFlags.Exported = 1] = "Exported", DeclFlags[DeclFlags.Private = 2] = "Private", DeclFlags[DeclFlags.Public = 4] = "Public", DeclFlags[DeclFlags.Ambient = 8] = "Ambient", DeclFlags[DeclFlags.Static = 16] = "Static", DeclFlags[DeclFlags.LocalStatic = 32] = "LocalStatic", DeclFlags[DeclFlags.GetAccessor = 64] = "GetAccessor", DeclFlags[DeclFlags.SetAccessor = 128] = "SetAccessor"; let ModuleFlags; - (ModuleFlags = ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = { - }))[ModuleFlags.None = 0] = "None", ModuleFlags[ModuleFlags.Exported = 1] = "Exported", ModuleFlags[ModuleFlags.Private = 2] = "Private", ModuleFlags[ModuleFlags.Public = 4] = "Public", ModuleFlags[ModuleFlags.Ambient = 8] = "Ambient", ModuleFlags[ModuleFlags.Static = 16] = "Static", ModuleFlags[ModuleFlags.LocalStatic = 32] = "LocalStatic", ModuleFlags[ModuleFlags.GetAccessor = 64] = "GetAccessor", ModuleFlags[ModuleFlags.SetAccessor = 128] = "SetAccessor", ModuleFlags[ModuleFlags.IsEnum = 256] = "IsEnum", ModuleFlags[ModuleFlags.ShouldEmitModuleDecl = 512] = "ShouldEmitModuleDecl", ModuleFlags[ModuleFlags.IsWholeFile = 1024] = "IsWholeFile", ModuleFlags[ModuleFlags.IsDynamic = 2048] = "IsDynamic", ModuleFlags[ModuleFlags.MustCaptureThis = 4096] = "MustCaptureThis"; + (ModuleFlags = ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = {}))[ModuleFlags.None = 0] = "None", ModuleFlags[ModuleFlags.Exported = 1] = "Exported", ModuleFlags[ModuleFlags.Private = 2] = "Private", ModuleFlags[ModuleFlags.Public = 4] = "Public", ModuleFlags[ModuleFlags.Ambient = 8] = "Ambient", ModuleFlags[ModuleFlags.Static = 16] = "Static", ModuleFlags[ModuleFlags.LocalStatic = 32] = "LocalStatic", ModuleFlags[ModuleFlags.GetAccessor = 64] = "GetAccessor", ModuleFlags[ModuleFlags.SetAccessor = 128] = "SetAccessor", ModuleFlags[ModuleFlags.IsEnum = 256] = "IsEnum", ModuleFlags[ModuleFlags.ShouldEmitModuleDecl = 512] = "ShouldEmitModuleDecl", ModuleFlags[ModuleFlags.IsWholeFile = 1024] = "IsWholeFile", ModuleFlags[ModuleFlags.IsDynamic = 2048] = "IsDynamic", ModuleFlags[ModuleFlags.MustCaptureThis = 4096] = "MustCaptureThis"; let SymbolFlags; - (SymbolFlags = SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = { - }))[SymbolFlags.None = 0] = "None", SymbolFlags[SymbolFlags.Exported = 1] = "Exported", SymbolFlags[SymbolFlags.Private = 2] = "Private", SymbolFlags[SymbolFlags.Public = 4] = "Public", SymbolFlags[SymbolFlags.Ambient = 8] = "Ambient", SymbolFlags[SymbolFlags.Static = 16] = "Static", SymbolFlags[SymbolFlags.LocalStatic = 32] = "LocalStatic", SymbolFlags[SymbolFlags.GetAccessor = 64] = "GetAccessor", SymbolFlags[SymbolFlags.SetAccessor = 128] = "SetAccessor", SymbolFlags[SymbolFlags.Property = 256] = "Property", SymbolFlags[SymbolFlags.Readonly = 512] = "Readonly", SymbolFlags[SymbolFlags.ModuleMember = 1024] = "ModuleMember", SymbolFlags[SymbolFlags.InterfaceMember = 2048] = "InterfaceMember", SymbolFlags[SymbolFlags.ClassMember = 4096] = "ClassMember", SymbolFlags[SymbolFlags.BuiltIn = 8192] = "BuiltIn", SymbolFlags[SymbolFlags.TypeSetDuringScopeAssignment = 16384] = "TypeSetDuringScopeAssignment", SymbolFlags[SymbolFlags.Constant = 32768] = "Constant", SymbolFlags[SymbolFlags.Optional = 65536] = "Optional", SymbolFlags[SymbolFlags.RecursivelyReferenced = 131072] = "RecursivelyReferenced", SymbolFlags[SymbolFlags.Bound = 262144] = "Bound", SymbolFlags[SymbolFlags.CompilerGenerated = 524288] = "CompilerGenerated"; + (SymbolFlags = SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = {}))[SymbolFlags.None = 0] = "None", SymbolFlags[SymbolFlags.Exported = 1] = "Exported", SymbolFlags[SymbolFlags.Private = 2] = "Private", SymbolFlags[SymbolFlags.Public = 4] = "Public", SymbolFlags[SymbolFlags.Ambient = 8] = "Ambient", SymbolFlags[SymbolFlags.Static = 16] = "Static", SymbolFlags[SymbolFlags.LocalStatic = 32] = "LocalStatic", SymbolFlags[SymbolFlags.GetAccessor = 64] = "GetAccessor", SymbolFlags[SymbolFlags.SetAccessor = 128] = "SetAccessor", SymbolFlags[SymbolFlags.Property = 256] = "Property", SymbolFlags[SymbolFlags.Readonly = 512] = "Readonly", SymbolFlags[SymbolFlags.ModuleMember = 1024] = "ModuleMember", SymbolFlags[SymbolFlags.InterfaceMember = 2048] = "InterfaceMember", SymbolFlags[SymbolFlags.ClassMember = 4096] = "ClassMember", SymbolFlags[SymbolFlags.BuiltIn = 8192] = "BuiltIn", SymbolFlags[SymbolFlags.TypeSetDuringScopeAssignment = 16384] = "TypeSetDuringScopeAssignment", SymbolFlags[SymbolFlags.Constant = 32768] = "Constant", SymbolFlags[SymbolFlags.Optional = 65536] = "Optional", SymbolFlags[SymbolFlags.RecursivelyReferenced = 131072] = "RecursivelyReferenced", SymbolFlags[SymbolFlags.Bound = 262144] = "Bound", SymbolFlags[SymbolFlags.CompilerGenerated = 524288] = "CompilerGenerated"; let VarFlags; - (VarFlags = VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = { - }))[VarFlags.None = 0] = "None", VarFlags[VarFlags.Exported = 1] = "Exported", VarFlags[VarFlags.Private = 2] = "Private", VarFlags[VarFlags.Public = 4] = "Public", VarFlags[VarFlags.Ambient = 8] = "Ambient", VarFlags[VarFlags.Static = 16] = "Static", VarFlags[VarFlags.LocalStatic = 32] = "LocalStatic", VarFlags[VarFlags.GetAccessor = 64] = "GetAccessor", VarFlags[VarFlags.SetAccessor = 128] = "SetAccessor", VarFlags[VarFlags.AutoInit = 256] = "AutoInit", VarFlags[VarFlags.Property = 512] = "Property", VarFlags[VarFlags.Readonly = 1024] = "Readonly", VarFlags[VarFlags.Class = 2048] = "Class", VarFlags[VarFlags.ClassProperty = 4096] = "ClassProperty", VarFlags[VarFlags.ClassBodyProperty = 8192] = "ClassBodyProperty", VarFlags[VarFlags.ClassConstructorProperty = 16384] = "ClassConstructorProperty", VarFlags[VarFlags.ClassSuperMustBeFirstCallInConstructor = 32768] = "ClassSuperMustBeFirstCallInConstructor", VarFlags[VarFlags.Constant = 65536] = "Constant", VarFlags[VarFlags.MustCaptureThis = 131072] = "MustCaptureThis"; + (VarFlags = VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = {}))[VarFlags.None = 0] = "None", VarFlags[VarFlags.Exported = 1] = "Exported", VarFlags[VarFlags.Private = 2] = "Private", VarFlags[VarFlags.Public = 4] = "Public", VarFlags[VarFlags.Ambient = 8] = "Ambient", VarFlags[VarFlags.Static = 16] = "Static", VarFlags[VarFlags.LocalStatic = 32] = "LocalStatic", VarFlags[VarFlags.GetAccessor = 64] = "GetAccessor", VarFlags[VarFlags.SetAccessor = 128] = "SetAccessor", VarFlags[VarFlags.AutoInit = 256] = "AutoInit", VarFlags[VarFlags.Property = 512] = "Property", VarFlags[VarFlags.Readonly = 1024] = "Readonly", VarFlags[VarFlags.Class = 2048] = "Class", VarFlags[VarFlags.ClassProperty = 4096] = "ClassProperty", VarFlags[VarFlags.ClassBodyProperty = 8192] = "ClassBodyProperty", VarFlags[VarFlags.ClassConstructorProperty = 16384] = "ClassConstructorProperty", VarFlags[VarFlags.ClassSuperMustBeFirstCallInConstructor = 32768] = "ClassSuperMustBeFirstCallInConstructor", VarFlags[VarFlags.Constant = 65536] = "Constant", VarFlags[VarFlags.MustCaptureThis = 131072] = "MustCaptureThis"; let FncFlags; - (FncFlags = FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = { - }))[FncFlags.None = 0] = "None", FncFlags[FncFlags.Exported = 1] = "Exported", FncFlags[FncFlags.Private = 2] = "Private", FncFlags[FncFlags.Public = 4] = "Public", FncFlags[FncFlags.Ambient = 8] = "Ambient", FncFlags[FncFlags.Static = 16] = "Static", FncFlags[FncFlags.LocalStatic = 32] = "LocalStatic", FncFlags[FncFlags.GetAccessor = 64] = "GetAccessor", FncFlags[FncFlags.SetAccessor = 128] = "SetAccessor", FncFlags[FncFlags.Definition = 256] = "Definition", FncFlags[FncFlags.Signature = 512] = "Signature", FncFlags[FncFlags.Method = 1024] = "Method", FncFlags[FncFlags.HasReturnExpression = 2048] = "HasReturnExpression", FncFlags[FncFlags.CallMember = 4096] = "CallMember", FncFlags[FncFlags.ConstructMember = 8192] = "ConstructMember", FncFlags[FncFlags.HasSelfReference = 16384] = "HasSelfReference", FncFlags[FncFlags.IsFatArrowFunction = 32768] = "IsFatArrowFunction", FncFlags[FncFlags.IndexerMember = 65536] = "IndexerMember", FncFlags[FncFlags.IsFunctionExpression = 131072] = "IsFunctionExpression", FncFlags[FncFlags.ClassMethod = 262144] = "ClassMethod", FncFlags[FncFlags.ClassPropertyMethodExported = 524288] = "ClassPropertyMethodExported"; + (FncFlags = FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = {}))[FncFlags.None = 0] = "None", FncFlags[FncFlags.Exported = 1] = "Exported", FncFlags[FncFlags.Private = 2] = "Private", FncFlags[FncFlags.Public = 4] = "Public", FncFlags[FncFlags.Ambient = 8] = "Ambient", FncFlags[FncFlags.Static = 16] = "Static", FncFlags[FncFlags.LocalStatic = 32] = "LocalStatic", FncFlags[FncFlags.GetAccessor = 64] = "GetAccessor", FncFlags[FncFlags.SetAccessor = 128] = "SetAccessor", FncFlags[FncFlags.Definition = 256] = "Definition", FncFlags[FncFlags.Signature = 512] = "Signature", FncFlags[FncFlags.Method = 1024] = "Method", FncFlags[FncFlags.HasReturnExpression = 2048] = "HasReturnExpression", FncFlags[FncFlags.CallMember = 4096] = "CallMember", FncFlags[FncFlags.ConstructMember = 8192] = "ConstructMember", FncFlags[FncFlags.HasSelfReference = 16384] = "HasSelfReference", FncFlags[FncFlags.IsFatArrowFunction = 32768] = "IsFatArrowFunction", FncFlags[FncFlags.IndexerMember = 65536] = "IndexerMember", FncFlags[FncFlags.IsFunctionExpression = 131072] = "IsFunctionExpression", FncFlags[FncFlags.ClassMethod = 262144] = "ClassMethod", FncFlags[FncFlags.ClassPropertyMethodExported = 524288] = "ClassPropertyMethodExported"; let SignatureFlags; - (SignatureFlags = SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = { - }))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer", TypeScript1.ToDeclFlags = function(fncOrVarOrSymbolOrModuleFlags) { + (SignatureFlags = SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer", TypeScript1.ToDeclFlags = function(fncOrVarOrSymbolOrModuleFlags) { return fncOrVarOrSymbolOrModuleFlags; }; let TypeFlags; - (TypeFlags = TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = { - }))[TypeFlags.None = 0] = "None", TypeFlags[TypeFlags.HasImplementation = 1] = "HasImplementation", TypeFlags[TypeFlags.HasSelfReference = 2] = "HasSelfReference", TypeFlags[TypeFlags.MergeResult = 4] = "MergeResult", TypeFlags[TypeFlags.IsEnum = 8] = "IsEnum", TypeFlags[TypeFlags.BuildingName = 16] = "BuildingName", TypeFlags[TypeFlags.HasBaseType = 32] = "HasBaseType", TypeFlags[TypeFlags.HasBaseTypeOfObject = 64] = "HasBaseTypeOfObject", TypeFlags[TypeFlags.IsClass = 128] = "IsClass"; + (TypeFlags = TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = {}))[TypeFlags.None = 0] = "None", TypeFlags[TypeFlags.HasImplementation = 1] = "HasImplementation", TypeFlags[TypeFlags.HasSelfReference = 2] = "HasSelfReference", TypeFlags[TypeFlags.MergeResult = 4] = "MergeResult", TypeFlags[TypeFlags.IsEnum = 8] = "IsEnum", TypeFlags[TypeFlags.BuildingName = 16] = "BuildingName", TypeFlags[TypeFlags.HasBaseType = 32] = "HasBaseType", TypeFlags[TypeFlags.HasBaseTypeOfObject = 64] = "HasBaseTypeOfObject", TypeFlags[TypeFlags.IsClass = 128] = "IsClass"; let TypeRelationshipFlags; - (TypeRelationshipFlags = TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = { - }))[TypeRelationshipFlags.SuccessfulComparison = 0] = "SuccessfulComparison", TypeRelationshipFlags[TypeRelationshipFlags.SourceIsNullTargetIsVoidOrUndefined = 1] = "SourceIsNullTargetIsVoidOrUndefined", TypeRelationshipFlags[TypeRelationshipFlags.RequiredPropertyIsMissing = 2] = "RequiredPropertyIsMissing", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleSignatures = 4] = "IncompatibleSignatures", TypeRelationshipFlags[TypeRelationshipFlags.SourceSignatureHasTooManyParameters = 3] = "SourceSignatureHasTooManyParameters", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleReturnTypes = 16] = "IncompatibleReturnTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatiblePropertyTypes = 32] = "IncompatiblePropertyTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleParameterTypes = 64] = "IncompatibleParameterTypes"; + (TypeRelationshipFlags = TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = {}))[TypeRelationshipFlags.SuccessfulComparison = 0] = "SuccessfulComparison", TypeRelationshipFlags[TypeRelationshipFlags.SourceIsNullTargetIsVoidOrUndefined = 1] = "SourceIsNullTargetIsVoidOrUndefined", TypeRelationshipFlags[TypeRelationshipFlags.RequiredPropertyIsMissing = 2] = "RequiredPropertyIsMissing", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleSignatures = 4] = "IncompatibleSignatures", TypeRelationshipFlags[TypeRelationshipFlags.SourceSignatureHasTooManyParameters = 3] = "SourceSignatureHasTooManyParameters", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleReturnTypes = 16] = "IncompatibleReturnTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatiblePropertyTypes = 32] = "IncompatiblePropertyTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleParameterTypes = 64] = "IncompatibleParameterTypes"; let CodeGenTarget; - (CodeGenTarget = CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = { - }))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5"; + (CodeGenTarget = CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = {}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5"; let ModuleGenTarget; - (ModuleGenTarget = ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = { - }))[ModuleGenTarget.Synchronous = 0] = "Synchronous", ModuleGenTarget[ModuleGenTarget.Asynchronous = 1] = "Asynchronous", ModuleGenTarget[ModuleGenTarget.Local = 2] = "Local", TypeScript1.codeGenTarget = CodeGenTarget.ES3, TypeScript1.moduleGenTarget = ModuleGenTarget.Synchronous, TypeScript1.optimizeModuleCodeGen = !0, TypeScript1.flagsToString = function(e, flags) { + (ModuleGenTarget = ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = {}))[ModuleGenTarget.Synchronous = 0] = "Synchronous", ModuleGenTarget[ModuleGenTarget.Asynchronous = 1] = "Asynchronous", ModuleGenTarget[ModuleGenTarget.Local = 2] = "Local", TypeScript1.codeGenTarget = CodeGenTarget.ES3, TypeScript1.moduleGenTarget = ModuleGenTarget.Synchronous, TypeScript1.optimizeModuleCodeGen = !0, TypeScript1.flagsToString = function(e, flags) { for(var builder = "", i = 1; i < -2147483648; i <<= 1)if ((flags & i) != 0) { for(var k in e)if (e[k] == i) { builder.length > 0 && (builder += "|"), builder += k; @@ -56,5 +42,4 @@ var TypeScript; } return builder; }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource2_es5.1.normal.js index 1354e39ee61..bbbf78e1813 100644 --- a/crates/swc/tests/tsc-references/parserRealSource2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource2_es5.1.normal.js @@ -67,8 +67,7 @@ var TypeScript; ErrorRecoverySet[ErrorRecoverySet["ExprStart"] = 520158210] = "ExprStart"; ErrorRecoverySet[ErrorRecoverySet["StmtStart"] = 1608580098] = "StmtStart"; ErrorRecoverySet[ErrorRecoverySet["Postfix"] = 49280] = "Postfix"; - })(ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = { - })); + })(ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = {})); var AllowedElements; (function(AllowedElements) { AllowedElements[AllowedElements["None"] = 0] = "None"; @@ -79,8 +78,7 @@ var TypeScript; AllowedElements[AllowedElements["Properties"] = 2048] = "Properties"; AllowedElements[AllowedElements["Global"] = 1052] = "Global"; AllowedElements[AllowedElements["QuickParse"] = 3100] = "QuickParse"; - })(AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = { - })); + })(AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = {})); var Modifiers; (function(Modifiers) { Modifiers[Modifiers["None"] = 0] = "None"; @@ -92,8 +90,7 @@ var TypeScript; Modifiers[Modifiers["Getter"] = 32] = "Getter"; Modifiers[Modifiers["Setter"] = 64] = "Setter"; Modifiers[Modifiers["Static"] = 128] = "Static"; - })(Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = { - })); + })(Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = {})); var ASTFlags; (function(ASTFlags) { ASTFlags[ASTFlags["None"] = 0] = "None"; @@ -112,8 +109,7 @@ var TypeScript; // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. // Once we have a better way to associate information with nodes, this flag should not be used. "SkipNextRParen"] = 2048] = "SkipNextRParen"; - })(ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = { - })); + })(ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = {})); var DeclFlags; (function(DeclFlags) { DeclFlags[DeclFlags["None"] = 0] = "None"; @@ -125,8 +121,7 @@ var TypeScript; DeclFlags[DeclFlags["LocalStatic"] = 32] = "LocalStatic"; DeclFlags[DeclFlags["GetAccessor"] = 64] = "GetAccessor"; DeclFlags[DeclFlags["SetAccessor"] = 128] = "SetAccessor"; - })(DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = { - })); + })(DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = {})); var ModuleFlags; (function(ModuleFlags) { ModuleFlags[ModuleFlags["None"] = 0] = "None"; @@ -143,8 +138,7 @@ var TypeScript; ModuleFlags[ModuleFlags["IsWholeFile"] = 1024] = "IsWholeFile"; ModuleFlags[ModuleFlags["IsDynamic"] = 2048] = "IsDynamic"; ModuleFlags[ModuleFlags["MustCaptureThis"] = 4096] = "MustCaptureThis"; - })(ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = { - })); + })(ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = {})); var SymbolFlags; (function(SymbolFlags) { SymbolFlags[SymbolFlags["None"] = 0] = "None"; @@ -168,8 +162,7 @@ var TypeScript; SymbolFlags[SymbolFlags["RecursivelyReferenced"] = 131072] = "RecursivelyReferenced"; SymbolFlags[SymbolFlags["Bound"] = 262144] = "Bound"; SymbolFlags[SymbolFlags["CompilerGenerated"] = 524288] = "CompilerGenerated"; - })(SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = { - })); + })(SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = {})); var VarFlags; (function(VarFlags) { VarFlags[VarFlags["None"] = 0] = "None"; @@ -191,8 +184,7 @@ var TypeScript; VarFlags[VarFlags["ClassSuperMustBeFirstCallInConstructor"] = 32768] = "ClassSuperMustBeFirstCallInConstructor"; VarFlags[VarFlags["Constant"] = 65536] = "Constant"; VarFlags[VarFlags["MustCaptureThis"] = 131072] = "MustCaptureThis"; - })(VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = { - })); + })(VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = {})); var FncFlags; (function(FncFlags) { FncFlags[FncFlags["None"] = 0] = "None"; @@ -216,16 +208,14 @@ var TypeScript; FncFlags[FncFlags["IsFunctionExpression"] = 131072] = "IsFunctionExpression"; FncFlags[FncFlags["ClassMethod"] = 262144] = "ClassMethod"; FncFlags[FncFlags["ClassPropertyMethodExported"] = 524288] = "ClassPropertyMethodExported"; - })(FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = { - })); + })(FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = {})); var SignatureFlags; (function(SignatureFlags) { SignatureFlags[SignatureFlags["None"] = 0] = "None"; SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; SignatureFlags[SignatureFlags["IsStringIndexer"] = 2] = "IsStringIndexer"; SignatureFlags[SignatureFlags["IsNumberIndexer"] = 4] = "IsNumberIndexer"; - })(SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = { - })); + })(SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = {})); TypeScript1.ToDeclFlags = ToDeclFlags; var TypeFlags; (function(TypeFlags) { @@ -238,8 +228,7 @@ var TypeScript; TypeFlags[TypeFlags["HasBaseType"] = 32] = "HasBaseType"; TypeFlags[TypeFlags["HasBaseTypeOfObject"] = 64] = "HasBaseTypeOfObject"; TypeFlags[TypeFlags["IsClass"] = 128] = "IsClass"; - })(TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = { - })); + })(TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = {})); var TypeRelationshipFlags; (function(TypeRelationshipFlags) { TypeRelationshipFlags[TypeRelationshipFlags["SuccessfulComparison"] = 0] = "SuccessfulComparison"; @@ -250,24 +239,20 @@ var TypeScript; TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleReturnTypes"] = 16] = "IncompatibleReturnTypes"; TypeRelationshipFlags[TypeRelationshipFlags["IncompatiblePropertyTypes"] = 32] = "IncompatiblePropertyTypes"; TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleParameterTypes"] = 64] = "IncompatibleParameterTypes"; - })(TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = { - })); + })(TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = {})); var CodeGenTarget; (function(CodeGenTarget) { CodeGenTarget[CodeGenTarget["ES3"] = 0] = "ES3"; CodeGenTarget[CodeGenTarget["ES5"] = 1] = "ES5"; - })(CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = { - })); + })(CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = {})); var ModuleGenTarget; (function(ModuleGenTarget) { ModuleGenTarget[ModuleGenTarget["Synchronous"] = 0] = "Synchronous"; ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 1] = "Asynchronous"; ModuleGenTarget[ModuleGenTarget["Local"] = 2] = "Local"; - })(ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = { - })); + })(ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = {})); var codeGenTarget = TypeScript1.codeGenTarget = CodeGenTarget.ES3; var moduleGenTarget = TypeScript1.moduleGenTarget = ModuleGenTarget.Synchronous; var optimizeModuleCodeGen = TypeScript1.optimizeModuleCodeGen = true; TypeScript1.flagsToString = flagsToString; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource2_es5.2.minified.js index 3987ee87164..6accabed2d2 100644 --- a/crates/swc/tests/tsc-references/parserRealSource2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource2_es5.2.minified.js @@ -3,23 +3,9 @@ var TypeScript; var ErrorRecoverySet, AllowedElements, Modifiers, ASTFlags, DeclFlags, ModuleFlags, SymbolFlags, VarFlags, FncFlags, SignatureFlags, TypeFlags, TypeRelationshipFlags, CodeGenTarget, ModuleGenTarget, ErrorRecoverySet, AllowedElements, Modifiers, ASTFlags, DeclFlags, ModuleFlags, SymbolFlags, VarFlags, FncFlags, SignatureFlags, TypeFlags, TypeRelationshipFlags, CodeGenTarget, ModuleGenTarget; TypeScript1.hasFlag = function(val, flag) { return (val & flag) != 0; - }, (ErrorRecoverySet = ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = { - }))[ErrorRecoverySet.None = 0] = "None", ErrorRecoverySet[ErrorRecoverySet.Comma = 1] = "Comma", ErrorRecoverySet[ErrorRecoverySet.SColon = 2] = "SColon", ErrorRecoverySet[ErrorRecoverySet.Asg = 4] = "Asg", ErrorRecoverySet[ErrorRecoverySet.BinOp = 8] = "BinOp", ErrorRecoverySet[ErrorRecoverySet.RBrack = 16] = "RBrack", ErrorRecoverySet[ErrorRecoverySet.RCurly = 32] = "RCurly", ErrorRecoverySet[ErrorRecoverySet.RParen = 64] = "RParen", ErrorRecoverySet[ErrorRecoverySet.Dot = 128] = "Dot", ErrorRecoverySet[ErrorRecoverySet.Colon = 256] = "Colon", ErrorRecoverySet[ErrorRecoverySet.PrimType = 512] = "PrimType", ErrorRecoverySet[ErrorRecoverySet.AddOp = 1024] = "AddOp", ErrorRecoverySet[ErrorRecoverySet.LCurly = 2048] = "LCurly", ErrorRecoverySet[ErrorRecoverySet.PreOp = 4096] = "PreOp", ErrorRecoverySet[ErrorRecoverySet.RegExp = 8192] = "RegExp", ErrorRecoverySet[ErrorRecoverySet.LParen = 16384] = "LParen", ErrorRecoverySet[ErrorRecoverySet.LBrack = 32768] = "LBrack", ErrorRecoverySet[ErrorRecoverySet.Scope = 65536] = "Scope", ErrorRecoverySet[ErrorRecoverySet.In = 131072] = "In", ErrorRecoverySet[ErrorRecoverySet.SCase = 262144] = "SCase", ErrorRecoverySet[ErrorRecoverySet.Else = 524288] = "Else", ErrorRecoverySet[ErrorRecoverySet.Catch = 1048576] = "Catch", ErrorRecoverySet[ErrorRecoverySet.Var = 2097152] = "Var", ErrorRecoverySet[ErrorRecoverySet.Stmt = 4194304] = "Stmt", ErrorRecoverySet[ErrorRecoverySet.While = 8388608] = "While", ErrorRecoverySet[ErrorRecoverySet.ID = 16777216] = "ID", ErrorRecoverySet[ErrorRecoverySet.Prefix = 33554432] = "Prefix", ErrorRecoverySet[ErrorRecoverySet.Literal = 67108864] = "Literal", ErrorRecoverySet[ErrorRecoverySet.RLit = 134217728] = "RLit", ErrorRecoverySet[ErrorRecoverySet.Func = 268435456] = "Func", ErrorRecoverySet[ErrorRecoverySet.EOF = 536870912] = "EOF", ErrorRecoverySet[ErrorRecoverySet.TypeScriptS = 1073741824] = "TypeScriptS", ErrorRecoverySet[ErrorRecoverySet.ExprStart = 520158210] = "ExprStart", ErrorRecoverySet[ErrorRecoverySet.StmtStart = 1608580098] = "StmtStart", ErrorRecoverySet[ErrorRecoverySet.Postfix = 49280] = "Postfix", (AllowedElements = AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = { - }))[AllowedElements.None = 0] = "None", AllowedElements[AllowedElements.ModuleDeclarations = 4] = "ModuleDeclarations", AllowedElements[AllowedElements.ClassDeclarations = 8] = "ClassDeclarations", AllowedElements[AllowedElements.InterfaceDeclarations = 16] = "InterfaceDeclarations", AllowedElements[AllowedElements.AmbientDeclarations = 1024] = "AmbientDeclarations", AllowedElements[AllowedElements.Properties = 2048] = "Properties", AllowedElements[AllowedElements.Global = 1052] = "Global", AllowedElements[AllowedElements.QuickParse = 3100] = "QuickParse", (Modifiers = Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = { - }))[Modifiers.None = 0] = "None", Modifiers[Modifiers.Private = 1] = "Private", Modifiers[Modifiers.Public = 2] = "Public", Modifiers[Modifiers.Readonly = 4] = "Readonly", Modifiers[Modifiers.Ambient = 8] = "Ambient", Modifiers[Modifiers.Exported = 16] = "Exported", Modifiers[Modifiers.Getter = 32] = "Getter", Modifiers[Modifiers.Setter = 64] = "Setter", Modifiers[Modifiers.Static = 128] = "Static", (ASTFlags = ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = { - }))[ASTFlags.None = 0] = "None", ASTFlags[ASTFlags.ExplicitSemicolon = 1] = "ExplicitSemicolon", ASTFlags[ASTFlags.AutomaticSemicolon = 2] = "AutomaticSemicolon", ASTFlags[ASTFlags.Writeable = 4] = "Writeable", ASTFlags[ASTFlags.Error = 8] = "Error", ASTFlags[ASTFlags.DotLHSPartial = 16] = "DotLHSPartial", ASTFlags[ASTFlags.DotLHS = 32] = "DotLHS", ASTFlags[ASTFlags.IsStatement = 64] = "IsStatement", ASTFlags[ASTFlags.StrictMode = 128] = "StrictMode", ASTFlags[ASTFlags.PossibleOptionalParameter = 256] = "PossibleOptionalParameter", ASTFlags[ASTFlags.ClassBaseConstructorCall = 512] = "ClassBaseConstructorCall", ASTFlags[ASTFlags.OptionalName = 1024] = "OptionalName", ASTFlags[ASTFlags.SkipNextRParen = 2048] = "SkipNextRParen", (DeclFlags = DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = { - }))[DeclFlags.None = 0] = "None", DeclFlags[DeclFlags.Exported = 1] = "Exported", DeclFlags[DeclFlags.Private = 2] = "Private", DeclFlags[DeclFlags.Public = 4] = "Public", DeclFlags[DeclFlags.Ambient = 8] = "Ambient", DeclFlags[DeclFlags.Static = 16] = "Static", DeclFlags[DeclFlags.LocalStatic = 32] = "LocalStatic", DeclFlags[DeclFlags.GetAccessor = 64] = "GetAccessor", DeclFlags[DeclFlags.SetAccessor = 128] = "SetAccessor", (ModuleFlags = ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = { - }))[ModuleFlags.None = 0] = "None", ModuleFlags[ModuleFlags.Exported = 1] = "Exported", ModuleFlags[ModuleFlags.Private = 2] = "Private", ModuleFlags[ModuleFlags.Public = 4] = "Public", ModuleFlags[ModuleFlags.Ambient = 8] = "Ambient", ModuleFlags[ModuleFlags.Static = 16] = "Static", ModuleFlags[ModuleFlags.LocalStatic = 32] = "LocalStatic", ModuleFlags[ModuleFlags.GetAccessor = 64] = "GetAccessor", ModuleFlags[ModuleFlags.SetAccessor = 128] = "SetAccessor", ModuleFlags[ModuleFlags.IsEnum = 256] = "IsEnum", ModuleFlags[ModuleFlags.ShouldEmitModuleDecl = 512] = "ShouldEmitModuleDecl", ModuleFlags[ModuleFlags.IsWholeFile = 1024] = "IsWholeFile", ModuleFlags[ModuleFlags.IsDynamic = 2048] = "IsDynamic", ModuleFlags[ModuleFlags.MustCaptureThis = 4096] = "MustCaptureThis", (SymbolFlags = SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = { - }))[SymbolFlags.None = 0] = "None", SymbolFlags[SymbolFlags.Exported = 1] = "Exported", SymbolFlags[SymbolFlags.Private = 2] = "Private", SymbolFlags[SymbolFlags.Public = 4] = "Public", SymbolFlags[SymbolFlags.Ambient = 8] = "Ambient", SymbolFlags[SymbolFlags.Static = 16] = "Static", SymbolFlags[SymbolFlags.LocalStatic = 32] = "LocalStatic", SymbolFlags[SymbolFlags.GetAccessor = 64] = "GetAccessor", SymbolFlags[SymbolFlags.SetAccessor = 128] = "SetAccessor", SymbolFlags[SymbolFlags.Property = 256] = "Property", SymbolFlags[SymbolFlags.Readonly = 512] = "Readonly", SymbolFlags[SymbolFlags.ModuleMember = 1024] = "ModuleMember", SymbolFlags[SymbolFlags.InterfaceMember = 2048] = "InterfaceMember", SymbolFlags[SymbolFlags.ClassMember = 4096] = "ClassMember", SymbolFlags[SymbolFlags.BuiltIn = 8192] = "BuiltIn", SymbolFlags[SymbolFlags.TypeSetDuringScopeAssignment = 16384] = "TypeSetDuringScopeAssignment", SymbolFlags[SymbolFlags.Constant = 32768] = "Constant", SymbolFlags[SymbolFlags.Optional = 65536] = "Optional", SymbolFlags[SymbolFlags.RecursivelyReferenced = 131072] = "RecursivelyReferenced", SymbolFlags[SymbolFlags.Bound = 262144] = "Bound", SymbolFlags[SymbolFlags.CompilerGenerated = 524288] = "CompilerGenerated", (VarFlags = VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = { - }))[VarFlags.None = 0] = "None", VarFlags[VarFlags.Exported = 1] = "Exported", VarFlags[VarFlags.Private = 2] = "Private", VarFlags[VarFlags.Public = 4] = "Public", VarFlags[VarFlags.Ambient = 8] = "Ambient", VarFlags[VarFlags.Static = 16] = "Static", VarFlags[VarFlags.LocalStatic = 32] = "LocalStatic", VarFlags[VarFlags.GetAccessor = 64] = "GetAccessor", VarFlags[VarFlags.SetAccessor = 128] = "SetAccessor", VarFlags[VarFlags.AutoInit = 256] = "AutoInit", VarFlags[VarFlags.Property = 512] = "Property", VarFlags[VarFlags.Readonly = 1024] = "Readonly", VarFlags[VarFlags.Class = 2048] = "Class", VarFlags[VarFlags.ClassProperty = 4096] = "ClassProperty", VarFlags[VarFlags.ClassBodyProperty = 8192] = "ClassBodyProperty", VarFlags[VarFlags.ClassConstructorProperty = 16384] = "ClassConstructorProperty", VarFlags[VarFlags.ClassSuperMustBeFirstCallInConstructor = 32768] = "ClassSuperMustBeFirstCallInConstructor", VarFlags[VarFlags.Constant = 65536] = "Constant", VarFlags[VarFlags.MustCaptureThis = 131072] = "MustCaptureThis", (FncFlags = FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = { - }))[FncFlags.None = 0] = "None", FncFlags[FncFlags.Exported = 1] = "Exported", FncFlags[FncFlags.Private = 2] = "Private", FncFlags[FncFlags.Public = 4] = "Public", FncFlags[FncFlags.Ambient = 8] = "Ambient", FncFlags[FncFlags.Static = 16] = "Static", FncFlags[FncFlags.LocalStatic = 32] = "LocalStatic", FncFlags[FncFlags.GetAccessor = 64] = "GetAccessor", FncFlags[FncFlags.SetAccessor = 128] = "SetAccessor", FncFlags[FncFlags.Definition = 256] = "Definition", FncFlags[FncFlags.Signature = 512] = "Signature", FncFlags[FncFlags.Method = 1024] = "Method", FncFlags[FncFlags.HasReturnExpression = 2048] = "HasReturnExpression", FncFlags[FncFlags.CallMember = 4096] = "CallMember", FncFlags[FncFlags.ConstructMember = 8192] = "ConstructMember", FncFlags[FncFlags.HasSelfReference = 16384] = "HasSelfReference", FncFlags[FncFlags.IsFatArrowFunction = 32768] = "IsFatArrowFunction", FncFlags[FncFlags.IndexerMember = 65536] = "IndexerMember", FncFlags[FncFlags.IsFunctionExpression = 131072] = "IsFunctionExpression", FncFlags[FncFlags.ClassMethod = 262144] = "ClassMethod", FncFlags[FncFlags.ClassPropertyMethodExported = 524288] = "ClassPropertyMethodExported", (SignatureFlags = SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = { - }))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer", TypeScript1.ToDeclFlags = function(fncOrVarOrSymbolOrModuleFlags) { + }, (ErrorRecoverySet = ErrorRecoverySet = TypeScript1.ErrorRecoverySet || (TypeScript1.ErrorRecoverySet = {}))[ErrorRecoverySet.None = 0] = "None", ErrorRecoverySet[ErrorRecoverySet.Comma = 1] = "Comma", ErrorRecoverySet[ErrorRecoverySet.SColon = 2] = "SColon", ErrorRecoverySet[ErrorRecoverySet.Asg = 4] = "Asg", ErrorRecoverySet[ErrorRecoverySet.BinOp = 8] = "BinOp", ErrorRecoverySet[ErrorRecoverySet.RBrack = 16] = "RBrack", ErrorRecoverySet[ErrorRecoverySet.RCurly = 32] = "RCurly", ErrorRecoverySet[ErrorRecoverySet.RParen = 64] = "RParen", ErrorRecoverySet[ErrorRecoverySet.Dot = 128] = "Dot", ErrorRecoverySet[ErrorRecoverySet.Colon = 256] = "Colon", ErrorRecoverySet[ErrorRecoverySet.PrimType = 512] = "PrimType", ErrorRecoverySet[ErrorRecoverySet.AddOp = 1024] = "AddOp", ErrorRecoverySet[ErrorRecoverySet.LCurly = 2048] = "LCurly", ErrorRecoverySet[ErrorRecoverySet.PreOp = 4096] = "PreOp", ErrorRecoverySet[ErrorRecoverySet.RegExp = 8192] = "RegExp", ErrorRecoverySet[ErrorRecoverySet.LParen = 16384] = "LParen", ErrorRecoverySet[ErrorRecoverySet.LBrack = 32768] = "LBrack", ErrorRecoverySet[ErrorRecoverySet.Scope = 65536] = "Scope", ErrorRecoverySet[ErrorRecoverySet.In = 131072] = "In", ErrorRecoverySet[ErrorRecoverySet.SCase = 262144] = "SCase", ErrorRecoverySet[ErrorRecoverySet.Else = 524288] = "Else", ErrorRecoverySet[ErrorRecoverySet.Catch = 1048576] = "Catch", ErrorRecoverySet[ErrorRecoverySet.Var = 2097152] = "Var", ErrorRecoverySet[ErrorRecoverySet.Stmt = 4194304] = "Stmt", ErrorRecoverySet[ErrorRecoverySet.While = 8388608] = "While", ErrorRecoverySet[ErrorRecoverySet.ID = 16777216] = "ID", ErrorRecoverySet[ErrorRecoverySet.Prefix = 33554432] = "Prefix", ErrorRecoverySet[ErrorRecoverySet.Literal = 67108864] = "Literal", ErrorRecoverySet[ErrorRecoverySet.RLit = 134217728] = "RLit", ErrorRecoverySet[ErrorRecoverySet.Func = 268435456] = "Func", ErrorRecoverySet[ErrorRecoverySet.EOF = 536870912] = "EOF", ErrorRecoverySet[ErrorRecoverySet.TypeScriptS = 1073741824] = "TypeScriptS", ErrorRecoverySet[ErrorRecoverySet.ExprStart = 520158210] = "ExprStart", ErrorRecoverySet[ErrorRecoverySet.StmtStart = 1608580098] = "StmtStart", ErrorRecoverySet[ErrorRecoverySet.Postfix = 49280] = "Postfix", (AllowedElements = AllowedElements = TypeScript1.AllowedElements || (TypeScript1.AllowedElements = {}))[AllowedElements.None = 0] = "None", AllowedElements[AllowedElements.ModuleDeclarations = 4] = "ModuleDeclarations", AllowedElements[AllowedElements.ClassDeclarations = 8] = "ClassDeclarations", AllowedElements[AllowedElements.InterfaceDeclarations = 16] = "InterfaceDeclarations", AllowedElements[AllowedElements.AmbientDeclarations = 1024] = "AmbientDeclarations", AllowedElements[AllowedElements.Properties = 2048] = "Properties", AllowedElements[AllowedElements.Global = 1052] = "Global", AllowedElements[AllowedElements.QuickParse = 3100] = "QuickParse", (Modifiers = Modifiers = TypeScript1.Modifiers || (TypeScript1.Modifiers = {}))[Modifiers.None = 0] = "None", Modifiers[Modifiers.Private = 1] = "Private", Modifiers[Modifiers.Public = 2] = "Public", Modifiers[Modifiers.Readonly = 4] = "Readonly", Modifiers[Modifiers.Ambient = 8] = "Ambient", Modifiers[Modifiers.Exported = 16] = "Exported", Modifiers[Modifiers.Getter = 32] = "Getter", Modifiers[Modifiers.Setter = 64] = "Setter", Modifiers[Modifiers.Static = 128] = "Static", (ASTFlags = ASTFlags = TypeScript1.ASTFlags || (TypeScript1.ASTFlags = {}))[ASTFlags.None = 0] = "None", ASTFlags[ASTFlags.ExplicitSemicolon = 1] = "ExplicitSemicolon", ASTFlags[ASTFlags.AutomaticSemicolon = 2] = "AutomaticSemicolon", ASTFlags[ASTFlags.Writeable = 4] = "Writeable", ASTFlags[ASTFlags.Error = 8] = "Error", ASTFlags[ASTFlags.DotLHSPartial = 16] = "DotLHSPartial", ASTFlags[ASTFlags.DotLHS = 32] = "DotLHS", ASTFlags[ASTFlags.IsStatement = 64] = "IsStatement", ASTFlags[ASTFlags.StrictMode = 128] = "StrictMode", ASTFlags[ASTFlags.PossibleOptionalParameter = 256] = "PossibleOptionalParameter", ASTFlags[ASTFlags.ClassBaseConstructorCall = 512] = "ClassBaseConstructorCall", ASTFlags[ASTFlags.OptionalName = 1024] = "OptionalName", ASTFlags[ASTFlags.SkipNextRParen = 2048] = "SkipNextRParen", (DeclFlags = DeclFlags = TypeScript1.DeclFlags || (TypeScript1.DeclFlags = {}))[DeclFlags.None = 0] = "None", DeclFlags[DeclFlags.Exported = 1] = "Exported", DeclFlags[DeclFlags.Private = 2] = "Private", DeclFlags[DeclFlags.Public = 4] = "Public", DeclFlags[DeclFlags.Ambient = 8] = "Ambient", DeclFlags[DeclFlags.Static = 16] = "Static", DeclFlags[DeclFlags.LocalStatic = 32] = "LocalStatic", DeclFlags[DeclFlags.GetAccessor = 64] = "GetAccessor", DeclFlags[DeclFlags.SetAccessor = 128] = "SetAccessor", (ModuleFlags = ModuleFlags = TypeScript1.ModuleFlags || (TypeScript1.ModuleFlags = {}))[ModuleFlags.None = 0] = "None", ModuleFlags[ModuleFlags.Exported = 1] = "Exported", ModuleFlags[ModuleFlags.Private = 2] = "Private", ModuleFlags[ModuleFlags.Public = 4] = "Public", ModuleFlags[ModuleFlags.Ambient = 8] = "Ambient", ModuleFlags[ModuleFlags.Static = 16] = "Static", ModuleFlags[ModuleFlags.LocalStatic = 32] = "LocalStatic", ModuleFlags[ModuleFlags.GetAccessor = 64] = "GetAccessor", ModuleFlags[ModuleFlags.SetAccessor = 128] = "SetAccessor", ModuleFlags[ModuleFlags.IsEnum = 256] = "IsEnum", ModuleFlags[ModuleFlags.ShouldEmitModuleDecl = 512] = "ShouldEmitModuleDecl", ModuleFlags[ModuleFlags.IsWholeFile = 1024] = "IsWholeFile", ModuleFlags[ModuleFlags.IsDynamic = 2048] = "IsDynamic", ModuleFlags[ModuleFlags.MustCaptureThis = 4096] = "MustCaptureThis", (SymbolFlags = SymbolFlags = TypeScript1.SymbolFlags || (TypeScript1.SymbolFlags = {}))[SymbolFlags.None = 0] = "None", SymbolFlags[SymbolFlags.Exported = 1] = "Exported", SymbolFlags[SymbolFlags.Private = 2] = "Private", SymbolFlags[SymbolFlags.Public = 4] = "Public", SymbolFlags[SymbolFlags.Ambient = 8] = "Ambient", SymbolFlags[SymbolFlags.Static = 16] = "Static", SymbolFlags[SymbolFlags.LocalStatic = 32] = "LocalStatic", SymbolFlags[SymbolFlags.GetAccessor = 64] = "GetAccessor", SymbolFlags[SymbolFlags.SetAccessor = 128] = "SetAccessor", SymbolFlags[SymbolFlags.Property = 256] = "Property", SymbolFlags[SymbolFlags.Readonly = 512] = "Readonly", SymbolFlags[SymbolFlags.ModuleMember = 1024] = "ModuleMember", SymbolFlags[SymbolFlags.InterfaceMember = 2048] = "InterfaceMember", SymbolFlags[SymbolFlags.ClassMember = 4096] = "ClassMember", SymbolFlags[SymbolFlags.BuiltIn = 8192] = "BuiltIn", SymbolFlags[SymbolFlags.TypeSetDuringScopeAssignment = 16384] = "TypeSetDuringScopeAssignment", SymbolFlags[SymbolFlags.Constant = 32768] = "Constant", SymbolFlags[SymbolFlags.Optional = 65536] = "Optional", SymbolFlags[SymbolFlags.RecursivelyReferenced = 131072] = "RecursivelyReferenced", SymbolFlags[SymbolFlags.Bound = 262144] = "Bound", SymbolFlags[SymbolFlags.CompilerGenerated = 524288] = "CompilerGenerated", (VarFlags = VarFlags = TypeScript1.VarFlags || (TypeScript1.VarFlags = {}))[VarFlags.None = 0] = "None", VarFlags[VarFlags.Exported = 1] = "Exported", VarFlags[VarFlags.Private = 2] = "Private", VarFlags[VarFlags.Public = 4] = "Public", VarFlags[VarFlags.Ambient = 8] = "Ambient", VarFlags[VarFlags.Static = 16] = "Static", VarFlags[VarFlags.LocalStatic = 32] = "LocalStatic", VarFlags[VarFlags.GetAccessor = 64] = "GetAccessor", VarFlags[VarFlags.SetAccessor = 128] = "SetAccessor", VarFlags[VarFlags.AutoInit = 256] = "AutoInit", VarFlags[VarFlags.Property = 512] = "Property", VarFlags[VarFlags.Readonly = 1024] = "Readonly", VarFlags[VarFlags.Class = 2048] = "Class", VarFlags[VarFlags.ClassProperty = 4096] = "ClassProperty", VarFlags[VarFlags.ClassBodyProperty = 8192] = "ClassBodyProperty", VarFlags[VarFlags.ClassConstructorProperty = 16384] = "ClassConstructorProperty", VarFlags[VarFlags.ClassSuperMustBeFirstCallInConstructor = 32768] = "ClassSuperMustBeFirstCallInConstructor", VarFlags[VarFlags.Constant = 65536] = "Constant", VarFlags[VarFlags.MustCaptureThis = 131072] = "MustCaptureThis", (FncFlags = FncFlags = TypeScript1.FncFlags || (TypeScript1.FncFlags = {}))[FncFlags.None = 0] = "None", FncFlags[FncFlags.Exported = 1] = "Exported", FncFlags[FncFlags.Private = 2] = "Private", FncFlags[FncFlags.Public = 4] = "Public", FncFlags[FncFlags.Ambient = 8] = "Ambient", FncFlags[FncFlags.Static = 16] = "Static", FncFlags[FncFlags.LocalStatic = 32] = "LocalStatic", FncFlags[FncFlags.GetAccessor = 64] = "GetAccessor", FncFlags[FncFlags.SetAccessor = 128] = "SetAccessor", FncFlags[FncFlags.Definition = 256] = "Definition", FncFlags[FncFlags.Signature = 512] = "Signature", FncFlags[FncFlags.Method = 1024] = "Method", FncFlags[FncFlags.HasReturnExpression = 2048] = "HasReturnExpression", FncFlags[FncFlags.CallMember = 4096] = "CallMember", FncFlags[FncFlags.ConstructMember = 8192] = "ConstructMember", FncFlags[FncFlags.HasSelfReference = 16384] = "HasSelfReference", FncFlags[FncFlags.IsFatArrowFunction = 32768] = "IsFatArrowFunction", FncFlags[FncFlags.IndexerMember = 65536] = "IndexerMember", FncFlags[FncFlags.IsFunctionExpression = 131072] = "IsFunctionExpression", FncFlags[FncFlags.ClassMethod = 262144] = "ClassMethod", FncFlags[FncFlags.ClassPropertyMethodExported = 524288] = "ClassPropertyMethodExported", (SignatureFlags = SignatureFlags = TypeScript1.SignatureFlags || (TypeScript1.SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer", TypeScript1.ToDeclFlags = function(fncOrVarOrSymbolOrModuleFlags) { return fncOrVarOrSymbolOrModuleFlags; - }, (TypeFlags = TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = { - }))[TypeFlags.None = 0] = "None", TypeFlags[TypeFlags.HasImplementation = 1] = "HasImplementation", TypeFlags[TypeFlags.HasSelfReference = 2] = "HasSelfReference", TypeFlags[TypeFlags.MergeResult = 4] = "MergeResult", TypeFlags[TypeFlags.IsEnum = 8] = "IsEnum", TypeFlags[TypeFlags.BuildingName = 16] = "BuildingName", TypeFlags[TypeFlags.HasBaseType = 32] = "HasBaseType", TypeFlags[TypeFlags.HasBaseTypeOfObject = 64] = "HasBaseTypeOfObject", TypeFlags[TypeFlags.IsClass = 128] = "IsClass", (TypeRelationshipFlags = TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = { - }))[TypeRelationshipFlags.SuccessfulComparison = 0] = "SuccessfulComparison", TypeRelationshipFlags[TypeRelationshipFlags.SourceIsNullTargetIsVoidOrUndefined = 1] = "SourceIsNullTargetIsVoidOrUndefined", TypeRelationshipFlags[TypeRelationshipFlags.RequiredPropertyIsMissing = 2] = "RequiredPropertyIsMissing", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleSignatures = 4] = "IncompatibleSignatures", TypeRelationshipFlags[TypeRelationshipFlags.SourceSignatureHasTooManyParameters = 3] = "SourceSignatureHasTooManyParameters", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleReturnTypes = 16] = "IncompatibleReturnTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatiblePropertyTypes = 32] = "IncompatiblePropertyTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleParameterTypes = 64] = "IncompatibleParameterTypes", (CodeGenTarget = CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = { - }))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5", (ModuleGenTarget = ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = { - }))[ModuleGenTarget.Synchronous = 0] = "Synchronous", ModuleGenTarget[ModuleGenTarget.Asynchronous = 1] = "Asynchronous", ModuleGenTarget[ModuleGenTarget.Local = 2] = "Local", TypeScript1.codeGenTarget = CodeGenTarget.ES3, TypeScript1.moduleGenTarget = ModuleGenTarget.Synchronous, TypeScript1.optimizeModuleCodeGen = !0, TypeScript1.flagsToString = function(e, flags) { + }, (TypeFlags = TypeFlags = TypeScript1.TypeFlags || (TypeScript1.TypeFlags = {}))[TypeFlags.None = 0] = "None", TypeFlags[TypeFlags.HasImplementation = 1] = "HasImplementation", TypeFlags[TypeFlags.HasSelfReference = 2] = "HasSelfReference", TypeFlags[TypeFlags.MergeResult = 4] = "MergeResult", TypeFlags[TypeFlags.IsEnum = 8] = "IsEnum", TypeFlags[TypeFlags.BuildingName = 16] = "BuildingName", TypeFlags[TypeFlags.HasBaseType = 32] = "HasBaseType", TypeFlags[TypeFlags.HasBaseTypeOfObject = 64] = "HasBaseTypeOfObject", TypeFlags[TypeFlags.IsClass = 128] = "IsClass", (TypeRelationshipFlags = TypeRelationshipFlags = TypeScript1.TypeRelationshipFlags || (TypeScript1.TypeRelationshipFlags = {}))[TypeRelationshipFlags.SuccessfulComparison = 0] = "SuccessfulComparison", TypeRelationshipFlags[TypeRelationshipFlags.SourceIsNullTargetIsVoidOrUndefined = 1] = "SourceIsNullTargetIsVoidOrUndefined", TypeRelationshipFlags[TypeRelationshipFlags.RequiredPropertyIsMissing = 2] = "RequiredPropertyIsMissing", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleSignatures = 4] = "IncompatibleSignatures", TypeRelationshipFlags[TypeRelationshipFlags.SourceSignatureHasTooManyParameters = 3] = "SourceSignatureHasTooManyParameters", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleReturnTypes = 16] = "IncompatibleReturnTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatiblePropertyTypes = 32] = "IncompatiblePropertyTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleParameterTypes = 64] = "IncompatibleParameterTypes", (CodeGenTarget = CodeGenTarget = TypeScript1.CodeGenTarget || (TypeScript1.CodeGenTarget = {}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5", (ModuleGenTarget = ModuleGenTarget = TypeScript1.ModuleGenTarget || (TypeScript1.ModuleGenTarget = {}))[ModuleGenTarget.Synchronous = 0] = "Synchronous", ModuleGenTarget[ModuleGenTarget.Asynchronous = 1] = "Asynchronous", ModuleGenTarget[ModuleGenTarget.Local = 2] = "Local", TypeScript1.codeGenTarget = CodeGenTarget.ES3, TypeScript1.moduleGenTarget = ModuleGenTarget.Synchronous, TypeScript1.optimizeModuleCodeGen = !0, TypeScript1.flagsToString = function(e, flags) { for(var builder = "", i = 1; i < -2147483648; i <<= 1)if ((flags & i) != 0) { for(var k in e)if (e[k] == i) { builder.length > 0 && (builder += "|"), builder += k; @@ -28,5 +14,4 @@ var TypeScript; } return builder; }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource3_es2015.1.normal.js index e32d3467be4..275be2d8c71 100644 --- a/crates/swc/tests/tsc-references/parserRealSource3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource3_es2015.1.normal.js @@ -114,7 +114,5 @@ var TypeScript; NodeType[NodeType["Debugger"] = 106] = "Debugger"; NodeType[NodeType["GeneralNode"] = 71] = "GeneralNode"; NodeType[NodeType["LastAsg"] = 41] = "LastAsg"; - })(NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = { - })); -})(TypeScript || (TypeScript = { -})); + })(NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = {})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource3_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource3_es2015.2.minified.js index fcab95dbdab..815607c39e2 100644 --- a/crates/swc/tests/tsc-references/parserRealSource3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource3_es2015.2.minified.js @@ -2,7 +2,5 @@ var TypeScript; !function(TypeScript1) { var NodeType; let NodeType; - (NodeType = NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = { - }))[NodeType.None = 0] = "None", NodeType[NodeType.Empty = 1] = "Empty", NodeType[NodeType.EmptyExpr = 2] = "EmptyExpr", NodeType[NodeType.True = 3] = "True", NodeType[NodeType.False = 4] = "False", NodeType[NodeType.This = 5] = "This", NodeType[NodeType.Super = 6] = "Super", NodeType[NodeType.QString = 7] = "QString", NodeType[NodeType.Regex = 8] = "Regex", NodeType[NodeType.Null = 9] = "Null", NodeType[NodeType.ArrayLit = 10] = "ArrayLit", NodeType[NodeType.ObjectLit = 11] = "ObjectLit", NodeType[NodeType.Void = 12] = "Void", NodeType[NodeType.Comma = 13] = "Comma", NodeType[NodeType.Pos = 14] = "Pos", NodeType[NodeType.Neg = 15] = "Neg", NodeType[NodeType.Delete = 16] = "Delete", NodeType[NodeType.Await = 17] = "Await", NodeType[NodeType.In = 18] = "In", NodeType[NodeType.Dot = 19] = "Dot", NodeType[NodeType.From = 20] = "From", NodeType[NodeType.Is = 21] = "Is", NodeType[NodeType.InstOf = 22] = "InstOf", NodeType[NodeType.Typeof = 23] = "Typeof", NodeType[NodeType.NumberLit = 24] = "NumberLit", NodeType[NodeType.Name = 25] = "Name", NodeType[NodeType.TypeRef = 26] = "TypeRef", NodeType[NodeType.Index = 27] = "Index", NodeType[NodeType.Call = 28] = "Call", NodeType[NodeType.New = 29] = "New", NodeType[NodeType.Asg = 30] = "Asg", NodeType[NodeType.AsgAdd = 31] = "AsgAdd", NodeType[NodeType.AsgSub = 32] = "AsgSub", NodeType[NodeType.AsgDiv = 33] = "AsgDiv", NodeType[NodeType.AsgMul = 34] = "AsgMul", NodeType[NodeType.AsgMod = 35] = "AsgMod", NodeType[NodeType.AsgAnd = 36] = "AsgAnd", NodeType[NodeType.AsgXor = 37] = "AsgXor", NodeType[NodeType.AsgOr = 38] = "AsgOr", NodeType[NodeType.AsgLsh = 39] = "AsgLsh", NodeType[NodeType.AsgRsh = 40] = "AsgRsh", NodeType[NodeType.AsgRs2 = 41] = "AsgRs2", NodeType[NodeType.ConditionalExpression = 42] = "ConditionalExpression", NodeType[NodeType.LogOr = 43] = "LogOr", NodeType[NodeType.LogAnd = 44] = "LogAnd", NodeType[NodeType.Or = 45] = "Or", NodeType[NodeType.Xor = 46] = "Xor", NodeType[NodeType.And = 47] = "And", NodeType[NodeType.Eq = 48] = "Eq", NodeType[NodeType.Ne = 49] = "Ne", NodeType[NodeType.Eqv = 50] = "Eqv", NodeType[NodeType.NEqv = 51] = "NEqv", NodeType[NodeType.Lt = 52] = "Lt", NodeType[NodeType.Le = 53] = "Le", NodeType[NodeType.Gt = 54] = "Gt", NodeType[NodeType.Ge = 55] = "Ge", NodeType[NodeType.Add = 56] = "Add", NodeType[NodeType.Sub = 57] = "Sub", NodeType[NodeType.Mul = 58] = "Mul", NodeType[NodeType.Div = 59] = "Div", NodeType[NodeType.Mod = 60] = "Mod", NodeType[NodeType.Lsh = 61] = "Lsh", NodeType[NodeType.Rsh = 62] = "Rsh", NodeType[NodeType.Rs2 = 63] = "Rs2", NodeType[NodeType.Not = 64] = "Not", NodeType[NodeType.LogNot = 65] = "LogNot", NodeType[NodeType.IncPre = 66] = "IncPre", NodeType[NodeType.DecPre = 67] = "DecPre", NodeType[NodeType.IncPost = 68] = "IncPost", NodeType[NodeType.DecPost = 69] = "DecPost", NodeType[NodeType.TypeAssertion = 70] = "TypeAssertion", NodeType[NodeType.FuncDecl = 71] = "FuncDecl", NodeType[NodeType.Member = 72] = "Member", NodeType[NodeType.VarDecl = 73] = "VarDecl", NodeType[NodeType.ArgDecl = 74] = "ArgDecl", NodeType[NodeType.Return = 75] = "Return", NodeType[NodeType.Break = 76] = "Break", NodeType[NodeType.Continue = 77] = "Continue", NodeType[NodeType.Throw = 78] = "Throw", NodeType[NodeType.For = 79] = "For", NodeType[NodeType.ForIn = 80] = "ForIn", NodeType[NodeType.If = 81] = "If", NodeType[NodeType.While = 82] = "While", NodeType[NodeType.DoWhile = 83] = "DoWhile", NodeType[NodeType.Block = 84] = "Block", NodeType[NodeType.Case = 85] = "Case", NodeType[NodeType.Switch = 86] = "Switch", NodeType[NodeType.Try = 87] = "Try", NodeType[NodeType.TryCatch = 88] = "TryCatch", NodeType[NodeType.TryFinally = 89] = "TryFinally", NodeType[NodeType.Finally = 90] = "Finally", NodeType[NodeType.Catch = 91] = "Catch", NodeType[NodeType.List = 92] = "List", NodeType[NodeType.Script = 93] = "Script", NodeType[NodeType.ClassDeclaration = 94] = "ClassDeclaration", NodeType[NodeType.InterfaceDeclaration = 95] = "InterfaceDeclaration", NodeType[NodeType.ModuleDeclaration = 96] = "ModuleDeclaration", NodeType[NodeType.ImportDeclaration = 97] = "ImportDeclaration", NodeType[NodeType.With = 98] = "With", NodeType[NodeType.Label = 99] = "Label", NodeType[NodeType.LabeledStatement = 100] = "LabeledStatement", NodeType[NodeType.EBStart = 101] = "EBStart", NodeType[NodeType.GotoEB = 102] = "GotoEB", NodeType[NodeType.EndCode = 103] = "EndCode", NodeType[NodeType.Error = 104] = "Error", NodeType[NodeType.Comment = 105] = "Comment", NodeType[NodeType.Debugger = 106] = "Debugger", NodeType[NodeType.GeneralNode = 71] = "GeneralNode", NodeType[NodeType.LastAsg = 41] = "LastAsg"; -}(TypeScript || (TypeScript = { -})); + (NodeType = NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = {}))[NodeType.None = 0] = "None", NodeType[NodeType.Empty = 1] = "Empty", NodeType[NodeType.EmptyExpr = 2] = "EmptyExpr", NodeType[NodeType.True = 3] = "True", NodeType[NodeType.False = 4] = "False", NodeType[NodeType.This = 5] = "This", NodeType[NodeType.Super = 6] = "Super", NodeType[NodeType.QString = 7] = "QString", NodeType[NodeType.Regex = 8] = "Regex", NodeType[NodeType.Null = 9] = "Null", NodeType[NodeType.ArrayLit = 10] = "ArrayLit", NodeType[NodeType.ObjectLit = 11] = "ObjectLit", NodeType[NodeType.Void = 12] = "Void", NodeType[NodeType.Comma = 13] = "Comma", NodeType[NodeType.Pos = 14] = "Pos", NodeType[NodeType.Neg = 15] = "Neg", NodeType[NodeType.Delete = 16] = "Delete", NodeType[NodeType.Await = 17] = "Await", NodeType[NodeType.In = 18] = "In", NodeType[NodeType.Dot = 19] = "Dot", NodeType[NodeType.From = 20] = "From", NodeType[NodeType.Is = 21] = "Is", NodeType[NodeType.InstOf = 22] = "InstOf", NodeType[NodeType.Typeof = 23] = "Typeof", NodeType[NodeType.NumberLit = 24] = "NumberLit", NodeType[NodeType.Name = 25] = "Name", NodeType[NodeType.TypeRef = 26] = "TypeRef", NodeType[NodeType.Index = 27] = "Index", NodeType[NodeType.Call = 28] = "Call", NodeType[NodeType.New = 29] = "New", NodeType[NodeType.Asg = 30] = "Asg", NodeType[NodeType.AsgAdd = 31] = "AsgAdd", NodeType[NodeType.AsgSub = 32] = "AsgSub", NodeType[NodeType.AsgDiv = 33] = "AsgDiv", NodeType[NodeType.AsgMul = 34] = "AsgMul", NodeType[NodeType.AsgMod = 35] = "AsgMod", NodeType[NodeType.AsgAnd = 36] = "AsgAnd", NodeType[NodeType.AsgXor = 37] = "AsgXor", NodeType[NodeType.AsgOr = 38] = "AsgOr", NodeType[NodeType.AsgLsh = 39] = "AsgLsh", NodeType[NodeType.AsgRsh = 40] = "AsgRsh", NodeType[NodeType.AsgRs2 = 41] = "AsgRs2", NodeType[NodeType.ConditionalExpression = 42] = "ConditionalExpression", NodeType[NodeType.LogOr = 43] = "LogOr", NodeType[NodeType.LogAnd = 44] = "LogAnd", NodeType[NodeType.Or = 45] = "Or", NodeType[NodeType.Xor = 46] = "Xor", NodeType[NodeType.And = 47] = "And", NodeType[NodeType.Eq = 48] = "Eq", NodeType[NodeType.Ne = 49] = "Ne", NodeType[NodeType.Eqv = 50] = "Eqv", NodeType[NodeType.NEqv = 51] = "NEqv", NodeType[NodeType.Lt = 52] = "Lt", NodeType[NodeType.Le = 53] = "Le", NodeType[NodeType.Gt = 54] = "Gt", NodeType[NodeType.Ge = 55] = "Ge", NodeType[NodeType.Add = 56] = "Add", NodeType[NodeType.Sub = 57] = "Sub", NodeType[NodeType.Mul = 58] = "Mul", NodeType[NodeType.Div = 59] = "Div", NodeType[NodeType.Mod = 60] = "Mod", NodeType[NodeType.Lsh = 61] = "Lsh", NodeType[NodeType.Rsh = 62] = "Rsh", NodeType[NodeType.Rs2 = 63] = "Rs2", NodeType[NodeType.Not = 64] = "Not", NodeType[NodeType.LogNot = 65] = "LogNot", NodeType[NodeType.IncPre = 66] = "IncPre", NodeType[NodeType.DecPre = 67] = "DecPre", NodeType[NodeType.IncPost = 68] = "IncPost", NodeType[NodeType.DecPost = 69] = "DecPost", NodeType[NodeType.TypeAssertion = 70] = "TypeAssertion", NodeType[NodeType.FuncDecl = 71] = "FuncDecl", NodeType[NodeType.Member = 72] = "Member", NodeType[NodeType.VarDecl = 73] = "VarDecl", NodeType[NodeType.ArgDecl = 74] = "ArgDecl", NodeType[NodeType.Return = 75] = "Return", NodeType[NodeType.Break = 76] = "Break", NodeType[NodeType.Continue = 77] = "Continue", NodeType[NodeType.Throw = 78] = "Throw", NodeType[NodeType.For = 79] = "For", NodeType[NodeType.ForIn = 80] = "ForIn", NodeType[NodeType.If = 81] = "If", NodeType[NodeType.While = 82] = "While", NodeType[NodeType.DoWhile = 83] = "DoWhile", NodeType[NodeType.Block = 84] = "Block", NodeType[NodeType.Case = 85] = "Case", NodeType[NodeType.Switch = 86] = "Switch", NodeType[NodeType.Try = 87] = "Try", NodeType[NodeType.TryCatch = 88] = "TryCatch", NodeType[NodeType.TryFinally = 89] = "TryFinally", NodeType[NodeType.Finally = 90] = "Finally", NodeType[NodeType.Catch = 91] = "Catch", NodeType[NodeType.List = 92] = "List", NodeType[NodeType.Script = 93] = "Script", NodeType[NodeType.ClassDeclaration = 94] = "ClassDeclaration", NodeType[NodeType.InterfaceDeclaration = 95] = "InterfaceDeclaration", NodeType[NodeType.ModuleDeclaration = 96] = "ModuleDeclaration", NodeType[NodeType.ImportDeclaration = 97] = "ImportDeclaration", NodeType[NodeType.With = 98] = "With", NodeType[NodeType.Label = 99] = "Label", NodeType[NodeType.LabeledStatement = 100] = "LabeledStatement", NodeType[NodeType.EBStart = 101] = "EBStart", NodeType[NodeType.GotoEB = 102] = "GotoEB", NodeType[NodeType.EndCode = 103] = "EndCode", NodeType[NodeType.Error = 104] = "Error", NodeType[NodeType.Comment = 105] = "Comment", NodeType[NodeType.Debugger = 106] = "Debugger", NodeType[NodeType.GeneralNode = 71] = "GeneralNode", NodeType[NodeType.LastAsg = 41] = "LastAsg"; +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource3_es5.1.normal.js index eb4af3df0ba..0c3c8926993 100644 --- a/crates/swc/tests/tsc-references/parserRealSource3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource3_es5.1.normal.js @@ -114,7 +114,5 @@ var TypeScript; NodeType[NodeType["Debugger"] = 106] = "Debugger"; NodeType[NodeType["GeneralNode"] = 71] = "GeneralNode"; NodeType[NodeType["LastAsg"] = 41] = "LastAsg"; - })(NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = { - })); -})(TypeScript || (TypeScript = { -})); + })(NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = {})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource3_es5.2.minified.js index c3e1631701e..0b232d1c4ab 100644 --- a/crates/swc/tests/tsc-references/parserRealSource3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource3_es5.2.minified.js @@ -1,7 +1,5 @@ var TypeScript; !function(TypeScript1) { var NodeType, NodeType; - (NodeType = NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = { - }))[NodeType.None = 0] = "None", NodeType[NodeType.Empty = 1] = "Empty", NodeType[NodeType.EmptyExpr = 2] = "EmptyExpr", NodeType[NodeType.True = 3] = "True", NodeType[NodeType.False = 4] = "False", NodeType[NodeType.This = 5] = "This", NodeType[NodeType.Super = 6] = "Super", NodeType[NodeType.QString = 7] = "QString", NodeType[NodeType.Regex = 8] = "Regex", NodeType[NodeType.Null = 9] = "Null", NodeType[NodeType.ArrayLit = 10] = "ArrayLit", NodeType[NodeType.ObjectLit = 11] = "ObjectLit", NodeType[NodeType.Void = 12] = "Void", NodeType[NodeType.Comma = 13] = "Comma", NodeType[NodeType.Pos = 14] = "Pos", NodeType[NodeType.Neg = 15] = "Neg", NodeType[NodeType.Delete = 16] = "Delete", NodeType[NodeType.Await = 17] = "Await", NodeType[NodeType.In = 18] = "In", NodeType[NodeType.Dot = 19] = "Dot", NodeType[NodeType.From = 20] = "From", NodeType[NodeType.Is = 21] = "Is", NodeType[NodeType.InstOf = 22] = "InstOf", NodeType[NodeType.Typeof = 23] = "Typeof", NodeType[NodeType.NumberLit = 24] = "NumberLit", NodeType[NodeType.Name = 25] = "Name", NodeType[NodeType.TypeRef = 26] = "TypeRef", NodeType[NodeType.Index = 27] = "Index", NodeType[NodeType.Call = 28] = "Call", NodeType[NodeType.New = 29] = "New", NodeType[NodeType.Asg = 30] = "Asg", NodeType[NodeType.AsgAdd = 31] = "AsgAdd", NodeType[NodeType.AsgSub = 32] = "AsgSub", NodeType[NodeType.AsgDiv = 33] = "AsgDiv", NodeType[NodeType.AsgMul = 34] = "AsgMul", NodeType[NodeType.AsgMod = 35] = "AsgMod", NodeType[NodeType.AsgAnd = 36] = "AsgAnd", NodeType[NodeType.AsgXor = 37] = "AsgXor", NodeType[NodeType.AsgOr = 38] = "AsgOr", NodeType[NodeType.AsgLsh = 39] = "AsgLsh", NodeType[NodeType.AsgRsh = 40] = "AsgRsh", NodeType[NodeType.AsgRs2 = 41] = "AsgRs2", NodeType[NodeType.ConditionalExpression = 42] = "ConditionalExpression", NodeType[NodeType.LogOr = 43] = "LogOr", NodeType[NodeType.LogAnd = 44] = "LogAnd", NodeType[NodeType.Or = 45] = "Or", NodeType[NodeType.Xor = 46] = "Xor", NodeType[NodeType.And = 47] = "And", NodeType[NodeType.Eq = 48] = "Eq", NodeType[NodeType.Ne = 49] = "Ne", NodeType[NodeType.Eqv = 50] = "Eqv", NodeType[NodeType.NEqv = 51] = "NEqv", NodeType[NodeType.Lt = 52] = "Lt", NodeType[NodeType.Le = 53] = "Le", NodeType[NodeType.Gt = 54] = "Gt", NodeType[NodeType.Ge = 55] = "Ge", NodeType[NodeType.Add = 56] = "Add", NodeType[NodeType.Sub = 57] = "Sub", NodeType[NodeType.Mul = 58] = "Mul", NodeType[NodeType.Div = 59] = "Div", NodeType[NodeType.Mod = 60] = "Mod", NodeType[NodeType.Lsh = 61] = "Lsh", NodeType[NodeType.Rsh = 62] = "Rsh", NodeType[NodeType.Rs2 = 63] = "Rs2", NodeType[NodeType.Not = 64] = "Not", NodeType[NodeType.LogNot = 65] = "LogNot", NodeType[NodeType.IncPre = 66] = "IncPre", NodeType[NodeType.DecPre = 67] = "DecPre", NodeType[NodeType.IncPost = 68] = "IncPost", NodeType[NodeType.DecPost = 69] = "DecPost", NodeType[NodeType.TypeAssertion = 70] = "TypeAssertion", NodeType[NodeType.FuncDecl = 71] = "FuncDecl", NodeType[NodeType.Member = 72] = "Member", NodeType[NodeType.VarDecl = 73] = "VarDecl", NodeType[NodeType.ArgDecl = 74] = "ArgDecl", NodeType[NodeType.Return = 75] = "Return", NodeType[NodeType.Break = 76] = "Break", NodeType[NodeType.Continue = 77] = "Continue", NodeType[NodeType.Throw = 78] = "Throw", NodeType[NodeType.For = 79] = "For", NodeType[NodeType.ForIn = 80] = "ForIn", NodeType[NodeType.If = 81] = "If", NodeType[NodeType.While = 82] = "While", NodeType[NodeType.DoWhile = 83] = "DoWhile", NodeType[NodeType.Block = 84] = "Block", NodeType[NodeType.Case = 85] = "Case", NodeType[NodeType.Switch = 86] = "Switch", NodeType[NodeType.Try = 87] = "Try", NodeType[NodeType.TryCatch = 88] = "TryCatch", NodeType[NodeType.TryFinally = 89] = "TryFinally", NodeType[NodeType.Finally = 90] = "Finally", NodeType[NodeType.Catch = 91] = "Catch", NodeType[NodeType.List = 92] = "List", NodeType[NodeType.Script = 93] = "Script", NodeType[NodeType.ClassDeclaration = 94] = "ClassDeclaration", NodeType[NodeType.InterfaceDeclaration = 95] = "InterfaceDeclaration", NodeType[NodeType.ModuleDeclaration = 96] = "ModuleDeclaration", NodeType[NodeType.ImportDeclaration = 97] = "ImportDeclaration", NodeType[NodeType.With = 98] = "With", NodeType[NodeType.Label = 99] = "Label", NodeType[NodeType.LabeledStatement = 100] = "LabeledStatement", NodeType[NodeType.EBStart = 101] = "EBStart", NodeType[NodeType.GotoEB = 102] = "GotoEB", NodeType[NodeType.EndCode = 103] = "EndCode", NodeType[NodeType.Error = 104] = "Error", NodeType[NodeType.Comment = 105] = "Comment", NodeType[NodeType.Debugger = 106] = "Debugger", NodeType[NodeType.GeneralNode = 71] = "GeneralNode", NodeType[NodeType.LastAsg = 41] = "LastAsg"; -}(TypeScript || (TypeScript = { -})); + (NodeType = NodeType = TypeScript1.NodeType || (TypeScript1.NodeType = {}))[NodeType.None = 0] = "None", NodeType[NodeType.Empty = 1] = "Empty", NodeType[NodeType.EmptyExpr = 2] = "EmptyExpr", NodeType[NodeType.True = 3] = "True", NodeType[NodeType.False = 4] = "False", NodeType[NodeType.This = 5] = "This", NodeType[NodeType.Super = 6] = "Super", NodeType[NodeType.QString = 7] = "QString", NodeType[NodeType.Regex = 8] = "Regex", NodeType[NodeType.Null = 9] = "Null", NodeType[NodeType.ArrayLit = 10] = "ArrayLit", NodeType[NodeType.ObjectLit = 11] = "ObjectLit", NodeType[NodeType.Void = 12] = "Void", NodeType[NodeType.Comma = 13] = "Comma", NodeType[NodeType.Pos = 14] = "Pos", NodeType[NodeType.Neg = 15] = "Neg", NodeType[NodeType.Delete = 16] = "Delete", NodeType[NodeType.Await = 17] = "Await", NodeType[NodeType.In = 18] = "In", NodeType[NodeType.Dot = 19] = "Dot", NodeType[NodeType.From = 20] = "From", NodeType[NodeType.Is = 21] = "Is", NodeType[NodeType.InstOf = 22] = "InstOf", NodeType[NodeType.Typeof = 23] = "Typeof", NodeType[NodeType.NumberLit = 24] = "NumberLit", NodeType[NodeType.Name = 25] = "Name", NodeType[NodeType.TypeRef = 26] = "TypeRef", NodeType[NodeType.Index = 27] = "Index", NodeType[NodeType.Call = 28] = "Call", NodeType[NodeType.New = 29] = "New", NodeType[NodeType.Asg = 30] = "Asg", NodeType[NodeType.AsgAdd = 31] = "AsgAdd", NodeType[NodeType.AsgSub = 32] = "AsgSub", NodeType[NodeType.AsgDiv = 33] = "AsgDiv", NodeType[NodeType.AsgMul = 34] = "AsgMul", NodeType[NodeType.AsgMod = 35] = "AsgMod", NodeType[NodeType.AsgAnd = 36] = "AsgAnd", NodeType[NodeType.AsgXor = 37] = "AsgXor", NodeType[NodeType.AsgOr = 38] = "AsgOr", NodeType[NodeType.AsgLsh = 39] = "AsgLsh", NodeType[NodeType.AsgRsh = 40] = "AsgRsh", NodeType[NodeType.AsgRs2 = 41] = "AsgRs2", NodeType[NodeType.ConditionalExpression = 42] = "ConditionalExpression", NodeType[NodeType.LogOr = 43] = "LogOr", NodeType[NodeType.LogAnd = 44] = "LogAnd", NodeType[NodeType.Or = 45] = "Or", NodeType[NodeType.Xor = 46] = "Xor", NodeType[NodeType.And = 47] = "And", NodeType[NodeType.Eq = 48] = "Eq", NodeType[NodeType.Ne = 49] = "Ne", NodeType[NodeType.Eqv = 50] = "Eqv", NodeType[NodeType.NEqv = 51] = "NEqv", NodeType[NodeType.Lt = 52] = "Lt", NodeType[NodeType.Le = 53] = "Le", NodeType[NodeType.Gt = 54] = "Gt", NodeType[NodeType.Ge = 55] = "Ge", NodeType[NodeType.Add = 56] = "Add", NodeType[NodeType.Sub = 57] = "Sub", NodeType[NodeType.Mul = 58] = "Mul", NodeType[NodeType.Div = 59] = "Div", NodeType[NodeType.Mod = 60] = "Mod", NodeType[NodeType.Lsh = 61] = "Lsh", NodeType[NodeType.Rsh = 62] = "Rsh", NodeType[NodeType.Rs2 = 63] = "Rs2", NodeType[NodeType.Not = 64] = "Not", NodeType[NodeType.LogNot = 65] = "LogNot", NodeType[NodeType.IncPre = 66] = "IncPre", NodeType[NodeType.DecPre = 67] = "DecPre", NodeType[NodeType.IncPost = 68] = "IncPost", NodeType[NodeType.DecPost = 69] = "DecPost", NodeType[NodeType.TypeAssertion = 70] = "TypeAssertion", NodeType[NodeType.FuncDecl = 71] = "FuncDecl", NodeType[NodeType.Member = 72] = "Member", NodeType[NodeType.VarDecl = 73] = "VarDecl", NodeType[NodeType.ArgDecl = 74] = "ArgDecl", NodeType[NodeType.Return = 75] = "Return", NodeType[NodeType.Break = 76] = "Break", NodeType[NodeType.Continue = 77] = "Continue", NodeType[NodeType.Throw = 78] = "Throw", NodeType[NodeType.For = 79] = "For", NodeType[NodeType.ForIn = 80] = "ForIn", NodeType[NodeType.If = 81] = "If", NodeType[NodeType.While = 82] = "While", NodeType[NodeType.DoWhile = 83] = "DoWhile", NodeType[NodeType.Block = 84] = "Block", NodeType[NodeType.Case = 85] = "Case", NodeType[NodeType.Switch = 86] = "Switch", NodeType[NodeType.Try = 87] = "Try", NodeType[NodeType.TryCatch = 88] = "TryCatch", NodeType[NodeType.TryFinally = 89] = "TryFinally", NodeType[NodeType.Finally = 90] = "Finally", NodeType[NodeType.Catch = 91] = "Catch", NodeType[NodeType.List = 92] = "List", NodeType[NodeType.Script = 93] = "Script", NodeType[NodeType.ClassDeclaration = 94] = "ClassDeclaration", NodeType[NodeType.InterfaceDeclaration = 95] = "InterfaceDeclaration", NodeType[NodeType.ModuleDeclaration = 96] = "ModuleDeclaration", NodeType[NodeType.ImportDeclaration = 97] = "ImportDeclaration", NodeType[NodeType.With = 98] = "With", NodeType[NodeType.Label = 99] = "Label", NodeType[NodeType.LabeledStatement = 100] = "LabeledStatement", NodeType[NodeType.EBStart = 101] = "EBStart", NodeType[NodeType.GotoEB = 102] = "GotoEB", NodeType[NodeType.EndCode = 103] = "EndCode", NodeType[NodeType.Error = 104] = "Error", NodeType[NodeType.Comment = 105] = "Comment", NodeType[NodeType.Debugger = 106] = "Debugger", NodeType[NodeType.GeneralNode = 71] = "GeneralNode", NodeType[NodeType.LastAsg = 41] = "LastAsg"; +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource5_es2015.1.normal.js index b8dca83b45d..f8957f8e88d 100644 --- a/crates/swc/tests/tsc-references/parserRealSource5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource5_es2015.1.normal.js @@ -55,5 +55,4 @@ var TypeScript; return ast; } TypeScript1.postPrintAST = postPrintAST; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource5_es2015.2.minified.js index 67bc56adb34..12677274d80 100644 --- a/crates/swc/tests/tsc-references/parserRealSource5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource5_es2015.2.minified.js @@ -1,6 +1,5 @@ var TypeScript, TypeScript1; -(TypeScript1 = TypeScript || (TypeScript = { -})).PrintContext = class { +(TypeScript1 = TypeScript || (TypeScript = {})).PrintContext = class { increaseIndent() { this.indentAmt++; } diff --git a/crates/swc/tests/tsc-references/parserRealSource5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource5_es5.1.normal.js index 6000c5d22bd..dabd0026cba 100644 --- a/crates/swc/tests/tsc-references/parserRealSource5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource5_es5.1.normal.js @@ -94,5 +94,4 @@ var TypeScript; TypeScript1.PrintContext = PrintContext; TypeScript1.prePrintAST = prePrintAST; TypeScript1.postPrintAST = postPrintAST; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource5_es5.2.minified.js index 8ead906e5a6..c14fbadb1e6 100644 --- a/crates/swc/tests/tsc-references/parserRealSource5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource5_es5.2.minified.js @@ -60,5 +60,4 @@ function _defineProperties(target, props) { }, TypeScript1.postPrintAST = function(ast, parent, walker) { return walker.state.decreaseIndent(), ast; }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource6_es2015.1.normal.js index 7befeae7c93..f9ee009a7ad 100644 --- a/crates/swc/tests/tsc-references/parserRealSource6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource6_es2015.1.normal.js @@ -183,5 +183,4 @@ var TypeScript; return context; } TypeScript1.findEnclosingScopeAt = findEnclosingScopeAt; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource6_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource6_es2015.2.minified.js index 5c00821e9d8..2982eec3655 100644 --- a/crates/swc/tests/tsc-references/parserRealSource6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource6_es2015.2.minified.js @@ -95,5 +95,4 @@ var TypeScript; var context = new EnclosingScopeContext(logger, script, text, pos, isMemberCompletion); return (TypeScript.getAstWalkerFactory().walk(script, preFindEnclosingScope, null, null, context), null === context.scopeStartAST) ? null : context; }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource6_es5.1.normal.js index 3f19fb406e8..590a6657646 100644 --- a/crates/swc/tests/tsc-references/parserRealSource6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource6_es5.1.normal.js @@ -228,5 +228,4 @@ var TypeScript; TypeScript1.popTypeCollectionScope = popTypeCollectionScope; TypeScript1.preFindEnclosingScope = preFindEnclosingScope; TypeScript1.findEnclosingScopeAt = findEnclosingScopeAt; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource6_es5.2.minified.js index 5ae2ad727ae..d45a503fb71 100644 --- a/crates/swc/tests/tsc-references/parserRealSource6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource6_es5.2.minified.js @@ -129,5 +129,4 @@ function _defineProperties(target, props) { }, TypeScript1.popTypeCollectionScope = function(context) { context.scopeChain = context.scopeChain.previous; }, TypeScript1.preFindEnclosingScope = preFindEnclosingScope, TypeScript1.findEnclosingScopeAt = findEnclosingScopeAt; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource8_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource8_es2015.1.normal.js index 210d62e341d..de4cd64368d 100644 --- a/crates/swc/tests/tsc-references/parserRealSource8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource8_es2015.1.normal.js @@ -364,5 +364,4 @@ var TypeScript; return ast; } TypeScript1.postAssignScopes = postAssignScopes; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource8_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource8_es2015.2.minified.js index 9008375fa79..4914c059f3e 100644 --- a/crates/swc/tests/tsc-references/parserRealSource8_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource8_es2015.2.minified.js @@ -112,5 +112,4 @@ var TypeScript; } else ast.nodeType == NodeType.Catch ? ast.param && popAssignScope(context) : go = !1; return walker.options.goChildren = go, ast; }; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource8_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource8_es5.1.normal.js index 2b45e6a2f85..5524f1e9be5 100644 --- a/crates/swc/tests/tsc-references/parserRealSource8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource8_es5.1.normal.js @@ -394,5 +394,4 @@ var TypeScript; TypeScript1.preAssignCatchScopes = preAssignCatchScopes; TypeScript1.preAssignScopes = preAssignScopes; TypeScript1.postAssignScopes = postAssignScopes; -})(TypeScript || (TypeScript = { -})); +})(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource8_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource8_es5.2.minified.js index ffe5a9c7e94..22a7c35ad68 100644 --- a/crates/swc/tests/tsc-references/parserRealSource8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource8_es5.2.minified.js @@ -121,5 +121,4 @@ function _defineProperties(target, props) { ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), ScopeSearchFilter; }(); TypeScript1.ScopeSearchFilter = ScopeSearchFilter, TypeScript1.instanceFilter = new ScopeSearchFilter(instanceCompare, instanceFilterStop), TypeScript1.preAssignModuleScopes = preAssignModuleScopes, TypeScript1.preAssignClassScopes = preAssignClassScopes, TypeScript1.preAssignInterfaceScopes = preAssignInterfaceScopes, TypeScript1.preAssignWithScopes = preAssignWithScopes, TypeScript1.preAssignFuncDeclScopes = preAssignFuncDeclScopes, TypeScript1.preAssignCatchScopes = preAssignCatchScopes, TypeScript1.preAssignScopes = preAssignScopes, TypeScript1.postAssignScopes = postAssignScopes; -}(TypeScript || (TypeScript = { -})); +}(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es2015.1.normal.js index 22419601971..43ea9795b3d 100644 --- a/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es2015.1.normal.js @@ -6,6 +6,5 @@ * @path bestPractice/Sbp_7.9_A9_T3.js * @description Execute do { \n ; \n }while(false) true */ //CHECK#1 -do { -}while (false) +do {}while (false) true; diff --git a/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es5.1.normal.js index 22419601971..43ea9795b3d 100644 --- a/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSbp_7.9_A9_T3_es5.1.normal.js @@ -6,6 +6,5 @@ * @path bestPractice/Sbp_7.9_A9_T3.js * @description Execute do { \n ; \n }while(false) true */ //CHECK#1 -do { -}while (false) +do {}while (false) true; diff --git a/crates/swc/tests/tsc-references/parserSuperExpression1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserSuperExpression1_es2015.1.normal.js index 2be37293539..2711cbe53b2 100644 --- a/crates/swc/tests/tsc-references/parserSuperExpression1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSuperExpression1_es2015.1.normal.js @@ -12,7 +12,5 @@ var M1; super.foo(); } } - })(M2 = M11.M2 || (M11.M2 = { - })); -})(M1 || (M1 = { -})); + })(M2 = M11.M2 || (M11.M2 = {})); +})(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/parserSuperExpression1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserSuperExpression1_es5.1.normal.js index 4b1cf4f2b99..981d098aead 100644 --- a/crates/swc/tests/tsc-references/parserSuperExpression1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSuperExpression1_es5.1.normal.js @@ -80,7 +80,5 @@ var M1; ]); return C; }(); - })(M2 = M11.M2 || (M11.M2 = { - })); -})(M1 || (M1 = { -})); + })(M2 = M11.M2 || (M11.M2 = {})); +})(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/parserSuperExpression1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserSuperExpression1_es5.2.minified.js index ccc0ce60069..2320805352a 100644 --- a/crates/swc/tests/tsc-references/parserSuperExpression1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserSuperExpression1_es5.2.minified.js @@ -44,8 +44,7 @@ var M1, C = function() { }(); !function(M11) { var C; - M11.M2 || (M11.M2 = { - }), C = (function() { + M11.M2 || (M11.M2 = {}), C = (function() { "use strict"; function C() { _classCallCheck(this, C); @@ -59,5 +58,4 @@ var M1, C = function() { } ]), C; })(); -}(M1 || (M1 = { -})); +}(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/parserSuperExpression4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserSuperExpression4_es2015.1.normal.js index 41afe7d8aed..05e4466e661 100644 --- a/crates/swc/tests/tsc-references/parserSuperExpression4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSuperExpression4_es2015.1.normal.js @@ -12,7 +12,5 @@ var M1; super.foo = 1; } } - })(M2 = M11.M2 || (M11.M2 = { - })); -})(M1 || (M1 = { -})); + })(M2 = M11.M2 || (M11.M2 = {})); +})(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/parserSuperExpression4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserSuperExpression4_es5.1.normal.js index c127ee63746..7881f6a0f8b 100644 --- a/crates/swc/tests/tsc-references/parserSuperExpression4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSuperExpression4_es5.1.normal.js @@ -115,7 +115,5 @@ var M1; ]); return C; }(); - })(M2 = M11.M2 || (M11.M2 = { - })); -})(M1 || (M1 = { -})); + })(M2 = M11.M2 || (M11.M2 = {})); +})(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/parserSuperExpression4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserSuperExpression4_es5.2.minified.js index 37f1a5ff89c..59d4803ca76 100644 --- a/crates/swc/tests/tsc-references/parserSuperExpression4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserSuperExpression4_es5.2.minified.js @@ -58,8 +58,7 @@ var M1, C = function() { }(); !function(M11) { var C; - M11.M2 || (M11.M2 = { - }), C = (function() { + M11.M2 || (M11.M2 = {}), C = (function() { "use strict"; function C() { _classCallCheck(this, C); @@ -73,5 +72,4 @@ var M1, C = function() { } ]), C; })(); -}(M1 || (M1 = { -})); +}(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/parserSymbolProperty7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserSymbolProperty7_es2015.1.normal.js index e85787c5006..feac031bfb2 100644 --- a/crates/swc/tests/tsc-references/parserSymbolProperty7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSymbolProperty7_es2015.1.normal.js @@ -1,6 +1,5 @@ var tmp = Symbol.toStringTag; //@target: ES6 class C { - [tmp]() { - } + [tmp]() {} } diff --git a/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.1.normal.js index 70be5587fd5..c025fa9c465 100644 --- a/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.1.normal.js @@ -27,8 +27,7 @@ var C = //@target: ES6 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.2.minified.js b/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.2.minified.js index 1d320aa2367..9c7a53e2e48 100644 --- a/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserSymbolProperty7_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = Symbol.toStringTag, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es2015.1.normal.js index 6940729e9eb..b0400ee9b26 100644 --- a/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es2015.1.normal.js @@ -1,2 +1 @@ -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es5.1.normal.js index 6940729e9eb..b0400ee9b26 100644 --- a/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserUnicodeWhitespaceCharacter1_es5.1.normal.js @@ -1,2 +1 @@ -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es2015.1.normal.js index a79af994514..09e0e32d5ba 100644 --- a/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es2015.1.normal.js @@ -1,6 +1,5 @@ function define(constructor, instanceMembers, staticMembers) { - constructor = constructor || function() { - }; + constructor = constructor || function() {}; PluginUtilities.Utilities.markSupportedForProcessing(constructor); if (instanceMembers) { initializeProperties(constructor.prototype, instanceMembers); @@ -12,8 +11,7 @@ function define(constructor, instanceMembers, staticMembers) { } function derive(baseClass, constructor, instanceMembers, staticMembers) { if (baseClass) { - constructor = constructor || function() { - }; + constructor = constructor || function() {}; var basePrototype = baseClass.prototype; constructor.prototype = Object.create(basePrototype); PluginUtilities.Utilities.markSupportedForProcessing(constructor); @@ -35,8 +33,7 @@ function derive(baseClass, constructor, instanceMembers, staticMembers) { } } function mix(constructor) { - constructor = constructor || function() { - }; + constructor = constructor || function() {}; var i, len; for(i = 1, len = arguments.length; i < len; i++){ initializeProperties(constructor.prototype, arguments[i]); diff --git a/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es5.1.normal.js index a79af994514..09e0e32d5ba 100644 --- a/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserUsingConstructorAsIdentifier_es5.1.normal.js @@ -1,6 +1,5 @@ function define(constructor, instanceMembers, staticMembers) { - constructor = constructor || function() { - }; + constructor = constructor || function() {}; PluginUtilities.Utilities.markSupportedForProcessing(constructor); if (instanceMembers) { initializeProperties(constructor.prototype, instanceMembers); @@ -12,8 +11,7 @@ function define(constructor, instanceMembers, staticMembers) { } function derive(baseClass, constructor, instanceMembers, staticMembers) { if (baseClass) { - constructor = constructor || function() { - }; + constructor = constructor || function() {}; var basePrototype = baseClass.prototype; constructor.prototype = Object.create(basePrototype); PluginUtilities.Utilities.markSupportedForProcessing(constructor); @@ -35,8 +33,7 @@ function derive(baseClass, constructor, instanceMembers, staticMembers) { } } function mix(constructor) { - constructor = constructor || function() { - }; + constructor = constructor || function() {}; var i, len; for(i = 1, len = arguments.length; i < len; i++){ initializeProperties(constructor.prototype, arguments[i]); diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration2_es2015.1.normal.js index d9e1dd25750..43641b2f219 100644 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserVariableDeclaration2_es2015.1.normal.js @@ -1,7 +1,5 @@ (function() { - var check = function() { - }; - var checkNot = function() { - }; + var check = function() {}; + var checkNot = function() {}; MUnit.test(a); })(); diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration2_es5.1.normal.js index 7e544679d2c..3e69860768a 100644 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserVariableDeclaration2_es5.1.normal.js @@ -1,7 +1,5 @@ (function() { - var check = function check() { - }; - var checkNot = function checkNot() { - }; + var check = function check() {}; + var checkNot = function checkNot() {}; MUnit.test(a); })(); diff --git a/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es2015.1.normal.js index dfc78b49c15..9fff181dcfd 100644 --- a/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es2015.1.normal.js @@ -1,2 +1 @@ -var v = (a, b)=>{ -}; +var v = (a, b)=>{}; diff --git a/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es5.1.normal.js index faf6d136971..e86465c2e95 100644 --- a/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserX_ArrowFunction4_es5.1.normal.js @@ -1,2 +1 @@ -var v = function(a, b) { -}; +var v = function(a, b) {}; diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parser_duplicateLabel3_es2015.1.normal.js index 22fd98ce255..edc7a86b113 100644 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parser_duplicateLabel3_es2015.1.normal.js @@ -1,7 +1,6 @@ // @allowUnusedLabels: true target: while(true){ function f() { - target: while(true){ - } + target: while(true){} } } diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel3_es5.1.normal.js b/crates/swc/tests/tsc-references/parser_duplicateLabel3_es5.1.normal.js index 6743511f2e2..6fd4a99a3d6 100644 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parser_duplicateLabel3_es5.1.normal.js @@ -1,7 +1,6 @@ // @allowUnusedLabels: true target: while(true){ var f = function f() { - target: while(true){ - } + target: while(true){} }; } diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parser_duplicateLabel4_es2015.1.normal.js index bf0512852a9..9ba5595c87e 100644 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parser_duplicateLabel4_es2015.1.normal.js @@ -1,6 +1,4 @@ // @allowUnusedLabels: true // @allowUnreachableCode: true -target: while(true){ -} -target: while(true){ -} +target: while(true){} +target: while(true){} diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel4_es5.1.normal.js b/crates/swc/tests/tsc-references/parser_duplicateLabel4_es5.1.normal.js index bf0512852a9..9ba5595c87e 100644 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parser_duplicateLabel4_es5.1.normal.js @@ -1,6 +1,4 @@ // @allowUnusedLabels: true // @allowUnreachableCode: true -target: while(true){ -} -target: while(true){ -} +target: while(true){} +target: while(true){} diff --git a/crates/swc/tests/tsc-references/parserindenter_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserindenter_es2015.1.normal.js index 8d104460eaa..5cc061b9f41 100644 --- a/crates/swc/tests/tsc-references/parserindenter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/parserindenter_es2015.1.normal.js @@ -557,5 +557,4 @@ var Formatting; } } Formatting1.Indenter = Indenter; -})(Formatting || (Formatting = { -})); +})(Formatting || (Formatting = {})); diff --git a/crates/swc/tests/tsc-references/parserindenter_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserindenter_es2015.2.minified.js index 28662934b2c..fb5ec76c948 100644 --- a/crates/swc/tests/tsc-references/parserindenter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/parserindenter_es2015.2.minified.js @@ -259,5 +259,4 @@ var Formatting; } } Formatting1.Indenter = Indenter; -}(Formatting || (Formatting = { -})); +}(Formatting || (Formatting = {})); diff --git a/crates/swc/tests/tsc-references/parserindenter_es5.1.normal.js b/crates/swc/tests/tsc-references/parserindenter_es5.1.normal.js index 2349906a714..2416c1cb7b8 100644 --- a/crates/swc/tests/tsc-references/parserindenter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserindenter_es5.1.normal.js @@ -654,5 +654,4 @@ var Formatting; return Indenter; }(); Formatting1.Indenter = Indenter; -})(Formatting || (Formatting = { -})); +})(Formatting || (Formatting = {})); diff --git a/crates/swc/tests/tsc-references/parserindenter_es5.2.minified.js b/crates/swc/tests/tsc-references/parserindenter_es5.2.minified.js index 82f3c2bc37b..64a9eac4487 100644 --- a/crates/swc/tests/tsc-references/parserindenter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/parserindenter_es5.2.minified.js @@ -344,5 +344,4 @@ function _defineProperties(target, props) { ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Indenter; }(); Formatting1.Indenter = Indenter; -}(Formatting || (Formatting = { -})); +}(Formatting || (Formatting = {})); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.1.normal.js index 1a36565ef4f..be7a146eb65 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.1.normal.js @@ -3,9 +3,6 @@ class C { class D extends C { } // more args -testError((t1, t2, t3)=>{ -}); -testError((t1, t2, t3)=>{ -}); -testError((t1, t2, t3)=>{ -}); +testError((t1, t2, t3)=>{}); +testError((t1, t2, t3)=>{}); +testError((t1, t2, t3)=>{}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.2.minified.js index 580bf3d3a2f..23f9c64b194 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es2015.2.minified.js @@ -1,4 +1 @@ -testError((t1, t2, t3)=>{ -}), testError((t1, t2, t3)=>{ -}), testError((t1, t2, t3)=>{ -}); +testError((t1, t2, t3)=>{}), testError((t1, t2, t3)=>{}), testError((t1, t2, t3)=>{}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.1.normal.js index 1b45718d2cf..44387297770 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -84,9 +83,6 @@ var D = /*#__PURE__*/ function(C) { return D; }(C); // more args -testError(function(t1, t2, t3) { -}); -testError(function(t1, t2, t3) { -}); -testError(function(t1, t2, t3) { -}); +testError(function(t1, t2, t3) {}); +testError(function(t1, t2, t3) {}); +testError(function(t1, t2, t3) {}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.2.minified.js index 50346405c51..db990ee4801 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError_es5.2.minified.js @@ -32,8 +32,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -55,7 +54,4 @@ var C = function() { } return D; }(C); -testError(function(t1, t2, t3) { -}), testError(function(t1, t2, t3) { -}), testError(function(t1, t2, t3) { -}); +testError(function(t1, t2, t3) {}), testError(function(t1, t2, t3) {}), testError(function(t1, t2, t3) {}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.1.normal.js index fb75fdb2912..ca64e8dde39 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.1.normal.js @@ -10,24 +10,15 @@ test((t1, t2)=>{ t2.test2; }); // zero arg -test(()=>{ -}); +test(()=>{}); // fewer args -test((t1)=>{ -}); +test((t1)=>{}); // rest arg -test((...ts)=>{ -}); +test((...ts)=>{}); // source function has rest arg -testRest((t1)=>{ -}); -testRest((t1, t2, t3)=>{ -}); -testRest((t1, t2, t3)=>{ -}); -testRest((t1, t2, t3)=>{ -}); -testRest((t2, ...t3)=>{ -}); -testRest((t2, ...t3)=>{ -}); +testRest((t1)=>{}); +testRest((t1, t2, t3)=>{}); +testRest((t1, t2, t3)=>{}); +testRest((t1, t2, t3)=>{}); +testRest((t2, ...t3)=>{}); +testRest((t2, ...t3)=>{}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.2.minified.js index 59a227041a6..ee527e99f13 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es2015.2.minified.js @@ -2,13 +2,4 @@ test((t1, t2)=>{ t2.test2; }), test((t1, t2)=>{ t2.test2; -}), test(()=>{ -}), test((t1)=>{ -}), test((...ts)=>{ -}), testRest((t1)=>{ -}), testRest((t1, t2, t3)=>{ -}), testRest((t1, t2, t3)=>{ -}), testRest((t1, t2, t3)=>{ -}), testRest((t2, ...t3)=>{ -}), testRest((t2, ...t3)=>{ -}); +}), test(()=>{}), test((t1)=>{}), test((...ts)=>{}), testRest((t1)=>{}), testRest((t1, t2, t3)=>{}), testRest((t1, t2, t3)=>{}), testRest((t1, t2, t3)=>{}), testRest((t2, ...t3)=>{}), testRest((t2, ...t3)=>{}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.1.normal.js index d824a9c8579..c08ba75a03d 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,11 +90,9 @@ test(function(t1, t2) { t2.test2; }); // zero arg -test(function() { -}); +test(function() {}); // fewer args -test(function(t1) { -}); +test(function(t1) {}); // rest arg test(function() { for(var _len = arguments.length, ts = new Array(_len), _key = 0; _key < _len; _key++){ @@ -103,14 +100,10 @@ test(function() { } }); // source function has rest arg -testRest(function(t1) { -}); -testRest(function(t1, t2, t3) { -}); -testRest(function(t1, t2, t3) { -}); -testRest(function(t1, t2, t3) { -}); +testRest(function(t1) {}); +testRest(function(t1, t2, t3) {}); +testRest(function(t1, t2, t3) {}); +testRest(function(t1, t2, t3) {}); testRest(function(t2) { for(var _len = arguments.length, t3 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ t3[_key - 1] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.2.minified.js index a5e8df9d1f8..337352c8ee5 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter_es5.2.minified.js @@ -32,8 +32,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -59,15 +58,9 @@ test(function(t1, t2) { t2.test2; }), test(function(t1, t2) { t2.test2; -}), test(function() { -}), test(function(t1) { -}), test(function() { +}), test(function() {}), test(function(t1) {}), test(function() { for(var _len = arguments.length, ts = new Array(_len), _key = 0; _key < _len; _key++)ts[_key] = arguments[_key]; -}), testRest(function(t1) { -}), testRest(function(t1, t2, t3) { -}), testRest(function(t1, t2, t3) { -}), testRest(function(t1, t2, t3) { -}), testRest(function(t2) { +}), testRest(function(t1) {}), testRest(function(t1, t2, t3) {}), testRest(function(t1, t2, t3) {}), testRest(function(t1, t2, t3) {}), testRest(function(t2) { for(var _len = arguments.length, t3 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)t3[_key - 1] = arguments[_key]; }), testRest(function(t2) { for(var _len = arguments.length, t3 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)t3[_key - 1] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.1.normal.js index db242dedbfb..d872aa01e1f 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.1.normal.js @@ -1,4 +1,2 @@ -simple((a, b)=>{ -}); -simple((a, b)=>{ -}); +simple((a, b)=>{}); +simple((a, b)=>{}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.2.minified.js index 94883eca54a..7c652d2164e 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es2015.2.minified.js @@ -1,3 +1 @@ -simple((a, b)=>{ -}), simple((a, b)=>{ -}); +simple((a, b)=>{}), simple((a, b)=>{}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.1.normal.js index 46fba6186f9..94c775a46f6 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.1.normal.js @@ -1,4 +1,2 @@ -simple(function(a, b) { -}); -simple(function(a, b) { -}); +simple(function(a, b) {}); +simple(function(a, b) {}); diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.2.minified.js index f94973584bd..e65a081029b 100644 --- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionWitoutTypeParameter_es5.2.minified.js @@ -1,3 +1 @@ -simple(function(a, b) { -}), simple(function(a, b) { -}); +simple(function(a, b) {}), simple(function(a, b) {}); diff --git a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.1.normal.js index b16cc8f6e60..c441b640aa1 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.1.normal.js @@ -7,10 +7,8 @@ var ANY2 = [ ]; var obj; var obj1 = { - x: (s)=>{ - }, - y: (s1)=>{ - } + x: (s)=>{}, + y: (s1)=>{} }; function foo() { var a; @@ -26,8 +24,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any other type var var ResultIsNumber1 = +ANY1; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.2.minified.js index 97db5fb8bb9..f1a2bd38c18 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es2015.2.minified.js @@ -2,19 +2,15 @@ var M, ANY2 = [ "", "" ], obj1 = { - x: (s)=>{ - }, - y: (s1)=>{ - } + x: (s)=>{}, + y: (s1)=>{} }; class A { - static foo() { - } + static foo() {} } !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.1.normal.js index 37fc2bd4f54..09eab1c3e8c 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.1.normal.js @@ -26,10 +26,8 @@ var ANY2 = [ ]; var obj; var obj1 = { - x: function(s) { - }, - y: function(s1) { - } + x: function(s) {}, + y: function(s1) {} }; function foo() { var a; @@ -55,8 +53,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any other type var var ResultIsNumber1 = +ANY1; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.2.minified.js index 77c68579005..4e2d063cbd3 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType_es5.2.minified.js @@ -2,10 +2,8 @@ var M, ANY2 = [ "", "" ], obj1 = { - x: function(s) { - }, - y: function(s1) { - } + x: function(s) {}, + y: function(s1) {} }, A = function() { "use strict"; var Constructor; @@ -22,15 +20,13 @@ var M, ANY2 = [ })(Constructor = A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(); !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], obj1.x, obj1.y, objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.1.normal.js index ba9c5ce8d5e..38af41d4214 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.1.normal.js @@ -12,8 +12,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsNumber1 = +BOOLEAN; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.2.minified.js index 65b9f6c5a71..294503578a1 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es2015.2.minified.js @@ -9,7 +9,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var M, objA = new A(); objA.a, foo(), A.foo(), foo(), objA.a; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.1.normal.js index ac652aa4501..0aff52c5a1c 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.1.normal.js @@ -41,8 +41,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsNumber1 = +BOOLEAN; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.2.minified.js index c6311cece82..823b28e436b 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithBooleanType_es5.2.minified.js @@ -26,7 +26,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.1.normal.js index 365bee30ae4..d0cfc82a884 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.1.normal.js @@ -1,15 +1,12 @@ var // + operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = +ENUM; var ResultIsNumber2 = +ENUM1; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.2.minified.js index d39c228c4cd..87ee734df8c 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM1.B; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.1.normal.js index 365bee30ae4..d0cfc82a884 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.1.normal.js @@ -1,15 +1,12 @@ var // + operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsNumber1 = +ENUM; var ResultIsNumber2 = +ENUM1; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.2.minified.js index d39c228c4cd..87ee734df8c 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM1.B; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.1.normal.js index e47353bba7d..680422118e8 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = +NUMBER; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.2.minified.js index e9a7fe8a25d..483281d8468 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es2015.2.minified.js @@ -7,7 +7,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.1.normal.js index 52b9811d4cd..a47ad446c2a 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsNumber1 = +NUMBER; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.2.minified.js index a0266fa2414..5782b25902c 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithNumberType_es5.2.minified.js @@ -23,7 +23,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.1.normal.js index ba2d43bb348..eba358b7cff 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsNumber1 = +STRING; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.2.minified.js index 582da0d7546..8d3ce9882d7 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es2015.2.minified.js @@ -10,7 +10,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.1.normal.js index a30896de678..d5aec06f59e 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsNumber1 = +STRING; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.2.minified.js index 9a048b7824d..8e87a47ca9a 100644 --- a/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/plusOperatorWithStringType_es5.2.minified.js @@ -26,7 +26,6 @@ var STRING, M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.1.normal.js b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.1.normal.js index 96458b6ab13..0c61f3784dc 100644 --- a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.1.normal.js @@ -1,19 +1,11 @@ -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} +function foo1(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function foo6(x) { -} -function foo7(x) { -} +})(E || (E = {})); +function foo6(x) {} +function foo7(x) {} diff --git a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.2.minified.js b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.1.normal.js b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.1.normal.js index 96458b6ab13..0c61f3784dc 100644 --- a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.1.normal.js @@ -1,19 +1,11 @@ -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} +function foo1(x) {} +function foo2(x) {} +function foo3(x) {} +function foo4(x) {} +function foo5(x) {} var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function foo6(x) { -} -function foo7(x) { -} +})(E || (E = {})); +function foo6(x) {} +function foo7(x) {} diff --git a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.2.minified.js b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/primtiveTypesAreIdentical_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/privateClassPropertyAccessibleWithinClass_es5.2.minified.js b/crates/swc/tests/tsc-references/privateClassPropertyAccessibleWithinClass_es5.2.minified.js index 17a3575bec5..5c7c1ed9d4b 100644 --- a/crates/swc/tests/tsc-references/privateClassPropertyAccessibleWithinClass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateClassPropertyAccessibleWithinClass_es5.2.minified.js @@ -65,13 +65,11 @@ var C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], [ { @@ -79,18 +77,15 @@ var C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} }, { key: "bar", - value: function() { - } + value: function() {} } ]), C2; }(); diff --git a/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.1.normal.js index 12ac19d47ce..5c37a112744 100644 --- a/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.1.normal.js @@ -3,6 +3,5 @@ // @declaration: true // @emitDeclarationOnly: true // @Filename: privateIdentifierExpando.js -const x = { -}; +const x = {}; x.#bar.baz = 20; diff --git a/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.2.minified.js index c0ba896d0e2..e5e7b36d422 100644 --- a/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/privateIdentifierExpando_es2015.2.minified.js @@ -1,3 +1,2 @@ -const x = { -}; +const x = {}; x.#bar.baz = 20; diff --git a/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.1.normal.js b/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.1.normal.js index 5bc4cd37067..50646b47d3e 100644 --- a/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.1.normal.js @@ -3,6 +3,5 @@ // @declaration: true // @emitDeclarationOnly: true // @Filename: privateIdentifierExpando.js -var x = { -}; +var x = {}; x.#bar.baz = 20; diff --git a/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.2.minified.js b/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.2.minified.js index b31cb837fad..9b4d0f8cc50 100644 --- a/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateIdentifierExpando_es5.2.minified.js @@ -1,2 +1 @@ -({ -}).#bar.baz = 20; +({}).#bar.baz = 20; diff --git a/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es2015.1.normal.js index 1d20f73e1a0..b9575120498 100644 --- a/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es2015.1.normal.js @@ -33,8 +33,7 @@ function _extends() { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -51,11 +50,9 @@ function _objectSpread(target) { // @target: es6 class C { method(other) { - const obj = _objectSpread({ - }, other); + const obj = _objectSpread({}, other); _classPrivateFieldGet(obj, _prop); - const rest = _extends({ - }, other); + const rest = _extends({}, other); _classPrivateFieldGet(rest, _prop); } constructor(){ diff --git a/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.1.normal.js index 8673cc100f6..f6fd89be4c9 100644 --- a/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.1.normal.js @@ -52,8 +52,7 @@ function _extends() { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -81,11 +80,9 @@ var C = // @strict: true { key: "method", value: function method(other) { - var obj = _objectSpread({ - }, other); + var obj = _objectSpread({}, other); _classPrivateFieldGet(obj, _prop); - var rest = _extends({ - }, other); + var rest = _extends({}, other); _classPrivateFieldGet(rest, _prop); } } diff --git a/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.2.minified.js index 77c680ae2d7..c6b59a000c5 100644 --- a/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameAndObjectRestSpread_es5.2.minified.js @@ -42,8 +42,7 @@ var C = function() { value: function(other) { _classPrivateFieldGet(function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -51,9 +50,7 @@ var C = function() { }); } return target; - }({ - }, other), _prop), _classPrivateFieldGet(_extends({ - }, other), _prop); + }({}, other), _prop), _classPrivateFieldGet(_extends({}, other), _prop); } } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; diff --git a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.1.normal.js index 98f26c6fc38..495ffcfbaf6 100644 --- a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.2.minified.js index 3a41db47dd4..22c0b8e7a9b 100644 --- a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields_es5.2.minified.js @@ -36,8 +36,7 @@ var B = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/privateNameBadSuper_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameBadSuper_es5.1.normal.js index 98f26c6fc38..495ffcfbaf6 100644 --- a/crates/swc/tests/tsc-references/privateNameBadSuper_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameBadSuper_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/privateNameBadSuper_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameBadSuper_es5.2.minified.js index 3a41db47dd4..22c0b8e7a9b 100644 --- a/crates/swc/tests/tsc-references/privateNameBadSuper_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameBadSuper_es5.2.minified.js @@ -36,8 +36,7 @@ var B = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.1.normal.js index db6d03ed58f..9b2e6431dc9 100644 --- a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.1.normal.js @@ -3,8 +3,7 @@ let getX; var tmp = (getX = (a)=>a.#x , "_"); class A { - [tmp]() { - } + [tmp]() {} constructor(){ _x.set(this, { writable: true, diff --git a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.2.minified.js index 30ea6b66e0f..84fefe735e7 100644 --- a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es2015.2.minified.js @@ -2,8 +2,7 @@ let getX; var tmp = (getX = (a)=>a.#x , "_"), _x = new WeakMap(); console.log(getX(new class { - [tmp]() { - } + [tmp]() {} constructor(){ _x.set(this, { writable: !0, diff --git a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.1.normal.js index 96c5707359d..14dce0e1f58 100644 --- a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.1.normal.js @@ -34,8 +34,7 @@ var A = /*#__PURE__*/ function() { _createClass(A, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.2.minified.js index a98c09ab2ca..c7a61157954 100644 --- a/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameComputedPropertyName2_es5.2.minified.js @@ -20,8 +20,7 @@ var getX, tmp = (getX = function(a) { return Constructor = A, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), A; }(), _x = new WeakMap(); diff --git a/crates/swc/tests/tsc-references/privateNameDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameDeclaration_es2015.1.normal.js index df80c58bdd9..7abc03f772c 100644 --- a/crates/swc/tests/tsc-references/privateNameDeclaration_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameDeclaration_es2015.1.normal.js @@ -1,8 +1,7 @@ // @declaration: true // @target: es2015 class A { - quux() { - } + quux() {} constructor(){ _foo.set(this, { writable: true, diff --git a/crates/swc/tests/tsc-references/privateNameDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameDeclaration_es5.1.normal.js index e74c88c8b5f..48b847183e6 100644 --- a/crates/swc/tests/tsc-references/privateNameDeclaration_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameDeclaration_es5.1.normal.js @@ -36,8 +36,7 @@ var A = // @declaration: true _createClass(A, [ { key: "quux", - value: function quux() { - } + value: function quux() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/privateNameDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameDeclaration_es5.2.minified.js index 31c0e36c228..3050f2d5524 100644 --- a/crates/swc/tests/tsc-references/privateNameDeclaration_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameDeclaration_es5.2.minified.js @@ -21,8 +21,7 @@ var A = function() { return protoProps = [ { key: "quux", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = A).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), A; }(), _foo = new WeakMap(), _bar = new WeakMap(); diff --git a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.1.normal.js index e3d1375242f..d3fe255cc3d 100644 --- a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.1.normal.js @@ -33,8 +33,7 @@ class A { }); _fieldFunc2.set(this, { writable: true, - value: function(a, ...b) { - } + value: function(a, ...b) {} }); this.x = 1; } diff --git a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.2.minified.js index 64cf3fae4f4..f07cae2d911 100644 --- a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es2015.2.minified.js @@ -25,8 +25,7 @@ class A { } }), _fieldFunc2.set(this, { writable: !0, - value: function(a, ...b) { - } + value: function(a, ...b) {} }), this.x = 1; } } diff --git a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.1.normal.js index a7175d7e935..c770889ba01 100644 --- a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.1.normal.js @@ -22,8 +22,7 @@ function isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })); + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.2.minified.js index 3d07266ae0f..48cc9c452d4 100644 --- a/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameFieldCallExpression_es5.2.minified.js @@ -13,8 +13,7 @@ function _construct(Parent, args, Class) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es2015.1.normal.js index 58690423999..c9aaf63d780 100644 --- a/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es2015.1.normal.js @@ -27,10 +27,8 @@ class C { const b = (_classPrivateFieldSet(_ref5 = this.getInstance(), _test, (old3 = +_classPrivateFieldGet(_ref5, _test)) - 1), old3); const c = _classPrivateFieldSet(_ref6 = this.getInstance(), _test, +_classPrivateFieldGet(_ref6, _test) + 1); const d = _classPrivateFieldSet(_ref7 = this.getInstance(), _test, +_classPrivateFieldGet(_ref7, _test) - 1); - for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref8 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref9 = this.getInstance(), _test, +_classPrivateFieldGet(_ref9, _test) + 1)){ - } - for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref10 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref11 = this.getInstance(), _test, (old4 = +_classPrivateFieldGet(_ref11, _test)) + 1), old4){ - } + for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref8 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref9 = this.getInstance(), _test, +_classPrivateFieldGet(_ref9, _test) + 1)){} + for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref10 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref11 = this.getInstance(), _test, (old4 = +_classPrivateFieldGet(_ref11, _test)) + 1), old4){} } getInstance() { return new C(); @@ -49,10 +47,8 @@ class C { const b = (_classPrivateFieldSet(this, _test, (old7 = +_classPrivateFieldGet(this, _test)) - 1), old7); const c = _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) + 1); const d = _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) - 1); - for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) + 1)){ - } - for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, (old8 = +_classPrivateFieldGet(this, _test)) + 1), old8){ - } + for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) + 1)){} + for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, (old8 = +_classPrivateFieldGet(this, _test)) + 1), old8){} } } var _test = new WeakMap(); diff --git a/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es5.1.normal.js index e0a0a67acde..96e00764fb0 100644 --- a/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameFieldUnaryMutation_es5.1.normal.js @@ -52,10 +52,8 @@ var C = // @target: es2015 var b = (_classPrivateFieldSet(this, _test, (old3 = +_classPrivateFieldGet(this, _test)) - 1), old3); var c = _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) + 1); var d = _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) - 1); - for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) + 1)){ - } - for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, (old4 = +_classPrivateFieldGet(this, _test)) + 1), old4){ - } + for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, +_classPrivateFieldGet(this, _test) + 1)){} + for(_classPrivateFieldSet(this, _test, 0); _classPrivateFieldGet(this, _test) < 10; _classPrivateFieldSet(this, _test, (old4 = +_classPrivateFieldGet(this, _test)) + 1), old4){} } _createClass(C, [ { @@ -70,10 +68,8 @@ var C = // @target: es2015 var b = (_classPrivateFieldSet(_ref5 = this.getInstance(), _test, (old7 = +_classPrivateFieldGet(_ref5, _test)) - 1), old7); var c = _classPrivateFieldSet(_ref6 = this.getInstance(), _test, +_classPrivateFieldGet(_ref6, _test) + 1); var d = _classPrivateFieldSet(_ref7 = this.getInstance(), _test, +_classPrivateFieldGet(_ref7, _test) - 1); - for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref8 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref9 = this.getInstance(), _test, +_classPrivateFieldGet(_ref9, _test) + 1)){ - } - for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref10 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref11 = this.getInstance(), _test, (old8 = +_classPrivateFieldGet(_ref11, _test)) + 1), old8){ - } + for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref8 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref9 = this.getInstance(), _test, +_classPrivateFieldGet(_ref9, _test) + 1)){} + for(_classPrivateFieldSet(this.getInstance(), _test, 0); _classPrivateFieldGet(_ref10 = this.getInstance(), _test) < 10; _classPrivateFieldSet(_ref11 = this.getInstance(), _test, (old8 = +_classPrivateFieldGet(_ref11, _test)) + 1), old8){} } }, { diff --git a/crates/swc/tests/tsc-references/privateNamesAndFields_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNamesAndFields_es5.1.normal.js index 55f6201f114..39d7e5d9202 100644 --- a/crates/swc/tests/tsc-references/privateNamesAndFields_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNamesAndFields_es5.1.normal.js @@ -60,8 +60,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/privateNamesAndFields_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNamesAndFields_es5.2.minified.js index 93b245bf9ae..5892fe2c328 100644 --- a/crates/swc/tests/tsc-references/privateNamesAndFields_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNamesAndFields_es5.2.minified.js @@ -45,8 +45,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.1.normal.js index 6a9524e929c..de7cdb038b9 100644 --- a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.1.normal.js @@ -1,6 +1,5 @@ class K { - privateMethod() { - } + privateMethod() {} m() { let { priv: a , prot: b } = this; // ok let { priv , prot } = new K(); // ok @@ -17,5 +16,4 @@ let { priv } = k; // error let { prot } = k; // error let { privateMethod } = k; // error let { priv: a , prot: b , privateMethod: pm } = k; // error -function f({ priv , prot , privateMethod }) { -} +function f({ priv , prot , privateMethod }) {} diff --git a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.2.minified.js index 3ec03cedc3c..4e73bc88dae 100644 --- a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es2015.2.minified.js @@ -1,6 +1,5 @@ class K { - privateMethod() { - } + privateMethod() {} m() { let { priv: a , prot: b } = this, { priv , prot } = new K(); } diff --git a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.1.normal.js b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.1.normal.js index d6218a4015f..e8c7c27dcd3 100644 --- a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,8 +90,7 @@ var K = /*#__PURE__*/ function() { _createClass(K, [ { key: "privateMethod", - value: function privateMethod() { - } + value: function privateMethod() {} }, { key: "m", diff --git a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.2.minified.js b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.2.minified.js index 0ea28395801..f732e06fda5 100644 --- a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring_es5.2.minified.js @@ -28,8 +28,7 @@ var K = function() { return _createClass(K, [ { key: "privateMethod", - value: function() { - } + value: function() {} }, { key: "m", @@ -58,8 +57,7 @@ var K = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.1.normal.js b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.1.normal.js index 6f3e447f214..380f12c7125 100644 --- a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.2.minified.js b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.2.minified.js index bdc899845d1..bfd646ddfb0 100644 --- a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.1.normal.js index a07a80f940d..b0ac8d87ad6 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.1.normal.js @@ -5,5 +5,4 @@ class D extends C { } (function(D1) { var y = D1.y = D.bar; -})(D || (D = { -})); +})(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.2.minified.js index abd1c2fb830..4fe71c237b6 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es2015.2.minified.js @@ -2,5 +2,4 @@ class C { } class D extends C { } -(D || (D = { -})).y = D.bar; +(D || (D = {})).y = D.bar; diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.1.normal.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.1.normal.js index 6e6b33b69d2..16ce5e0ee4f 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -85,5 +84,4 @@ var D = /*#__PURE__*/ function(C) { }(C); (function(D1) { var y = D1.y = D.bar; -})(D || (D = { -})); +})(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.2.minified.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.2.minified.js index 695e0d60383..45e045d497e 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2_es5.2.minified.js @@ -34,8 +34,7 @@ var _typeof = function(obj) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -57,5 +56,4 @@ var _typeof = function(obj) { } return D; }(C); -(D || (D = { -})).y = D.bar; +(D || (D = {})).y = D.bar; diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.1.normal.js index b661f758926..2edcbe237ea 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.1.normal.js @@ -3,5 +3,4 @@ class C { } (function(C1) { var y = C1.y = C.bar; -})(C || (C = { -})); +})(C || (C = {})); diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.2.minified.js index d5809ed268a..d82c85e3e64 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es2015.2.minified.js @@ -1,4 +1,3 @@ class C { } -(C || (C = { -})).y = C.bar; +(C || (C = {})).y = C.bar; diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.1.normal.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.1.normal.js index 3381661db1d..e019ec007fc 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.1.normal.js @@ -9,5 +9,4 @@ var C = function C() { }; (function(C1) { var y = C1.y = C.bar; -})(C || (C = { -})); +})(C || (C = {})); diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.2.minified.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.2.minified.js index 4c73702208c..bda348caacc 100644 --- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule_es5.2.minified.js @@ -4,5 +4,4 @@ var C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(C || (C = { -})).y = C.bar; +(C || (C = {})).y = C.bar; diff --git a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.1.normal.js index 004ecd2ae19..1b74c89f65f 100644 --- a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.1.normal.js @@ -8,8 +8,7 @@ * @param {string} ik * @param {V} iv */ function Multimap(ik, iv) { - /** @type {{ [s: string]: V }} */ this._map = { - }; + /** @type {{ [s: string]: V }} */ this._map = {}; // without type annotation this._map2 = { [ik]: iv diff --git a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.2.minified.js b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.2.minified.js index 6d088367244..25251f6ad2c 100644 --- a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es2015.2.minified.js @@ -1,6 +1,5 @@ function Multimap(ik, iv) { - this._map = { - }, this._map2 = { + this._map = {}, this._map2 = { [ik]: iv }; } diff --git a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.1.normal.js b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.1.normal.js index e6caa18a9b3..414e6d2ff12 100644 --- a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.1.normal.js @@ -21,11 +21,9 @@ function _defineProperty(obj, key, value) { * @param {string} ik * @param {V} iv */ function Multimap(ik, iv) { - /** @type {{ [s: string]: V }} */ this._map = { - }; + /** @type {{ [s: string]: V }} */ this._map = {}; // without type annotation - this._map2 = _defineProperty({ - }, ik, iv); + this._map2 = _defineProperty({}, ik, iv); } /** @type {Multimap<"a" | "b", number>} with type annotation */ var map = new Multimap("a", 1); // without type annotation diff --git a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.2.minified.js b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.2.minified.js index fdeec5c05a6..3311e0b4a62 100644 --- a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions_es5.2.minified.js @@ -1,8 +1,6 @@ function Multimap(ik, iv) { var obj, key, value; - this._map = { - }, obj = { - }, key = ik, value = iv, key in obj ? Object.defineProperty(obj, key, { + this._map = {}, obj = {}, key = ik, value = iv, key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.1.normal.js index 1305ae9c31b..54f8d1071d4 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.2.minified.js index bc5591d6b81..ff1af9945b4 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2_es5.2.minified.js @@ -51,8 +51,7 @@ var i, a, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.1.normal.js index 6241331ede5..310cfc5251f 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.2.minified.js index 334bbc479c1..662670825da 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3_es5.2.minified.js @@ -51,8 +51,7 @@ var i, a, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.1.normal.js index 66c4d319f4d..36736cf19cc 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.2.minified.js index 5b994161312..9c306779b0c 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5_es5.2.minified.js @@ -51,8 +51,7 @@ var i, a, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyAccessWidening_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessWidening_es2015.1.normal.js index cd9d75772d1..07c7a9e2166 100644 --- a/crates/swc/tests/tsc-references/propertyAccessWidening_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessWidening_es2015.1.normal.js @@ -28,12 +28,8 @@ function g2(headerNames) { } // Object in property or element access is widened when target of assignment function foo(options) { - let x1 = (options || { - }).a; // Object type not widened - let x2 = (options || { - })["a"]; // Object type not widened - (options || { - }).a = 1; // Object type widened, error - (options || { - })["a"] = 1; // Object type widened, error + let x1 = (options || {}).a; // Object type not widened + let x2 = (options || {})["a"]; // Object type not widened + (options || {}).a = 1; // Object type widened, error + (options || {})["a"] = 1; // Object type widened, error } diff --git a/crates/swc/tests/tsc-references/propertyAccessWidening_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessWidening_es5.1.normal.js index e32310cf3cd..b3eaf1f4162 100644 --- a/crates/swc/tests/tsc-references/propertyAccessWidening_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessWidening_es5.1.normal.js @@ -28,12 +28,8 @@ function g2(headerNames) { } // Object in property or element access is widened when target of assignment function foo(options) { - var x1 = (options || { - }).a; // Object type not widened - var x2 = (options || { - })["a"]; // Object type not widened - (options || { - }).a = 1; // Object type widened, error - (options || { - })["a"] = 1; // Object type widened, error + var x1 = (options || {}).a; // Object type not widened + var x2 = (options || {})["a"]; // Object type not widened + (options || {}).a = 1; // Object type widened, error + (options || {})["a"] = 1; // Object type widened, error } diff --git a/crates/swc/tests/tsc-references/propertyAccess_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAccess_es2015.1.normal.js index 7176c09d2cc..07fe52c6b3d 100644 --- a/crates/swc/tests/tsc-references/propertyAccess_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccess_es2015.1.normal.js @@ -8,8 +8,7 @@ var Compass; Compass[Compass["South"] = 1] = "South"; Compass[Compass["East"] = 2] = "East"; Compass[Compass["West"] = 3] = "West"; -})(Compass || (Compass = { -})); +})(Compass || (Compass = {})); var numIndex = { 3: 'three', 'three': 'three' @@ -19,8 +18,7 @@ var strIndex = { 'E': Compass.East }; var bothIndex; -function noIndex() { -} +function noIndex() {} var obj = { 10: 'ten', x: 'hello', @@ -32,8 +30,7 @@ var obj = { }, 'literal property': 100 }; -var anyVar = { -}; +var anyVar = {}; var stringOrNumber; var someObject; // Assign to a property access diff --git a/crates/swc/tests/tsc-references/propertyAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/propertyAccess_es2015.2.minified.js index b171d0d4e79..791b5281a73 100644 --- a/crates/swc/tests/tsc-references/propertyAccess_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccess_es2015.2.minified.js @@ -1,5 +1,4 @@ -(Compass = Compass || (Compass = { -}))[Compass.North = 0] = "North", Compass[Compass.South = 1] = "South", Compass[Compass.East = 2] = "East", Compass[Compass.West = 3] = "West"; +(Compass = Compass || (Compass = {}))[Compass.North = 0] = "North", Compass[Compass.South = 1] = "South", Compass[Compass.East = 2] = "East", Compass[Compass.West = 3] = "West"; var Compass, Compass, bothIndex, stringOrNumber, someObject, numIndex = { 3: "three", three: "three" @@ -7,8 +6,7 @@ var Compass, Compass, bothIndex, stringOrNumber, someObject, numIndex = { N: Compass.North, E: Compass.East }; -function noIndex() { -} +function noIndex() {} var obj = { 10: "ten", x: "hello", @@ -19,6 +17,5 @@ var obj = { o: ()=>!1 }, "literal property": 100 -}, anyVar = { -}; +}, 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], numIndex[Compass.South], numIndex[anyVar], numIndex.what, numIndex[someObject], strIndex.N, strIndex.zzz, strIndex[10], strIndex[Compass.East], strIndex[null], noIndex[123], noIndex[Compass.South], noIndex[null], noIndex[someObject], noIndex[32], bothIndex[Compass.East], bothIndex[null], bothIndex.foo, bothIndex["1.0"], bothIndex[someObject], numIndex[stringOrNumber], strIndex[stringOrNumber], bothIndex[stringOrNumber]; diff --git a/crates/swc/tests/tsc-references/propertyAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccess_es5.1.normal.js index e10c2c8f14a..36949775ea2 100644 --- a/crates/swc/tests/tsc-references/propertyAccess_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccess_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -89,8 +88,7 @@ var Compass; Compass[Compass["South"] = 1] = "South"; Compass[Compass["East"] = 2] = "East"; Compass[Compass["West"] = 3] = "West"; -})(Compass || (Compass = { -})); +})(Compass || (Compass = {})); var numIndex = { 3: 'three', 'three': 'three' @@ -100,8 +98,7 @@ var strIndex = { 'E': Compass.East }; var bothIndex; -function noIndex() { -} +function noIndex() {} var obj = { 10: 'ten', x: 'hello', @@ -115,8 +112,7 @@ var obj = { }, 'literal property': 100 }; -var anyVar = { -}; +var anyVar = {}; var stringOrNumber; var someObject; // Assign to a property access diff --git a/crates/swc/tests/tsc-references/propertyAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAccess_es5.2.minified.js index 2870bbb4eb6..23e870d5dd3 100644 --- a/crates/swc/tests/tsc-references/propertyAccess_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccess_es5.2.minified.js @@ -32,8 +32,7 @@ var Compass, bothIndex, stringOrNumber, someObject, Compass, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -55,8 +54,7 @@ var Compass, bothIndex, stringOrNumber, someObject, Compass, A = function() { } return B; }(A); -(Compass = Compass || (Compass = { -}))[Compass.North = 0] = "North", Compass[Compass.South = 1] = "South", Compass[Compass.East = 2] = "East", Compass[Compass.West = 3] = "West"; +(Compass = Compass || (Compass = {}))[Compass.North = 0] = "North", Compass[Compass.South = 1] = "South", Compass[Compass.East = 2] = "East", Compass[Compass.West = 3] = "West"; var numIndex = { 3: "three", three: "three" @@ -64,8 +62,7 @@ var numIndex = { N: Compass.North, E: Compass.East }; -function noIndex() { -} +function noIndex() {} var obj = { 10: "ten", x: "hello", @@ -78,6 +75,5 @@ var obj = { } }, "literal property": 100 -}, anyVar = { -}; +}, 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], numIndex[Compass.South], numIndex[anyVar], numIndex.what, numIndex[someObject], strIndex.N, strIndex.zzz, strIndex[10], strIndex[Compass.East], strIndex[null], noIndex[123], noIndex[Compass.South], noIndex[null], noIndex[someObject], noIndex[32], bothIndex[Compass.East], bothIndex[null], bothIndex.foo, bothIndex["1.0"], bothIndex[someObject], numIndex[stringOrNumber], strIndex[stringOrNumber], bothIndex[stringOrNumber]; diff --git a/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es2015.1.normal.js index 61487718dbb..0298561b074 100644 --- a/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es2015.1.normal.js @@ -4,13 +4,11 @@ class C { } } class D { - set x(v) { - } + set x(v) {} } class E { get x() { return 1; } - set x(v) { - } + set x(v) {} } diff --git a/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.1.normal.js index 9868c23a68e..e53a3449505 100644 --- a/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.1.normal.js @@ -40,8 +40,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "x", - set: function set(v) { - } // error + set: function set(v) {} // error } ]); return D; @@ -57,8 +56,7 @@ var E = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return E; diff --git a/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.2.minified.js index 7d01b30a115..78f5fd02c5b 100644 --- a/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAndAccessorWithSameName_es5.2.minified.js @@ -31,8 +31,7 @@ var C = function() { return _createClass(D, [ { key: "x", - set: function(v) { - } + set: function(v) {} } ]), D; }(), E = function() { @@ -46,8 +45,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), E; }(); diff --git a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es2015.1.normal.js index 7119825409e..deb64b1111b 100644 --- a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es2015.1.normal.js @@ -4,6 +4,5 @@ class C { } } class D { - x(v) { - } + x(v) {} } diff --git a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.1.normal.js index 148cf0dc911..5fbedf684dc 100644 --- a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.1.normal.js @@ -40,8 +40,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "x", - value: function x(v) { - } // error + value: function x(v) {} // error } ]); return D; diff --git a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.2.minified.js index 454d3677db8..77999b9da21 100644 --- a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName_es5.2.minified.js @@ -31,8 +31,7 @@ var C = function() { return _createClass(D, [ { key: "x", - value: function(v) { - } + value: function(v) {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js index c3f52c4c830..dba399ea5d0 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js @@ -2,6 +2,5 @@ // @checkJs: true // @noEmit: true // @Filename: mod1.js -export var hurk = { -}; +export var hurk = {}; hurk.expando = 4; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js index e9abb06a920..57a3cb20657 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js @@ -1,3 +1,2 @@ -export var hurk = { -}; +export var hurk = {}; hurk.expando = 4; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js index c3f52c4c830..dba399ea5d0 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js @@ -2,6 +2,5 @@ // @checkJs: true // @noEmit: true // @Filename: mod1.js -export var hurk = { -}; +export var hurk = {}; hurk.expando = 4; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js index e9abb06a920..57a3cb20657 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js @@ -1,3 +1,2 @@ -export var hurk = { -}; +export var hurk = {}; hurk.expando = 4; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.1.normal.js index c1d8576274e..0295a120bb0 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.1.normal.js @@ -2,7 +2,6 @@ // @checkJs: true // @noEmit: true // @Filename: bug38934.js -var x = { -}; +var x = {}; // should not crash and also should not result in a property '0' on x. x[0] = 1; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.2.minified.js index a8a52147544..252fdac067d 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es2015.2.minified.js @@ -1,2 +1 @@ -({ -})[0] = 1; +({})[0] = 1; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.1.normal.js index c1d8576274e..0295a120bb0 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.1.normal.js @@ -2,7 +2,6 @@ // @checkJs: true // @noEmit: true // @Filename: bug38934.js -var x = { -}; +var x = {}; // should not crash and also should not result in a property '0' on x. x[0] = 1; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.2.minified.js index a8a52147544..252fdac067d 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnParenthesizedNumber_es5.2.minified.js @@ -1,2 +1 @@ -({ -})[0] = 1; +({})[0] = 1; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.1.normal.js index 60715a63622..930f83099ed 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.2.minified.js index 0da8a306568..7734cc7cfff 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors2_es5.2.minified.js @@ -52,8 +52,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.1.normal.js index 917bb392cf5..e6ea2d05945 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.2.minified.js index 4ce19f53911..ac00a5d2fa2 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors3_es5.2.minified.js @@ -60,8 +60,7 @@ var Lion = function(Animal) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.1.normal.js index 2288c3a31b4..e4194d23b40 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.2.minified.js index 534a0e8d512..1b5a23a1fe2 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors4_es5.2.minified.js @@ -26,8 +26,7 @@ var Lion = function(Animal) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.1.normal.js index 052a0c95d5a..f1debddde2a 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.2.minified.js index 445306cd117..30158986f82 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors5_es5.2.minified.js @@ -49,8 +49,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.1.normal.js index 3b6cf93f9e1..c0d8905dd85 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.2.minified.js index ddc78b262ae..fd0860ffb6f 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/propertyOverridesMethod_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesMethod_es2015.1.normal.js index 8d21413566e..f0f75dc68ab 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesMethod_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesMethod_es2015.1.normal.js @@ -1,8 +1,7 @@ // @target: esnext // @useDefineForClassFields: true class A { - m() { - } + m() {} } class B extends A { constructor(...args){ diff --git a/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.1.normal.js index 48aedb08314..8da46ff0698 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -93,8 +92,7 @@ var A = // @target: esnext _createClass(A, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return A; diff --git a/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.2.minified.js index 733b66ea6b6..3dc7d8d3d06 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesMethod_es5.2.minified.js @@ -26,8 +26,7 @@ var A = function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = A).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), A; }(), B = function(A) { @@ -48,8 +47,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinClass_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinClass_es5.2.minified.js index 17a3575bec5..5c7c1ed9d4b 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinClass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinClass_es5.2.minified.js @@ -65,13 +65,11 @@ var C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} } ], [ { @@ -79,18 +77,15 @@ var C = function() { get: function() { return null; }, - set: function(x) { - } + set: function(x) {} }, { key: "foo", - value: function() { - } + value: function() {} }, { key: "bar", - value: function() { - } + value: function() {} } ]), C2; }(); diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.1.normal.js index 349c0215dd8..cc60cc75d1d 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.2.minified.js index 490faedba31..21fa6f6757b 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.1.normal.js index 5984f9a311b..b7bf1bb1cc8 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.2.minified.js index e5a1140578d..2657a3a7e86 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.1.normal.js index 803c72d9864..40944f36632 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.2.minified.js index 9b4962ee109..acc1ebff852 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.1.normal.js index ff4c4ccf5fa..a63ae3da238 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.2.minified.js index eefaa53bc8b..63072fe6ef9 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3_es5.2.minified.js @@ -64,8 +64,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.1.normal.js index 645b08da9b2..f13a5a34ba5 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.2.minified.js index fc8c11620ba..e7022e34f4f 100644 --- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass_es5.2.minified.js @@ -38,8 +38,7 @@ var B = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.1.normal.js index 025867d9ea8..31d881bbb60 100644 --- a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.2.minified.js index 3e366aba234..20e215572f8 100644 --- a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility_es5.2.minified.js @@ -49,8 +49,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.1.normal.js index 7675441b649..1a4f6c1a30c 100644 --- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.2.minified.js index 7def54afc54..ec989adf984 100644 --- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2_es5.2.minified.js @@ -49,8 +49,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es2015.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es2015.2.minified.js index 9ba3c599778..c19c620608a 100644 --- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es2015.2.minified.js @@ -1,16 +1,12 @@ class Base { - static staticMethod() { - } + static staticMethod() {} } class Derived1 extends Base { - static staticMethod1() { - } + static staticMethod1() {} } class Derived2 extends Base { - static staticMethod2() { - } + static staticMethod2() {} } class Derived3 extends Derived1 { - static staticMethod3() { - } + static staticMethod3() {} } diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.1.normal.js index 9d762928ed8..5f1475c0340 100644 --- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.2.minified.js index 8389c59a703..ee47b309f51 100644 --- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.1.normal.js b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.1.normal.js index 3cc64f905fb..6c5942824b4 100644 --- a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.1.normal.js @@ -4,5 +4,4 @@ class C { (function(C1) { var f = C1.f = C.foo; var b = C1.b = C.bar; -})(C || (C = { -})); +})(C || (C = {})); diff --git a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.2.minified.js index 3c4e9e9b8c2..9c7b66ecdef 100644 --- a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es2015.2.minified.js @@ -1,5 +1,4 @@ var C; class C1 { } -(C = C1 || (C1 = { -})).f = C1.foo, C.b = C1.bar; +(C = C1 || (C1 = {})).f = C1.foo, C.b = C1.bar; diff --git a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.1.normal.js b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.1.normal.js index 346b40fce3e..3be80b656d7 100644 --- a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.1.normal.js @@ -10,5 +10,4 @@ var C = function C() { (function(C1) { var f = C1.f = C.foo; var b = C1.b = C.bar; -})(C || (C = { -})); +})(C || (C = {})); diff --git a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.2.minified.js index ae6fa0cd39f..10a740411e3 100644 --- a/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/protectedStaticNotAccessibleInClodule_es5.2.minified.js @@ -4,5 +4,4 @@ var C, C1 = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C1); }; -(C = C1 || (C1 = { -})).f = C1.foo, C.b = C1.bar; +(C = C1 || (C1 = {})).f = C1.foo, C.b = C1.bar; diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.1.normal.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.1.normal.js index 1ac13e004f6..0d927c74c6d 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.1.normal.js @@ -2,18 +2,13 @@ // @allowJs: true // @checkJs: true // @noEmit: true -var Ns = { -}; -Ns.One = function() { -}; -Ns.Two = function() { -}; +var Ns = {}; +Ns.One = function() {}; +Ns.Two = function() {}; Ns.One.prototype = { - ok () { - } -}; -Ns.Two.prototype = { + ok () {} }; +Ns.Two.prototype = {}; // @Filename: other.js /** * @type {Ns.One} diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js index 37fd53ed0c2..599b69ed23b 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js @@ -1,9 +1,4 @@ -var one, two, Ns = { -}; -Ns.One = function() { -}, Ns.Two = function() { -}, Ns.One.prototype = { - ok () { - } -}, Ns.Two.prototype = { -}, one.wat, two.wat; +var one, two, Ns = {}; +Ns.One = function() {}, Ns.Two = function() {}, Ns.One.prototype = { + ok () {} +}, Ns.Two.prototype = {}, one.wat, two.wat; diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.1.normal.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.1.normal.js index 3a9123b7618..bb2bb45adfe 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.1.normal.js @@ -2,18 +2,13 @@ // @allowJs: true // @checkJs: true // @noEmit: true -var Ns = { -}; -Ns.One = function() { -}; -Ns.Two = function() { -}; +var Ns = {}; +Ns.One = function() {}; +Ns.Two = function() {}; Ns.One.prototype = { - ok: function ok() { - } -}; -Ns.Two.prototype = { + ok: function ok() {} }; +Ns.Two.prototype = {}; // @Filename: other.js /** * @type {Ns.One} diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js index 21862ef1bd0..e235da296f1 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js @@ -1,9 +1,4 @@ -var one, two, Ns = { -}; -Ns.One = function() { -}, Ns.Two = function() { -}, Ns.One.prototype = { - ok: function() { - } -}, Ns.Two.prototype = { -}, one.wat, two.wat; +var one, two, Ns = {}; +Ns.One = function() {}, Ns.Two = function() {}, Ns.One.prototype = { + ok: function() {} +}, Ns.Two.prototype = {}, one.wat, two.wat; diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.1.normal.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.1.normal.js index 1227bc1372a..38b073be8bd 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.1.normal.js @@ -1,8 +1,6 @@ // @Filename: lovefield.js -lf.Transaction = function() { -}; +lf.Transaction = function() {}; /** * @param {!Array} scope * @return {!IThenable} - */ lf.Transaction.prototype.begin = function(scope) { -}; + */ lf.Transaction.prototype.begin = function(scope) {}; diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.2.minified.js index 24e0c85aecf..3180177fffc 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es2015.2.minified.js @@ -1,3 +1 @@ -lf.Transaction = function() { -}, lf.Transaction.prototype.begin = function(scope) { -}; +lf.Transaction = function() {}, lf.Transaction.prototype.begin = function(scope) {}; diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.1.normal.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.1.normal.js index 1227bc1372a..38b073be8bd 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.1.normal.js @@ -1,8 +1,6 @@ // @Filename: lovefield.js -lf.Transaction = function() { -}; +lf.Transaction = function() {}; /** * @param {!Array} scope * @return {!IThenable} - */ lf.Transaction.prototype.begin = function(scope) { -}; + */ lf.Transaction.prototype.begin = function(scope) {}; diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.2.minified.js index 24e0c85aecf..3180177fffc 100644 --- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeWithInterfaceMethod_es5.2.minified.js @@ -1,3 +1 @@ -lf.Transaction = function() { -}, lf.Transaction.prototype.begin = function(scope) { -}; +lf.Transaction = function() {}, lf.Transaction.prototype.begin = function(scope) {}; diff --git a/crates/swc/tests/tsc-references/quotedConstructors_es2015.1.normal.js b/crates/swc/tests/tsc-references/quotedConstructors_es2015.1.normal.js index 984488fd5cb..1df601fe23b 100644 --- a/crates/swc/tests/tsc-references/quotedConstructors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/quotedConstructors_es2015.1.normal.js @@ -20,8 +20,7 @@ new class _class { } }; var o = { - "constructor" () { - } + "constructor" () {} }; class F { constructor(){ diff --git a/crates/swc/tests/tsc-references/quotedConstructors_es5.1.normal.js b/crates/swc/tests/tsc-references/quotedConstructors_es5.1.normal.js index 6794a294e3b..d62f4a4fff8 100644 --- a/crates/swc/tests/tsc-references/quotedConstructors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/quotedConstructors_es5.1.normal.js @@ -49,8 +49,7 @@ new function _class() { console.log(this); }; var o = { - "constructor": function() { - } + "constructor": function() {} }; var F = function F() { "use strict"; diff --git a/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.1.normal.js b/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.1.normal.js index 7b687dc4fcc..cc0fcee3264 100644 --- a/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.1.normal.js @@ -4,8 +4,7 @@ import { f } from "./m1"; // @module: commonjs // @target: ES5 // @filename: m1.ts -export default function f() { -}; +export default function f() {}; export { f }; f(); foo(); diff --git a/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js b/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js index d2a9b1c83ce..6bfe520e3d9 100644 --- a/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js @@ -1,6 +1,5 @@ import foo from "./m1"; import { f } from "./m1"; -export default function f() { -}; +export default function f() {}; export { f }; f(), foo(); diff --git a/crates/swc/tests/tsc-references/reExportDefaultExport_es5.1.normal.js b/crates/swc/tests/tsc-references/reExportDefaultExport_es5.1.normal.js index 7b687dc4fcc..cc0fcee3264 100644 --- a/crates/swc/tests/tsc-references/reExportDefaultExport_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/reExportDefaultExport_es5.1.normal.js @@ -4,8 +4,7 @@ import { f } from "./m1"; // @module: commonjs // @target: ES5 // @filename: m1.ts -export default function f() { -}; +export default function f() {}; export { f }; f(); foo(); diff --git a/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js b/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js index d2a9b1c83ce..6bfe520e3d9 100644 --- a/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js @@ -1,6 +1,5 @@ import foo from "./m1"; import { f } from "./m1"; -export default function f() { -}; +export default function f() {}; export { f }; f(), foo(); diff --git a/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.1.normal.js index 1142eefa526..220854ba675 100644 --- a/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.2.minified.js index 866504f44d6..ab6957fd6ec 100644 --- a/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/readonlyConstructorAssignment_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/recursiveTypeReferences2_es2015.1.normal.js b/crates/swc/tests/tsc-references/recursiveTypeReferences2_es2015.1.normal.js index fb2333324d2..bd9bd2999ea 100644 --- a/crates/swc/tests/tsc-references/recursiveTypeReferences2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveTypeReferences2_es2015.1.normal.js @@ -19,5 +19,4 @@ T[K] extends string ? string : XMLObject ) -}} XMLObject */ /** @type {XMLObject<{foo:string}>} */ const p = { -}; +}} XMLObject */ /** @type {XMLObject<{foo:string}>} */ const p = {}; diff --git a/crates/swc/tests/tsc-references/recursiveTypeReferences2_es5.1.normal.js b/crates/swc/tests/tsc-references/recursiveTypeReferences2_es5.1.normal.js index 2c86e9f3a87..014d37a028f 100644 --- a/crates/swc/tests/tsc-references/recursiveTypeReferences2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveTypeReferences2_es5.1.normal.js @@ -19,5 +19,4 @@ T[K] extends string ? string : XMLObject ) -}} XMLObject */ /** @type {XMLObject<{foo:string}>} */ var p = { -}; +}} XMLObject */ /** @type {XMLObject<{foo:string}>} */ var p = {}; diff --git a/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es2015.1.normal.js index 36b99762bee..e921683eccd 100644 --- a/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es2015.1.normal.js @@ -2,15 +2,11 @@ class List { } class MyList { } -function foo(x) { -} -function foo2(x) { -} +function foo(x) {} +function foo2(x) {} function other() { - function foo3(x) { - } - function foo4(x) { - } + function foo3(x) {} + function foo4(x) {} function foo5(x) { return null; } diff --git a/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es5.1.normal.js index 26c8de61571..a83c253aa78 100644 --- a/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveTypesUsedAsFunctionParameters_es5.1.normal.js @@ -11,15 +11,11 @@ var MyList = function MyList() { "use strict"; _classCallCheck(this, MyList); }; -function foo(x) { -} -function foo2(x) { -} +function foo(x) {} +function foo2(x) {} function other() { - var foo3 = function foo3(x) { - }; - var foo4 = function foo4(x) { - }; + var foo3 = function foo3(x) {}; + var foo4 = function foo4(x) {}; var foo5 = function foo5(x) { return null; }; diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js index 0e99d83fdb6..02fc3ba226f 100644 --- a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js index d9f657495db..17e65d005c6 100644 --- a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js @@ -38,8 +38,7 @@ var x = function(_x) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js b/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js index 3bc59881006..d8e1708a328 100644 --- a/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js @@ -2,6 +2,5 @@ // @Filename: /a.ts class A { } -const d = { -}; +const d = {}; export { }; diff --git a/crates/swc/tests/tsc-references/renamed_es5.1.normal.js b/crates/swc/tests/tsc-references/renamed_es5.1.normal.js index 769fc780a32..5224f80f341 100644 --- a/crates/swc/tests/tsc-references/renamed_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/renamed_es5.1.normal.js @@ -7,8 +7,7 @@ var A = function A() { "use strict"; _classCallCheck(this, A); }; -var d = { -}; +var d = {}; // @strict: true // @Filename: /a.ts export { }; diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.1.normal.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.1.normal.js index a5c0a654360..9c6fd07fba2 100644 --- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.1.normal.js @@ -10,7 +10,6 @@ x.grey; x.x.grey; // @filename: ch.js const x = { - grey: { - } + grey: {} }; export { x }; diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js index 9e9ba1c4f79..5f77b1f964b 100644 --- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js @@ -1,7 +1,6 @@ const x = require("./ch").x; x.grey, x.x.grey; const x = { - grey: { - } + grey: {} }; export { x }; diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.1.normal.js index ce6239944a6..534e88e0e81 100644 --- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.1.normal.js @@ -10,7 +10,6 @@ x.grey; x.x.grey; // @filename: ch.js var x = { - grey: { - } + grey: {} }; export { x }; diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.2.minified.js index c279fa22539..0a9b9e4affc 100644 --- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es5.2.minified.js @@ -1,7 +1,6 @@ var x = require("./ch").x; x.grey, x.x.grey; var x = { - grey: { - } + grey: {} }; export { x }; diff --git a/crates/swc/tests/tsc-references/restElementWithNullInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/restElementWithNullInitializer_es2015.1.normal.js index 1f8df295a8c..4eee9da2898 100644 --- a/crates/swc/tests/tsc-references/restElementWithNullInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/restElementWithNullInitializer_es2015.1.normal.js @@ -1,9 +1,4 @@ -function foo1([...r] = null) { -} -function foo2([...r] = undefined) { -} -function foo3([...r] = { -}) { -} -function foo4([...r] = []) { -} +function foo1([...r] = null) {} +function foo2([...r] = undefined) {} +function foo3([...r] = {}) {} +function foo4([...r] = []) {} diff --git a/crates/swc/tests/tsc-references/restElementWithNullInitializer_es5.1.normal.js b/crates/swc/tests/tsc-references/restElementWithNullInitializer_es5.1.normal.js index 10574c9a331..de52676c909 100644 --- a/crates/swc/tests/tsc-references/restElementWithNullInitializer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/restElementWithNullInitializer_es5.1.normal.js @@ -30,8 +30,7 @@ function foo2() { var ref = _toArray(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined), r = ref.slice(0); } function foo3() { - var ref = _toArray(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { - }), r = ref.slice(0); + var ref = _toArray(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), r = ref.slice(0); } function foo4() { var ref = _toArray(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []), r = ref.slice(0); diff --git a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.1.normal.js index da2041edb29..897d0ffff3e 100644 --- a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.1.normal.js @@ -1,78 +1,41 @@ -(function(a, b, c) { -})(...t1); -(function(...x) { -})(...t1); -(function(a, ...x) { -})(...t1); -(function(a, b, ...x) { -})(...t1); -(function(a, b, c, ...x) { -})(...t1); -f1((a, b, c)=>{ -}); -f1((...x)=>{ -}); -f1((a, ...x)=>{ -}); -f1((a, b, ...x)=>{ -}); -f1((a, b, c, ...x)=>{ -}); -(function(a, b, c) { -})(...t2); -(function(...x) { -})(...t2); -(function(a, ...x) { -})(...t2); -(function(a, b, ...x) { -})(...t2); -(function(a, b, c, ...x) { -})(...t2); -f2((a, b, c)=>{ -}); -f2((...x)=>{ -}); -f2((a, ...x)=>{ -}); -f2((a, b, ...x)=>{ -}); -f2((a, b, c, ...x)=>{ -}); -(function(a, b, c) { -})(1, ...t3); -(function(...x) { -})(1, ...t3); -(function(a, ...x) { -})(1, ...t3); -(function(a, b, ...x) { -})(1, ...t3); -(function(a, b, c, ...x) { -})(1, ...t3); -f3((a, b, c)=>{ -}); -f3((...x)=>{ -}); -f3((a, ...x)=>{ -}); -f3((a, b, ...x)=>{ -}); -f3((a, b, c, ...x)=>{ -}); +(function(a, b, c) {})(...t1); +(function(...x) {})(...t1); +(function(a, ...x) {})(...t1); +(function(a, b, ...x) {})(...t1); +(function(a, b, c, ...x) {})(...t1); +f1((a, b, c)=>{}); +f1((...x)=>{}); +f1((a, ...x)=>{}); +f1((a, b, ...x)=>{}); +f1((a, b, c, ...x)=>{}); +(function(a, b, c) {})(...t2); +(function(...x) {})(...t2); +(function(a, ...x) {})(...t2); +(function(a, b, ...x) {})(...t2); +(function(a, b, c, ...x) {})(...t2); +f2((a, b, c)=>{}); +f2((...x)=>{}); +f2((a, ...x)=>{}); +f2((a, b, ...x)=>{}); +f2((a, b, c, ...x)=>{}); +(function(a, b, c) {})(1, ...t3); +(function(...x) {})(1, ...t3); +(function(a, ...x) {})(1, ...t3); +(function(a, b, ...x) {})(1, ...t3); +(function(a, b, c, ...x) {})(1, ...t3); +f3((a, b, c)=>{}); +f3((...x)=>{}); +f3((a, ...x)=>{}); +f3((a, b, ...x)=>{}); +f3((a, b, c, ...x)=>{}); function f4(t) { - (function(...x) { - })(...t); - (function(a, ...x) { - })(1, ...t); - (function(a, ...x) { - })(1, 2, ...t); - function f(cb) { - } - f((...x)=>{ - }); - f((a, ...x)=>{ - }); - f((a, b, ...x)=>{ - }); + (function(...x) {})(...t); + (function(a, ...x) {})(1, ...t); + (function(a, ...x) {})(1, 2, ...t); + function f(cb) {} + f((...x)=>{}); + f((a, ...x)=>{}); + f((a, b, ...x)=>{}); } let g0 = f5(()=>"hello" ); @@ -96,12 +59,9 @@ let g7 = pipe((x, y)=>42 let g8 = pipe((x, y)=>42 , (x)=>"" + x ); -(function foo(a, b) { -})(...tuple); -(function foo(...rest) { -})(1, ''); -take(function(...rest) { -}); +(function foo(a, b) {})(...tuple); +(function foo(...rest) {})(1, ''); +take(function(...rest) {}); const funcUnionTupleNoRest = (num, strOrErr)=>{ return num; }; diff --git a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.2.minified.js index c5975f1c06c..e1990be2ba3 100644 --- a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es2015.2.minified.js @@ -1,19 +1,4 @@ -f1((a, b, c)=>{ -}), f1((...x)=>{ -}), f1((a, ...x)=>{ -}), f1((a, b, ...x)=>{ -}), f1((a, b, c, ...x)=>{ -}), f2((a, b, c)=>{ -}), f2((...x)=>{ -}), f2((a, ...x)=>{ -}), f2((a, b, ...x)=>{ -}), f2((a, b, c, ...x)=>{ -}), f3((a, b, c)=>{ -}), f3((...x)=>{ -}), f3((a, ...x)=>{ -}), f3((a, b, ...x)=>{ -}), f3((a, b, c, ...x)=>{ -}), f5(()=>"hello" +f1((a, b, c)=>{}), f1((...x)=>{}), f1((a, ...x)=>{}), f1((a, b, ...x)=>{}), f1((a, b, c, ...x)=>{}), f2((a, b, c)=>{}), f2((...x)=>{}), f2((a, ...x)=>{}), f2((a, b, ...x)=>{}), f2((a, b, c, ...x)=>{}), f3((a, b, c)=>{}), f3((...x)=>{}), f3((a, ...x)=>{}), f3((a, b, ...x)=>{}), f3((a, b, c, ...x)=>{}), f5(()=>"hello" ), f5((x, y)=>42 ), f5((x, y)=>42 ), f5((x, y)=>x + y @@ -26,6 +11,5 @@ f1((a, b, c)=>{ , (x)=>"" + x ), pipe((x, y)=>42 , (x)=>"" + x -), take(function(...rest) { -}), (num, strOrErr)=>num +), take(function(...rest) {}), (num, strOrErr)=>num ; diff --git a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.1.normal.js index 806f81107bc..9fe5eaeadcd 100644 --- a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.1.normal.js @@ -56,8 +56,7 @@ function _unsupportedIterableToArray(o, minLen) { if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -(function(a, b, c) { -}).apply(this, _toConsumableArray(t1)); +(function(a, b, c) {}).apply(this, _toConsumableArray(t1)); (function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ x[_key] = arguments[_key]; @@ -78,8 +77,7 @@ function _unsupportedIterableToArray(o, minLen) { x[_key - 3] = arguments[_key]; } }).apply(this, _toConsumableArray(t1)); -f1(function(a, b, c) { -}); +f1(function(a, b, c) {}); f1(function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ x[_key] = arguments[_key]; @@ -100,8 +98,7 @@ f1(function(a, b, c) { x[_key - 3] = arguments[_key]; } }); -(function(a, b, c) { -}).apply(this, _toConsumableArray(t2)); +(function(a, b, c) {}).apply(this, _toConsumableArray(t2)); (function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ x[_key] = arguments[_key]; @@ -122,8 +119,7 @@ f1(function(a, b, c) { x[_key - 3] = arguments[_key]; } }).apply(this, _toConsumableArray(t2)); -f2(function(a, b, c) { -}); +f2(function(a, b, c) {}); f2(function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ x[_key] = arguments[_key]; @@ -144,8 +140,7 @@ f2(function(a, b, c) { x[_key - 3] = arguments[_key]; } }); -(function(a, b, c) { -}).apply(this, [ +(function(a, b, c) {}).apply(this, [ 1 ].concat(_toConsumableArray(t3))); (function() { @@ -176,8 +171,7 @@ f2(function(a, b, c) { }).apply(this, [ 1 ].concat(_toConsumableArray(t3))); -f3(function(a, b, c) { -}); +f3(function(a, b, c) {}); f3(function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ x[_key] = arguments[_key]; @@ -199,8 +193,7 @@ f3(function(a, b, c) { } }); function f4(t) { - var f = function f(cb) { - }; + var f = function f(cb) {}; (function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ x[_key] = arguments[_key]; @@ -275,8 +268,7 @@ var g8 = pipe(function(x, y) { }, function(x) { return "" + x; }); -(function foo(a, b) { -}).apply(this, _toConsumableArray(tuple)); +(function foo(a, b) {}).apply(this, _toConsumableArray(tuple)); (function foo() { 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_es5.2.minified.js b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.2.minified.js index c49f7d36106..3fc642bf60d 100644 --- a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes_es5.2.minified.js @@ -20,8 +20,7 @@ function _unsupportedIterableToArray(o, minLen) { if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } } -(function(a, b, c) { -}).apply(this, _toConsumableArray(t1)), (function() { +(function(a, b, c) {}).apply(this, _toConsumableArray(t1)), (function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key]; }).apply(this, _toConsumableArray(t1)), (function(a) { for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key]; @@ -29,8 +28,7 @@ function _unsupportedIterableToArray(o, minLen) { for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key]; }).apply(this, _toConsumableArray(t1)), (function(a, b, c) { for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key]; -}).apply(this, _toConsumableArray(t1)), f1(function(a, b, c) { -}), f1(function() { +}).apply(this, _toConsumableArray(t1)), f1(function(a, b, c) {}), f1(function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key]; }), f1(function(a) { for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key]; @@ -38,8 +36,7 @@ function _unsupportedIterableToArray(o, minLen) { for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key]; }), f1(function(a, b, c) { for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key]; -}), (function(a, b, c) { -}).apply(this, _toConsumableArray(t2)), (function() { +}), (function(a, b, c) {}).apply(this, _toConsumableArray(t2)), (function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key]; }).apply(this, _toConsumableArray(t2)), (function(a) { for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key]; @@ -47,8 +44,7 @@ function _unsupportedIterableToArray(o, minLen) { for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key]; }).apply(this, _toConsumableArray(t2)), (function(a, b, c) { for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key]; -}).apply(this, _toConsumableArray(t2)), f2(function(a, b, c) { -}), f2(function() { +}).apply(this, _toConsumableArray(t2)), f2(function(a, b, c) {}), f2(function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key]; }), f2(function(a) { for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key]; @@ -56,8 +52,7 @@ function _unsupportedIterableToArray(o, minLen) { for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key]; }), f2(function(a, b, c) { for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key]; -}), (function(a, b, c) { -}).apply(this, [ +}), (function(a, b, c) {}).apply(this, [ 1 ].concat(_toConsumableArray(t3))), (function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key]; @@ -75,8 +70,7 @@ function _unsupportedIterableToArray(o, minLen) { for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key]; }).apply(this, [ 1 -].concat(_toConsumableArray(t3))), f3(function(a, b, c) { -}), f3(function() { +].concat(_toConsumableArray(t3))), f3(function(a, b, c) {}), f3(function() { for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key]; }), f3(function(a) { for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key]; @@ -111,8 +105,7 @@ function _unsupportedIterableToArray(o, minLen) { return 42; }, function(x) { return "" + x; -}), (function(a, b) { -}).apply(this, _toConsumableArray(tuple)), (function() { +}), (function(a, b) {}).apply(this, _toConsumableArray(tuple)), (function() { for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key]; })(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/returnStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/returnStatements_es2015.1.normal.js index a36d2977a3e..7d5a64d3352 100644 --- a/crates/swc/tests/tsc-references/returnStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/returnStatements_es2015.1.normal.js @@ -24,8 +24,7 @@ function fn8() { return; } // OK, eq. to 'return undefined' class C { - dispose() { - } + dispose() {} } class D extends C { } diff --git a/crates/swc/tests/tsc-references/returnStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/returnStatements_es5.1.normal.js index 76fbdc3a794..e340b6d2df3 100644 --- a/crates/swc/tests/tsc-references/returnStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/returnStatements_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -116,8 +115,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "dispose", - value: function dispose() { - } + value: function dispose() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/returnStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/returnStatements_es5.2.minified.js index e849e4e0357..7ca5bcf2297 100644 --- a/crates/swc/tests/tsc-references/returnStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/returnStatements_es5.2.minified.js @@ -26,8 +26,7 @@ var C = function() { return protoProps = [ { key: "dispose", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), D = function(C) { @@ -48,8 +47,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/scannerEnum1_es2015.1.normal.js b/crates/swc/tests/tsc-references/scannerEnum1_es2015.1.normal.js index 45d7ada7db0..ba1ca8259b2 100644 --- a/crates/swc/tests/tsc-references/scannerEnum1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/scannerEnum1_es2015.1.normal.js @@ -2,5 +2,4 @@ export var CodeGenTarget; (function(CodeGenTarget) { CodeGenTarget[CodeGenTarget["ES3"] = 0] = "ES3"; CodeGenTarget[CodeGenTarget["ES5"] = 1] = "ES5"; -})(CodeGenTarget || (CodeGenTarget = { -})); +})(CodeGenTarget || (CodeGenTarget = {})); diff --git a/crates/swc/tests/tsc-references/scannerEnum1_es2015.2.minified.js b/crates/swc/tests/tsc-references/scannerEnum1_es2015.2.minified.js index 243f274ae21..1c24aa46f22 100644 --- a/crates/swc/tests/tsc-references/scannerEnum1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/scannerEnum1_es2015.2.minified.js @@ -1,3 +1,2 @@ var CodeGenTarget, CodeGenTarget; -(CodeGenTarget = CodeGenTarget || (CodeGenTarget = { -}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5"; +(CodeGenTarget = CodeGenTarget || (CodeGenTarget = {}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5"; diff --git a/crates/swc/tests/tsc-references/scannerEnum1_es5.1.normal.js b/crates/swc/tests/tsc-references/scannerEnum1_es5.1.normal.js index 45d7ada7db0..ba1ca8259b2 100644 --- a/crates/swc/tests/tsc-references/scannerEnum1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/scannerEnum1_es5.1.normal.js @@ -2,5 +2,4 @@ export var CodeGenTarget; (function(CodeGenTarget) { CodeGenTarget[CodeGenTarget["ES3"] = 0] = "ES3"; CodeGenTarget[CodeGenTarget["ES5"] = 1] = "ES5"; -})(CodeGenTarget || (CodeGenTarget = { -})); +})(CodeGenTarget || (CodeGenTarget = {})); diff --git a/crates/swc/tests/tsc-references/scannerEnum1_es5.2.minified.js b/crates/swc/tests/tsc-references/scannerEnum1_es5.2.minified.js index 243f274ae21..1c24aa46f22 100644 --- a/crates/swc/tests/tsc-references/scannerEnum1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/scannerEnum1_es5.2.minified.js @@ -1,3 +1,2 @@ var CodeGenTarget, CodeGenTarget; -(CodeGenTarget = CodeGenTarget || (CodeGenTarget = { -}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5"; +(CodeGenTarget = CodeGenTarget || (CodeGenTarget = {}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5"; diff --git a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.1.normal.js b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.1.normal.js index 6029cd0db9b..50ecf547292 100644 --- a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.1.normal.js @@ -6,15 +6,13 @@ var M1; var n = s1; var n; M11.s = s1; -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); var M2; (function(M2) { var s2; var n = s2; var n; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); function fn() { var s3; var n = s3; @@ -36,7 +34,5 @@ var M3; (function(M4) { var n = s4; var n; - })(M4 || (M4 = { - })); -})(M3 || (M3 = { -})); + })(M4 || (M4 = {})); +})(M3 || (M3 = {})); diff --git a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.2.minified.js b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.2.minified.js index 482f1639d2c..813f9de6376 100644 --- a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es2015.2.minified.js @@ -2,5 +2,4 @@ var M1; !function(M11) { var s; M11.s = s; -}(M1 || (M1 = { -})); +}(M1 || (M1 = {})); diff --git a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.1.normal.js b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.1.normal.js index 8531e767c13..b765601da73 100644 --- a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.1.normal.js @@ -25,15 +25,13 @@ var M1; var n = s1; var n; M11.s = s1; -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); var M2; (function(M2) { var s2; var n = s2; var n; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); function fn() { var s3; var n = s3; @@ -63,7 +61,5 @@ var M3; (function(M4) { var n = s4; var n; - })(M4 || (M4 = { - })); -})(M3 || (M3 = { -})); + })(M4 || (M4 = {})); +})(M3 || (M3 = {})); diff --git a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.2.minified.js b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.2.minified.js index 12130f204f7..3aac568d353 100644 --- a/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/scopeResolutionIdentifiers_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperties(target, props) { !function(M11) { var s; M11.s = s; -}(M1 || (M1 = { -})); +}(M1 || (M1 = {})); var M1, C = function() { "use strict"; var Constructor, protoProps, staticProps; diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js index b5ec19e1103..39271226d5f 100644 --- a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js @@ -5,25 +5,21 @@ var A; x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); var B; (function(B) { var A = { x: 0, y: 0 }; -})(B || (B = { -})); +})(B || (B = {})); var X; (function(X1) { class Y { } X1.Y = Y; -})(X || (X = { -})); +})(X || (X = {})); var Z; (function(Z) { var Y = 12; -})(Z || (Z = { -})); +})(Z || (Z = {})); diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js index 8458e748347..d0f5a2ebf5d 100644 --- a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js @@ -1,8 +1,6 @@ var A, X; -(A || (A = { -})).Point = { +(A || (A = {})).Point = { x: 0, y: 0 -}, (X || (X = { -})).Y = class { +}, (X || (X = {})).Y = class { }; diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js index c9601774c45..facc4d21394 100644 --- a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js @@ -10,16 +10,14 @@ var A; x: 0, y: 0 }; -})(A || (A = { -})); +})(A || (A = {})); var B; (function(B) { var A = { x: 0, y: 0 }; -})(B || (B = { -})); +})(B || (B = {})); var X; (function(X1) { var Y = function Y() { @@ -27,10 +25,8 @@ var X; _classCallCheck(this, Y); }; X1.Y = Y; -})(X || (X = { -})); +})(X || (X = {})); var Z; (function(Z) { var Y = 12; -})(Z || (Z = { -})); +})(Z || (Z = {})); diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js index 32e9b705f63..328971f3b8d 100644 --- a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js @@ -1,6 +1,5 @@ var A, X; -(A || (A = { -})).Point = { +(A || (A = {})).Point = { x: 0, y: 0 }, (function(X1) { @@ -11,5 +10,4 @@ var A, X; }(this, Y); }; X1.Y = Y; -})(X || (X = { -})); +})(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es2015.1.normal.js b/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es2015.1.normal.js index f732954ae4e..3de6877f32d 100644 --- a/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es2015.1.normal.js @@ -1,16 +1,12 @@ -function foo(x) { -} +function foo(x) {} class C { - foo(x) { - } + foo(x) {} } class C2 { - foo(x) { - } + foo(x) {} } class C3 { - foo(x) { - } + foo(x) {} } var a; var a2; diff --git a/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.1.normal.js index 1a7f7b8c272..58e1e596a29 100644 --- a/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.1.normal.js @@ -17,8 +17,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function foo(x) { -} +function foo(x) {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -27,8 +26,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; @@ -41,8 +39,7 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C2; @@ -55,8 +52,7 @@ var C3 = /*#__PURE__*/ function() { _createClass(C3, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C3; diff --git a/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.2.minified.js index 532377df49e..0a25eb419da 100644 --- a/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/specializedSignatureIsNotSubtypeOfNonSpecializedSignature_es5.2.minified.js @@ -18,8 +18,7 @@ var C = function() { return _createClass(C, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C; }(), C2 = function() { @@ -30,8 +29,7 @@ var C = function() { return _createClass(C2, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C2; }(), C3 = function() { @@ -42,8 +40,7 @@ var C = function() { return _createClass(C3, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C3; }(); diff --git a/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es2015.1.normal.js b/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es2015.1.normal.js index f732954ae4e..3de6877f32d 100644 --- a/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es2015.1.normal.js @@ -1,16 +1,12 @@ -function foo(x) { -} +function foo(x) {} class C { - foo(x) { - } + foo(x) {} } class C2 { - foo(x) { - } + foo(x) {} } class C3 { - foo(x) { - } + foo(x) {} } var a; var a2; diff --git a/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.1.normal.js b/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.1.normal.js index 1a7f7b8c272..58e1e596a29 100644 --- a/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.1.normal.js @@ -17,8 +17,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function foo(x) { -} +function foo(x) {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -27,8 +26,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; @@ -41,8 +39,7 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C2; @@ -55,8 +52,7 @@ var C3 = /*#__PURE__*/ function() { _createClass(C3, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C3; diff --git a/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.2.minified.js b/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.2.minified.js index 532377df49e..0a25eb419da 100644 --- a/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/specializedSignatureIsSubtypeOfNonSpecializedSignature_es5.2.minified.js @@ -18,8 +18,7 @@ var C = function() { return _createClass(C, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C; }(), C2 = function() { @@ -30,8 +29,7 @@ var C = function() { return _createClass(C2, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C2; }(), C3 = function() { @@ -42,8 +40,7 @@ var C = function() { return _createClass(C3, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C3; }(); diff --git a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.1.normal.js index 45904f33e13..a4be52741a7 100644 --- a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,5 +27,4 @@ function _objectSpread(target) { return target; } // [ts] Initializer provides no value for this binding element and the binding element has no default value. -const { naam , age } = _objectSpread({ -}, bob, alice); +const { naam , age } = _objectSpread({}, bob, alice); diff --git a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.2.minified.js index fabb34a2ae7..27b2cb469fd 100644 --- a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } const { naam , age } = function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -17,5 +16,4 @@ const { naam , age } = function(target) { }); } return target; -}({ -}, bob, alice); +}({}, bob, alice); diff --git a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.1.normal.js index 5d94c0af8d7..e8cbaf4e6e1 100644 --- a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,5 +27,4 @@ function _objectSpread(target) { return target; } // [ts] Initializer provides no value for this binding element and the binding element has no default value. -var ref = _objectSpread({ -}, bob, alice), naam = ref.naam, age = ref.age; +var ref = _objectSpread({}, bob, alice), naam = ref.naam, age = ref.age; diff --git a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.2.minified.js index 04bcf9851ec..334a481ac7d 100644 --- a/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadContextualTypedBindingPattern_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } var ref = function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -17,6 +16,5 @@ var ref = function(target) { }); } return target; -}({ -}, bob, alice); +}({}, bob, alice); ref.naam, ref.age; diff --git a/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.1.normal.js index cf52efb7cb9..6c0564000f0 100644 --- a/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -32,5 +31,4 @@ const extra1 = { b: "b", extra: "extra" }; -const a1 = _objectSpread({ -}, extra1); // spread should not give excess property errors +const a1 = _objectSpread({}, extra1); // spread should not give excess property errors diff --git a/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.2.minified.js index a1ff3b8d3f2..c08abda3196 100644 --- a/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadExcessProperty_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } !function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -17,8 +16,7 @@ function _defineProperty(obj, key, value) { }); } return target; -}({ -}, { +}({}, { a: "a", b: "b", extra: "extra" diff --git a/crates/swc/tests/tsc-references/spreadExcessProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadExcessProperty_es5.1.normal.js index e55457ac9a0..2469b371579 100644 --- a/crates/swc/tests/tsc-references/spreadExcessProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadExcessProperty_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -32,5 +31,4 @@ var extra1 = { b: "b", extra: "extra" }; -var a1 = _objectSpread({ -}, extra1); // spread should not give excess property errors +var a1 = _objectSpread({}, extra1); // spread should not give excess property errors diff --git a/crates/swc/tests/tsc-references/spreadExcessProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadExcessProperty_es5.2.minified.js index a1ff3b8d3f2..c08abda3196 100644 --- a/crates/swc/tests/tsc-references/spreadExcessProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadExcessProperty_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } !function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -17,8 +16,7 @@ function _defineProperty(obj, key, value) { }); } return target; -}({ -}, { +}({}, { a: "a", b: "b", extra: "extra" diff --git a/crates/swc/tests/tsc-references/spreadMethods_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadMethods_es2015.1.normal.js index 42d38ecbfdb..edae03a8857 100644 --- a/crates/swc/tests/tsc-references/spreadMethods_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadMethods_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = arguments[i1] != null ? arguments[i1] : { - }; + var source = arguments[i1] != null ? arguments[i1] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -29,8 +28,7 @@ function _objectSpread(target) { } // @target: esnext class K { - m() { - } + m() {} get g() { return 0; } @@ -39,10 +37,8 @@ class K { } } let k = new K(); -let sk = _objectSpread({ -}, k); -let ssk = _objectSpread({ -}, k, k); +let sk = _objectSpread({}, k); +let ssk = _objectSpread({}, k, k); sk.p; sk.m(); // error sk.g; // error @@ -51,16 +47,13 @@ ssk.m(); // error ssk.g; // error let i = { p: 12, - m () { - }, + m () {}, get g () { return 0; } }; -let si = _objectSpread({ -}, i); -let ssi = _objectSpread({ -}, i, i); +let si = _objectSpread({}, i); +let ssi = _objectSpread({}, i, i); si.p; si.m(); // ok si.g; // ok @@ -69,16 +62,13 @@ ssi.m(); // ok ssi.g; // ok let o = { p: 12, - m () { - }, + m () {}, get g () { return 0; } }; -let so = _objectSpread({ -}, o); -let sso = _objectSpread({ -}, o, o); +let so = _objectSpread({}, o); +let sso = _objectSpread({}, o, o); so.p; so.m(); // ok so.g; // ok diff --git a/crates/swc/tests/tsc-references/spreadMethods_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadMethods_es2015.2.minified.js index c5609d314a4..46df8a5c283 100644 --- a/crates/swc/tests/tsc-references/spreadMethods_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadMethods_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = null != arguments[i1] ? arguments[i1] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i1] ? arguments[i1] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -19,37 +18,28 @@ function _objectSpread(target) { return target; } let k = new class { - m() { - } + m() {} get g() { return 0; } constructor(){ this.p = 12; } -}(), sk = _objectSpread({ -}, k), ssk = _objectSpread({ -}, k, k); +}(), sk = _objectSpread({}, k), ssk = _objectSpread({}, k, k); sk.p, sk.m(), sk.g, ssk.p, ssk.m(), ssk.g; let i = { p: 12, - m () { - }, + m () {}, get g () { return 0; } -}, si = _objectSpread({ -}, i), ssi = _objectSpread({ -}, i, i); +}, si = _objectSpread({}, i), ssi = _objectSpread({}, i, i); si.p, si.m(), si.g, ssi.p, ssi.m(), ssi.g; let o = { p: 12, - m () { - }, + m () {}, get g () { return 0; } -}, so = _objectSpread({ -}, o), sso = _objectSpread({ -}, o, o); +}, so = _objectSpread({}, o), sso = _objectSpread({}, o, o); so.p, so.m(), so.g, sso.p, sso.m(), sso.g; diff --git a/crates/swc/tests/tsc-references/spreadMethods_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadMethods_es5.1.normal.js index 8a8cb31c7ee..050a656fe84 100644 --- a/crates/swc/tests/tsc-references/spreadMethods_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadMethods_es5.1.normal.js @@ -32,8 +32,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = arguments[i1] != null ? arguments[i1] : { - }; + var source = arguments[i1] != null ? arguments[i1] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -56,8 +55,7 @@ var K = // @target: esnext _createClass(K, [ { key: "m", - value: function m() { - } + value: function m() {} }, { key: "g", @@ -69,10 +67,8 @@ var K = // @target: esnext return K; }(); var k = new K(); -var sk = _objectSpread({ -}, k); -var ssk = _objectSpread({ -}, k, k); +var sk = _objectSpread({}, k); +var ssk = _objectSpread({}, k, k); sk.p; sk.m(); // error sk.g; // error @@ -81,16 +77,13 @@ ssk.m(); // error ssk.g; // error var i = { p: 12, - m: function m() { - }, + m: function m() {}, get g () { return 0; } }; -var si = _objectSpread({ -}, i); -var ssi = _objectSpread({ -}, i, i); +var si = _objectSpread({}, i); +var ssi = _objectSpread({}, i, i); si.p; si.m(); // ok si.g; // ok @@ -99,16 +92,13 @@ ssi.m(); // ok ssi.g; // ok var o = { p: 12, - m: function m() { - }, + m: function m() {}, get g () { return 0; } }; -var so = _objectSpread({ -}, o); -var sso = _objectSpread({ -}, o, o); +var so = _objectSpread({}, o); +var sso = _objectSpread({}, o, o); so.p; so.m(); // ok so.g; // ok diff --git a/crates/swc/tests/tsc-references/spreadMethods_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadMethods_es5.2.minified.js index 6dcb65672b2..ef50bd7ea7a 100644 --- a/crates/swc/tests/tsc-references/spreadMethods_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadMethods_es5.2.minified.js @@ -14,8 +14,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = null != arguments[i1] ? arguments[i1] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i1] ? arguments[i1] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -35,8 +34,7 @@ var K = function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} }, { key: "g", @@ -45,29 +43,21 @@ var K = function() { } } ], _defineProperties((Constructor = K).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), K; -}(), k = new K(), sk = _objectSpread({ -}, k), ssk = _objectSpread({ -}, k, k); +}(), k = new K(), sk = _objectSpread({}, k), ssk = _objectSpread({}, k, k); sk.p, sk.m(), sk.g, ssk.p, ssk.m(), ssk.g; var i = { p: 12, - m: function() { - }, + m: function() {}, get g () { return 0; } -}, si = _objectSpread({ -}, i), ssi = _objectSpread({ -}, i, i); +}, si = _objectSpread({}, i), ssi = _objectSpread({}, i, i); si.p, si.m(), si.g, ssi.p, ssi.m(), ssi.g; var o = { p: 12, - m: function() { - }, + m: function() {}, get g () { return 0; } -}, so = _objectSpread({ -}, o), sso = _objectSpread({ -}, o, o); +}, so = _objectSpread({}, o), sso = _objectSpread({}, o, o); so.p, so.m(), so.g, sso.p, sso.m(), sso.g; diff --git a/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.1.normal.js index c84365187aa..34f562d0c81 100644 --- a/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { diff --git a/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.2.minified.js index 95d0dae746f..483e6feb85b 100644 --- a/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadNonPrimitive_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } !function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { diff --git a/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.1.normal.js index c57b1cb89ae..6e6938895ab 100644 --- a/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { diff --git a/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.2.minified.js index 95d0dae746f..483e6feb85b 100644 --- a/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadNonPrimitive_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } !function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { diff --git a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.1.normal.js index b088c2de8d0..0b9f58fde4d 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = arguments[i1] != null ? arguments[i1] : { - }; + var source = arguments[i1] != null ? arguments[i1] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -31,20 +30,17 @@ var unused1 = _objectSpread({ b: 1 }, ab) // error ; -var unused2 = _objectSpread({ -}, ab, ab) // ok, overwritten error doesn't apply to spreads +var unused2 = _objectSpread({}, ab, ab) // ok, overwritten error doesn't apply to spreads ; var unused3 = _objectSpread({ b: 1 }, abq) // ok, abq might have b: undefined ; -var unused4 = _objectSpread({ -}, ab, { +var unused4 = _objectSpread({}, ab, { b: 1 }) // ok, we don't care that b in ab is overwritten ; -var unused5 = _objectSpread({ -}, abq, { +var unused5 = _objectSpread({}, abq, { b: 1 }) // ok ; @@ -67,13 +63,11 @@ function h(obj) { function i(b, t) { return _objectSpread({ command: "hi" - }, b ? t : { - }) // ok + }, b ? t : {}) // ok ; } function j() { - return _objectSpread({ - }, { + return _objectSpread({}, { command: "hi" }, { command: "bye" diff --git a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.2.minified.js index 0125a5a9165..ceb4e10fb55 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -20,13 +19,10 @@ function _objectSpread(target) { } _objectSpread({ b: 1 -}, ab), _objectSpread({ -}, ab, ab), _objectSpread({ +}, ab), _objectSpread({}, ab, ab), _objectSpread({ b: 1 -}, abq), _objectSpread({ -}, ab, { +}, abq), _objectSpread({}, ab, { b: 1 -}), _objectSpread({ -}, abq, { +}), _objectSpread({}, abq, { b: 1 }); diff --git a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.1.normal.js index b088c2de8d0..0b9f58fde4d 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i1 = 1; i1 < arguments.length; i1++){ - var source = arguments[i1] != null ? arguments[i1] : { - }; + var source = arguments[i1] != null ? arguments[i1] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -31,20 +30,17 @@ var unused1 = _objectSpread({ b: 1 }, ab) // error ; -var unused2 = _objectSpread({ -}, ab, ab) // ok, overwritten error doesn't apply to spreads +var unused2 = _objectSpread({}, ab, ab) // ok, overwritten error doesn't apply to spreads ; var unused3 = _objectSpread({ b: 1 }, abq) // ok, abq might have b: undefined ; -var unused4 = _objectSpread({ -}, ab, { +var unused4 = _objectSpread({}, ab, { b: 1 }) // ok, we don't care that b in ab is overwritten ; -var unused5 = _objectSpread({ -}, abq, { +var unused5 = _objectSpread({}, abq, { b: 1 }) // ok ; @@ -67,13 +63,11 @@ function h(obj) { function i(b, t) { return _objectSpread({ command: "hi" - }, b ? t : { - }) // ok + }, b ? t : {}) // ok ; } function j() { - return _objectSpread({ - }, { + return _objectSpread({}, { command: "hi" }, { command: "bye" diff --git a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.2.minified.js index 0125a5a9165..ceb4e10fb55 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -20,13 +19,10 @@ function _objectSpread(target) { } _objectSpread({ b: 1 -}, ab), _objectSpread({ -}, ab, ab), _objectSpread({ +}, ab), _objectSpread({}, ab, ab), _objectSpread({ b: 1 -}, abq), _objectSpread({ -}, ab, { +}, abq), _objectSpread({}, ab, { b: 1 -}), _objectSpread({ -}, abq, { +}), _objectSpread({}, abq, { b: 1 }); diff --git a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.1.normal.js index 3b49872a464..cc46c508ac6 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -30,8 +29,7 @@ function _objectSpread(target) { var unused1 = _objectSpread({ b: 1 }, ab); -var unused2 = _objectSpread({ -}, ab, ab); +var unused2 = _objectSpread({}, ab, ab); var unused3 = _objectSpread({ b: 1 }, abq); diff --git a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.2.minified.js index d60f4ea44d5..42a7cb779b2 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -20,7 +19,6 @@ function _objectSpread(target) { } _objectSpread({ b: 1 -}, ab), _objectSpread({ -}, ab, ab), _objectSpread({ +}, ab), _objectSpread({}, ab, ab), _objectSpread({ b: 1 }, abq); diff --git a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.1.normal.js index 3b49872a464..cc46c508ac6 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -30,8 +29,7 @@ function _objectSpread(target) { var unused1 = _objectSpread({ b: 1 }, ab); -var unused2 = _objectSpread({ -}, ab, ab); +var unused2 = _objectSpread({}, ab, ab); var unused3 = _objectSpread({ b: 1 }, abq); diff --git a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.2.minified.js index d60f4ea44d5..42a7cb779b2 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesProperty_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -20,7 +19,6 @@ function _objectSpread(target) { } _objectSpread({ b: 1 -}, ab), _objectSpread({ -}, ab, ab), _objectSpread({ +}, ab), _objectSpread({}, ab, ab), _objectSpread({ b: 1 }, abq); diff --git a/crates/swc/tests/tsc-references/spreadTypeVariable_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadTypeVariable_es2015.1.normal.js index 2a246f7d5ba..8bc25019547 100644 --- a/crates/swc/tests/tsc-references/spreadTypeVariable_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadTypeVariable_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,26 +27,20 @@ function _objectSpread(target) { return target; } function f1(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f2(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f3(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f4(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f5(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f6(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } diff --git a/crates/swc/tests/tsc-references/spreadTypeVariable_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadTypeVariable_es5.1.normal.js index 2a246f7d5ba..8bc25019547 100644 --- a/crates/swc/tests/tsc-references/spreadTypeVariable_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadTypeVariable_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,26 +27,20 @@ function _objectSpread(target) { return target; } function f1(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f2(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f3(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f4(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f5(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } function f6(arg) { - return _objectSpread({ - }, arg); + return _objectSpread({}, arg); } diff --git a/crates/swc/tests/tsc-references/spreadUnion2_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadUnion2_es2015.1.normal.js index 455e7d1029a..39675ded2a8 100644 --- a/crates/swc/tests/tsc-references/spreadUnion2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadUnion2_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,19 +27,13 @@ function _objectSpread(target) { return target; } var o1; -var o1 = _objectSpread({ -}, undefinedUnion); +var o1 = _objectSpread({}, undefinedUnion); var o2; -var o2 = _objectSpread({ -}, nullUnion); +var o2 = _objectSpread({}, nullUnion); var o3; -var o3 = _objectSpread({ -}, undefinedUnion, nullUnion); -var o3 = _objectSpread({ -}, nullUnion, undefinedUnion); +var o3 = _objectSpread({}, undefinedUnion, nullUnion); +var o3 = _objectSpread({}, nullUnion, undefinedUnion); var o4; -var o4 = _objectSpread({ -}, undefinedUnion, undefinedUnion); +var o4 = _objectSpread({}, undefinedUnion, undefinedUnion); var o5; -var o5 = _objectSpread({ -}, nullUnion, nullUnion); +var o5 = _objectSpread({}, nullUnion, nullUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion2_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadUnion2_es2015.2.minified.js index 5996fdf3a1d..10a26962642 100644 --- a/crates/swc/tests/tsc-references/spreadUnion2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadUnion2_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,10 +17,4 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, undefinedUnion), _objectSpread({ -}, nullUnion), _objectSpread({ -}, undefinedUnion, nullUnion), _objectSpread({ -}, nullUnion, undefinedUnion), _objectSpread({ -}, undefinedUnion, undefinedUnion), _objectSpread({ -}, nullUnion, nullUnion); +_objectSpread({}, undefinedUnion), _objectSpread({}, nullUnion), _objectSpread({}, undefinedUnion, nullUnion), _objectSpread({}, nullUnion, undefinedUnion), _objectSpread({}, undefinedUnion, undefinedUnion), _objectSpread({}, nullUnion, nullUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion2_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadUnion2_es5.1.normal.js index 455e7d1029a..39675ded2a8 100644 --- a/crates/swc/tests/tsc-references/spreadUnion2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadUnion2_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -28,19 +27,13 @@ function _objectSpread(target) { return target; } var o1; -var o1 = _objectSpread({ -}, undefinedUnion); +var o1 = _objectSpread({}, undefinedUnion); var o2; -var o2 = _objectSpread({ -}, nullUnion); +var o2 = _objectSpread({}, nullUnion); var o3; -var o3 = _objectSpread({ -}, undefinedUnion, nullUnion); -var o3 = _objectSpread({ -}, nullUnion, undefinedUnion); +var o3 = _objectSpread({}, undefinedUnion, nullUnion); +var o3 = _objectSpread({}, nullUnion, undefinedUnion); var o4; -var o4 = _objectSpread({ -}, undefinedUnion, undefinedUnion); +var o4 = _objectSpread({}, undefinedUnion, undefinedUnion); var o5; -var o5 = _objectSpread({ -}, nullUnion, nullUnion); +var o5 = _objectSpread({}, nullUnion, nullUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion2_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadUnion2_es5.2.minified.js index 5996fdf3a1d..10a26962642 100644 --- a/crates/swc/tests/tsc-references/spreadUnion2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadUnion2_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -18,10 +17,4 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, undefinedUnion), _objectSpread({ -}, nullUnion), _objectSpread({ -}, undefinedUnion, nullUnion), _objectSpread({ -}, nullUnion, undefinedUnion), _objectSpread({ -}, undefinedUnion, undefinedUnion), _objectSpread({ -}, nullUnion, nullUnion); +_objectSpread({}, undefinedUnion), _objectSpread({}, nullUnion), _objectSpread({}, undefinedUnion, nullUnion), _objectSpread({}, nullUnion, undefinedUnion), _objectSpread({}, undefinedUnion, undefinedUnion), _objectSpread({}, nullUnion, nullUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion3_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadUnion3_es2015.1.normal.js index f19e3f8676d..f7f3b983899 100644 --- a/crates/swc/tests/tsc-references/spreadUnion3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadUnion3_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -36,14 +35,11 @@ function f(x1) { } f(undefined); function g(t) { - let b = _objectSpread({ - }, t); + let b = _objectSpread({}, t); let c = b.a; // might not have 'a' } g(); g(undefined); g(null); -var x = _objectSpread({ -}, nullAndUndefinedUnion, nullAndUndefinedUnion); -var y = _objectSpread({ -}, nullAndUndefinedUnion); +var x = _objectSpread({}, nullAndUndefinedUnion, nullAndUndefinedUnion); +var y = _objectSpread({}, nullAndUndefinedUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion3_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadUnion3_es2015.2.minified.js index b3fae939077..81ec0e01b11 100644 --- a/crates/swc/tests/tsc-references/spreadUnion3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadUnion3_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -19,11 +18,8 @@ function _objectSpread(target) { return target; } function g(t) { - _objectSpread({ - }, t).a; + _objectSpread({}, t).a; } _objectSpread({ y: 123 -}, void 0), g(), g(void 0), g(null), _objectSpread({ -}, nullAndUndefinedUnion, nullAndUndefinedUnion), _objectSpread({ -}, nullAndUndefinedUnion); +}, void 0), g(), g(void 0), g(null), _objectSpread({}, nullAndUndefinedUnion, nullAndUndefinedUnion), _objectSpread({}, nullAndUndefinedUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion3_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadUnion3_es5.1.normal.js index 47778ee4261..73f5ff8d701 100644 --- a/crates/swc/tests/tsc-references/spreadUnion3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadUnion3_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -36,14 +35,11 @@ function f(x1) { } f(undefined); function g(t) { - var b = _objectSpread({ - }, t); + var b = _objectSpread({}, t); var c = b.a; // might not have 'a' } g(); g(undefined); g(null); -var x = _objectSpread({ -}, nullAndUndefinedUnion, nullAndUndefinedUnion); -var y = _objectSpread({ -}, nullAndUndefinedUnion); +var x = _objectSpread({}, nullAndUndefinedUnion, nullAndUndefinedUnion); +var y = _objectSpread({}, nullAndUndefinedUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion3_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadUnion3_es5.2.minified.js index b3fae939077..81ec0e01b11 100644 --- a/crates/swc/tests/tsc-references/spreadUnion3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadUnion3_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -19,11 +18,8 @@ function _objectSpread(target) { return target; } function g(t) { - _objectSpread({ - }, t).a; + _objectSpread({}, t).a; } _objectSpread({ y: 123 -}, void 0), g(), g(void 0), g(null), _objectSpread({ -}, nullAndUndefinedUnion, nullAndUndefinedUnion), _objectSpread({ -}, nullAndUndefinedUnion); +}, void 0), g(), g(void 0), g(null), _objectSpread({}, nullAndUndefinedUnion, nullAndUndefinedUnion), _objectSpread({}, nullAndUndefinedUnion); diff --git a/crates/swc/tests/tsc-references/spreadUnion_es2015.1.normal.js b/crates/swc/tests/tsc-references/spreadUnion_es2015.1.normal.js index a020eaea573..42a796a4285 100644 --- a/crates/swc/tests/tsc-references/spreadUnion_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadUnion_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -29,13 +28,10 @@ function _objectSpread(target) { } var union; var o3; -var o3 = _objectSpread({ -}, union); +var o3 = _objectSpread({}, union); var o4; -var o4 = _objectSpread({ -}, union, { +var o4 = _objectSpread({}, union, { a: false }); var o5; -var o5 = _objectSpread({ -}, union, union); +var o5 = _objectSpread({}, union, union); diff --git a/crates/swc/tests/tsc-references/spreadUnion_es2015.2.minified.js b/crates/swc/tests/tsc-references/spreadUnion_es2015.2.minified.js index c619383fa53..46e64d54acd 100644 --- a/crates/swc/tests/tsc-references/spreadUnion_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadUnion_es2015.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -19,9 +18,6 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, union), _objectSpread({ -}, union, { +_objectSpread({}, union), _objectSpread({}, union, { a: !1 -}), _objectSpread({ -}, union, union); +}), _objectSpread({}, union, union); diff --git a/crates/swc/tests/tsc-references/spreadUnion_es5.1.normal.js b/crates/swc/tests/tsc-references/spreadUnion_es5.1.normal.js index a020eaea573..42a796a4285 100644 --- a/crates/swc/tests/tsc-references/spreadUnion_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadUnion_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -29,13 +28,10 @@ function _objectSpread(target) { } var union; var o3; -var o3 = _objectSpread({ -}, union); +var o3 = _objectSpread({}, union); var o4; -var o4 = _objectSpread({ -}, union, { +var o4 = _objectSpread({}, union, { a: false }); var o5; -var o5 = _objectSpread({ -}, union, union); +var o5 = _objectSpread({}, union, union); diff --git a/crates/swc/tests/tsc-references/spreadUnion_es5.2.minified.js b/crates/swc/tests/tsc-references/spreadUnion_es5.2.minified.js index c619383fa53..46e64d54acd 100644 --- a/crates/swc/tests/tsc-references/spreadUnion_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/spreadUnion_es5.2.minified.js @@ -9,8 +9,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -19,9 +18,6 @@ function _objectSpread(target) { } return target; } -_objectSpread({ -}, union), _objectSpread({ -}, union, { +_objectSpread({}, union), _objectSpread({}, union, { a: !1 -}), _objectSpread({ -}, union, union); +}), _objectSpread({}, union, union); diff --git a/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es2015.1.normal.js index b9764615a68..04a06c40f3f 100644 --- a/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es2015.1.normal.js @@ -1,6 +1,4 @@ class C { - f() { - } - static f() { - } + f() {} + static f() {} } diff --git a/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.1.normal.js index 9d000f4e356..8fe9de5e064 100644 --- a/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.1.normal.js @@ -25,14 +25,12 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "f", - value: function f() { - } + value: function f() {} } ], [ { key: "f", - value: function f() { - } + value: function f() {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.2.minified.js index fd434422eb3..a9543e3a2e5 100644 --- a/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/staticAndNonStaticPropertiesSameName_es5.2.minified.js @@ -15,14 +15,12 @@ var C = function() { return staticProps = [ { key: "f", - value: function() { - } + value: function() {} } ], protoProps = [ { key: "f", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/staticFactory1_es5.1.normal.js b/crates/swc/tests/tsc-references/staticFactory1_es5.1.normal.js index 5db95d963c5..01999e112bc 100644 --- a/crates/swc/tests/tsc-references/staticFactory1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/staticFactory1_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/staticFactory1_es5.2.minified.js b/crates/swc/tests/tsc-references/staticFactory1_es5.2.minified.js index 6b09ee08477..452b44a1188 100644 --- a/crates/swc/tests/tsc-references/staticFactory1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/staticFactory1_es5.2.minified.js @@ -58,8 +58,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.1.normal.js index d03f00a1a15..ad920a6c97f 100644 --- a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.1.normal.js @@ -1,11 +1,9 @@ class C { static foo() { - C.foo = ()=>{ - }; + C.foo = ()=>{}; } static bar(x1) { - C.bar = ()=>{ - } // error + C.bar = ()=>{} // error ; C.bar = (x)=>x ; // ok diff --git a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.2.minified.js index 8a5ff17276b..40e85582be5 100644 --- a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es2015.2.minified.js @@ -1,11 +1,9 @@ class C { static foo() { - C.foo = ()=>{ - }; + C.foo = ()=>{}; } static bar(x1) { - return C.bar = ()=>{ - }, C.bar = (x)=>x + return C.bar = ()=>{}, C.bar = (x)=>x , C.bar = (x)=>1 , 1; } diff --git a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.1.normal.js index 7d1209cea0e..18a9743c177 100644 --- a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.1.normal.js @@ -26,15 +26,13 @@ var C = /*#__PURE__*/ function() { { key: "foo", value: function foo() { - C.foo = function() { - }; + C.foo = function() {}; } }, { key: "bar", value: function bar(x1) { - C.bar = function() { - } // error + C.bar = function() {} // error ; C.bar = function(x) { return x; diff --git a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.2.minified.js index b4eaf5dc0d7..305ed9f60a7 100644 --- a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers_es5.2.minified.js @@ -15,15 +15,13 @@ var C = function() { { key: "foo", value: function() { - C.foo = function() { - }; + C.foo = function() {}; } }, { key: "bar", value: function(x1) { - return C.bar = function() { - }, C.bar = function(x) { + return C.bar = function() {}, C.bar = function(x) { return x; }, C.bar = function(x) { return 1; diff --git a/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es2015.1.normal.js index 395bea914bc..8738d83e8e1 100644 --- a/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es2015.1.normal.js @@ -1,13 +1,10 @@ // BUG 745747 class C { - static f(x) { - } + static f(x) {} } class C2 { - static f(x) { - } + static f(x) {} } class C3 { - static f(x) { - } + static f(x) {} } diff --git a/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.1.normal.js index ab5cb2bf90c..9e6c31ea787 100644 --- a/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.1.normal.js @@ -26,8 +26,7 @@ var C = // BUG 745747 _createClass(C, null, [ { key: "f", - value: function f(x) { - } + value: function f(x) {} } ]); return C; @@ -40,8 +39,7 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, null, [ { key: "f", - value: function f(x) { - } + value: function f(x) {} } ]); return C2; @@ -54,8 +52,7 @@ var C3 = /*#__PURE__*/ function() { _createClass(C3, null, [ { key: "f", - value: function f(x) { - } + value: function f(x) {} } ]); return C3; diff --git a/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.2.minified.js index ca9e4e0a93a..581e47c950e 100644 --- a/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/staticMembersUsingClassTypeParameter_es5.2.minified.js @@ -18,8 +18,7 @@ var C = function() { return _createClass(C, null, [ { key: "f", - value: function(x) { - } + value: function(x) {} } ]), C; }(), C2 = function() { @@ -30,8 +29,7 @@ var C = function() { return _createClass(C2, null, [ { key: "f", - value: function(x) { - } + value: function(x) {} } ]), C2; }(), C3 = function() { @@ -42,8 +40,7 @@ var C = function() { return _createClass(C3, null, [ { key: "f", - value: function(x) { - } + value: function(x) {} } ]), C3; }(); diff --git a/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es2015.1.normal.js b/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es2015.1.normal.js index 1e2d7969196..57489fdf82a 100644 --- a/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es2015.1.normal.js @@ -1,6 +1,5 @@ class C { } class D { - f() { - } + f() {} } diff --git a/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.1.normal.js b/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.1.normal.js index 6fe334ee29c..a44e869eaed 100644 --- a/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.1.normal.js @@ -29,8 +29,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "f", - value: function f() { - } + value: function f() {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.2.minified.js b/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.2.minified.js index 2a80d46502c..286159c4c81 100644 --- a/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/staticPropertyAndFunctionWithSameName_es5.2.minified.js @@ -19,8 +19,7 @@ var C = function() { return protoProps = [ { key: "f", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = D).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), D; }(); diff --git a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.1.normal.js b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.1.normal.js index 8f6b6aaaf20..26441a84471 100644 --- a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.1.normal.js @@ -7,8 +7,7 @@ var NonGeneric; static get x() { return 1; } - static set x(v) { - } + static set x(v) {} constructor(a, b){ this.a = a; this.b = b; @@ -16,15 +15,13 @@ var NonGeneric; } (function(C) { var bar = C.bar = ''; - })(C1 || (C1 = { - })); + })(C1 || (C1 = {})); var c = new C1(1, 2); var r = c.fn(); var r4 = c.foo; // error var r5 = c.bar; // error var r6 = c.x; // error -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { class C2 { @@ -34,8 +31,7 @@ var Generic; static get x() { return 1; } - static set x(v) { - } + static set x(v) {} constructor(a, b){ this.a = a; this.b = b; @@ -43,12 +39,10 @@ var Generic; } (function(C) { var bar = C.bar = ''; - })(C2 || (C2 = { - })); + })(C2 || (C2 = {})); var c = new C2(1, ''); var r = c.fn(); var r4 = c.foo; // error var r5 = c.bar; // error var r6 = c.x; // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.2.minified.js b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.2.minified.js index 608c91263dc..cb90c70ef58 100644 --- a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es2015.2.minified.js @@ -7,18 +7,15 @@ var NonGeneric, Generic; static get x() { return 1; } - static set x(v) { - } + static set x(v) {} constructor(a, b){ this.a = a, this.b = b; } } - (C || (C = { - })).bar = ""; + (C || (C = {})).bar = ""; var c = new C(1, 2); c.fn(), c.foo, c.bar, c.x; -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { class C { fn() { return this; @@ -26,15 +23,12 @@ var NonGeneric, Generic; static get x() { return 1; } - static set x(v) { - } + static set x(v) {} constructor(a, b){ this.a = a, this.b = b; } } - (C || (C = { - })).bar = ""; + (C || (C = {})).bar = ""; var c = new C(1, ""); c.fn(), c.foo, c.bar, c.x; -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.1.normal.js b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.1.normal.js index 72886d9624a..5998c4c593f 100644 --- a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.1.normal.js @@ -39,23 +39,20 @@ var NonGeneric; get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; }(); (function(C) { var bar = C.bar = ''; - })(C || (C = { - })); + })(C || (C = {})); var c = new C(1, 2); var r = c.fn(); var r4 = c.foo; // error var r5 = c.bar; // error var r6 = c.x; // error -})(NonGeneric || (NonGeneric = { -})); +})(NonGeneric || (NonGeneric = {})); var Generic; (function(Generic) { var C = /*#__PURE__*/ function() { @@ -78,20 +75,17 @@ var Generic; get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return C; }(); (function(C) { var bar = C.bar = ''; - })(C || (C = { - })); + })(C || (C = {})); var c = new C(1, ''); var r = c.fn(); var r4 = c.foo; // error var r5 = c.bar; // error var r6 = c.x; // error -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.2.minified.js b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.2.minified.js index d2be4b6e762..e821bb56a1d 100644 --- a/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/staticPropertyNotInClassType_es5.2.minified.js @@ -30,17 +30,14 @@ function _createClass(Constructor, protoProps, staticProps) { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), C; }(); - (C || (C = { - })).bar = ""; + (C || (C = {})).bar = ""; var c = new C(1, 2); c.fn(), c.foo, c.bar, c.x; -}(NonGeneric || (NonGeneric = { -})), (function(Generic) { +}(NonGeneric || (NonGeneric = {})), (function(Generic) { var C = function() { "use strict"; function C(a, b) { @@ -59,14 +56,11 @@ function _createClass(Constructor, protoProps, staticProps) { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), C; }(); - (C || (C = { - })).bar = ""; + (C || (C = {})).bar = ""; var c = new C(1, ""); c.fn(), c.foo, c.bar, c.x; -})(Generic || (Generic = { -})); +})(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.1.normal.js b/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.1.normal.js index 17a39d32220..c60a1e7b24b 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.1.normal.js @@ -34,8 +34,7 @@ class C { generic(x) { return x; } - constructor(a, b){ - } + constructor(a, b){} } let f10 = c.foo.bind(c); let f11 = c.foo.bind(c, 10); diff --git a/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.2.minified.js b/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.2.minified.js index 6db3f1b06ef..e72196de876 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply1_es2015.2.minified.js @@ -15,13 +15,11 @@ class C { foo(a, b) { return ""; } - overloaded(x) { - } + overloaded(x) {} generic(x) { return x; } - constructor(a, b){ - } + constructor(a, b){} } c.foo.bind(c), c.foo.bind(c, 10), c.foo.bind(c, 10, "hello"), c.foo.bind(c, 10, 20), c.foo.bind(void 0), c.overloaded.bind(c), c.generic.bind(c), c.foo.call(c, 10, "hello"), c.foo.call(c, 10), c.foo.call(c, 10, 20), c.foo.call(c, 10, "hello", 30), c.foo.call(void 0, 10, "hello"), c.foo.apply(c, [ 10, diff --git a/crates/swc/tests/tsc-references/strictBindCallApply1_es5.2.minified.js b/crates/swc/tests/tsc-references/strictBindCallApply1_es5.2.minified.js index 83a6e7e49d8..10071025a23 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply1_es5.2.minified.js @@ -34,8 +34,7 @@ var C = function() { }, { key: "overloaded", - value: function(x) { - } + value: function(x) {} }, { key: "generic", diff --git a/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.1.normal.js b/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.1.normal.js index b5bce63fbce..30e8b0b24e5 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.1.normal.js @@ -1,5 +1,4 @@ -function fn() { -} +function fn() {} const fb = fn.bind({ blub: "blub" }); diff --git a/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.2.minified.js b/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.2.minified.js index 8b12fde6d70..436e21a725c 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply2_es2015.2.minified.js @@ -1,4 +1,3 @@ -(function() { -}).bind({ +(function() {}).bind({ blub: "blub" }); diff --git a/crates/swc/tests/tsc-references/strictBindCallApply2_es5.1.normal.js b/crates/swc/tests/tsc-references/strictBindCallApply2_es5.1.normal.js index fc739083873..7d76cace119 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply2_es5.1.normal.js @@ -1,5 +1,4 @@ -function fn() { -} +function fn() {} var fb = fn.bind({ blub: "blub" }); diff --git a/crates/swc/tests/tsc-references/strictBindCallApply2_es5.2.minified.js b/crates/swc/tests/tsc-references/strictBindCallApply2_es5.2.minified.js index 8b12fde6d70..436e21a725c 100644 --- a/crates/swc/tests/tsc-references/strictBindCallApply2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/strictBindCallApply2_es5.2.minified.js @@ -1,4 +1,3 @@ -(function() { -}).bind({ +(function() {}).bind({ blub: "blub" }); diff --git a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.1.normal.js index d4d6327d9a0..e2006acc7b9 100644 --- a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.1.normal.js @@ -4,6 +4,5 @@ E; E["A"] = "a"; E["B"] = "b"; E["C"] = "c"; -})(E || (E = { -})); +})(E || (E = {})); const snb = item[e]; diff --git a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.2.minified.js index d254d0d12ea..39d48f298d1 100644 --- a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -})).A = "a", E.B = "b", E.C = "c", item[e]; +(E = E || (E = {})).A = "a", E.B = "b", E.C = "c", item[e]; diff --git a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.1.normal.js b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.1.normal.js index 84ace534122..f9f5cd1209b 100644 --- a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.1.normal.js @@ -4,6 +4,5 @@ E; E["A"] = "a"; E["B"] = "b"; E["C"] = "c"; -})(E || (E = { -})); +})(E || (E = {})); var snb = item[e]; diff --git a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.2.minified.js b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.2.minified.js index d254d0d12ea..39d48f298d1 100644 --- a/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumInElementAccess01_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -})).A = "a", E.B = "b", E.C = "c", item[e]; +(E = E || (E = {})).A = "a", E.B = "b", E.C = "c", item[e]; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.1.normal.js index 671a75aa065..21a0089b14f 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice["Unknown"] = ""; Choice["Yes"] = "yes"; Choice["No"] = "no"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.2.minified.js index e06d6e85103..09cc5f3f717 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es2015.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; +(Choice = Choice || (Choice = {})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.1.normal.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.1.normal.js index 671a75aa065..21a0089b14f 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice["Unknown"] = ""; Choice["Yes"] = "yes"; Choice["No"] = "no"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.2.minified.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.2.minified.js index e06d6e85103..09cc5f3f717 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes1_es5.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; +(Choice = Choice || (Choice = {})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.1.normal.js index b98fc097717..dfb35bbf57f 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.1.normal.js @@ -4,8 +4,7 @@ Choice; Choice["Unknown"] = ""; Choice["Yes"] = "yes"; Choice["No"] = "no"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.2.minified.js index e06d6e85103..09cc5f3f717 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es2015.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; +(Choice = Choice || (Choice = {})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.1.normal.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.1.normal.js index b98fc097717..dfb35bbf57f 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.1.normal.js @@ -4,8 +4,7 @@ Choice; Choice["Unknown"] = ""; Choice["Yes"] = "yes"; Choice["No"] = "no"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1() { var a; var a; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.2.minified.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.2.minified.js index e06d6e85103..09cc5f3f717 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes2_es5.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; +(Choice = Choice || (Choice = {})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.1.normal.js index e4437f65629..ba542e941a2 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice["Unknown"] = ""; Choice["Yes"] = "yes"; Choice["No"] = "no"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1(a, b, c, d) { a = a; a = b; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.2.minified.js index e06d6e85103..09cc5f3f717 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es2015.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; +(Choice = Choice || (Choice = {})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.1.normal.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.1.normal.js index e4437f65629..ba542e941a2 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.1.normal.js @@ -3,8 +3,7 @@ var Choice; Choice["Unknown"] = ""; Choice["Yes"] = "yes"; Choice["No"] = "no"; -})(Choice || (Choice = { -})); +})(Choice || (Choice = {})); function f1(a, b, c, d) { a = a; a = b; diff --git a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.2.minified.js b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.2.minified.js index e06d6e85103..09cc5f3f717 100644 --- a/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringEnumLiteralTypes3_es5.2.minified.js @@ -1,3 +1,2 @@ var Choice, Choice; -(Choice = Choice || (Choice = { -})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; +(Choice = Choice || (Choice = {})).Unknown = "", Choice.Yes = "yes", Choice.No = "no"; diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.1.normal.js index 7ee6b4f443a..d938e924531 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.2.minified.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.2.minified.js index ef5841e9c8d..81d80d90703 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2_es5.2.minified.js @@ -51,8 +51,7 @@ var A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es2015.1.normal.js index 5b786899840..0aff8b71e52 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es2015.1.normal.js @@ -2,26 +2,22 @@ class C { get X() { return ''; } - set X(v) { - } + set X(v) {} foo() { return ''; } - static foo() { - } + static foo() {} static get X() { return 1; } - constructor(){ - } + constructor(){} } var a; // error var b = { a: '', b: 1, - c: ()=>{ - }, + c: ()=>{}, "d": '', "e": 1, 1: '', @@ -32,8 +28,7 @@ var b = { get X () { return ''; }, - set X (v){ - }, + set X (v){}, foo () { return ''; } diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.1.normal.js index 829a165f514..6022d7b7767 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.1.normal.js @@ -28,8 +28,7 @@ var C = /*#__PURE__*/ function() { get: function get() { return ''; }, - set: function set(v) { - } // ok + set: function set(v) {} // ok }, { key: "foo", @@ -40,8 +39,7 @@ var C = /*#__PURE__*/ function() { ], [ { key: "foo", - value: function foo() { - } // ok + value: function foo() {} // ok }, { key: "X", @@ -57,8 +55,7 @@ var a; var b = { a: '', b: 1, - c: function() { - }, + c: function() {}, "d": '', "e": 1, 1: '', @@ -69,8 +66,7 @@ var b = { get X () { return ''; }, - set X (v){ - }, + set X (v){}, foo: function foo() { return ''; } diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.2.minified.js index 8b1d728f945..63805daf36b 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, staticProps = [ { key: "foo", - value: function() { - } + value: function() {} }, { key: "X", @@ -30,8 +29,7 @@ var C = function() { get: function() { return ""; }, - set: function(v) { - } + set: function(v) {} }, { key: "foo", diff --git a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.1.normal.js index 6dfbf7cdcbc..2b0ef895eff 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.1.normal.js @@ -1,21 +1,12 @@ -function f1(x) { -} -function f2(x) { -} -function f3(x) { -} -function f4(x) { -} -function f5(x) { -} -function f6(x) { -} -function f7(x) { -} -function f8(x) { -} -function f9(x) { -} +function f1(x) {} +function f2(x) {} +function f3(x) {} +function f4(x) {} +function f5(x) {} +function f6(x) {} +function f7(x) {} +function f8(x) {} +function f9(x) {} class C { toString() { return null; @@ -78,22 +69,14 @@ class C { return null; } } -function f10(x) { -} -function f11(x) { -} -function f12(x) { -} -function f13(x) { -} +function f10(x) {} +function f11(x) {} +function f12(x) {} +function f13(x) {} var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f14(x) { -} -function f15(x) { -} -function f16(x) { -} +})(E || (E = {})); +function f14(x) {} +function f15(x) {} +function f16(x) {} diff --git a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.1.normal.js index d80862f5c27..2e20efb7f10 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.1.normal.js @@ -17,24 +17,15 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function f1(x) { -} -function f2(x) { -} -function f3(x) { -} -function f4(x) { -} -function f5(x) { -} -function f6(x) { -} -function f7(x) { -} -function f8(x) { -} -function f9(x) { -} +function f1(x) {} +function f2(x) {} +function f3(x) {} +function f4(x) {} +function f5(x) {} +function f6(x) {} +function f7(x) {} +function f8(x) {} +function f9(x) {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -167,22 +158,14 @@ var C = /*#__PURE__*/ function() { ]); return C; }(); -function f10(x) { -} -function f11(x) { -} -function f12(x) { -} -function f13(x) { -} +function f10(x) {} +function f11(x) {} +function f12(x) {} +function f13(x) {} var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f14(x) { -} -function f15(x) { -} -function f16(x) { -} +})(E || (E = {})); +function f14(x) {} +function f15(x) {} +function f16(x) {} diff --git a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.2.minified.js index 102d28d3694..e450f4b7b4d 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypeIsSubtypeOfString_es5.2.minified.js @@ -136,5 +136,4 @@ var E, E, C = function() { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/stringLiteralType_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralType_es2015.1.normal.js index e0f99ba11ac..1192a497477 100644 --- a/crates/swc/tests/tsc-references/stringLiteralType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralType_es2015.1.normal.js @@ -1,3 +1,2 @@ var x; -function f(x) { -} +function f(x) {} diff --git a/crates/swc/tests/tsc-references/stringLiteralType_es5.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralType_es5.1.normal.js index e0f99ba11ac..1192a497477 100644 --- a/crates/swc/tests/tsc-references/stringLiteralType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralType_es5.1.normal.js @@ -1,3 +1,2 @@ var x; -function f(x) { -} +function f(x) {} diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es2015.1.normal.js index a165a7b15b0..f1b9172b7ec 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es2015.1.normal.js @@ -1,13 +1,9 @@ -function foo(x) { -} +function foo(x) {} class C { - foo(x) { - } + foo(x) {} } var a; var b = { - foo (x) { - }, - foo (x) { - } + foo (x) {}, + foo (x) {} }; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.1.normal.js index 0ac642dbcbc..05aa16f8a5a 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.1.normal.js @@ -30,8 +30,7 @@ function _defineProperty(obj, key, value) { } return obj; } -function foo(x) { -} +function foo(x) {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -40,15 +39,12 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; }(); var a; var b = _defineProperty({ - foo: function foo(x) { - } -}, "foo", function foo(x) { -}); + foo: function foo(x) {} +}, "foo", function foo(x) {}); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.2.minified.js index 5d414eccf29..166609907cc 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures2_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); @@ -28,7 +27,5 @@ var C = function() { writable: !0 }) : obj[key] = value, obj; }({ - foo: function(x) { - } -}, "foo", function(x) { -}); + foo: function(x) {} +}, "foo", function(x) {}); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es2015.1.normal.js index 4f240d8caeb..9066b9ce35c 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es2015.1.normal.js @@ -1,20 +1,13 @@ // String literal types are only valid in overload signatures -function foo(x) { -} -var f = function foo(x) { -}; -var f2 = (x, y)=>{ -}; +function foo(x) {} +var f = function foo(x) {}; +var f2 = (x, y)=>{}; class C { - foo(x) { - } + foo(x) {} } var a; var b = { - foo (x) { - }, - a: function foo(x, y) { - }, - b: (x)=>{ - } + foo (x) {}, + a: function foo(x, y) {}, + b: (x)=>{} }; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.1.normal.js index 63df0746d73..aa40c4ecc08 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.1.normal.js @@ -18,12 +18,9 @@ function _createClass(Constructor, protoProps, staticProps) { return Constructor; } // String literal types are only valid in overload signatures -function foo(x) { -} -var f = function foo(x) { -}; -var f2 = function(x, y) { -}; +function foo(x) {} +var f = function foo(x) {}; +var f2 = function(x, y) {}; var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -32,18 +29,14 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} } ]); return C; }(); var a; var b = { - foo: function foo(x) { - }, - a: function foo(x, y) { - }, - b: function(x) { - } + foo: function foo(x) {}, + a: function foo(x, y) {}, + b: function(x) {} }; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.2.minified.js index fe1674d9c2f..b9f4f2eedd9 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesInImplementationSignatures_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.1.normal.js index 2a474869957..6e230cfc197 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.1.normal.js @@ -16,8 +16,7 @@ var Consts1; const EMPTY_STRING = getFalsyPrimitive("string"); const ZERO = getFalsyPrimitive('number'); const FALSE = getFalsyPrimitive("boolean"); -})(Consts1 || (Consts1 = { -})); +})(Consts1 || (Consts1 = {})); const string = "string"; const number = "number"; const boolean = "boolean"; @@ -34,5 +33,4 @@ var Consts2; const b = getFalsyPrimitive(stringOrBoolean); const c = getFalsyPrimitive(booleanOrNumber); const d = getFalsyPrimitive(stringOrBooleanOrNumber); -})(Consts2 || (Consts2 = { -})); +})(Consts2 || (Consts2 = {})); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.2.minified.js index 34a7a40bc38..cbcf4178a1d 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es2015.2.minified.js @@ -5,8 +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"); const string = "string", number = "number", boolean = "boolean", stringOrBoolean = string || boolean; -Consts2 || (Consts2 = { -}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); +Consts2 || (Consts2 = {}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.1.normal.js index 29fd4ecb4ad..8721541c14a 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.1.normal.js @@ -16,8 +16,7 @@ var Consts1; var EMPTY_STRING = getFalsyPrimitive("string"); var ZERO = getFalsyPrimitive('number'); var FALSE = getFalsyPrimitive("boolean"); -})(Consts1 || (Consts1 = { -})); +})(Consts1 || (Consts1 = {})); var string = "string"; var number = "number"; var boolean = "boolean"; @@ -34,5 +33,4 @@ var Consts2; var b = getFalsyPrimitive(stringOrBoolean); var c = getFalsyPrimitive(booleanOrNumber); var d = getFalsyPrimitive(stringOrBooleanOrNumber); -})(Consts2 || (Consts2 = { -})); +})(Consts2 || (Consts2 = {})); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.2.minified.js index 217a3086042..703aa9f46a0 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01_es5.2.minified.js @@ -4,8 +4,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", stringOrBoolean = string || boolean; -Consts2 || (Consts2 = { -}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); +Consts2 || (Consts2 = {}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.1.normal.js index 2a474869957..6e230cfc197 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.1.normal.js @@ -16,8 +16,7 @@ var Consts1; const EMPTY_STRING = getFalsyPrimitive("string"); const ZERO = getFalsyPrimitive('number'); const FALSE = getFalsyPrimitive("boolean"); -})(Consts1 || (Consts1 = { -})); +})(Consts1 || (Consts1 = {})); const string = "string"; const number = "number"; const boolean = "boolean"; @@ -34,5 +33,4 @@ var Consts2; const b = getFalsyPrimitive(stringOrBoolean); const c = getFalsyPrimitive(booleanOrNumber); const d = getFalsyPrimitive(stringOrBooleanOrNumber); -})(Consts2 || (Consts2 = { -})); +})(Consts2 || (Consts2 = {})); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.2.minified.js index 34a7a40bc38..cbcf4178a1d 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es2015.2.minified.js @@ -5,8 +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"); const string = "string", number = "number", boolean = "boolean", stringOrBoolean = string || boolean; -Consts2 || (Consts2 = { -}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); +Consts2 || (Consts2 = {}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.1.normal.js index 29fd4ecb4ad..8721541c14a 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.1.normal.js @@ -16,8 +16,7 @@ var Consts1; var EMPTY_STRING = getFalsyPrimitive("string"); var ZERO = getFalsyPrimitive('number'); var FALSE = getFalsyPrimitive("boolean"); -})(Consts1 || (Consts1 = { -})); +})(Consts1 || (Consts1 = {})); var string = "string"; var number = "number"; var boolean = "boolean"; @@ -34,5 +33,4 @@ var Consts2; var b = getFalsyPrimitive(stringOrBoolean); var c = getFalsyPrimitive(booleanOrNumber); var d = getFalsyPrimitive(stringOrBooleanOrNumber); -})(Consts2 || (Consts2 = { -})); +})(Consts2 || (Consts2 = {})); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.2.minified.js index 217a3086042..703aa9f46a0 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02_es5.2.minified.js @@ -4,8 +4,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", stringOrBoolean = string || boolean; -Consts2 || (Consts2 = { -}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); +Consts2 || (Consts2 = {}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(string || number), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(number || boolean), getFalsyPrimitive(stringOrBoolean || number); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads03_es2015.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads03_es2015.2.minified.js index 0b04161ff11..2187426bdb0 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads03_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads03_es2015.2.minified.js @@ -1,6 +1,4 @@ let hello, world, helloOrWorld; -function f(...args) { -} -function g(...args) { -} +function f(...args) {} +function g(...args) {} f(hello), f(world), f(helloOrWorld), g(hello), g(world), g(helloOrWorld); diff --git a/crates/swc/tests/tsc-references/subtypesOfAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfAny_es2015.1.normal.js index 233a154065a..e424b41aaf5 100644 --- a/crates/swc/tests/tsc-references/subtypesOfAny_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfAny_es2015.1.normal.js @@ -5,17 +5,13 @@ class A2 { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfAny_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfAny_es2015.2.minified.js index a2e87ad744c..3f3700c80c3 100644 --- a/crates/swc/tests/tsc-references/subtypesOfAny_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfAny_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfAny_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfAny_es5.1.normal.js index 9cbe663529a..831f86df045 100644 --- a/crates/swc/tests/tsc-references/subtypesOfAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfAny_es5.1.normal.js @@ -14,19 +14,15 @@ var A2 = function A2() { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfAny_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfAny_es5.2.minified.js index 6507a42018d..13efea2d586 100644 --- a/crates/swc/tests/tsc-references/subtypesOfAny_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfAny_es5.2.minified.js @@ -8,14 +8,10 @@ var E, E, A = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.1.normal.js index 9576feaf460..39aab5eecbc 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.1.normal.js @@ -32,20 +32,16 @@ class C2 { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f22) { var bar = f22.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); function f4(x) { var r0 = true ? x : null; // ok var r0 = true ? null : x; // ok @@ -82,10 +78,8 @@ function f10(x) { }; // ok } function f11(x) { - var r7 = true ? ()=>{ - } : x; // ok - var r7 = true ? x : ()=>{ - }; // ok + var r7 = true ? ()=>{} : x; // ok + var r7 = true ? x : ()=>{}; // ok } function f12(x1) { var r8 = true ? (x)=>{ @@ -141,8 +135,6 @@ function f20(x) { var r19 = true ? x : new Object(); // ok } function f21(x) { - var r20 = true ? { - } : x; // ok - var r20 = true ? x : { - }; // ok + var r20 = true ? {} : x; // ok + var r20 = true ? x : {}; // ok } diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.2.minified.js index a2e87ad744c..3f3700c80c3 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.1.normal.js index b0f691e6d31..16c71de37ce 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.1.normal.js @@ -41,22 +41,18 @@ var C2 = function C2() { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f22) { var bar = f22.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); function f4(x) { var r0 = true ? x : null; // ok var r0 = true ? null : x; // ok @@ -93,10 +89,8 @@ function f10(x) { }; // ok } function f11(x) { - var r7 = true ? function() { - } : x; // ok - var r7 = true ? x : function() { - }; // ok + var r7 = true ? function() {} : x; // ok + var r7 = true ? x : function() {}; // ok } function f12(x1) { var r8 = true ? function(x) { @@ -152,8 +146,6 @@ function f20(x) { var r19 = true ? x : new Object(); // ok } function f21(x) { - var r20 = true ? { - } : x; // ok - var r20 = true ? x : { - }; // ok + var r20 = true ? {} : x; // ok + var r20 = true ? x : {}; // ok } diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.2.minified.js index c7cb0708913..997771845c8 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2_es5.2.minified.js @@ -8,14 +8,10 @@ var E, E, C1 = function() { "use strict"; _classCallCheck(this, C2); }; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.1.normal.js index aea0d2da8ce..58221d80fd4 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.2.minified.js index 0659234121f..76052be99a7 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.1.normal.js index 0c71cd3ce00..77174f05317 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.2.minified.js index e8fd57e8ef0..c62e1f4dbda 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es2015.1.normal.js index 3ee8bb0e32b..779a074505f 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es2015.1.normal.js @@ -61,8 +61,7 @@ var M1; } class D9 extends Base { } -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); var M2; (function(M2) { class Base2 { @@ -85,5 +84,4 @@ var M2; } class D9 extends Base2 { } -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.1.normal.js index ba3bf412ad7..238052c03e7 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -207,8 +206,7 @@ var M1; } return D9; }(Base); -})(M1 || (M1 = { -})); +})(M1 || (M1 = {})); var M2; (function(M2) { var Base2 = function Base2() { @@ -305,5 +303,4 @@ var M2; } return D9; }(Base2); -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.2.minified.js index 1460e6416f7..4bc3326d547 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -126,8 +125,7 @@ var M1, M2, Foo = function() { } return D9; }(Base1); -}(M1 || (M1 = { -})), (function(M2) { +}(M1 || (M1 = {})), (function(M2) { var Base21 = function() { "use strict"; _classCallCheck(this, Base21); @@ -204,5 +202,4 @@ var M1, M2, Foo = function() { } return D9; }(Base21); -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.1.normal.js index df25aab1c1a..729e62d35f6 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.1.normal.js @@ -14,20 +14,16 @@ class C2 { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f3) { var bar = f3.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); // errors throughout function f2(x1, y) { var r0 = true ? x1 : null; @@ -51,10 +47,8 @@ function f2(x1, y) { var r6 = true ? x1 : { foo: 1 }; - var r7 = true ? ()=>{ - } : x1; - var r7 = true ? x1 : ()=>{ - }; + var r7 = true ? ()=>{} : x1; + var r7 = true ? x1 : ()=>{}; var r8 = true ? (x)=>{ return x; } : x1; @@ -90,8 +84,6 @@ function f2(x1, y) { } var r19 = true ? new Object() : x1; // BCT is Object var r19 = true ? x1 : new Object(); // BCT is Object - var r20 = true ? { - } : x1; // ok - var r20 = true ? x1 : { - }; // ok + var r20 = true ? {} : x1; // ok + var r20 = true ? x1 : {}; // ok } diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.2.minified.js index a2e87ad744c..3f3700c80c3 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.1.normal.js index 55bdc8b685a..77a90e5ec5c 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -98,22 +97,18 @@ var C2 = function C2() { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); -function f() { -} +})(E || (E = {})); +function f() {} (function(f3) { var bar = f3.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); // errors throughout function f2(x1, y) { var f17 = function f17(a) { @@ -145,10 +140,8 @@ function f2(x1, y) { var r6 = true ? x1 : { foo: 1 }; - var r7 = true ? function() { - } : x1; - var r7 = true ? x1 : function() { - }; + var r7 = true ? function() {} : x1; + var r7 = true ? x1 : function() {}; var r8 = true ? function(x) { return x; } : x1; @@ -176,8 +169,6 @@ function f2(x1, y) { var r16 = true ? x1 : ac; var r19 = true ? new Object() : x1; // BCT is Object var r19 = true ? x1 : new Object(); // BCT is Object - var r20 = true ? { - } : x1; // ok - var r20 = true ? x1 : { - }; // ok + var r20 = true ? {} : x1; // ok + var r20 = true ? x1 : {}; // ok } diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.2.minified.js index 68e946ed516..311d32f068d 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter_es5.2.minified.js @@ -34,8 +34,7 @@ var E, E, _typeof = function(obj) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -63,14 +62,10 @@ var E, E, _typeof = function(obj) { "use strict"; _classCallCheck(this, C2); }; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.1.normal.js index 67e8fa5c4ae..a204228cbd5 100644 --- a/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.1.normal.js @@ -2,21 +2,17 @@ var E; (function(E) { E[E["e1"] = 0] = "e1"; E[E["e2"] = 1] = "e2"; -})(E || (E = { -})); +})(E || (E = {})); class A { } class A2 { } -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.2.minified.js index 2eec6bd9537..ff86d1459f3 100644 --- a/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfUnion_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -(E = E || (E = { -}))[E.e1 = 0] = "e1", E[E.e2 = 1] = "e2", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.e1 = 0] = "e1", E[E.e2 = 1] = "e2", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypesOfUnion_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfUnion_es5.1.normal.js index 6263e92077a..2294e22eca9 100644 --- a/crates/swc/tests/tsc-references/subtypesOfUnion_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfUnion_es5.1.normal.js @@ -7,8 +7,7 @@ var E; (function(E) { E[E["e1"] = 0] = "e1"; E[E["e2"] = 1] = "e2"; -})(E || (E = { -})); +})(E || (E = {})); var A = function A() { "use strict"; _classCallCheck(this, A); @@ -17,17 +16,14 @@ var A2 = function A2() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/subtypesOfUnion_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfUnion_es5.2.minified.js index df032a577cd..9a74586c3f2 100644 --- a/crates/swc/tests/tsc-references/subtypesOfUnion_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypesOfUnion_es5.2.minified.js @@ -1,8 +1,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } -(E = E || (E = { -}))[E.e1 = 0] = "e1", E[E.e2 = 1] = "e2"; +(E = E || (E = {}))[E.e1 = 0] = "e1", E[E.e2 = 1] = "e2"; var E, E, A = function() { "use strict"; _classCallCheck(this, A); @@ -10,13 +9,10 @@ var E, E, A = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -(f || (f = { -})).bar = 1; +function f() {} +(f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es2015.1.normal.js index d8302abcd1d..e427d65e775 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es2015.1.normal.js @@ -43,8 +43,7 @@ var r2b = [ ]; var r3arg1 = (x)=>x ; -var r3arg2 = (x)=>{ -}; +var r3arg2 = (x)=>{}; var r3 = foo3(r3arg1); var r3a = [ r3arg1, diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.1.normal.js index 5a8e221332c..1daa9e4b228 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -144,8 +143,7 @@ var r2b = [ var r3arg1 = function(x) { return x; }; -var r3arg2 = function(x) { -}; +var r3arg2 = function(x) {}; var r3 = foo3(r3arg1); var r3a = [ r3arg1, diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.2.minified.js index f729557acf4..fd5db94741a 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.1.normal.js index 6e678e8839e..6171d379367 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.1.normal.js @@ -121,8 +121,7 @@ var Errors; var r9arg = (x)=>null ; var r9 = foo17(r9arg); // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { var r2arg2 = (x)=>[ @@ -133,5 +132,4 @@ var WithGenericSignaturesInBaseType; var r3arg2 = (x)=>null ; var r3 = foo3(r3arg2); // any -})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -})); +})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.2.minified.js index 32bdae46d9b..2c8c45c64c7 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es2015.2.minified.js @@ -1,6 +1,5 @@ var Errors, WithGenericSignaturesInBaseType; -Errors || (Errors = { -}), foo2((x)=>null +Errors || (Errors = {}), foo2((x)=>null ), foo7((x)=>(r)=>null ), foo8((x, y)=>(r)=>null ), foo10((...x)=>null @@ -10,8 +9,7 @@ Errors || (Errors = { ), foo15((x)=>1 ), foo16((x)=>null ), foo17((x)=>null -), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -}), foo2((x)=>[ +), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), foo2((x)=>[ "" ] ), foo3((x)=>null diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.1.normal.js index 9c40ecbea4c..58a00f72c45 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -254,8 +253,7 @@ var Errors; return null; }; var r9 = foo17(r9arg); // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { var r2arg2 = function(x) { @@ -268,5 +266,4 @@ var WithGenericSignaturesInBaseType; return null; }; var r3 = foo3(r3arg2); // any -})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -})); +})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.2.minified.js index 8ce5d768715..d44f6042e15 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -101,9 +100,7 @@ function _createSuper(Derived) { }), foo17(function(x) { return null; }); -}(Errors || (Errors = { -})), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -}), foo2(function(x) { +}(Errors || (Errors = {})), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), foo2(function(x) { return [ "" ]; diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es2015.1.normal.js index 90b427d30ed..815c0ec08c9 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es2015.1.normal.js @@ -39,8 +39,7 @@ var r2b = [ ]; var r3arg = (x)=>null ; -var r3arg2 = (x)=>{ -}; +var r3arg2 = (x)=>{}; var r3 = foo3(r3arg); var r3a = [ r3arg, diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.1.normal.js index 4dd4fddceb6..e725765a24c 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -140,8 +139,7 @@ var r2b = [ var r3arg = function(x) { return null; }; -var r3arg2 = function(x) { -}; +var r3arg2 = function(x) {}; var r3 = foo3(r3arg); var r3a = [ r3arg, diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.2.minified.js index 2694b2ffe4f..d5858653a14 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.1.normal.js index 9035f6f3794..0713c514429 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.1.normal.js @@ -8,5 +8,4 @@ var CallSignature; ); // ok because base returns void var r4 = foo2((x)=>'' ); // ok because base returns void -})(CallSignature || (CallSignature = { -})); +})(CallSignature || (CallSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.2.minified.js index efccf618931..e4408f214c4 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es2015.2.minified.js @@ -1,6 +1,5 @@ var CallSignature; -CallSignature || (CallSignature = { -}), foo1((x)=>1 +CallSignature || (CallSignature = {}), foo1((x)=>1 ), foo1((x)=>"" ), foo2((x, y)=>1 ), foo2((x)=>"" diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.1.normal.js index 7745ed44915..aa5ffbba3b1 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.1.normal.js @@ -12,5 +12,4 @@ var CallSignature; var r4 = foo2(function(x) { return ''; }); // ok because base returns void -})(CallSignature || (CallSignature = { -})); +})(CallSignature || (CallSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.2.minified.js index 3b6be8bc017..4ccb38f84e2 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures_es5.2.minified.js @@ -1,6 +1,5 @@ var CallSignature; -CallSignature || (CallSignature = { -}), foo1(function(x) { +CallSignature || (CallSignature = {}), foo1(function(x) { return 1; }), foo1(function(x) { return ""; diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.1.normal.js index ae78780c241..38db737a017 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.2.minified.js index c61386ba0eb..62899671c6e 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.1.normal.js index abf9120e9a2..8dda613037d 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.1.normal.js @@ -101,13 +101,11 @@ var Errors; var r8 = foo16(r8arg); // any var r9arg; var r9 = foo17(r9arg); // // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { var r2arg2; var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now var r3arg2; var r3 = foo3(r3arg2); // any -})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -})); +})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.2.minified.js index 7d0b740943d..d9d04add3b9 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es2015.2.minified.js @@ -2,9 +2,7 @@ var Errors, WithGenericSignaturesInBaseType; !function(Errors) { var r2arg1, r3arg1, r4arg1, r5arg1, r6arg1, r7arg1, r7arg3, r8arg, r9arg; foo2(void 0), foo7(r2arg1), foo8(r3arg1), foo10(r4arg1), foo11(r5arg1), foo12(r6arg1), foo15(r7arg1), foo15(r7arg3), foo16(r8arg), foo17(r9arg); -}(Errors || (Errors = { -})), (function(WithGenericSignaturesInBaseType) { +}(Errors || (Errors = {})), (function(WithGenericSignaturesInBaseType) { var r3arg2; foo2(void 0), foo3(r3arg2); -})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -})); +})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.1.normal.js index fca74f500ab..9d896af40df 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -198,13 +197,11 @@ var Errors; var r8 = foo16(r8arg); // any var r9arg; var r9 = foo17(r9arg); // // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; -})(Errors || (Errors = { -})); +})(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { var r2arg2; var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now var r3arg2; var r3 = foo3(r3arg2); // any -})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -})); +})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.2.minified.js index 6f46afbeade..4481b90a696 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3_es5.2.minified.js @@ -28,8 +28,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -76,9 +75,7 @@ function _createSuper(Derived) { return OtherDerived; }(Base1); foo2(r1arg1), foo7(r2arg1), foo8(r3arg1), foo10(r4arg1), foo11(r5arg1), foo12(r6arg1), foo15(r7arg1), foo15(r7arg3), foo16(r8arg), foo17(r9arg); -}(Errors || (Errors = { -})), (function(WithGenericSignaturesInBaseType) { +}(Errors || (Errors = {})), (function(WithGenericSignaturesInBaseType) { var r3arg2; foo2(void 0), foo3(r3arg2); -})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = { -})); +})(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.1.normal.js index 68e94ce90ff..cae63716532 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.2.minified.js index 8446f4cb1c6..6b6c5c97234 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.1.normal.js index 20624ef10df..488c5771a20 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.2.minified.js index c5bd3e3778a..5246c7b2bd6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.1.normal.js index f7ab4429453..03e38b96eb6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.1.normal.js @@ -8,5 +8,4 @@ var ConstructSignature; var r3 = foo2(r3arg1); // ok because base returns void var r4arg1; var r4 = foo2(r4arg1); // ok because base returns void -})(ConstructSignature || (ConstructSignature = { -})); +})(ConstructSignature || (ConstructSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.2.minified.js index 3d710e1f595..1cb42999340 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es2015.2.minified.js @@ -2,5 +2,4 @@ var ConstructSignature; !function(ConstructSignature) { var rarg2, r3arg1, r4arg1; foo1(void 0), foo1(rarg2), foo2(r3arg1), foo2(r4arg1); -}(ConstructSignature || (ConstructSignature = { -})); +}(ConstructSignature || (ConstructSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.1.normal.js index f7ab4429453..03e38b96eb6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.1.normal.js @@ -8,5 +8,4 @@ var ConstructSignature; var r3 = foo2(r3arg1); // ok because base returns void var r4arg1; var r4 = foo2(r4arg1); // ok because base returns void -})(ConstructSignature || (ConstructSignature = { -})); +})(ConstructSignature || (ConstructSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.2.minified.js index 3d710e1f595..1cb42999340 100644 --- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures_es5.2.minified.js @@ -2,5 +2,4 @@ var ConstructSignature; !function(ConstructSignature) { var rarg2, r3arg1, r4arg1; foo1(void 0), foo1(rarg2), foo2(r3arg1), foo2(r4arg1); -}(ConstructSignature || (ConstructSignature = { -})); +}(ConstructSignature || (ConstructSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es2015.1.normal.js index 7ce8def1c96..58033508fa8 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es2015.1.normal.js @@ -18,5 +18,4 @@ var Generics; } class B5 extends A1 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.1.normal.js index fbf965135a8..d0b3f22c4f7 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -149,5 +148,4 @@ var Generics; } return B5; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.2.minified.js index b6babc15615..e7d7b5a26fb 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -110,5 +109,4 @@ var Generics, A = function() { } return B5; }(A3); -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es2015.1.normal.js index f712efd8b58..728912da65a 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es2015.1.normal.js @@ -10,5 +10,4 @@ var Generics; } class B3 extends A1 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.1.normal.js index 8b6ccb09568..22289b22114 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -109,5 +108,4 @@ var Generics; } return B3; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.2.minified.js index 0cb01240a68..d9e8352b11e 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -78,5 +77,4 @@ var Generics, A = function() { } return B3; }(A2); -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es2015.1.normal.js index c1501086df4..76a6931b11e 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es2015.1.normal.js @@ -14,5 +14,4 @@ var Generics; } class B5 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.1.normal.js index 310b4db1186..0ff3dd6635d 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.1.normal.js @@ -33,5 +33,4 @@ var Generics; "use strict"; _classCallCheck(this, B5); }; -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.2.minified.js index 3a87632ef5c..fff35724cbd 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer5_es5.2.minified.js @@ -25,5 +25,4 @@ var Generics, B = function() { "use strict"; _classCallCheck(this, B5); }; -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es2015.1.normal.js index 26489b3dcaa..a0deaf09aa6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es2015.1.normal.js @@ -16,5 +16,4 @@ var Generics; } class B4 extends A1 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.1.normal.js index 5ea14013b96..54752d1ec0a 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -139,5 +138,4 @@ var Generics; } return B4; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.2.minified.js index ff91551b4ce..50cdda450d0 100644 --- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -102,5 +101,4 @@ var Generics, A = function() { } return B4; }(A3); -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.1.normal.js index 91bf960cbee..8fb42bf30b7 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.2.minified.js index 7a2fe0869ed..b8eccefacba 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es2015.1.normal.js index 73065cd95de..620d08e67cb 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es2015.1.normal.js @@ -8,8 +8,7 @@ var NotOptional; } class B3 { } -})(NotOptional || (NotOptional = { -})); +})(NotOptional || (NotOptional = {})); // same cases as above but with optional var Optional; (function(Optional) { @@ -19,5 +18,4 @@ var Optional; } class B3 { } -})(Optional || (Optional = { -})); +})(Optional || (Optional = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.1.normal.js index bf52e540c95..8c113c47fb4 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.1.normal.js @@ -19,8 +19,7 @@ var NotOptional; "use strict"; _classCallCheck(this, B3); }; -})(NotOptional || (NotOptional = { -})); +})(NotOptional || (NotOptional = {})); // same cases as above but with optional var Optional; (function(Optional) { @@ -36,5 +35,4 @@ var Optional; "use strict"; _classCallCheck(this, B3); }; -})(Optional || (Optional = { -})); +})(Optional || (Optional = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.2.minified.js index 076d60de745..807a967e738 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers5_es5.2.minified.js @@ -13,8 +13,7 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, B3); }; -}(NotOptional || (NotOptional = { -})), (function(Optional) { +}(NotOptional || (NotOptional = {})), (function(Optional) { var B = function() { "use strict"; _classCallCheck(this, B); @@ -25,5 +24,4 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, B3); }; -})(Optional || (Optional = { -})); +})(Optional || (Optional = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es2015.1.normal.js index 4a002b594c0..e144d636575 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es2015.1.normal.js @@ -17,8 +17,7 @@ var ExplicitPublic; } class B3 extends A3 { } -})(ExplicitPublic || (ExplicitPublic = { -})); +})(ExplicitPublic || (ExplicitPublic = {})); var ImplicitPublic; (function(ImplicitPublic) { class A { @@ -33,5 +32,4 @@ var ImplicitPublic; } class B3 extends A3 { } -})(ImplicitPublic || (ImplicitPublic = { -})); +})(ImplicitPublic || (ImplicitPublic = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.1.normal.js index 75280d4d84f..1b4cb4e5186 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -127,8 +126,7 @@ var ExplicitPublic; } return B3; }(A3); -})(ExplicitPublic || (ExplicitPublic = { -})); +})(ExplicitPublic || (ExplicitPublic = {})); var ImplicitPublic; (function(ImplicitPublic) { var A = function A() { @@ -173,5 +171,4 @@ var ImplicitPublic; } return B3; }(A3); -})(ImplicitPublic || (ImplicitPublic = { -})); +})(ImplicitPublic || (ImplicitPublic = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.2.minified.js index b24b2fdd4c3..6236ea0c0ca 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -92,8 +91,7 @@ var ExplicitPublic, ImplicitPublic, Base = function() { } return B3; }(A31); -}(ExplicitPublic || (ExplicitPublic = { -})), (function(ImplicitPublic) { +}(ExplicitPublic || (ExplicitPublic = {})), (function(ImplicitPublic) { var A4 = function() { "use strict"; _classCallCheck(this, A4); @@ -128,5 +126,4 @@ var ExplicitPublic, ImplicitPublic, Base = function() { } return B3; }(A32); -})(ImplicitPublic || (ImplicitPublic = { -})); +})(ImplicitPublic || (ImplicitPublic = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.1.normal.js index 91bf960cbee..8fb42bf30b7 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.2.minified.js index 7a2fe0869ed..b8eccefacba 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es2015.1.normal.js index feca2a8356d..4a1b44dcdb9 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es2015.1.normal.js @@ -12,5 +12,4 @@ var TwoLevels; Foo: null }; var r = true ? a1 : b1; -})(TwoLevels || (TwoLevels = { -})); +})(TwoLevels || (TwoLevels = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es5.1.normal.js index feca2a8356d..4a1b44dcdb9 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersOptionality_es5.1.normal.js @@ -12,5 +12,4 @@ var TwoLevels; Foo: null }; var r = true ? a1 : b1; -})(TwoLevels || (TwoLevels = { -})); +})(TwoLevels || (TwoLevels = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es2015.1.normal.js index 4efacf6ab14..18328042892 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es2015.1.normal.js @@ -32,5 +32,4 @@ var TwoLevels; } class B3 extends A31 { } -})(TwoLevels || (TwoLevels = { -})); +})(TwoLevels || (TwoLevels = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.1.normal.js index 05448f49d6b..b1b56a2addd 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -179,5 +178,4 @@ var TwoLevels; } return B3; }(A3); -})(TwoLevels || (TwoLevels = { -})); +})(TwoLevels || (TwoLevels = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.2.minified.js index 9b56d790e3b..0dab54821bf 100644 --- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -133,5 +132,4 @@ var TwoLevels, Base = function() { } return B3; }(A32); -}(TwoLevels || (TwoLevels = { -})); +}(TwoLevels || (TwoLevels = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es2015.1.normal.js index 7ce8def1c96..58033508fa8 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es2015.1.normal.js @@ -18,5 +18,4 @@ var Generics; } class B5 extends A1 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.1.normal.js index fbf965135a8..d0b3f22c4f7 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -149,5 +148,4 @@ var Generics; } return B5; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.2.minified.js index b6babc15615..e7d7b5a26fb 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -110,5 +109,4 @@ var Generics, A = function() { } return B5; }(A3); -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es2015.1.normal.js index f712efd8b58..728912da65a 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es2015.1.normal.js @@ -10,5 +10,4 @@ var Generics; } class B3 extends A1 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.1.normal.js index 8b6ccb09568..22289b22114 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -109,5 +108,4 @@ var Generics; } return B3; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.2.minified.js index 0cb01240a68..d9e8352b11e 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -78,5 +77,4 @@ var Generics, A = function() { } return B3; }(A2); -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es2015.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es2015.1.normal.js index 26489b3dcaa..a0deaf09aa6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es2015.1.normal.js @@ -16,5 +16,4 @@ var Generics; } class B4 extends A1 { } -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.1.normal.js index 5ea14013b96..54752d1ec0a 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -139,5 +138,4 @@ var Generics; } return B4; }(A); -})(Generics || (Generics = { -})); +})(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.2.minified.js index ff91551b4ce..50cdda450d0 100644 --- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -102,5 +101,4 @@ var Generics, A = function() { } return B4; }(A3); -}(Generics || (Generics = { -})); +}(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es2015.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es2015.1.normal.js index b4ebb818a2f..2d40a4b876e 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es2015.1.normal.js @@ -1,6 +1,5 @@ class Base { - constructor(c){ - } + constructor(c){} } class D extends Base { constructor(){ diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.1.normal.js index 972421280d4..d424208b4b8 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.2.minified.js index 8d110a0eec2..7f36351fee5 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function(c) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es2015.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es2015.1.normal.js index aa3b7c7c811..8ac60009fbb 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es2015.1.normal.js @@ -1,6 +1,5 @@ class Base { - constructor(c){ - } + constructor(c){} } class D extends Base { constructor(){ diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.1.normal.js index 4a14690352a..a8f2b84795f 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.2.minified.js index 0511ae1e808..1ddc2bb961c 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2_es5.2.minified.js @@ -32,8 +32,7 @@ var Base = function(c) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.1.normal.js index b7367ef7aec..450f347da34 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.2.minified.js index a48f31d12f4..da18c9f6726 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5_es5.2.minified.js @@ -33,8 +33,7 @@ var D = function(_super) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es2015.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es2015.1.normal.js index cbc12f1c9fb..884e15a84f0 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es2015.1.normal.js @@ -1,6 +1,5 @@ class Base { - constructor(c){ - } + constructor(c){} } class D extends Base { constructor(){ diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.1.normal.js index 1e90685e3be..0dd205951f5 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.2.minified.js index a5041c145aa..20140368150 100644 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8_es5.2.minified.js @@ -40,8 +40,7 @@ var _typeof = function(obj) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.1.normal.js index c428fa1c81d..db3845d61b6 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.2.minified.js index 434718c7bca..dcac7459856 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1_es5.2.minified.js @@ -32,8 +32,7 @@ var A = function(map) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.1.normal.js index 1580a68cd14..246e06f492b 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.2.minified.js index 2bf05eb5a0f..3f8274c3bd5 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2_es5.2.minified.js @@ -32,8 +32,7 @@ var A = function(map) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es2015.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es2015.1.normal.js index c67c70cd589..78e18817363 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es2015.1.normal.js @@ -1,8 +1,6 @@ class CBase { - foo(param) { - } - constructor(param){ - } + foo(param) {} + constructor(param){} } class C extends CBase { constructor(){ diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.1.normal.js index 032d404359c..e9b084643ca 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -114,8 +113,7 @@ var CBase = /*#__PURE__*/ function() { _createClass(CBase, [ { key: "foo", - value: function foo(param) { - } + value: function foo(param) {} } ]); return CBase; diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.2.minified.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.2.minified.js index 2979724d8b2..deca019b329 100644 --- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3_es5.2.minified.js @@ -43,8 +43,7 @@ var CBase = function() { return Constructor = CBase, protoProps = [ { key: "foo", - value: function(param) { - } + value: function(param) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), CBase; }(), C = function(CBase) { @@ -65,8 +64,7 @@ var CBase = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superCalls_es2015.1.normal.js b/crates/swc/tests/tsc-references/superCalls_es2015.1.normal.js index 98e0f2c1adf..72fde19533f 100644 --- a/crates/swc/tests/tsc-references/superCalls_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/superCalls_es2015.1.normal.js @@ -3,8 +3,7 @@ class Base { this.x = 43; } } -function v() { -} +function v() {} class Derived extends Base { //super call in class constructor of derived type constructor(q){ diff --git a/crates/swc/tests/tsc-references/superCalls_es5.1.normal.js b/crates/swc/tests/tsc-references/superCalls_es5.1.normal.js index 1eb84b8c6bf..afbe5b8f65b 100644 --- a/crates/swc/tests/tsc-references/superCalls_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superCalls_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -74,8 +73,7 @@ var Base = function Base(n) { _classCallCheck(this, Base); this.x = 43; }; -function v() { -} +function v() {} var Derived = /*#__PURE__*/ function(Base) { "use strict"; _inherits(Derived, Base); diff --git a/crates/swc/tests/tsc-references/superCalls_es5.2.minified.js b/crates/swc/tests/tsc-references/superCalls_es5.2.minified.js index 9c399b9daa6..69c22506fe2 100644 --- a/crates/swc/tests/tsc-references/superCalls_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superCalls_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived1) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superMethodCall_es2015.1.normal.js b/crates/swc/tests/tsc-references/superMethodCall_es2015.1.normal.js index 40d157f0b3b..75c7f7edd16 100644 --- a/crates/swc/tests/tsc-references/superMethodCall_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/superMethodCall_es2015.1.normal.js @@ -30,8 +30,7 @@ function _asyncToGenerator(fn) { // @strict: true // @target: ES6 class Base { - method() { - } + method() {} } class Derived extends Base { method() { diff --git a/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js b/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js index 6a1a605557d..a836920112e 100644 --- a/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js @@ -116,8 +116,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -146,8 +145,7 @@ var Base = // @strict: true _createClass(Base, [ { key: "method", - value: function method() { - } + value: function method() {} } ]); return Base; diff --git a/crates/swc/tests/tsc-references/superMethodCall_es5.2.minified.js b/crates/swc/tests/tsc-references/superMethodCall_es5.2.minified.js index 9ea26e0098d..470f34d10a1 100644 --- a/crates/swc/tests/tsc-references/superMethodCall_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superMethodCall_es5.2.minified.js @@ -51,8 +51,7 @@ var Base = function() { return _createClass(Base, [ { key: "method", - value: function() { - } + value: function() {} } ]), Base; }(), Derived1 = function(Base) { @@ -73,8 +72,7 @@ var Base = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.1.normal.js b/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.1.normal.js index ed570cf0238..f9abfb7eb1e 100644 --- a/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.2.minified.js b/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.2.minified.js index 6fc3d7db3b4..c73998116f9 100644 --- a/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superPropertyAccessNoError_es5.2.minified.js @@ -81,8 +81,7 @@ var SomeBaseClass = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.1.normal.js index ba417952489..6dfdfcafbfa 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.2.minified.js index aa5a8143525..98b8401978d 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess1_es5.2.minified.js @@ -64,8 +64,7 @@ var symbol = Symbol.for("myThing"), tmp = symbol, Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.1.normal.js index c351227b627..01371482ba0 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.2.minified.js index 9b87815404d..b088c4648eb 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess2_es5.2.minified.js @@ -64,8 +64,7 @@ var tmp = Symbol.isConcatSpreadable, Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.1.normal.js index 0dba941fbde..fc299beaf9f 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.2.minified.js index 8f66250879c..13b8e12fb31 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess3_es5.2.minified.js @@ -64,8 +64,7 @@ var symbol = Symbol.for("myThing"), tmp = symbol, Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.1.normal.js index bb5a63f88ba..bf759ca59aa 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.2.minified.js index 529b793e13c..e1c8662efa7 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5_es5.2.minified.js @@ -64,8 +64,7 @@ var symbol, tmp = symbol, Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.1.normal.js index acaf3f000f5..a8159bb5354 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.1.normal.js @@ -86,8 +86,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.2.minified.js index e9285d98071..5c319e541a9 100644 --- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6_es5.2.minified.js @@ -64,8 +64,7 @@ var symbol, tmp = symbol, Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/switchBreakStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/switchBreakStatements_es2015.1.normal.js index aef7f27f1c9..ed13769240e 100644 --- a/crates/swc/tests/tsc-references/switchBreakStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/switchBreakStatements_es2015.1.normal.js @@ -35,8 +35,7 @@ SEVEN: switch(''){ break SEVEN; EIGHT: switch(''){ case 'a': - var fn = function() { - }; + var fn = function() {}; break EIGHT; } } diff --git a/crates/swc/tests/tsc-references/switchBreakStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/switchBreakStatements_es5.1.normal.js index b8ba626faef..156e9ebba81 100644 --- a/crates/swc/tests/tsc-references/switchBreakStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/switchBreakStatements_es5.1.normal.js @@ -35,8 +35,7 @@ SEVEN: switch(''){ break SEVEN; EIGHT: switch(''){ case 'a': - var fn = function fn() { - }; + var fn = function fn() {}; break EIGHT; } } diff --git a/crates/swc/tests/tsc-references/switchStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/switchStatements_es2015.1.normal.js index fb35435c4b3..1879b3f1396 100644 --- a/crates/swc/tests/tsc-references/switchStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/switchStatements_es2015.1.normal.js @@ -4,8 +4,7 @@ var M; return ''; } M1.fn = fn; -})(M || (M = { -})); +})(M || (M = {})); var x; switch(x){ case '': @@ -17,8 +16,7 @@ switch(x){ case new Object(): case /[a-z]/: case []: - case { - }: + case {}: case { id: 12 }: @@ -65,8 +63,7 @@ switch(/[a-z]/){ } switch([]){ } -switch({ -}){ +switch({}){ } switch({ id: 12 diff --git a/crates/swc/tests/tsc-references/switchStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/switchStatements_es2015.2.minified.js index e28a1179017..b43cfd26211 100644 --- a/crates/swc/tests/tsc-references/switchStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/switchStatements_es2015.2.minified.js @@ -1,6 +1,5 @@ var M, x; -switch((M || (M = { -})).fn = function(x) { +switch((M || (M = {})).fn = function(x) { return ""; }, x){ case "": @@ -12,8 +11,7 @@ switch((M || (M = { case new Object(): case /[a-z]/: case []: - case { - }: + case {}: case { id: 12 }: @@ -57,8 +55,7 @@ switch(/[a-z]/){ } switch([]){ } -switch({ -}){ +switch({}){ } switch({ id: 12 diff --git a/crates/swc/tests/tsc-references/switchStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/switchStatements_es5.1.normal.js index 0a8cc4ac6a5..427aeee4289 100644 --- a/crates/swc/tests/tsc-references/switchStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/switchStatements_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -75,8 +74,7 @@ var M; return ''; }; M1.fn = fn; -})(M || (M = { -})); +})(M || (M = {})); var x; switch(x){ case '': @@ -88,8 +86,7 @@ switch(x){ case new Object(): case /[a-z]/: case []: - case { - }: + case {}: case { id: 12 }: @@ -147,8 +144,7 @@ switch(/[a-z]/){ } switch([]){ } -switch({ -}){ +switch({}){ } switch({ id: 12 diff --git a/crates/swc/tests/tsc-references/switchStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/switchStatements_es5.2.minified.js index 67d4a7deb1f..a0f8ae4062b 100644 --- a/crates/swc/tests/tsc-references/switchStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/switchStatements_es5.2.minified.js @@ -14,8 +14,7 @@ function _setPrototypeOf(o, p) { var M, x, _typeof = function(obj) { return obj && "undefined" != typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj; }; -switch((M || (M = { -})).fn = function(x) { +switch((M || (M = {})).fn = function(x) { return ""; }, x){ case "": @@ -27,8 +26,7 @@ switch((M || (M = { case new Object(): case /[a-z]/: case []: - case { - }: + case {}: case { id: 12 }: @@ -65,8 +63,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -114,8 +111,7 @@ switch(/[a-z]/){ } switch([]){ } -switch({ -}){ +switch({}){ } switch({ id: 12 diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es2015.1.normal.js index 1d96919e1ad..004b4b0ba5e 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es2015.1.normal.js @@ -4,6 +4,5 @@ var obj = { get [Symbol.isConcatSpreadable] () { return ''; }, - set [Symbol.isConcatSpreadable] (x){ - } + set [Symbol.isConcatSpreadable] (x){} }; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.1.normal.js index 86b3bb69186..830b826f76a 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.1.normal.js @@ -17,14 +17,9 @@ function _defineEnumerableProperties(obj1, descs) { } return obj1; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES6 //@declaration: true -var obj = (_obj = { -}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || { -}, _mutatorMap[Symbol.isConcatSpreadable].get = function() { +var obj = (_obj = {}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || {}, _mutatorMap[Symbol.isConcatSpreadable].get = function() { return ''; -}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || { -}, _mutatorMap[Symbol.isConcatSpreadable].set = function(x) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || {}, _mutatorMap[Symbol.isConcatSpreadable].set = function(x) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.2.minified.js index f81e39d3599..88f0a8f3b2a 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit10_es5.2.minified.js @@ -1,12 +1,7 @@ -var _obj, _mutatorMap = { -}; -_obj = { -}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || { -}, _mutatorMap[Symbol.isConcatSpreadable].get = function() { +var _obj, _mutatorMap = {}; +_obj = {}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || {}, _mutatorMap[Symbol.isConcatSpreadable].get = function() { return ""; -}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || { -}, _mutatorMap[Symbol.isConcatSpreadable].set = function(x) { -}, (function(obj, descs) { +}, _mutatorMap[Symbol.isConcatSpreadable] = _mutatorMap[Symbol.isConcatSpreadable] || {}, _mutatorMap[Symbol.isConcatSpreadable].set = function(x) {}, (function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.1.normal.js index 89a581a5a29..1b2c447c2b6 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.1.normal.js @@ -3,12 +3,10 @@ var tmp = (_key = Symbol.iterator, Symbol.isConcatSpreadable), tmp1 = Symbol.toP //@target: ES6 //@declaration: true class C { - static [tmp]() { - } + static [tmp]() {} static get [tmp1]() { return ""; } - static set [tmp2](x) { - } + static set [tmp2](x) {} } C[_key] = 0; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.2.minified.js index bd56d03868b..7820c47b63c 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es2015.2.minified.js @@ -1,10 +1,8 @@ var _key, tmp = (_key = Symbol.iterator, Symbol.isConcatSpreadable), tmp1 = Symbol.toPrimitive, tmp2 = Symbol.toPrimitive; (class { - static [tmp]() { - } + static [tmp]() {} static get [tmp1]() { return ""; } - static set [tmp2](x) { - } + static set [tmp2](x) {} })[_key] = 0; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.1.normal.js index 5e3732509d1..5e1cd8661d1 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.1.normal.js @@ -29,8 +29,7 @@ var C = //@target: ES6 _createClass(C, null, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, @@ -40,8 +39,7 @@ var C = //@target: ES6 }, { key: tmp2, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.2.minified.js index d3ce83398d6..6d92b87802b 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit11_es5.2.minified.js @@ -14,8 +14,7 @@ var _key, tmp = (_key = Symbol.iterator, Symbol.isConcatSpreadable), tmp1 = Symb })(Constructor = C, [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, @@ -25,8 +24,7 @@ var _key, tmp = (_key = Symbol.iterator, Symbol.isConcatSpreadable), tmp1 = Symb }, { key: tmp2, - set: function(x) { - } + set: function(x) {} } ]), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.1.normal.js index 6f2aac3460c..c5ccdc3f0dc 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.1.normal.js @@ -4,17 +4,14 @@ var M; (function(M1) { var tmp = Symbol.toPrimitive, tmp1 = Symbol.isConcatSpreadable, tmp2 = Symbol.toPrimitive, tmp3 = Symbol.toPrimitive; class C { - [tmp](x) { - } + [tmp](x) {} [tmp1]() { return undefined; } get [tmp2]() { return undefined; } - set [tmp3](x) { - } + set [tmp3](x) {} } M1.C = C; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.2.minified.js index a019ac46cba..ddf098f5df9 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es2015.2.minified.js @@ -2,14 +2,9 @@ var M; !function(M1) { var tmp = Symbol.toPrimitive, tmp1 = Symbol.isConcatSpreadable, tmp2 = Symbol.toPrimitive, tmp3 = Symbol.toPrimitive; M1.C = class { - [tmp](x) { - } - [tmp1]() { - } - get [tmp2]() { - } - set [tmp3](x) { - } + [tmp](x) {} + [tmp1]() {} + get [tmp2]() {} + set [tmp3](x) {} }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.1.normal.js index aaef255d7a2..238ec50612e 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.1.normal.js @@ -30,8 +30,7 @@ var M; _createClass(C, [ { key: tmp, - value: function value(x) { - } + value: function value(x) {} }, { key: tmp1, @@ -47,12 +46,10 @@ var M; }, { key: tmp3, - set: function set(x) { - } + set: function set(x) {} } ]); return C; }(); M1.C = C; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.2.minified.js index bb2ea0ecdca..b07f6465753 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit12_es5.2.minified.js @@ -17,26 +17,21 @@ function _defineProperties(target, props) { return Constructor = C, protoProps = [ { key: tmp, - value: function(x) { - } + value: function(x) {} }, { key: tmp1, - value: function() { - } + value: function() {} }, { key: tmp2, - get: function() { - } + get: function() {} }, { key: tmp3, - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); M1.C = C; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es2015.1.normal.js index 59cdef97bb5..12ee32e3f46 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es2015.1.normal.js @@ -5,6 +5,5 @@ class C { get [tmp]() { return ""; } - set [tmp1](x) { - } + set [tmp1](x) {} } diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.1.normal.js index 7b270be6a79..b97e9cfe564 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.1.normal.js @@ -34,8 +34,7 @@ var C = //@target: ES6 }, { key: tmp1, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.2.minified.js index efcbe8b40f1..86581f3c529 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit13_es5.2.minified.js @@ -21,8 +21,7 @@ var tmp = Symbol.toPrimitive, tmp1 = Symbol.toStringTag, C = function() { }, { key: tmp1, - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es2015.1.normal.js index 2c8671d2a0f..98a5fc63245 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es2015.1.normal.js @@ -2,6 +2,5 @@ var tmp = Symbol.toPrimitive; //@target: ES6 //@declaration: true class C { - [tmp](x) { - } + [tmp](x) {} } diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.1.normal.js index dddc5614ce0..67a2a07a171 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.1.normal.js @@ -28,8 +28,7 @@ var C = //@target: ES6 _createClass(C, [ { key: tmp, - value: function value(x) { - } + value: function value(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.2.minified.js index f1282ddddbe..9acf3d5da9e 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit3_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = Symbol.toPrimitive, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es2015.1.normal.js index 36550a0213e..7d2843072bc 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es2015.1.normal.js @@ -5,6 +5,5 @@ class C { get [tmp]() { return ""; } - set [tmp1](x) { - } + set [tmp1](x) {} } diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.1.normal.js index 3da15f7ffcc..2ccb3cb747e 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.1.normal.js @@ -34,8 +34,7 @@ var C = //@target: ES6 }, { key: tmp1, - set: function set(x) { - } + set: function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.2.minified.js index 12b27c895a1..da652e3eaab 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit4_es5.2.minified.js @@ -21,8 +21,7 @@ var tmp = Symbol.toPrimitive, tmp1 = Symbol.toPrimitive, C = function() { }, { key: tmp1, - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.1.normal.js index 0f1250acddd..89feccaacf1 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.1.normal.js @@ -13,5 +13,4 @@ function _defineProperty(obj1, key, value) { } //@target: ES6 //@declaration: true -var obj = _defineProperty({ -}, Symbol.isConcatSpreadable, 0); +var obj = _defineProperty({}, Symbol.isConcatSpreadable, 0); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.2.minified.js index 29fffcaf8fe..f547484881f 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit8_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = Symbol.isConcatSpreadable) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = Symbol.isConcatSpreadable) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es2015.1.normal.js index 5dbb2fc7eb8..47a97f7a8f7 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: ES6 //@declaration: true var obj = { - [Symbol.isConcatSpreadable] () { - } + [Symbol.isConcatSpreadable] () {} }; diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.1.normal.js index 25b7a3fa703..51e4ccc96be 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.1.normal.js @@ -13,6 +13,4 @@ function _defineProperty(obj1, key, value) { } //@target: ES6 //@declaration: true -var obj = _defineProperty({ -}, Symbol.isConcatSpreadable, function() { -}); +var obj = _defineProperty({}, Symbol.isConcatSpreadable, function() {}); diff --git a/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.2.minified.js index 59fd93430d6..092c5af73da 100644 --- a/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolDeclarationEmit9_es5.2.minified.js @@ -5,6 +5,4 @@ configurable: !0, writable: !0 }) : obj[key] = value, obj; -}({ -}, Symbol.isConcatSpreadable, function() { -}); +}({}, Symbol.isConcatSpreadable, function() {}); diff --git a/crates/swc/tests/tsc-references/symbolProperty18_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty18_es2015.1.normal.js index 1536c0f2d30..632fc6ff017 100644 --- a/crates/swc/tests/tsc-references/symbolProperty18_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty18_es2015.1.normal.js @@ -4,8 +4,7 @@ var i = { [Symbol.toStringTag] () { return ""; }, - set [Symbol.toPrimitive] (p){ - } + set [Symbol.toPrimitive] (p){} }; var it = i[Symbol.iterator]; var str = i[Symbol.toStringTag](); diff --git a/crates/swc/tests/tsc-references/symbolProperty18_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty18_es2015.2.minified.js index 4ce6357d23f..f6dc1bd3aa1 100644 --- a/crates/swc/tests/tsc-references/symbolProperty18_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty18_es2015.2.minified.js @@ -3,7 +3,6 @@ var i = { [Symbol.toStringTag] () { return ""; }, - set [Symbol.toPrimitive] (p){ - } + set [Symbol.toPrimitive] (p){} }; i[Symbol.iterator], i[Symbol.toStringTag](), i[Symbol.toPrimitive] = !1; diff --git a/crates/swc/tests/tsc-references/symbolProperty18_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty18_es5.1.normal.js index beb9ef0d06e..2b90a0386b7 100644 --- a/crates/swc/tests/tsc-references/symbolProperty18_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty18_es5.1.normal.js @@ -30,15 +30,11 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES6 -var i = (_obj = { -}, _defineProperty(_obj, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toStringTag, function() { +var i = (_obj = {}, _defineProperty(_obj, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toStringTag, function() { return ""; -}), _mutatorMap[Symbol.toPrimitive] = _mutatorMap[Symbol.toPrimitive] || { -}, _mutatorMap[Symbol.toPrimitive].set = function(p) { -}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); +}), _mutatorMap[Symbol.toPrimitive] = _mutatorMap[Symbol.toPrimitive] || {}, _mutatorMap[Symbol.toPrimitive].set = function(p) {}, _defineEnumerableProperties(_obj, _mutatorMap), _obj); var it = i[Symbol.iterator]; var str = i[Symbol.toStringTag](); i[Symbol.toPrimitive] = false; diff --git a/crates/swc/tests/tsc-references/symbolProperty18_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty18_es5.2.minified.js index 0e399821b51..c3fa79da138 100644 --- a/crates/swc/tests/tsc-references/symbolProperty18_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty18_es5.2.minified.js @@ -6,13 +6,9 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, _mutatorMap = { -}, i = (_defineProperty(_obj = { -}, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toStringTag, function() { +var _obj, _mutatorMap = {}, i = (_defineProperty(_obj = {}, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toStringTag, function() { return ""; -}), _mutatorMap[Symbol.toPrimitive] = _mutatorMap[Symbol.toPrimitive] || { -}, _mutatorMap[Symbol.toPrimitive].set = function(p) { -}, function(obj, descs) { +}), _mutatorMap[Symbol.toPrimitive] = _mutatorMap[Symbol.toPrimitive] || {}, _mutatorMap[Symbol.toPrimitive].set = function(p) {}, function(obj, descs) { for(var key in descs){ var desc = descs[key]; desc.configurable = desc.enumerable = !0, "value" in desc && (desc.writable = !0), Object.defineProperty(obj, key, desc); diff --git a/crates/swc/tests/tsc-references/symbolProperty19_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty19_es5.1.normal.js index 9b0e424f334..66a71affdc4 100644 --- a/crates/swc/tests/tsc-references/symbolProperty19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty19_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } var _obj; //@target: ES6 -var i = (_obj = { -}, _defineProperty(_obj, Symbol.iterator, { +var i = (_obj = {}, _defineProperty(_obj, Symbol.iterator, { p: null }), _defineProperty(_obj, Symbol.toStringTag, function() { return { diff --git a/crates/swc/tests/tsc-references/symbolProperty19_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty19_es5.2.minified.js index 966ebb3d73f..4217b77e110 100644 --- a/crates/swc/tests/tsc-references/symbolProperty19_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty19_es5.2.minified.js @@ -6,8 +6,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, i = (_defineProperty(_obj = { -}, Symbol.iterator, { +var _obj, i = (_defineProperty(_obj = {}, Symbol.iterator, { p: null }), _defineProperty(_obj, Symbol.toStringTag, function() { return { diff --git a/crates/swc/tests/tsc-references/symbolProperty1_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty1_es2015.1.normal.js index 4e8d3d78cd0..2ce76a3986e 100644 --- a/crates/swc/tests/tsc-references/symbolProperty1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty1_es2015.1.normal.js @@ -2,8 +2,7 @@ var s; var x = { [s]: 0, - [s] () { - }, + [s] () {}, get [s] () { return 0; } diff --git a/crates/swc/tests/tsc-references/symbolProperty1_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty1_es5.1.normal.js index 4af4fdd73a0..0348b840c84 100644 --- a/crates/swc/tests/tsc-references/symbolProperty1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty1_es5.1.normal.js @@ -32,11 +32,7 @@ function _defineProperty(obj, key, value) { } //@target: ES6 var s; -var _obj, _mutatorMap = { -}; -var x = (_obj = { -}, _defineProperty(_obj, s, 0), _defineProperty(_obj, s, function() { -}), _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, _mutatorMap = {}; +var x = (_obj = {}, _defineProperty(_obj, s, 0), _defineProperty(_obj, s, function() {}), _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/symbolProperty1_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty1_es5.2.minified.js index 8ac201ce750..c56ac6eb752 100644 --- a/crates/swc/tests/tsc-references/symbolProperty1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty1_es5.2.minified.js @@ -6,12 +6,8 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var s, _obj, _mutatorMap = { -}; -_defineProperty(_obj = { -}, s, 0), _defineProperty(_obj, s, function() { -}), _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var s, _obj, _mutatorMap = {}; +_defineProperty(_obj = {}, s, 0), _defineProperty(_obj, s, function() {}), _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/symbolProperty20_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty20_es5.1.normal.js index 25e9862fbca..cfe28d6433d 100644 --- a/crates/swc/tests/tsc-references/symbolProperty20_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty20_es5.1.normal.js @@ -12,8 +12,7 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -var i = (_obj = { -}, _defineProperty(_obj, Symbol.iterator, function(s) { +var i = (_obj = {}, _defineProperty(_obj, Symbol.iterator, function(s) { return s; }), _defineProperty(_obj, Symbol.toStringTag, function(n) { return n; diff --git a/crates/swc/tests/tsc-references/symbolProperty20_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty20_es5.2.minified.js index c5fa335921a..6610a4b60bc 100644 --- a/crates/swc/tests/tsc-references/symbolProperty20_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty20_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, Symbol.iterator, function(s) { +_defineProperty(_obj = {}, Symbol.iterator, function(s) { return s; }), _defineProperty(_obj, Symbol.toStringTag, function(n) { return n; diff --git a/crates/swc/tests/tsc-references/symbolProperty21_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty21_es5.1.normal.js index 40f793047d2..5d3539a2a33 100644 --- a/crates/swc/tests/tsc-references/symbolProperty21_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty21_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj, key, value) { return obj; } var _obj; -foo((_obj = { -}, _defineProperty(_obj, Symbol.isConcatSpreadable, ""), _defineProperty(_obj, Symbol.toPrimitive, 0), _defineProperty(_obj, Symbol.unscopables, true), _obj)); +foo((_obj = {}, _defineProperty(_obj, Symbol.isConcatSpreadable, ""), _defineProperty(_obj, Symbol.toPrimitive, 0), _defineProperty(_obj, Symbol.unscopables, true), _obj)); diff --git a/crates/swc/tests/tsc-references/symbolProperty21_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty21_es5.2.minified.js index 05576105e3e..e1019e52f7e 100644 --- a/crates/swc/tests/tsc-references/symbolProperty21_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty21_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -foo((_defineProperty(_obj = { -}, Symbol.isConcatSpreadable, ""), _defineProperty(_obj, Symbol.toPrimitive, 0), _defineProperty(_obj, Symbol.unscopables, !0), _obj)); +foo((_defineProperty(_obj = {}, Symbol.isConcatSpreadable, ""), _defineProperty(_obj, Symbol.toPrimitive, 0), _defineProperty(_obj, Symbol.unscopables, !0), _obj)); diff --git a/crates/swc/tests/tsc-references/symbolProperty22_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty22_es5.1.normal.js index 88a62b4d595..2c1f48878cf 100644 --- a/crates/swc/tests/tsc-references/symbolProperty22_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty22_es5.1.normal.js @@ -11,7 +11,6 @@ function _defineProperty(obj, key, value) { } return obj; } -foo("", _defineProperty({ -}, Symbol.unscopables, function(s) { +foo("", _defineProperty({}, Symbol.unscopables, function(s) { return s.length; })); diff --git a/crates/swc/tests/tsc-references/symbolProperty22_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty22_es5.2.minified.js index ac7938ce81a..ed8b2ab102f 100644 --- a/crates/swc/tests/tsc-references/symbolProperty22_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty22_es5.2.minified.js @@ -5,7 +5,6 @@ foo("", function(obj, key, value) { configurable: !0, writable: !0 }) : obj[key] = value, obj; -}({ -}, Symbol.unscopables, function(s) { +}({}, Symbol.unscopables, function(s) { return s.length; })); diff --git a/crates/swc/tests/tsc-references/symbolProperty26_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty26_es5.1.normal.js index 297934599a2..2d23f2455c1 100644 --- a/crates/swc/tests/tsc-references/symbolProperty26_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty26_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/symbolProperty26_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty26_es5.2.minified.js index 5f6d02f9f98..a4528e0172e 100644 --- a/crates/swc/tests/tsc-references/symbolProperty26_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty26_es5.2.minified.js @@ -51,8 +51,7 @@ var tmp = Symbol.toStringTag, C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/symbolProperty27_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty27_es2015.1.normal.js index a230fece242..e23338ee183 100644 --- a/crates/swc/tests/tsc-references/symbolProperty27_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty27_es2015.1.normal.js @@ -2,8 +2,7 @@ var tmp = Symbol.toStringTag; //@target: ES6 class C1 { [tmp]() { - return { - }; + return {}; } } var tmp1 = Symbol.toStringTag; diff --git a/crates/swc/tests/tsc-references/symbolProperty27_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty27_es5.1.normal.js index 863f2b726bd..83237114f55 100644 --- a/crates/swc/tests/tsc-references/symbolProperty27_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty27_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -94,8 +93,7 @@ var C1 = //@target: ES6 { key: tmp, value: function value() { - return { - }; + return {}; } } ]); diff --git a/crates/swc/tests/tsc-references/symbolProperty27_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty27_es5.2.minified.js index 352eb2bd312..069efbf8fe2 100644 --- a/crates/swc/tests/tsc-references/symbolProperty27_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty27_es5.2.minified.js @@ -29,8 +29,7 @@ var tmp = Symbol.toStringTag, C1 = function() { { key: tmp, value: function() { - return { - }; + return {}; } } ]), C1; @@ -52,8 +51,7 @@ var tmp = Symbol.toStringTag, C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/symbolProperty28_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty28_es5.1.normal.js index 4b0f1ce6028..c0b90426a6d 100644 --- a/crates/swc/tests/tsc-references/symbolProperty28_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty28_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/symbolProperty28_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty28_es5.2.minified.js index fec68cb1d7f..94fc862231b 100644 --- a/crates/swc/tests/tsc-references/symbolProperty28_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty28_es5.2.minified.js @@ -51,8 +51,7 @@ var c, tmp = Symbol.toStringTag, C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/symbolProperty2_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty2_es2015.1.normal.js index bf1d85d1da9..d048d19cced 100644 --- a/crates/swc/tests/tsc-references/symbolProperty2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty2_es2015.1.normal.js @@ -2,8 +2,7 @@ var s = Symbol(); var x = { [s]: 0, - [s] () { - }, + [s] () {}, get [s] () { return 0; } diff --git a/crates/swc/tests/tsc-references/symbolProperty2_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty2_es5.1.normal.js index 12aaccd1fa2..f6a51700774 100644 --- a/crates/swc/tests/tsc-references/symbolProperty2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty2_es5.1.normal.js @@ -32,11 +32,7 @@ function _defineProperty(obj, key, value) { } //@target: ES6 var s = Symbol(); -var _obj, _mutatorMap = { -}; -var x = (_obj = { -}, _defineProperty(_obj, s, 0), _defineProperty(_obj, s, function() { -}), _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, _mutatorMap = {}; +var x = (_obj = {}, _defineProperty(_obj, s, 0), _defineProperty(_obj, s, function() {}), _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/symbolProperty2_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty2_es5.2.minified.js index 3fbf7a555ff..e8f00a627da 100644 --- a/crates/swc/tests/tsc-references/symbolProperty2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty2_es5.2.minified.js @@ -6,12 +6,8 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, s = Symbol(), _mutatorMap = { -}; -_defineProperty(_obj = { -}, s, 0), _defineProperty(_obj, s, function() { -}), _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, s = Symbol(), _mutatorMap = {}; +_defineProperty(_obj = {}, s, 0), _defineProperty(_obj, s, function() {}), _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/symbolProperty36_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty36_es5.1.normal.js index b458c983485..97f5b1f6937 100644 --- a/crates/swc/tests/tsc-references/symbolProperty36_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty36_es5.1.normal.js @@ -13,5 +13,4 @@ function _defineProperty(obj, key, value) { } var _obj; //@target: ES6 -var x = (_obj = { -}, _defineProperty(_obj, Symbol.isConcatSpreadable, 0), _defineProperty(_obj, Symbol.isConcatSpreadable, 1), _obj); +var x = (_obj = {}, _defineProperty(_obj, Symbol.isConcatSpreadable, 0), _defineProperty(_obj, Symbol.isConcatSpreadable, 1), _obj); diff --git a/crates/swc/tests/tsc-references/symbolProperty36_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty36_es5.2.minified.js index f5133b8f639..62f2ab2e25f 100644 --- a/crates/swc/tests/tsc-references/symbolProperty36_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty36_es5.2.minified.js @@ -7,5 +7,4 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -_defineProperty(_obj = { -}, Symbol.isConcatSpreadable, 0), _defineProperty(_obj, Symbol.isConcatSpreadable, 1); +_defineProperty(_obj = {}, Symbol.isConcatSpreadable, 0), _defineProperty(_obj, Symbol.isConcatSpreadable, 1); diff --git a/crates/swc/tests/tsc-references/symbolProperty39_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty39_es5.2.minified.js index 6df2cafd808..dc23b4ec1e0 100644 --- a/crates/swc/tests/tsc-references/symbolProperty39_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty39_es5.2.minified.js @@ -15,13 +15,11 @@ var tmp = Symbol.iterator, tmp1 = Symbol.iterator, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function(x) { - } + value: function(x) {} }, { key: tmp1, - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolProperty3_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty3_es2015.1.normal.js index f8619284e4c..62ac7b57cf4 100644 --- a/crates/swc/tests/tsc-references/symbolProperty3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty3_es2015.1.normal.js @@ -2,8 +2,7 @@ var s = Symbol; var x = { [s]: 0, - [s] () { - }, + [s] () {}, get [s] () { return 0; } diff --git a/crates/swc/tests/tsc-references/symbolProperty3_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty3_es5.1.normal.js index 48d78dd1dbb..d538ba1fc03 100644 --- a/crates/swc/tests/tsc-references/symbolProperty3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty3_es5.1.normal.js @@ -32,11 +32,7 @@ function _defineProperty(obj, key, value) { } //@target: ES6 var s = Symbol; -var _obj, _mutatorMap = { -}; -var x = (_obj = { -}, _defineProperty(_obj, s, 0), _defineProperty(_obj, s, function() { -}), _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, _mutatorMap = {}; +var x = (_obj = {}, _defineProperty(_obj, s, 0), _defineProperty(_obj, s, function() {}), _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/symbolProperty3_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty3_es5.2.minified.js index f7422458082..7f98cdedd1f 100644 --- a/crates/swc/tests/tsc-references/symbolProperty3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty3_es5.2.minified.js @@ -6,12 +6,8 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, s = Symbol, _mutatorMap = { -}; -_defineProperty(_obj = { -}, s, 0), _defineProperty(_obj, s, function() { -}), _mutatorMap[s] = _mutatorMap[s] || { -}, _mutatorMap[s].get = function() { +var _obj, s = Symbol, _mutatorMap = {}; +_defineProperty(_obj = {}, s, 0), _defineProperty(_obj, s, function() {}), _mutatorMap[s] = _mutatorMap[s] || {}, _mutatorMap[s].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/symbolProperty40_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty40_es2015.2.minified.js index 97eceda8625..dff5123b332 100644 --- a/crates/swc/tests/tsc-references/symbolProperty40_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty40_es2015.2.minified.js @@ -1,5 +1,4 @@ var c = new class { - [Symbol.iterator](x) { - } + [Symbol.iterator](x) {} }; c[Symbol.iterator](""), c[Symbol.iterator](0); diff --git a/crates/swc/tests/tsc-references/symbolProperty40_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty40_es5.2.minified.js index 39e1bb62fa2..dc78c183f89 100644 --- a/crates/swc/tests/tsc-references/symbolProperty40_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty40_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = Symbol.iterator, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), c = new C; diff --git a/crates/swc/tests/tsc-references/symbolProperty41_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty41_es2015.2.minified.js index 5571bd322fa..cacbe5a7af9 100644 --- a/crates/swc/tests/tsc-references/symbolProperty41_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty41_es2015.2.minified.js @@ -1,5 +1,4 @@ var c = new class { - [Symbol.iterator](x) { - } + [Symbol.iterator](x) {} }; c[Symbol.iterator](""), c[Symbol.iterator]("hello"); diff --git a/crates/swc/tests/tsc-references/symbolProperty41_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty41_es5.2.minified.js index 5a8c1b76dec..e8e7fe1457a 100644 --- a/crates/swc/tests/tsc-references/symbolProperty41_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty41_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = Symbol.iterator, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), c = new C; diff --git a/crates/swc/tests/tsc-references/symbolProperty42_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty42_es5.2.minified.js index e4d6e6f52fb..6c2e2e0bb09 100644 --- a/crates/swc/tests/tsc-references/symbolProperty42_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty42_es5.2.minified.js @@ -15,8 +15,7 @@ var tmp = Symbol.iterator, C = function() { return Constructor = C, protoProps = [ { key: tmp, - value: function(x) { - } + value: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolProperty46_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty46_es2015.1.normal.js index 0294124d0f3..4243b3e9c40 100644 --- a/crates/swc/tests/tsc-references/symbolProperty46_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty46_es2015.1.normal.js @@ -5,8 +5,7 @@ class C { return ""; } // Should take a string - set [tmp1](x) { - } + set [tmp1](x) {} } (new C)[Symbol.hasInstance] = 0; (new C)[Symbol.hasInstance] = ""; diff --git a/crates/swc/tests/tsc-references/symbolProperty46_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty46_es2015.2.minified.js index 8915767e960..1f409aa20d4 100644 --- a/crates/swc/tests/tsc-references/symbolProperty46_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty46_es2015.2.minified.js @@ -3,7 +3,6 @@ class C { get [tmp]() { return ""; } - set [tmp1](x) { - } + set [tmp1](x) {} } (new C)[Symbol.hasInstance] = 0, (new C)[Symbol.hasInstance] = ""; diff --git a/crates/swc/tests/tsc-references/symbolProperty46_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty46_es5.1.normal.js index f09e8bf6af5..425a08e4300 100644 --- a/crates/swc/tests/tsc-references/symbolProperty46_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty46_es5.1.normal.js @@ -34,8 +34,7 @@ var C = //@target: ES6 { key: tmp1, set: // Should take a string - function set(x) { - } + function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/symbolProperty46_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty46_es5.2.minified.js index 68c51a487da..10c780c782a 100644 --- a/crates/swc/tests/tsc-references/symbolProperty46_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty46_es5.2.minified.js @@ -21,8 +21,7 @@ var tmp = Symbol.hasInstance, tmp1 = Symbol.hasInstance, C = function() { }, { key: tmp1, - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolProperty47_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty47_es2015.1.normal.js index 0294124d0f3..4243b3e9c40 100644 --- a/crates/swc/tests/tsc-references/symbolProperty47_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty47_es2015.1.normal.js @@ -5,8 +5,7 @@ class C { return ""; } // Should take a string - set [tmp1](x) { - } + set [tmp1](x) {} } (new C)[Symbol.hasInstance] = 0; (new C)[Symbol.hasInstance] = ""; diff --git a/crates/swc/tests/tsc-references/symbolProperty47_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty47_es2015.2.minified.js index 8915767e960..1f409aa20d4 100644 --- a/crates/swc/tests/tsc-references/symbolProperty47_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty47_es2015.2.minified.js @@ -3,7 +3,6 @@ class C { get [tmp]() { return ""; } - set [tmp1](x) { - } + set [tmp1](x) {} } (new C)[Symbol.hasInstance] = 0, (new C)[Symbol.hasInstance] = ""; diff --git a/crates/swc/tests/tsc-references/symbolProperty47_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty47_es5.1.normal.js index f09e8bf6af5..425a08e4300 100644 --- a/crates/swc/tests/tsc-references/symbolProperty47_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty47_es5.1.normal.js @@ -34,8 +34,7 @@ var C = //@target: ES6 { key: tmp1, set: // Should take a string - function set(x) { - } + function set(x) {} } ]); return C; diff --git a/crates/swc/tests/tsc-references/symbolProperty47_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty47_es5.2.minified.js index 68c51a487da..10c780c782a 100644 --- a/crates/swc/tests/tsc-references/symbolProperty47_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty47_es5.2.minified.js @@ -21,8 +21,7 @@ var tmp = Symbol.hasInstance, tmp1 = Symbol.hasInstance, C = function() { }, { key: tmp1, - set: function(x) { - } + set: function(x) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); diff --git a/crates/swc/tests/tsc-references/symbolProperty48_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty48_es2015.1.normal.js index fbf15c107a4..1e0ba5c0c38 100644 --- a/crates/swc/tests/tsc-references/symbolProperty48_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty48_es2015.1.normal.js @@ -4,8 +4,6 @@ var M; var Symbol; var tmp = Symbol.iterator; class C { - [tmp]() { - } + [tmp]() {} } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty48_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty48_es2015.2.minified.js index fff3c75abe2..487df508fae 100644 --- a/crates/swc/tests/tsc-references/symbolProperty48_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty48_es2015.2.minified.js @@ -1,3 +1,2 @@ var M; -M || (M = { -}), (void 0).iterator; +M || (M = {}), (void 0).iterator; diff --git a/crates/swc/tests/tsc-references/symbolProperty48_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty48_es5.1.normal.js index cf2c477d00f..69eab041ec5 100644 --- a/crates/swc/tests/tsc-references/symbolProperty48_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty48_es5.1.normal.js @@ -30,11 +30,9 @@ var M; _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; }(); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty48_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty48_es5.2.minified.js index 9d5edf8e4f0..6d0756d325a 100644 --- a/crates/swc/tests/tsc-references/symbolProperty48_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty48_es5.2.minified.js @@ -17,10 +17,8 @@ function _defineProperties(target, props) { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty49_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty49_es2015.1.normal.js index 790b1ea0ce2..8de725af8cc 100644 --- a/crates/swc/tests/tsc-references/symbolProperty49_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty49_es2015.1.normal.js @@ -4,9 +4,7 @@ var M; var Symbol; var tmp = Symbol.iterator; class C { - [tmp]() { - } + [tmp]() {} } M1.Symbol = Symbol; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty49_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty49_es2015.2.minified.js index 732ffe89f41..f9eb8410ad2 100644 --- a/crates/swc/tests/tsc-references/symbolProperty49_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty49_es2015.2.minified.js @@ -2,5 +2,4 @@ var M; !function(M1) { var Symbol; Symbol.iterator, M1.Symbol = Symbol; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty49_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty49_es5.1.normal.js index e4fde28f30d..140ea15941e 100644 --- a/crates/swc/tests/tsc-references/symbolProperty49_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty49_es5.1.normal.js @@ -30,12 +30,10 @@ var M; _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; }(); M1.Symbol = Symbol; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty49_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty49_es5.2.minified.js index aa4e73a06f1..3d41d2a9d94 100644 --- a/crates/swc/tests/tsc-references/symbolProperty49_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty49_es5.2.minified.js @@ -17,11 +17,9 @@ function _defineProperties(target, props) { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); M1.Symbol = Symbol; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty4_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty4_es2015.1.normal.js index 19b2ff1209c..4d789a3825a 100644 --- a/crates/swc/tests/tsc-references/symbolProperty4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty4_es2015.1.normal.js @@ -1,8 +1,7 @@ //@target: ES6 var x = { [Symbol()]: 0, - [Symbol()] () { - }, + [Symbol()] () {}, get [Symbol()] () { return 0; } diff --git a/crates/swc/tests/tsc-references/symbolProperty4_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty4_es5.1.normal.js index f908ae1b814..1d5cfc2a0c8 100644 --- a/crates/swc/tests/tsc-references/symbolProperty4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty4_es5.1.normal.js @@ -30,12 +30,8 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES6 -var x = (_obj = { -}, _defineProperty(_obj, Symbol(), 0), _defineProperty(_obj, Symbol(), function() { -}), _mutatorMap[Symbol()] = _mutatorMap[Symbol()] || { -}, _mutatorMap[Symbol()].get = function() { +var x = (_obj = {}, _defineProperty(_obj, Symbol(), 0), _defineProperty(_obj, Symbol(), function() {}), _mutatorMap[Symbol()] = _mutatorMap[Symbol()] || {}, _mutatorMap[Symbol()].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/symbolProperty4_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty4_es5.2.minified.js index 28ed57cb6c5..16012dc0ace 100644 --- a/crates/swc/tests/tsc-references/symbolProperty4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty4_es5.2.minified.js @@ -6,12 +6,8 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, _mutatorMap = { -}; -_defineProperty(_obj = { -}, Symbol(), 0), _defineProperty(_obj, Symbol(), function() { -}), _mutatorMap[Symbol()] = _mutatorMap[Symbol()] || { -}, _mutatorMap[Symbol()].get = function() { +var _obj, _mutatorMap = {}; +_defineProperty(_obj = {}, Symbol(), 0), _defineProperty(_obj, Symbol(), function() {}), _mutatorMap[Symbol()] = _mutatorMap[Symbol()] || {}, _mutatorMap[Symbol()].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/symbolProperty50_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty50_es2015.1.normal.js index d5fc6ae2029..335f9c46016 100644 --- a/crates/swc/tests/tsc-references/symbolProperty50_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty50_es2015.1.normal.js @@ -3,8 +3,6 @@ var M; (function(M) { var tmp = Symbol.iterator; class C { - [tmp]() { - } + [tmp]() {} } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty50_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty50_es5.1.normal.js index 3c2c2f11b5a..7254e33d438 100644 --- a/crates/swc/tests/tsc-references/symbolProperty50_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty50_es5.1.normal.js @@ -29,11 +29,9 @@ var M; _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; }(); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty50_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty50_es5.2.minified.js index e6aa8bc29b7..e0c8dd5fec8 100644 --- a/crates/swc/tests/tsc-references/symbolProperty50_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty50_es5.2.minified.js @@ -17,10 +17,8 @@ function _defineProperties(target, props) { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty51_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty51_es2015.1.normal.js index d5fc6ae2029..335f9c46016 100644 --- a/crates/swc/tests/tsc-references/symbolProperty51_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty51_es2015.1.normal.js @@ -3,8 +3,6 @@ var M; (function(M) { var tmp = Symbol.iterator; class C { - [tmp]() { - } + [tmp]() {} } -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty51_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty51_es5.1.normal.js index 3c2c2f11b5a..7254e33d438 100644 --- a/crates/swc/tests/tsc-references/symbolProperty51_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty51_es5.1.normal.js @@ -29,11 +29,9 @@ var M; _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} } ]); return C; }(); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty51_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty51_es5.2.minified.js index e6aa8bc29b7..e0c8dd5fec8 100644 --- a/crates/swc/tests/tsc-references/symbolProperty51_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty51_es5.2.minified.js @@ -17,10 +17,8 @@ function _defineProperties(target, props) { return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty52_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty52_es2015.1.normal.js index 351b4598e12..b79de236f27 100644 --- a/crates/swc/tests/tsc-references/symbolProperty52_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty52_es2015.1.normal.js @@ -2,6 +2,5 @@ var obj = { [Symbol.nonsense]: 0 }; -obj = { -}; +obj = {}; obj[Symbol.nonsense]; diff --git a/crates/swc/tests/tsc-references/symbolProperty52_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty52_es2015.2.minified.js index 83314207252..7ae2d004866 100644 --- a/crates/swc/tests/tsc-references/symbolProperty52_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty52_es2015.2.minified.js @@ -1,2 +1 @@ -({ -})[Symbol.nonsense]; +({})[Symbol.nonsense]; diff --git a/crates/swc/tests/tsc-references/symbolProperty52_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty52_es5.1.normal.js index 7781c94f382..eb22ff2ae82 100644 --- a/crates/swc/tests/tsc-references/symbolProperty52_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty52_es5.1.normal.js @@ -12,8 +12,6 @@ function _defineProperty(obj1, key, value) { return obj1; } //@target: ES6 -var obj = _defineProperty({ -}, Symbol.nonsense, 0); -obj = { -}; +var obj = _defineProperty({}, Symbol.nonsense, 0); +obj = {}; obj[Symbol.nonsense]; diff --git a/crates/swc/tests/tsc-references/symbolProperty52_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty52_es5.2.minified.js index a80a44aa4f3..dee3b2ab5f6 100644 --- a/crates/swc/tests/tsc-references/symbolProperty52_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty52_es5.2.minified.js @@ -1,9 +1,7 @@ var obj, key; -obj = { -}, (key = Symbol.nonsense) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = Symbol.nonsense) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, writable: !0 -}) : obj[key] = 0, ({ -})[Symbol.nonsense]; +}) : obj[key] = 0, ({})[Symbol.nonsense]; diff --git a/crates/swc/tests/tsc-references/symbolProperty53_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty53_es5.1.normal.js index 58cb3d429e3..d83743c9ad0 100644 --- a/crates/swc/tests/tsc-references/symbolProperty53_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty53_es5.1.normal.js @@ -12,6 +12,5 @@ function _defineProperty(obj1, key, value) { return obj1; } //@target: ES6 -var obj = _defineProperty({ -}, Symbol.for, 0); +var obj = _defineProperty({}, Symbol.for, 0); obj[Symbol.for]; diff --git a/crates/swc/tests/tsc-references/symbolProperty53_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty53_es5.2.minified.js index a40b40f084b..c5c79145399 100644 --- a/crates/swc/tests/tsc-references/symbolProperty53_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty53_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -(obj = { -}, (key = Symbol.for) in obj ? Object.defineProperty(obj, key, { +(obj = {}, (key = Symbol.for) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolProperty54_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty54_es5.1.normal.js index 301915cb176..138b3ed3033 100644 --- a/crates/swc/tests/tsc-references/symbolProperty54_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty54_es5.1.normal.js @@ -12,5 +12,4 @@ function _defineProperty(obj1, key, value) { return obj1; } //@target: ES6 -var obj = _defineProperty({ -}, Symbol.prototype, 0); +var obj = _defineProperty({}, Symbol.prototype, 0); diff --git a/crates/swc/tests/tsc-references/symbolProperty54_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty54_es5.2.minified.js index 204562d782b..3db0bf47ff6 100644 --- a/crates/swc/tests/tsc-references/symbolProperty54_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty54_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = Symbol.prototype) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = Symbol.prototype) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolProperty55_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty55_es2015.1.normal.js index ee64d8d5fe6..c01ae78f848 100644 --- a/crates/swc/tests/tsc-references/symbolProperty55_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty55_es2015.1.normal.js @@ -8,5 +8,4 @@ var M; // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. obj[Symbol.iterator]; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty55_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty55_es2015.2.minified.js index 477f0ebae86..e19d3589472 100644 --- a/crates/swc/tests/tsc-references/symbolProperty55_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty55_es2015.2.minified.js @@ -1,5 +1,4 @@ var M; -M || (M = { -}), ({ +M || (M = {}), ({ [Symbol.iterator]: 0 })[(void 0).iterator]; diff --git a/crates/swc/tests/tsc-references/symbolProperty55_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty55_es5.1.normal.js index 906eb335967..f8d8256baac 100644 --- a/crates/swc/tests/tsc-references/symbolProperty55_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty55_es5.1.normal.js @@ -12,13 +12,11 @@ function _defineProperty(obj1, key, value) { return obj1; } //@target: ES6 -var obj = _defineProperty({ -}, Symbol.iterator, 0); +var obj = _defineProperty({}, Symbol.iterator, 0); var M; (function(M) { var Symbol; // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. obj[Symbol.iterator]; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty55_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty55_es5.2.minified.js index b89829185e9..df92900c1ba 100644 --- a/crates/swc/tests/tsc-references/symbolProperty55_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty55_es5.2.minified.js @@ -1,7 +1,5 @@ var obj, key, M; -M || (M = { -}), (obj = { -}, (key = Symbol.iterator) in obj ? Object.defineProperty(obj, key, { +M || (M = {}), (obj = {}, (key = Symbol.iterator) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolProperty56_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty56_es2015.1.normal.js index 8040ec3d916..4dda332e059 100644 --- a/crates/swc/tests/tsc-references/symbolProperty56_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty56_es2015.1.normal.js @@ -8,5 +8,4 @@ var M; // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. obj[Symbol["iterator"]]; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty56_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty56_es2015.2.minified.js index 477f0ebae86..e19d3589472 100644 --- a/crates/swc/tests/tsc-references/symbolProperty56_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty56_es2015.2.minified.js @@ -1,5 +1,4 @@ var M; -M || (M = { -}), ({ +M || (M = {}), ({ [Symbol.iterator]: 0 })[(void 0).iterator]; diff --git a/crates/swc/tests/tsc-references/symbolProperty56_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty56_es5.1.normal.js index 111fcdd371d..f6b62719c33 100644 --- a/crates/swc/tests/tsc-references/symbolProperty56_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty56_es5.1.normal.js @@ -12,13 +12,11 @@ function _defineProperty(obj1, key, value) { return obj1; } //@target: ES6 -var obj = _defineProperty({ -}, Symbol.iterator, 0); +var obj = _defineProperty({}, Symbol.iterator, 0); var M; (function(M) { var Symbol; // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. obj[Symbol["iterator"]]; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/symbolProperty56_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty56_es5.2.minified.js index b89829185e9..df92900c1ba 100644 --- a/crates/swc/tests/tsc-references/symbolProperty56_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty56_es5.2.minified.js @@ -1,7 +1,5 @@ var obj, key, M; -M || (M = { -}), (obj = { -}, (key = Symbol.iterator) in obj ? Object.defineProperty(obj, key, { +M || (M = {}), (obj = {}, (key = Symbol.iterator) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolProperty57_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty57_es5.1.normal.js index 9e482733d6b..733db26f96a 100644 --- a/crates/swc/tests/tsc-references/symbolProperty57_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty57_es5.1.normal.js @@ -12,7 +12,6 @@ function _defineProperty(obj1, key, value) { return obj1; } //@target: ES6 -var obj = _defineProperty({ -}, Symbol.iterator, 0); +var obj = _defineProperty({}, Symbol.iterator, 0); // Should give type 'any'. obj[Symbol["nonsense"]]; diff --git a/crates/swc/tests/tsc-references/symbolProperty57_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty57_es5.2.minified.js index 90a1bd00a81..4255a9b4ec2 100644 --- a/crates/swc/tests/tsc-references/symbolProperty57_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty57_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -(obj = { -}, (key = Symbol.iterator) in obj ? Object.defineProperty(obj, key, { +(obj = {}, (key = Symbol.iterator) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolProperty58_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty58_es5.1.normal.js index 38319123986..1684400a4e4 100644 --- a/crates/swc/tests/tsc-references/symbolProperty58_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty58_es5.1.normal.js @@ -11,5 +11,4 @@ function _defineProperty(obj1, key, value) { } return obj1; } -var obj = _defineProperty({ -}, Symbol.foo, 0); +var obj = _defineProperty({}, Symbol.foo, 0); diff --git a/crates/swc/tests/tsc-references/symbolProperty58_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty58_es5.2.minified.js index 4619bc8f42b..07f214da074 100644 --- a/crates/swc/tests/tsc-references/symbolProperty58_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty58_es5.2.minified.js @@ -1,6 +1,5 @@ var obj, key; -obj = { -}, (key = Symbol.foo) in obj ? Object.defineProperty(obj, key, { +obj = {}, (key = Symbol.foo) in obj ? Object.defineProperty(obj, key, { value: 0, enumerable: !0, configurable: !0, diff --git a/crates/swc/tests/tsc-references/symbolProperty5_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty5_es2015.1.normal.js index bbe22c1305a..4c535a0d598 100644 --- a/crates/swc/tests/tsc-references/symbolProperty5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty5_es2015.1.normal.js @@ -1,8 +1,7 @@ //@target: ES6 var x = { [Symbol.iterator]: 0, - [Symbol.toPrimitive] () { - }, + [Symbol.toPrimitive] () {}, get [Symbol.toStringTag] () { return 0; } diff --git a/crates/swc/tests/tsc-references/symbolProperty5_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty5_es5.1.normal.js index 4b234fe433b..4e4d1549d26 100644 --- a/crates/swc/tests/tsc-references/symbolProperty5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty5_es5.1.normal.js @@ -30,12 +30,8 @@ function _defineProperty(obj, key, value) { } return obj; } -var _obj, _mutatorMap = { -}; +var _obj, _mutatorMap = {}; //@target: ES6 -var x = (_obj = { -}, _defineProperty(_obj, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toPrimitive, function() { -}), _mutatorMap[Symbol.toStringTag] = _mutatorMap[Symbol.toStringTag] || { -}, _mutatorMap[Symbol.toStringTag].get = function() { +var x = (_obj = {}, _defineProperty(_obj, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toPrimitive, function() {}), _mutatorMap[Symbol.toStringTag] = _mutatorMap[Symbol.toStringTag] || {}, _mutatorMap[Symbol.toStringTag].get = function() { return 0; }, _defineEnumerableProperties(_obj, _mutatorMap), _obj); diff --git a/crates/swc/tests/tsc-references/symbolProperty5_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty5_es5.2.minified.js index a0048bfa3c1..bffacbf8134 100644 --- a/crates/swc/tests/tsc-references/symbolProperty5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty5_es5.2.minified.js @@ -6,12 +6,8 @@ function _defineProperty(obj, key, value) { writable: !0 }) : obj[key] = value, obj; } -var _obj, _mutatorMap = { -}; -_defineProperty(_obj = { -}, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toPrimitive, function() { -}), _mutatorMap[Symbol.toStringTag] = _mutatorMap[Symbol.toStringTag] || { -}, _mutatorMap[Symbol.toStringTag].get = function() { +var _obj, _mutatorMap = {}; +_defineProperty(_obj = {}, Symbol.iterator, 0), _defineProperty(_obj, Symbol.toPrimitive, function() {}), _mutatorMap[Symbol.toStringTag] = _mutatorMap[Symbol.toStringTag] || {}, _mutatorMap[Symbol.toStringTag].get = function() { return 0; }, (function(obj, descs) { for(var key in descs){ diff --git a/crates/swc/tests/tsc-references/symbolProperty6_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty6_es2015.1.normal.js index 7a478cdfca9..406f72c4aff 100644 --- a/crates/swc/tests/tsc-references/symbolProperty6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty6_es2015.1.normal.js @@ -2,8 +2,7 @@ var _key; var tmp = (_key = Symbol.iterator, Symbol.toPrimitive), tmp1 = Symbol.toStringTag; //@target: ES6 class C { - [tmp]() { - } + [tmp]() {} get [tmp1]() { return 0; } diff --git a/crates/swc/tests/tsc-references/symbolProperty6_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty6_es5.1.normal.js index 16e239c0ab2..7fde316f5b2 100644 --- a/crates/swc/tests/tsc-references/symbolProperty6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolProperty6_es5.1.normal.js @@ -29,8 +29,7 @@ var C = //@target: ES6 _createClass(C, [ { key: tmp, - value: function value() { - } + value: function value() {} }, { key: tmp1, diff --git a/crates/swc/tests/tsc-references/symbolProperty6_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty6_es5.2.minified.js index ee478a7ae8d..bd4447edec8 100644 --- a/crates/swc/tests/tsc-references/symbolProperty6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolProperty6_es5.2.minified.js @@ -15,8 +15,7 @@ var _key, tmp = (_key = Symbol.iterator, Symbol.toPrimitive), tmp1 = Symbol.toSt return Constructor = C, protoProps = [ { key: tmp, - value: function() { - } + value: function() {} }, { key: tmp1, diff --git a/crates/swc/tests/tsc-references/symbolType11_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolType11_es2015.1.normal.js index cdb6e720dc4..e62416070fc 100644 --- a/crates/swc/tests/tsc-references/symbolType11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType11_es2015.1.normal.js @@ -5,5 +5,4 @@ s && []; 0 && s; s || s; s || 1; -{ -} || s; +{} || s; diff --git a/crates/swc/tests/tsc-references/symbolType11_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolType11_es5.1.normal.js index cdb6e720dc4..e62416070fc 100644 --- a/crates/swc/tests/tsc-references/symbolType11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType11_es5.1.normal.js @@ -5,5 +5,4 @@ s && []; 0 && s; s || s; s || 1; -{ -} || s; +{} || s; diff --git a/crates/swc/tests/tsc-references/symbolType13_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolType13_es2015.1.normal.js index 8cd5a8482ac..a1b46034676 100644 --- a/crates/swc/tests/tsc-references/symbolType13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType13_es2015.1.normal.js @@ -1,10 +1,6 @@ //@target: ES6 var s = Symbol(); var x; -for(s in { -}){ -} -for(x in s){ -} -for(var y in s){ -} +for(s in {}){} +for(x in s){} +for(var y in s){} diff --git a/crates/swc/tests/tsc-references/symbolType13_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolType13_es2015.2.minified.js index f31f42573c4..82a1b5f34f6 100644 --- a/crates/swc/tests/tsc-references/symbolType13_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolType13_es2015.2.minified.js @@ -1,5 +1,4 @@ var x, s = Symbol(); -for(s in { -}); +for(s in {}); for(x in s); for(var y in s); diff --git a/crates/swc/tests/tsc-references/symbolType13_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolType13_es5.1.normal.js index 8cd5a8482ac..a1b46034676 100644 --- a/crates/swc/tests/tsc-references/symbolType13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType13_es5.1.normal.js @@ -1,10 +1,6 @@ //@target: ES6 var s = Symbol(); var x; -for(s in { -}){ -} -for(x in s){ -} -for(var y in s){ -} +for(s in {}){} +for(x in s){} +for(var y in s){} diff --git a/crates/swc/tests/tsc-references/symbolType13_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolType13_es5.2.minified.js index f31f42573c4..82a1b5f34f6 100644 --- a/crates/swc/tests/tsc-references/symbolType13_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolType13_es5.2.minified.js @@ -1,5 +1,4 @@ var x, s = Symbol(); -for(s in { -}); +for(s in {}); for(x in s); for(var y in s); diff --git a/crates/swc/tests/tsc-references/symbolType19_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolType19_es2015.1.normal.js index 53b03097b62..9987da04ab2 100644 --- a/crates/swc/tests/tsc-references/symbolType19_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType19_es2015.1.normal.js @@ -1,8 +1,6 @@ var //@target: ES6 E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); var x; x; if (typeof x === "number") { diff --git a/crates/swc/tests/tsc-references/symbolType19_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolType19_es5.1.normal.js index 53b03097b62..9987da04ab2 100644 --- a/crates/swc/tests/tsc-references/symbolType19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType19_es5.1.normal.js @@ -1,8 +1,6 @@ var //@target: ES6 E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); var x; x; if (typeof x === "number") { diff --git a/crates/swc/tests/tsc-references/symbolType1_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolType1_es2015.1.normal.js index fd2b6916e39..6c1afd10937 100644 --- a/crates/swc/tests/tsc-references/symbolType1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType1_es2015.1.normal.js @@ -1,7 +1,5 @@ //@target: ES6 Symbol() instanceof Symbol; Symbol instanceof Symbol(); -(Symbol() || { -}) instanceof Object; // This one should be okay, it's a valid way of distinguishing types -Symbol instanceof (Symbol() || { -}); +(Symbol() || {}) instanceof Object; // This one should be okay, it's a valid way of distinguishing types +Symbol instanceof (Symbol() || {}); diff --git a/crates/swc/tests/tsc-references/symbolType1_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolType1_es2015.2.minified.js index ae3ac84fb48..22c88ed07f1 100644 --- a/crates/swc/tests/tsc-references/symbolType1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolType1_es2015.2.minified.js @@ -1,3 +1 @@ -Symbol() instanceof Symbol, Symbol instanceof Symbol(), (Symbol() || { -}) instanceof Object, Symbol instanceof (Symbol() || { -}); +Symbol() instanceof Symbol, Symbol instanceof Symbol(), (Symbol() || {}) instanceof Object, Symbol instanceof (Symbol() || {}); diff --git a/crates/swc/tests/tsc-references/symbolType1_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolType1_es5.1.normal.js index 72e323ebe8c..2285141026a 100644 --- a/crates/swc/tests/tsc-references/symbolType1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType1_es5.1.normal.js @@ -8,7 +8,5 @@ function _instanceof(left, right) { //@target: ES6 _instanceof(Symbol(), Symbol); _instanceof(Symbol, Symbol()); -_instanceof(Symbol() || { -}, Object); // This one should be okay, it's a valid way of distinguishing types -_instanceof(Symbol, Symbol() || { -}); +_instanceof(Symbol() || {}, Object); // This one should be okay, it's a valid way of distinguishing types +_instanceof(Symbol, Symbol() || {}); diff --git a/crates/swc/tests/tsc-references/symbolType1_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolType1_es5.2.minified.js index 6705c54326b..dcd771e9cb2 100644 --- a/crates/swc/tests/tsc-references/symbolType1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolType1_es5.2.minified.js @@ -1,6 +1,4 @@ function _instanceof(left, right) { return null != right && "undefined" != typeof Symbol && right[Symbol.hasInstance] ? right[Symbol.hasInstance](left) : left instanceof right; } -_instanceof(Symbol(), Symbol), _instanceof(Symbol, Symbol()), _instanceof(Symbol() || { -}, Object), _instanceof(Symbol, Symbol() || { -}); +_instanceof(Symbol(), Symbol), _instanceof(Symbol, Symbol()), _instanceof(Symbol() || {}, Object), _instanceof(Symbol, Symbol() || {}); diff --git a/crates/swc/tests/tsc-references/symbolType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolType2_es2015.1.normal.js index e5f119afae9..7b981de10d0 100644 --- a/crates/swc/tests/tsc-references/symbolType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType2_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 -Symbol.isConcatSpreadable in { -}; +Symbol.isConcatSpreadable in {}; "" in Symbol.toPrimitive; diff --git a/crates/swc/tests/tsc-references/symbolType2_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolType2_es2015.2.minified.js index 8049f8dc280..d027b307fef 100644 --- a/crates/swc/tests/tsc-references/symbolType2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolType2_es2015.2.minified.js @@ -1,2 +1 @@ -Symbol.isConcatSpreadable in { -}, "" in Symbol.toPrimitive; +Symbol.isConcatSpreadable in {}, "" in Symbol.toPrimitive; diff --git a/crates/swc/tests/tsc-references/symbolType2_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolType2_es5.1.normal.js index e5f119afae9..7b981de10d0 100644 --- a/crates/swc/tests/tsc-references/symbolType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/symbolType2_es5.1.normal.js @@ -1,4 +1,3 @@ //@target: ES6 -Symbol.isConcatSpreadable in { -}; +Symbol.isConcatSpreadable in {}; "" in Symbol.toPrimitive; diff --git a/crates/swc/tests/tsc-references/symbolType2_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolType2_es5.2.minified.js index 8049f8dc280..d027b307fef 100644 --- a/crates/swc/tests/tsc-references/symbolType2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/symbolType2_es5.2.minified.js @@ -1,2 +1 @@ -Symbol.isConcatSpreadable in { -}, "" in Symbol.toPrimitive; +Symbol.isConcatSpreadable in {}, "" in Symbol.toPrimitive; diff --git a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js index 0818ff7c611..b1ddb9743c3 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js @@ -1,5 +1,4 @@ -function tempTag1(...rest) { -} +function tempTag1(...rest) {} tempTag1`${(x)=>{ x(undefined); return x; diff --git a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js index 4ccd70ed0ad..d7be5020d51 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js @@ -1,5 +1,4 @@ -function tempTag2(...rest) { -} +function tempTag2(...rest) {} tempTag2`${(x)=>{ x(undefined); return x; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.1.normal.js index 9a8cd499da2..83bb1a3d51a 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es6 -function f(...x) { -} +function f(...x) {} f`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.2.minified.js index 0a78839b8d4..1ea1a57ab8e 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6_es2015.2.minified.js @@ -1,2 +1 @@ -(function(...x) { -})`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; +(function(...x) {})`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.1.normal.js index 1751f7ebcba..fedbbfcd683 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.1.normal.js @@ -1,3 +1,2 @@ -function f(...x) { -} +function f(...x) {} f`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.2.minified.js index 0a78839b8d4..1ea1a57ab8e 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_es2015.2.minified.js @@ -1,2 +1 @@ -(function(...x) { -})`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; +(function(...x) {})`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.1.normal.js index c17a0d18b8e..19a4b0a817c 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.1.normal.js @@ -1,4 +1,3 @@ // @target: es6 -function f(...x) { -} +function f(...x) {} f`0${" "}1${" "}2${" "}3${" "}4${" "}5${" "}6${" "}7${" "}8${" "}9${" "}10${" "}11${" "}12${" "}13${" "}14${" "}15${" "}16${" "}17${" "}18${" "}19${" "}20${" "}2028${" "}2029${" "}0085${" "}t${" "}v${" "}f${" "}b${" "}r${" "}n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.2.minified.js index e50ea6c9768..59c9362db12 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6_es2015.2.minified.js @@ -1,2 +1 @@ -(function(...x) { -})`0${" "}1${" "}2${" "}3${" "}4${" "}5${" "}6${" "}7${" "}8${" "}9${" "}10${" "}11${" "}12${" "}13${" "}14${" "}15${" "}16${" "}17${" "}18${" "}19${" "}20${" "}2028${" "}2029${" "}0085${" "}t${" "}v${" "}f${" "}b${" "}r${" "}n`; +(function(...x) {})`0${" "}1${" "}2${" "}3${" "}4${" "}5${" "}6${" "}7${" "}8${" "}9${" "}10${" "}11${" "}12${" "}13${" "}14${" "}15${" "}16${" "}17${" "}18${" "}19${" "}20${" "}2028${" "}2029${" "}0085${" "}t${" "}v${" "}f${" "}b${" "}r${" "}n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.1.normal.js index e47ebc2e5b2..75107a8dfde 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.1.normal.js @@ -1,31 +1,24 @@ //@target: es6 // Generic tag with one parameter -function noParams(n) { -} +function noParams(n) {} noParams``; // Generic tag with parameter which does not use type parameter -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams``; // Generic tag with multiple type parameters and only one used in parameter type annotation -function someGenerics1a(n, m) { -} +function someGenerics1a(n, m) {} someGenerics1a`${3}`; -function someGenerics1b(n, m) { -} +function someGenerics1b(n, m) {} someGenerics1b`${3}`; // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs, n) { -} +function someGenerics2a(strs, n) {} someGenerics2a`${(n)=>n }`; -function someGenerics2b(strs, n) { -} +function someGenerics2b(strs, n) {} someGenerics2b`${(n, x)=>n }`; // 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) { -} +function someGenerics3(strs, producer) {} someGenerics3`${()=>'' }`; someGenerics3`${()=>undefined @@ -33,24 +26,21 @@ someGenerics3`${()=>undefined someGenerics3`${()=>3 }`; // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs, n, f) { -} +function someGenerics4(strs, n, f) {} someGenerics4`${4}${()=>null }`; someGenerics4`${''}${()=>3 }`; someGenerics4`${null}${null}`; // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs, n, f) { -} +function someGenerics5(strs, n, f) {} someGenerics5`${4} ${()=>null }`; someGenerics5`${''}${()=>3 }`; someGenerics5`${null}${null}`; // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs, a, b, c) { -} +function someGenerics6(strs, a, b, c) {} someGenerics6`${(n)=>n }${(n)=>n }${(n)=>n @@ -64,8 +54,7 @@ someGenerics6`${(n)=>n }${(n)=>n }`; // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} +function someGenerics7(strs, a, b, c) {} someGenerics7`${(n)=>n }${(n)=>n }${(n)=>n diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js index a76fd492538..f0ca79cac6d 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js @@ -1,25 +1,14 @@ var anyVar; -function someGenerics3(strs, producer) { -} -function someGenerics4(strs, n, f) { -} -function someGenerics5(strs, n, f) { -} -function someGenerics6(strs, a, b, c) { -} -function someGenerics7(strs, a, b, c) { -} +function someGenerics3(strs, producer) {} +function someGenerics4(strs, n, f) {} +function someGenerics5(strs, n, f) {} +function someGenerics6(strs, a, b, c) {} +function someGenerics7(strs, a, b, c) {} function someGenerics9(strs, a, b, c) { return null; } -(function(n) { -})``, (function(n) { -})``, (function(n, m) { -})`${3}`, (function(n, m) { -})`${3}`, (function(strs, n) { -})`${(n)=>n -}`, (function(strs, n) { -})`${(n, x)=>n +(function(n) {})``, (function(n) {})``, (function(n, m) {})`${3}`, (function(n, m) {})`${3}`, (function(strs, n) {})`${(n)=>n +}`, (function(strs, n) {})`${(n, x)=>n }`, someGenerics3`${()=>'' }`, someGenerics3`${()=>undefined }`, someGenerics3`${()=>3 diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.1.normal.js index c577c4b80f4..02b744390e2 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.1.normal.js @@ -318,34 +318,27 @@ function _templateObject27() { } //@target: es6 // Generic tag with one parameter -function noParams(n) { -} +function noParams(n) {} noParams(_templateObject()); // Generic tag with parameter which does not use type parameter -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams(_templateObject1()); // Generic tag with multiple type parameters and only one used in parameter type annotation -function someGenerics1a(n, m) { -} +function someGenerics1a(n, m) {} someGenerics1a(_templateObject2(), 3); -function someGenerics1b(n, m) { -} +function someGenerics1b(n, m) {} someGenerics1b(_templateObject3(), 3); // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs, n) { -} +function someGenerics2a(strs, n) {} someGenerics2a(_templateObject4(), function(n) { return n; }); -function someGenerics2b(strs, n) { -} +function someGenerics2b(strs, n) {} someGenerics2b(_templateObject5(), function(n, x) { return n; }); // 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) { -} +function someGenerics3(strs, producer) {} someGenerics3(_templateObject6(), function() { return ''; }); @@ -356,8 +349,7 @@ someGenerics3(_templateObject8(), function() { return 3; }); // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs, n, f) { -} +function someGenerics4(strs, n, f) {} someGenerics4(_templateObject9(), 4, function() { return null; }); @@ -366,8 +358,7 @@ someGenerics4(_templateObject10(), '', function() { }); someGenerics4(_templateObject11(), null, null); // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs, n, f) { -} +function someGenerics5(strs, n, f) {} someGenerics5(_templateObject12(), 4, function() { return null; }); @@ -376,8 +367,7 @@ someGenerics5(_templateObject13(), '', function() { }); someGenerics5(_templateObject14(), null, null); // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs, a, b, c) { -} +function someGenerics6(strs, a, b, c) {} someGenerics6(_templateObject15(), function(n) { return n; }, function(n) { @@ -400,8 +390,7 @@ someGenerics6(_templateObject17(), function(n) { return n; }); // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} +function someGenerics7(strs, a, b, c) {} someGenerics7(_templateObject18(), function(n) { return n; }, function(n) { diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.2.minified.js index 43b6136bb56..826b26a824e 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es5.2.minified.js @@ -286,29 +286,21 @@ function _templateObject27() { return data; }, data; } -function someGenerics3(strs, producer) { -} -function someGenerics4(strs, n, f) { -} -function someGenerics5(strs, n, f) { -} -function someGenerics6(strs, a, b, c) { -} -function someGenerics7(strs, a, b, c) { -} +function someGenerics3(strs, producer) {} +function someGenerics4(strs, n, f) {} +function someGenerics5(strs, n, f) {} +function someGenerics6(strs, a, b, c) {} +function someGenerics7(strs, a, b, c) {} function someGenerics9(strs, a, b, c) { return null; } -!function(strs, n) { -}(_templateObject4(), function(n) { +!function(strs, n) {}(_templateObject4(), function(n) { return n; -}), (function(strs, n) { -})(_templateObject5(), function(n, x) { +}), (function(strs, n) {})(_templateObject5(), function(n, x) { return n; }), someGenerics3(_templateObject6(), function() { return ""; -}), someGenerics3(_templateObject7(), function() { -}), someGenerics3(_templateObject8(), function() { +}), someGenerics3(_templateObject7(), function() {}), someGenerics3(_templateObject8(), function() { return 3; }), someGenerics4(_templateObject9(), 4, function() { return null; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.1.normal.js index 71f71bb6d3c..154f2827f03 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.1.normal.js @@ -1,30 +1,23 @@ // Generic tag with one parameter -function noParams(n) { -} +function noParams(n) {} noParams``; // Generic tag with parameter which does not use type parameter -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams``; // Generic tag with multiple type parameters and only one used in parameter type annotation -function someGenerics1a(n, m) { -} +function someGenerics1a(n, m) {} someGenerics1a`${3}`; -function someGenerics1b(n, m) { -} +function someGenerics1b(n, m) {} someGenerics1b`${3}`; // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs, n) { -} +function someGenerics2a(strs, n) {} someGenerics2a`${(n)=>n }`; -function someGenerics2b(strs, n) { -} +function someGenerics2b(strs, n) {} someGenerics2b`${(n, x)=>n }`; // 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) { -} +function someGenerics3(strs, producer) {} someGenerics3`${()=>'' }`; someGenerics3`${()=>undefined @@ -32,24 +25,21 @@ someGenerics3`${()=>undefined someGenerics3`${()=>3 }`; // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs, n, f) { -} +function someGenerics4(strs, n, f) {} someGenerics4`${4}${()=>null }`; someGenerics4`${''}${()=>3 }`; someGenerics4`${null}${null}`; // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs, n, f) { -} +function someGenerics5(strs, n, f) {} someGenerics5`${4} ${()=>null }`; someGenerics5`${''}${()=>3 }`; someGenerics5`${null}${null}`; // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs, a, b, c) { -} +function someGenerics6(strs, a, b, c) {} someGenerics6`${(n)=>n }${(n)=>n }${(n)=>n @@ -63,8 +53,7 @@ someGenerics6`${(n)=>n }${(n)=>n }`; // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} +function someGenerics7(strs, a, b, c) {} someGenerics7`${(n)=>n }${(n)=>n }${(n)=>n diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js index a76fd492538..f0ca79cac6d 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js @@ -1,25 +1,14 @@ var anyVar; -function someGenerics3(strs, producer) { -} -function someGenerics4(strs, n, f) { -} -function someGenerics5(strs, n, f) { -} -function someGenerics6(strs, a, b, c) { -} -function someGenerics7(strs, a, b, c) { -} +function someGenerics3(strs, producer) {} +function someGenerics4(strs, n, f) {} +function someGenerics5(strs, n, f) {} +function someGenerics6(strs, a, b, c) {} +function someGenerics7(strs, a, b, c) {} function someGenerics9(strs, a, b, c) { return null; } -(function(n) { -})``, (function(n) { -})``, (function(n, m) { -})`${3}`, (function(n, m) { -})`${3}`, (function(strs, n) { -})`${(n)=>n -}`, (function(strs, n) { -})`${(n, x)=>n +(function(n) {})``, (function(n) {})``, (function(n, m) {})`${3}`, (function(n, m) {})`${3}`, (function(strs, n) {})`${(n)=>n +}`, (function(strs, n) {})`${(n, x)=>n }`, someGenerics3`${()=>'' }`, someGenerics3`${()=>undefined }`, someGenerics3`${()=>3 diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.1.normal.js index 1511122b43b..46462cd207b 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.1.normal.js @@ -317,34 +317,27 @@ function _templateObject27() { return data; } // Generic tag with one parameter -function noParams(n) { -} +function noParams(n) {} noParams(_templateObject()); // Generic tag with parameter which does not use type parameter -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams(_templateObject1()); // Generic tag with multiple type parameters and only one used in parameter type annotation -function someGenerics1a(n, m) { -} +function someGenerics1a(n, m) {} someGenerics1a(_templateObject2(), 3); -function someGenerics1b(n, m) { -} +function someGenerics1b(n, m) {} someGenerics1b(_templateObject3(), 3); // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs, n) { -} +function someGenerics2a(strs, n) {} someGenerics2a(_templateObject4(), function(n) { return n; }); -function someGenerics2b(strs, n) { -} +function someGenerics2b(strs, n) {} someGenerics2b(_templateObject5(), function(n, x) { return n; }); // 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) { -} +function someGenerics3(strs, producer) {} someGenerics3(_templateObject6(), function() { return ''; }); @@ -355,8 +348,7 @@ someGenerics3(_templateObject8(), function() { return 3; }); // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs, n, f) { -} +function someGenerics4(strs, n, f) {} someGenerics4(_templateObject9(), 4, function() { return null; }); @@ -365,8 +357,7 @@ someGenerics4(_templateObject10(), '', function() { }); someGenerics4(_templateObject11(), null, null); // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs, n, f) { -} +function someGenerics5(strs, n, f) {} someGenerics5(_templateObject12(), 4, function() { return null; }); @@ -375,8 +366,7 @@ someGenerics5(_templateObject13(), '', function() { }); someGenerics5(_templateObject14(), null, null); // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs, a, b, c) { -} +function someGenerics6(strs, a, b, c) {} someGenerics6(_templateObject15(), function(n) { return n; }, function(n) { @@ -399,8 +389,7 @@ someGenerics6(_templateObject17(), function(n) { return n; }); // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} +function someGenerics7(strs, a, b, c) {} someGenerics7(_templateObject18(), function(n) { return n; }, function(n) { diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.2.minified.js index 43b6136bb56..826b26a824e 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es5.2.minified.js @@ -286,29 +286,21 @@ function _templateObject27() { return data; }, data; } -function someGenerics3(strs, producer) { -} -function someGenerics4(strs, n, f) { -} -function someGenerics5(strs, n, f) { -} -function someGenerics6(strs, a, b, c) { -} -function someGenerics7(strs, a, b, c) { -} +function someGenerics3(strs, producer) {} +function someGenerics4(strs, n, f) {} +function someGenerics5(strs, n, f) {} +function someGenerics6(strs, a, b, c) {} +function someGenerics7(strs, a, b, c) {} function someGenerics9(strs, a, b, c) { return null; } -!function(strs, n) { -}(_templateObject4(), function(n) { +!function(strs, n) {}(_templateObject4(), function(n) { return n; -}), (function(strs, n) { -})(_templateObject5(), function(n, x) { +}), (function(strs, n) {})(_templateObject5(), function(n, x) { return n; }), someGenerics3(_templateObject6(), function() { return ""; -}), someGenerics3(_templateObject7(), function() { -}), someGenerics3(_templateObject8(), function() { +}), someGenerics3(_templateObject7(), function() {}), someGenerics3(_templateObject8(), function() { return 3; }), someGenerics4(_templateObject9(), 4, function() { return null; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js index cd56f31175b..e813e92a0e6 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js @@ -1,3 +1,2 @@ -function foo(...stuff) { -} +function foo(...stuff) {} foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${true}`, foo`${1}${"2"}`, foo`${1}${2}${3}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js index cd56f31175b..e813e92a0e6 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js @@ -1,3 +1,2 @@ -function foo(...stuff) { -} +function foo(...stuff) {} foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${true}`, foo`${1}${"2"}`, foo`${1}${2}${3}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6_es2015.2.minified.js index 2671742d443..e21683abaaf 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6_es2015.2.minified.js @@ -1,5 +1,3 @@ -function foo1(...stuff) { -} -function foo2(...stuff) { -} +function foo1(...stuff) {} +function foo2(...stuff) {} foo1`${1}`, foo1([], 1), foo2`${1}`, foo2([], 1); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_es2015.2.minified.js index 2671742d443..e21683abaaf 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_es2015.2.minified.js @@ -1,5 +1,3 @@ -function foo1(...stuff) { -} -function foo2(...stuff) { -} +function foo1(...stuff) {} +function foo2(...stuff) {} foo1`${1}`, foo1([], 1), foo2`${1}`, foo2([], 1); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.1.normal.js index 8c32d67d425..e8f6b156c72 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.1.normal.js @@ -3,8 +3,7 @@ function fn1() { } var s = fn1`${undefined}`; // No candidate overloads found -fn1`${{ -}}`; // Error +fn1`${{}}`; // Error function fn2() { return undefined; } @@ -29,8 +28,7 @@ var s = fn3`${''}${''}${''}`; var n = fn3`${''}${''}${3}`; // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3``; // Error -function fn4() { -} +function fn4() {} // Generic overloads with constraints tagged with types that satisfy the constraints fn4`${''}${3}`; fn4`${3}${''}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js index 2c19a432934..c05a4ba4eae 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js @@ -1,18 +1,14 @@ function fn1() { return null; } -function fn2() { -} -fn1`${undefined}`, fn1`${{ -}}`; +function fn2() {} +fn1`${undefined}`, fn1`${{}}`; var d1 = fn2`${0}${undefined}`, d2 = fn2`${0}${undefined}`; function fn3() { return null; } -function fn4() { -} -function fn5() { -} +function fn4() {} +function fn5() {} d1.foo(), d2(), fn2`${0}${''}`, fn2`${''}${0}`, fn3`${3}`, fn3`${''}${3}${''}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${''}${''}${''}`, fn3`${''}${''}${3}`, fn3``, fn4`${''}${3}`, fn4`${3}${''}`, fn4`${3}${undefined}`, fn4`${''}${null}`, fn4`${null}${null}`, fn4`${true}${null}`, fn4`${null}${true}`, fn5`${(n)=>n.toFixed() }`, fn5`${(n)=>n.substr(0) }`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.1.normal.js index 8c9190c7101..872e67187d9 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.1.normal.js @@ -251,8 +251,7 @@ function fn1() { } var s = fn1(_templateObject(), undefined); // No candidate overloads found -fn1(_templateObject1(), { -}); // Error +fn1(_templateObject1(), {}); // Error function fn2() { return undefined; } @@ -277,8 +276,7 @@ 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() { -} +function fn4() {} // Generic overloads with constraints tagged with types that satisfy the constraints fn4(_templateObject13(), '', 3); fn4(_templateObject14(), 3, ''); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.2.minified.js index 03d142eccc9..5b98ac12736 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es5.2.minified.js @@ -224,18 +224,14 @@ function _templateObject21() { function fn1() { return null; } -function fn2() { -} -fn1(_templateObject(), void 0), fn1(_templateObject1(), { -}); +function fn2() {} +fn1(_templateObject(), void 0), fn1(_templateObject1(), {}); var d1 = fn2(_templateObject2(), 0, void 0), d2 = fn2(_templateObject3(), 0, void 0); function fn3() { return null; } -function fn4() { -} -function fn5() { -} +function fn4() {} +function fn5() {} d1.foo(), d2(), fn2(_templateObject4(), 0, ""), fn2(_templateObject5(), "", 0), fn3(_templateObject6(), 3), fn3(_templateObject7(), "", 3, ""), fn3(_templateObject8(), 5, 5, 5), fn3(_templateObject9(), 4), fn3(_templateObject10(), "", "", ""), fn3(_templateObject11(), "", "", 3), fn3(_templateObject12()), fn4(_templateObject13(), "", 3), fn4(_templateObject14(), 3, ""), fn4(_templateObject15(), 3, void 0), fn4(_templateObject16(), "", null), fn4(_templateObject17(), null, null), fn4(_templateObject18(), !0, null), fn4(_templateObject19(), null, !0), fn5(_templateObject20(), function(n) { return n.toFixed(); }), fn5(_templateObject21(), function(n) { diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.1.normal.js index 8c32d67d425..e8f6b156c72 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.1.normal.js @@ -3,8 +3,7 @@ function fn1() { } var s = fn1`${undefined}`; // No candidate overloads found -fn1`${{ -}}`; // Error +fn1`${{}}`; // Error function fn2() { return undefined; } @@ -29,8 +28,7 @@ var s = fn3`${''}${''}${''}`; var n = fn3`${''}${''}${3}`; // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3``; // Error -function fn4() { -} +function fn4() {} // Generic overloads with constraints tagged with types that satisfy the constraints fn4`${''}${3}`; fn4`${3}${''}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js index 2c19a432934..c05a4ba4eae 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js @@ -1,18 +1,14 @@ function fn1() { return null; } -function fn2() { -} -fn1`${undefined}`, fn1`${{ -}}`; +function fn2() {} +fn1`${undefined}`, fn1`${{}}`; var d1 = fn2`${0}${undefined}`, d2 = fn2`${0}${undefined}`; function fn3() { return null; } -function fn4() { -} -function fn5() { -} +function fn4() {} +function fn5() {} d1.foo(), d2(), fn2`${0}${''}`, fn2`${''}${0}`, fn3`${3}`, fn3`${''}${3}${''}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${''}${''}${''}`, fn3`${''}${''}${3}`, fn3``, fn4`${''}${3}`, fn4`${3}${''}`, fn4`${3}${undefined}`, fn4`${''}${null}`, fn4`${null}${null}`, fn4`${true}${null}`, fn4`${null}${true}`, fn5`${(n)=>n.toFixed() }`, fn5`${(n)=>n.substr(0) }`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.1.normal.js index 8c9190c7101..872e67187d9 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.1.normal.js @@ -251,8 +251,7 @@ function fn1() { } var s = fn1(_templateObject(), undefined); // No candidate overloads found -fn1(_templateObject1(), { -}); // Error +fn1(_templateObject1(), {}); // Error function fn2() { return undefined; } @@ -277,8 +276,7 @@ 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() { -} +function fn4() {} // Generic overloads with constraints tagged with types that satisfy the constraints fn4(_templateObject13(), '', 3); fn4(_templateObject14(), 3, ''); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.2.minified.js index 03d142eccc9..5b98ac12736 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es5.2.minified.js @@ -224,18 +224,14 @@ function _templateObject21() { function fn1() { return null; } -function fn2() { -} -fn1(_templateObject(), void 0), fn1(_templateObject1(), { -}); +function fn2() {} +fn1(_templateObject(), void 0), fn1(_templateObject1(), {}); var d1 = fn2(_templateObject2(), 0, void 0), d2 = fn2(_templateObject3(), 0, void 0); function fn3() { return null; } -function fn4() { -} -function fn5() { -} +function fn4() {} +function fn5() {} d1.foo(), d2(), fn2(_templateObject4(), 0, ""), fn2(_templateObject5(), "", 0), fn3(_templateObject6(), 3), fn3(_templateObject7(), "", 3, ""), fn3(_templateObject8(), 5, 5, 5), fn3(_templateObject9(), 4), fn3(_templateObject10(), "", "", ""), fn3(_templateObject11(), "", "", 3), fn3(_templateObject12()), fn4(_templateObject13(), "", 3), fn4(_templateObject14(), 3, ""), fn4(_templateObject15(), 3, void 0), fn4(_templateObject16(), "", null), fn4(_templateObject17(), null, null), fn4(_templateObject18(), !0, null), fn4(_templateObject19(), null, !0), fn5(_templateObject20(), function(n) { return n.toFixed(); }), fn5(_templateObject21(), function(n) { diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.1.normal.js index b1357a3a031..eecab9131e5 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.1.normal.js @@ -1,4 +1,3 @@ //@target: es6 -function declare(x, ...ys) { -} +function declare(x, ...ys) {} declare`Hello ${0} world!`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.2.minified.js index cd7c0437319..10c82d76d1f 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6_es2015.2.minified.js @@ -1,2 +1 @@ -(function(x, ...ys) { -})`Hello ${0} world!`; +(function(x, ...ys) {})`Hello ${0} world!`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.1.normal.js index 4cbe4717080..beb4eaecfec 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.1.normal.js @@ -1,3 +1,2 @@ -function declare(x, ...ys) { -} +function declare(x, ...ys) {} declare`Hello ${0} world!`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.2.minified.js index cd7c0437319..10c82d76d1f 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclare_es2015.2.minified.js @@ -1,2 +1 @@ -(function(x, ...ys) { -})`Hello ${0} world!`; +(function(x, ...ys) {})`Hello ${0} world!`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.1.normal.js index e85ae336880..3a15e66fe49 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.1.normal.js @@ -1,6 +1,5 @@ //@target: es6 -function foo(...rest) { -} +function foo(...rest) {} foo`${function(x) { x = "bad"; }}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js index 161354952bf..d9fb8adf288 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js @@ -1,4 +1,3 @@ -(function(...rest) { -})`${function(x) { +(function(...rest) {})`${function(x) { x = "bad"; }}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.1.normal.js index 753057afb51..76ec582ac76 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo(...rest) { -} +function foo(...rest) {} foo`${function(x) { x = "bad"; }}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js index 161354952bf..d9fb8adf288 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js @@ -1,4 +1,3 @@ -(function(...rest) { -})`${function(x) { +(function(...rest) {})`${function(x) { x = "bad"; }}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.1.normal.js index c550eddef3b..12be6fbb693 100644 --- a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -49,14 +48,12 @@ export const b = g` ${(stuff)=>stuff.z } `; -export let c = obj["prop"]`${(input)=>_objectSpread({ - }, input) +export let c = obj["prop"]`${(input)=>_objectSpread({}, input) }`; c.returnedObjProp.x; c.returnedObjProp.y; c.returnedObjProp.z; -c = obj.prop`${(input)=>_objectSpread({ - }, input) +c = obj.prop`${(input)=>_objectSpread({}, input) }`; c.returnedObjProp.x; c.returnedObjProp.y; diff --git a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.2.minified.js index 0bc5c23da46..e0dbfa2a86f 100644 --- a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es2015.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -40,9 +39,7 @@ export const b = g` ${(stuff)=>stuff.z } `; -export let c = obj.prop`${(input)=>_objectSpread({ - }, input) +export let c = obj.prop`${(input)=>_objectSpread({}, input) }`; -c.returnedObjProp.x, c.returnedObjProp.y, c.returnedObjProp.z, (c = obj.prop`${(input)=>_objectSpread({ - }, input) +c.returnedObjProp.x, c.returnedObjProp.y, c.returnedObjProp.z, (c = obj.prop`${(input)=>_objectSpread({}, input) }`).returnedObjProp.x, c.returnedObjProp.y, c.returnedObjProp.z; diff --git a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.1.normal.js index 9d25dc57e40..a5329419eff 100644 --- a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.1.normal.js @@ -13,8 +13,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -96,15 +95,13 @@ export var b = g(_templateObject1(), function(stuff) { return stuff.z; }); export var c = obj["prop"](_templateObject2(), function(input) { - return _objectSpread({ - }, input); + return _objectSpread({}, input); }); c.returnedObjProp.x; c.returnedObjProp.y; c.returnedObjProp.z; c = obj.prop(_templateObject3(), function(input) { - return _objectSpread({ - }, input); + return _objectSpread({}, input); }); c.returnedObjProp.x; c.returnedObjProp.y; diff --git a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.2.minified.js index 119588268b4..4a3c7c8af3e 100644 --- a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments1_es5.2.minified.js @@ -8,8 +8,7 @@ function _defineProperty(obj, key, value) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -80,10 +79,8 @@ export var b = g(_templateObject1(), function(stuff) { return stuff.z; }); export var c = obj.prop(_templateObject2(), function(input) { - return _objectSpread({ - }, input); + return _objectSpread({}, input); }); c.returnedObjProp.x, c.returnedObjProp.y, c.returnedObjProp.z, (c = obj.prop(_templateObject3(), function(input) { - return _objectSpread({ - }, input); + return _objectSpread({}, input); })).returnedObjProp.x, c.returnedObjProp.y, c.returnedObjProp.z; diff --git a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.1.normal.js b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.1.normal.js index 43714effa93..6d51f7aa8bb 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.1.normal.js @@ -2,8 +2,7 @@ const a = "/bin"; // not ok const b = "no slash"; -function download(hostSpec) { -} +function download(hostSpec) {} // ok, has protocol download("http://example.com/protocol"); // issues error - no protocol diff --git a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.2.minified.js b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.2.minified.js index 039fe96abba..fc742b6fb74 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es2015.2.minified.js @@ -1,5 +1,4 @@ -function download(hostSpec) { -} +function download(hostSpec) {} download("http://example.com/protocol"), download("example.com/noprotocol"), download("gopher://example.com/protocol"), bools("true"), bools("false"), bools("other"), nullishes("null"), nullishes("undefined"), nullishes("0"), nullishes("false"), nullishes("NaN"), nullishes(""), nullishes("other"), numbers("1"), numbers("-1"), numbers("0"), numbers("0b1"), numbers("0x1"), numbers("0o1"), numbers("1e21"), numbers("1E21"), numbers("1e-21"), numbers("1E-21"), numbers("1.1"), numbers("-1.1"), numbers("-1.1e-10"), numbers("-1.1E-10"), numbers("1.1e-10"), numbers("?"), numbers("NaN"), numbers("Infinity"), numbers("+Infinity"), numbers("-Infinity"), numbers("1_000"), numbers("a10"), numbers("10a"), numbers("- 1"), numbers("-/**/1"), bigints("1"), bigints("-1"), bigints("0"), bigints("0b1"), bigints("0x1"), bigints("0o1"), bigints("1e21"), bigints("1E21"), bigints("1e-21"), bigints("1E-21"), bigints("1.0"), bigints("1.1"), bigints("-1.1"), bigints("-1.1e-10"), bigints("-1.1E-10"), bigints("1.1e-10"), bigints("?"), bigints("NaN"), bigints("Infinity"), bigints("+Infinity"), bigints("-Infinity"), bigints("1_000"), bigints("- 1"), bigints("-/**/1"), bigints("a10n"), bigints("10an"), bigints("1n"), bigints("-1n"), bigints("0n"), bigints("0b1n"), bigints("0x1n"), bigints("0o1n"), bigints("1e21n"), bigints("1E21n"), bigints("1e-21n"), bigints("1E-21n"), bigints("1.1n"), bigints("-1.1n"), bigints("-1.1e-10n"), bigints("-1.1E-10n"), bigints("1.1e-10n"), anyish = "bno", str = anyish = str = num = str, anyish = num, num = anyish, anyish = "aok"; export class AA { } diff --git a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.1.normal.js b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.1.normal.js index 3934f519442..f50b8dcad3c 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.1.normal.js @@ -21,8 +21,7 @@ function _createClass(Constructor, protoProps, staticProps) { var a = "/bin"; // not ok var b = "no slash"; -function download(hostSpec) { -} +function download(hostSpec) {} // ok, has protocol download("http://example.com/protocol"); // issues error - no protocol diff --git a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.2.minified.js b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.2.minified.js index 7dcdf7546d1..8f74cbb5bb8 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypesPatterns_es5.2.minified.js @@ -7,8 +7,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -function download(hostSpec) { -} +function download(hostSpec) {} download("http://example.com/protocol"), download("example.com/noprotocol"), download("gopher://example.com/protocol"), bools("true"), bools("false"), bools("other"), nullishes("null"), nullishes("undefined"), nullishes("0"), nullishes("false"), nullishes("NaN"), nullishes(""), nullishes("other"), numbers("1"), numbers("-1"), numbers("0"), numbers("0b1"), numbers("0x1"), numbers("0o1"), numbers("1e21"), numbers("1E21"), numbers("1e-21"), numbers("1E-21"), numbers("1.1"), numbers("-1.1"), numbers("-1.1e-10"), numbers("-1.1E-10"), numbers("1.1e-10"), numbers("?"), numbers("NaN"), numbers("Infinity"), numbers("+Infinity"), numbers("-Infinity"), numbers("1_000"), numbers("a10"), numbers("10a"), numbers("- 1"), numbers("-/**/1"), bigints("1"), bigints("-1"), bigints("0"), bigints("0b1"), bigints("0x1"), bigints("0o1"), bigints("1e21"), bigints("1E21"), bigints("1e-21"), bigints("1E-21"), bigints("1.0"), bigints("1.1"), bigints("-1.1"), bigints("-1.1e-10"), bigints("-1.1E-10"), bigints("1.1e-10"), bigints("?"), bigints("NaN"), bigints("Infinity"), bigints("+Infinity"), bigints("-Infinity"), bigints("1_000"), bigints("- 1"), bigints("-/**/1"), bigints("a10n"), bigints("10an"), bigints("1n"), bigints("-1n"), bigints("0n"), bigints("0b1n"), bigints("0x1n"), bigints("0o1n"), bigints("1e21n"), bigints("1E21n"), bigints("1e-21n"), bigints("1E-21n"), bigints("1.1n"), bigints("-1.1n"), bigints("-1.1e-10n"), bigints("-1.1E-10n"), bigints("1.1e-10n"), anyish = "bno", str = anyish = str = num = str, anyish = num, num = anyish, anyish = "aok"; export var AA = function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/thisMethodCall_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisMethodCall_es2015.1.normal.js index 17f0ea5c85f..eccf64ff2be 100644 --- a/crates/swc/tests/tsc-references/thisMethodCall_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisMethodCall_es2015.1.normal.js @@ -1,8 +1,7 @@ // @strict: true // @target: es6 class C { - method() { - } + method() {} other() { var _obj, ref; (ref = (_obj = this).method) === null || ref === void 0 ? void 0 : ref.call(_obj); diff --git a/crates/swc/tests/tsc-references/thisMethodCall_es5.1.normal.js b/crates/swc/tests/tsc-references/thisMethodCall_es5.1.normal.js index da52f960a69..8a2cfc5e1ab 100644 --- a/crates/swc/tests/tsc-references/thisMethodCall_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisMethodCall_es5.1.normal.js @@ -27,8 +27,7 @@ var C = // @strict: true _createClass(C, [ { key: "method", - value: function method() { - } + value: function method() {} }, { key: "other", diff --git a/crates/swc/tests/tsc-references/thisMethodCall_es5.2.minified.js b/crates/swc/tests/tsc-references/thisMethodCall_es5.2.minified.js index f72069263b2..f6db84f583e 100644 --- a/crates/swc/tests/tsc-references/thisMethodCall_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisMethodCall_es5.2.minified.js @@ -15,8 +15,7 @@ var C = function() { return Constructor = C, protoProps = [ { key: "method", - value: function() { - } + value: function() {} }, { key: "other", diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.1.normal.js index 43eb8977232..b2edd1dfb9e 100644 --- a/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.1.normal.js @@ -10,23 +10,15 @@ // if it needs to be that way in JavaScript; the test simply // ensures no accidental changes were introduced while allowing // element access assignments to create declarations. -this.x = { -}; -this.x.y = { -}; -this["y"] = { -}; -this["y"]["z"] = { -}; +this.x = {}; +this.x.y = {}; +this["y"] = {}; +this["y"]["z"] = {}; /** @constructor */ function F() { - this.a = { - }; - this.a.b = { - }; - this["b"] = { - }; - this["b"]["c"] = { - }; + this.a = {}; + this.a.b = {}; + this["b"] = {}; + this["b"]["c"] = {}; } const f = new F(); f.a; diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.2.minified.js index aeab3768902..62f50e35010 100644 --- a/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/thisPropertyAssignment_es2015.2.minified.js @@ -1,13 +1,5 @@ -this.x = { -}, this.x.y = { -}, this.y = { -}, this.y.z = { -}; +this.x = {}, this.x.y = {}, this.y = {}, this.y.z = {}; const f = new function() { - this.a = { - }, this.a.b = { - }, this.b = { - }, this.b.c = { - }; + this.a = {}, this.a.b = {}, this.b = {}, this.b.c = {}; }(); f.a, f.b; diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.1.normal.js index 36979eb4e86..45548bece99 100644 --- a/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.1.normal.js @@ -10,23 +10,15 @@ // if it needs to be that way in JavaScript; the test simply // ensures no accidental changes were introduced while allowing // element access assignments to create declarations. -this.x = { -}; -this.x.y = { -}; -this["y"] = { -}; -this["y"]["z"] = { -}; +this.x = {}; +this.x.y = {}; +this["y"] = {}; +this["y"]["z"] = {}; /** @constructor */ function F() { - this.a = { - }; - this.a.b = { - }; - this["b"] = { - }; - this["b"]["c"] = { - }; + this.a = {}; + this.a.b = {}; + this["b"] = {}; + this["b"]["c"] = {}; } var f = new F(); f.a; diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.2.minified.js index 869a5fc503f..4251059fa97 100644 --- a/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisPropertyAssignment_es5.2.minified.js @@ -1,13 +1,5 @@ -this.x = { -}, this.x.y = { -}, this.y = { -}, this.y.z = { -}; +this.x = {}, this.x.y = {}, this.y = {}, this.y.z = {}; var f = new function() { - this.a = { - }, this.a.b = { - }, this.b = { - }, this.b.c = { - }; + this.a = {}, this.a.b = {}, this.b = {}, this.b.c = {}; }(); f.a, f.b; diff --git a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.1.normal.js index 3596e644d74..65b586b23d6 100644 --- a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.1.normal.js @@ -7,8 +7,7 @@ class Foo { get p() { return 1; } - set p(value) { - } + set p(value) {} } // @Filename: bar.js class Bar extends Foo { diff --git a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js index d96169b837b..aec77c0a3a1 100644 --- a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -99,8 +98,7 @@ var Foo = // @target: esnext get: function get() { return 1; }, - set: function set(value) { - } + set: function set(value) {} } ]); return Foo; diff --git a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js index 56d8ea9e3ce..40072e80b6f 100644 --- a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js @@ -29,8 +29,7 @@ var Foo = function() { get: function() { return 1; }, - set: function(value) { - } + set: function(value) {} } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Foo; }(), Bar = function(Foo) { @@ -51,8 +50,7 @@ var Foo = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/thisTypeErrors2_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisTypeErrors2_es2015.1.normal.js index df0b80547a2..128a640d478 100644 --- a/crates/swc/tests/tsc-references/thisTypeErrors2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeErrors2_es2015.1.normal.js @@ -1,6 +1,5 @@ class Base { - constructor(a){ - } + constructor(a){} } class Generic { } diff --git a/crates/swc/tests/tsc-references/thisTypeErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisTypeErrors_es2015.1.normal.js index ae14a7f38d4..0ddb35c9811 100644 --- a/crates/swc/tests/tsc-references/thisTypeErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeErrors_es2015.1.normal.js @@ -18,8 +18,7 @@ var N1; var x; var y = N11.y = this; N11.x = x; -})(N1 || (N1 = { -})); +})(N1 || (N1 = {})); class C3 { f() { function g(x) { diff --git a/crates/swc/tests/tsc-references/thisTypeErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/thisTypeErrors_es2015.2.minified.js index 2339a63968e..81f073c5c84 100644 --- a/crates/swc/tests/tsc-references/thisTypeErrors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeErrors_es2015.2.minified.js @@ -1,9 +1,7 @@ var N1; (class { - static foo(x) { - } + static foo(x) {} }).y = void 0, (function(N11) { var x; N11.y = this, N11.x = x; -})(N1 || (N1 = { -})); +})(N1 || (N1 = {})); diff --git a/crates/swc/tests/tsc-references/thisTypeErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/thisTypeErrors_es5.1.normal.js index 214277c2a9e..01fcdac335a 100644 --- a/crates/swc/tests/tsc-references/thisTypeErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeErrors_es5.1.normal.js @@ -49,8 +49,7 @@ var N1; var x; var y = N11.y = this; N11.x = x; -})(N1 || (N1 = { -})); +})(N1 || (N1 = {})); var C3 = /*#__PURE__*/ function() { "use strict"; function C3() { diff --git a/crates/swc/tests/tsc-references/thisTypeErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/thisTypeErrors_es5.2.minified.js index cf15908a2cd..a4806e99516 100644 --- a/crates/swc/tests/tsc-references/thisTypeErrors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeErrors_es5.2.minified.js @@ -21,29 +21,25 @@ var N1, C1 = function() { return _createClass(C2, null, [ { key: "foo", - value: function(x) { - } + value: function(x) {} } ]), C2; }(); C2.y = void 0, (function(N11) { var x; N11.y = this, N11.x = x; -})(N1 || (N1 = { -})); +})(N1 || (N1 = {})); var C3 = function() { "use strict"; function C3() { _classCallCheck(this, C3), this.x1 = { - g: function(x) { - } + g: function(x) {} }; } return _createClass(C3, [ { key: "f", - value: function() { - } + value: function() {} } ]), C3; }(); diff --git a/crates/swc/tests/tsc-references/thisTypeInClasses_es5.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInClasses_es5.2.minified.js index 55b5f5d2519..c65d748d6a7 100644 --- a/crates/swc/tests/tsc-references/thisTypeInClasses_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInClasses_es5.2.minified.js @@ -18,8 +18,7 @@ var C1 = function() { return _createClass(C1, [ { key: "f", - value: function(x) { - } + value: function(x) {} } ]), C1; }(), C2 = function() { @@ -36,13 +35,11 @@ var C1 = function() { return _createClass(C5, [ { key: "foo", - value: function() { - } + value: function() {} }, { key: "bar", - value: function() { - } + value: function() {} } ]), C5; }(); diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.1.normal.js index 6bda09a6f17..16d7ecdfb3a 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.2.minified.js index a4908300f33..570e684c5a7 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions3_es5.2.minified.js @@ -32,8 +32,7 @@ var Test = function(Base) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.1.normal.js index 8531df81f90..978238eab95 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.2.minified.js index 108be1d49b3..67dd7153554 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.1.normal.js index 99202ee1a18..0d280540edd 100644 --- a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.1.normal.js @@ -161,8 +161,7 @@ let vue = new Vue({ get () { return "hi"; }, - set (value) { - } + set (value) {} } } }); diff --git a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.2.minified.js index 505d129a91a..cb9f73961cf 100644 --- a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es2015.2.minified.js @@ -84,8 +84,7 @@ let vue = new Vue({ get () { return "hi"; }, - set (value) { - } + set (value) {} } } }); diff --git a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.1.normal.js index 286a292bd7b..f94c9d2d07c 100644 --- a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.1.normal.js @@ -162,8 +162,7 @@ var vue = new Vue({ get: function get() { return "hi"; }, - set: function set(value) { - } + set: function set(value) {} } } }); diff --git a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.2.minified.js index 2ae556a33a9..fb66605a90d 100644 --- a/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInObjectLiterals2_es5.2.minified.js @@ -85,8 +85,7 @@ var vue = new Vue({ get: function() { return "hi"; }, - set: function(value) { - } + set: function(value) {} } } }); diff --git a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.1.normal.js b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.1.normal.js index 49638e3061a..ba4e5c4eff3 100644 --- a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.1.normal.js @@ -1,5 +1,4 @@ -function f() { -} +function f() {} const o = { n: 1 }; diff --git a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.2.minified.js b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.2.minified.js index 943cf2e0ea9..78aa601d594 100644 --- a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es2015.2.minified.js @@ -1,5 +1,4 @@ const o = { n: 1 }; -o.test = function() { -}, o.test(), o.test(), o.test(), o.test(), o.test(), o.test(); +o.test = function() {}, o.test(), o.test(), o.test(), o.test(), o.test(), o.test(); diff --git a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.1.normal.js b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.1.normal.js index edd691f3d27..9384acefa05 100644 --- a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.1.normal.js @@ -1,5 +1,4 @@ -function f() { -} +function f() {} var o = { n: 1 }; diff --git a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.2.minified.js b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.2.minified.js index 7e52d2e8449..b8b03458d41 100644 --- a/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeSyntacticContext_es5.2.minified.js @@ -1,5 +1,4 @@ var o = { n: 1 }; -o.test = function() { -}, o.test(), o.test(), o.test(), o.test(), o.test(), o.test(); +o.test = function() {}, o.test(), o.test(), o.test(), o.test(), o.test(), o.test(); diff --git a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.1.normal.js index cdcb4e13a3c..05e5b7869fd 100644 --- a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.1.normal.js @@ -19,8 +19,7 @@ while(z < 10){ for(var i = 0;;){ throw i; } -for(var idx in { -}){ +for(var idx in {}){ throw idx; } do { diff --git a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.2.minified.js index db0f005fbac..207a7e4408a 100644 --- a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es2015.2.minified.js @@ -7,6 +7,5 @@ switch(y){ } for(;;)throw 0; for(;;)throw 0; -for(var idx in { -})throw idx; +for(var idx in {})throw idx; for(;;)throw null; diff --git a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.1.normal.js index 58f7d783974..495635a3c97 100644 --- a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.1.normal.js @@ -38,8 +38,7 @@ while(z < 10){ for(var i = 0;;){ throw i; } -for(var idx in { -}){ +for(var idx in {}){ throw idx; } do { diff --git a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.2.minified.js index d65c478d18d..ae22e95270b 100644 --- a/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/throwInEnclosingStatements_es5.2.minified.js @@ -12,8 +12,7 @@ switch(y){ } for(;;)throw 0; for(;;)throw 0; -for(var idx in { -})throw idx; +for(var idx in {})throw idx; for(;;)throw null; var y, C = function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/throwStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/throwStatements_es2015.1.normal.js index df34d277548..3354882bf7d 100644 --- a/crates/swc/tests/tsc-references/throwStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/throwStatements_es2015.1.normal.js @@ -14,8 +14,7 @@ var M; return x1.toString(); } M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var aNumber = 9.9; throw aNumber; var aString = 'this is a string'; diff --git a/crates/swc/tests/tsc-references/throwStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/throwStatements_es2015.2.minified.js index b5d7f2c63ac..1b7e1f0e18c 100644 --- a/crates/swc/tests/tsc-references/throwStatements_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/throwStatements_es2015.2.minified.js @@ -1,6 +1,5 @@ var M, M1; -throw (M = M1 || (M1 = { -})).A = class { +throw (M = M1 || (M1 = {})).A = class { }, M.F2 = function(x) { return x.toString(); }, 9.9; diff --git a/crates/swc/tests/tsc-references/throwStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/throwStatements_es5.1.normal.js index beea5fa281a..4586fc97631 100644 --- a/crates/swc/tests/tsc-references/throwStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/throwStatements_es5.1.normal.js @@ -28,8 +28,7 @@ var M; }; M1.A = A; M1.F2 = F2; -})(M || (M = { -})); +})(M || (M = {})); var aNumber = 9.9; throw aNumber; var aString = 'this is a string'; diff --git a/crates/swc/tests/tsc-references/throwStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/throwStatements_es5.2.minified.js index 059c113b2df..69c36c1749e 100644 --- a/crates/swc/tests/tsc-references/throwStatements_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/throwStatements_es5.2.minified.js @@ -16,5 +16,4 @@ throw !function(M1) { M1.A = A, M1.F2 = function(x) { return x.toString(); }; -}(M || (M = { -})), 9.9; +}(M || (M = {})), 9.9; diff --git a/crates/swc/tests/tsc-references/tryStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/tryStatements_es2015.1.normal.js index c9a133d78e1..ae0f92fa10c 100644 --- a/crates/swc/tests/tsc-references/tryStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tryStatements_es2015.1.normal.js @@ -1,32 +1,15 @@ function fn() { - try { - } catch (e) { - } - try { - } catch (e1) { - try { - } catch (e) { - try { - } catch (e) { - } - } - try { - } catch (e2) { + try {} catch (e) {} + try {} catch (e1) { + try {} catch (e) { + try {} catch (e) {} } + try {} catch (e2) {} } - try { - } catch (x) { + try {} catch (x) { var x; } - try { - } finally{ - } - try { - } catch (e3) { - } finally{ - } - try { - } catch (z) { - } finally{ - } + try {} finally{} + try {} catch (e3) {} finally{} + try {} catch (z) {} finally{} } diff --git a/crates/swc/tests/tsc-references/tryStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/tryStatements_es5.1.normal.js index c9a133d78e1..ae0f92fa10c 100644 --- a/crates/swc/tests/tsc-references/tryStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tryStatements_es5.1.normal.js @@ -1,32 +1,15 @@ function fn() { - try { - } catch (e) { - } - try { - } catch (e1) { - try { - } catch (e) { - try { - } catch (e) { - } - } - try { - } catch (e2) { + try {} catch (e) {} + try {} catch (e1) { + try {} catch (e) { + try {} catch (e) {} } + try {} catch (e2) {} } - try { - } catch (x) { + try {} catch (x) { var x; } - try { - } finally{ - } - try { - } catch (e3) { - } finally{ - } - try { - } catch (z) { - } finally{ - } + try {} finally{} + try {} catch (e3) {} finally{} + try {} catch (z) {} finally{} } diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.1.normal.js index 675d7f9b2c1..23d5448e392 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.1.normal.js @@ -1,8 +1,7 @@ // @declaration: true // @filename: file.ts // @ts-nocheck -export const a = 1 + { -}; // This is an error, ofc, `Operator '+' cannot be applied to types '1' and '{}'`, which will be suppressed by the `nocheck` comment +export const a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied to types '1' and '{}'`, which will be suppressed by the `nocheck` comment export class Bet { constructor(){ this.q // And so will this implements error diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.2.minified.js index ce6d87f4c70..2faca4dd1f2 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es2015.2.minified.js @@ -1,5 +1,4 @@ -export const a = 1 + { -}; +export const a = 1 + {}; export class Bet { constructor(){ this.q = "lol"; diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.1.normal.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.1.normal.js index 5c05b057fa3..62255ac236b 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.1.normal.js @@ -6,8 +6,7 @@ function _classCallCheck(instance, Constructor) { // @declaration: true // @filename: file.ts // @ts-nocheck -export var a = 1 + { -}; // This is an error, ofc, `Operator '+' cannot be applied to types '1' and '{}'`, which will be suppressed by the `nocheck` comment +export var a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied to types '1' and '{}'`, which will be suppressed by the `nocheck` comment export var Bet = function Bet() { "use strict"; _classCallCheck(this, Bet); diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.2.minified.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.2.minified.js index 0feecee152e..da0f8dd8135 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescript_es5.2.minified.js @@ -1,5 +1,4 @@ -export var a = 1 + { -}; +export var a = 1 + {}; export var Bet = function() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.1.normal.js index 9d76af7df31..043b6cc2bcd 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.1.normal.js @@ -24,8 +24,7 @@ function _extends() { var attribs = { text: 100 }; -/*#__PURE__*/ React.createElement("div", _extends({ -}, attribs)); +/*#__PURE__*/ React.createElement("div", _extends({}, attribs)); // No errors here /*#__PURE__*/ React.createElement("span", { foo: "bar", diff --git a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.2.minified.js index 333dc1af7b7..c0da36ffb5c 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es2015.2.minified.js @@ -11,8 +11,7 @@ React.createElement("div", { text: 42 }), React.createElement("div", { width: "foo" -}), React.createElement("div", _extends({ -}, { +}), React.createElement("div", _extends({}, { text: 100 })), React.createElement("span", { foo: "bar", diff --git a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.1.normal.js index 9d76af7df31..043b6cc2bcd 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.1.normal.js @@ -24,8 +24,7 @@ function _extends() { var attribs = { text: 100 }; -/*#__PURE__*/ React.createElement("div", _extends({ -}, attribs)); +/*#__PURE__*/ React.createElement("div", _extends({}, attribs)); // No errors here /*#__PURE__*/ React.createElement("span", { foo: "bar", diff --git a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.2.minified.js index 333dc1af7b7..c0da36ffb5c 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeErrorsx_es5.2.minified.js @@ -11,8 +11,7 @@ React.createElement("div", { text: 42 }), React.createElement("div", { width: "foo" -}), React.createElement("div", _extends({ -}, { +}), React.createElement("div", _extends({}, { text: 100 })), React.createElement("span", { foo: "bar", diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.1.normal.js index 0f3e7439416..eae5abac951 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.1.normal.js @@ -1,7 +1,6 @@ //@filename: file.tsx export class MyComponent { - render() { - } + render() {} } // Should be an error /*#__PURE__*/ React.createElement(MyComponent, { diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.2.minified.js index d1067de0184..27d7a007ec6 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es2015.2.minified.js @@ -1,6 +1,5 @@ export class MyComponent { - render() { - } + render() {} } React.createElement(MyComponent, { bar: "world" diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.1.normal.js index dfd61b96c6a..b098d2eb797 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.1.normal.js @@ -26,8 +26,7 @@ export var MyComponent = /*#__PURE__*/ function() { _createClass(MyComponent, [ { key: "render", - value: function render() { - } + value: function render() {} } ]); return MyComponent; diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.2.minified.js index 9fe30d4baa0..b948a2ab356 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution10x_es5.2.minified.js @@ -15,8 +15,7 @@ export var MyComponent = function() { return protoProps = [ { key: "render", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = MyComponent).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), MyComponent; }(); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.1.normal.js index 05bc7e2ec2d..6d4e5d5bac5 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.1.normal.js @@ -1,7 +1,6 @@ //@filename: file.tsx class MyComponent { - render() { - } + render() {} } // Should be an OK var x = /*#__PURE__*/ React.createElement(MyComponent, { diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.2.minified.js index 8f012552b7c..edc5fe95555 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es2015.2.minified.js @@ -1,6 +1,5 @@ React.createElement(class { - render() { - } + render() {} }, { bar: "world" }); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.1.normal.js index 5bffeee27a1..82c82283047 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.1.normal.js @@ -26,8 +26,7 @@ var MyComponent = //@filename: file.tsx _createClass(MyComponent, [ { key: "render", - value: function render() { - } + value: function render() {} } ]); return MyComponent; diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.2.minified.js index 3ea8bffaa0a..1ae888b1ab5 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution11x_es5.2.minified.js @@ -15,8 +15,7 @@ var MyComponent = function() { return protoProps = [ { key: "render", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = MyComponent).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), MyComponent; }(); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.1.normal.js index dfc50da904c..68563492a47 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.1.normal.js @@ -1,5 +1,4 @@ //@jsx: preserve //@filename: test.tsx -function Test() { -} +function Test() {} /*#__PURE__*/ React.createElement(Test, null); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.2.minified.js index 2a17ba3b7cf..0bdccb0969b 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es2015.2.minified.js @@ -1,2 +1 @@ -React.createElement(function() { -}, null); +React.createElement(function() {}, null); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.1.normal.js index dfc50da904c..68563492a47 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.1.normal.js @@ -1,5 +1,4 @@ //@jsx: preserve //@filename: test.tsx -function Test() { -} +function Test() {} /*#__PURE__*/ React.createElement(Test, null); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.2.minified.js index 2a17ba3b7cf..0bdccb0969b 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution13x_es5.2.minified.js @@ -1,2 +1 @@ -React.createElement(function() { -}, null); +React.createElement(function() {}, null); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.1.normal.js index ef2786931f1..80048ceeef8 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.2.minified.js index 1b1d65db467..d0040e90f67 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution15x_es5.2.minified.js @@ -32,8 +32,7 @@ var _this = this, React = require("react"), BigGreeter = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.1.normal.js index 417c022fdb2..530a848de80 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.2.minified.js index e592df8107c..0fbc1c58921 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution16x_es5.2.minified.js @@ -33,8 +33,7 @@ export var AddressComp = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.1.normal.js index c840cfdf77b..c9b3094638b 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.1.normal.js @@ -16,27 +16,23 @@ function _extends() { var obj1 = { x: 'foo' }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj1)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj1)); // Error, x is not string var obj2 = { x: 32 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj2)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj2)); // Error, x is missing var obj3 = { y: 32 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj3)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj3)); // OK var obj4 = { x: 32, y: 32 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj4, { +/*#__PURE__*/ React.createElement("test1", _extends({}, obj4, { x: "ok" })); // Error @@ -53,8 +49,7 @@ var obj6 = { y: 32, extra: 100 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj6)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj6)); // OK (spread override) var obj7 = { x: 'foo' diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.2.minified.js index c7849474764..1e248f710e4 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es2015.2.minified.js @@ -7,17 +7,13 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("test1", _extends({ -}, { +React.createElement("test1", _extends({}, { x: "foo" -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: 32 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { y: 32 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: 32, y: 32 }, { @@ -27,8 +23,7 @@ React.createElement("test1", _extends({ }, { x: 32, y: 32 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: "ok", y: 32, extra: 100 diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.1.normal.js index c840cfdf77b..c9b3094638b 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.1.normal.js @@ -16,27 +16,23 @@ function _extends() { var obj1 = { x: 'foo' }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj1)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj1)); // Error, x is not string var obj2 = { x: 32 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj2)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj2)); // Error, x is missing var obj3 = { y: 32 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj3)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj3)); // OK var obj4 = { x: 32, y: 32 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj4, { +/*#__PURE__*/ React.createElement("test1", _extends({}, obj4, { x: "ok" })); // Error @@ -53,8 +49,7 @@ var obj6 = { y: 32, extra: 100 }; -/*#__PURE__*/ React.createElement("test1", _extends({ -}, obj6)); +/*#__PURE__*/ React.createElement("test1", _extends({}, obj6)); // OK (spread override) var obj7 = { x: 'foo' diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.2.minified.js index c7849474764..1e248f710e4 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution3x_es5.2.minified.js @@ -7,17 +7,13 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("test1", _extends({ -}, { +React.createElement("test1", _extends({}, { x: "foo" -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: 32 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { y: 32 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: 32, y: 32 }, { @@ -27,8 +23,7 @@ React.createElement("test1", _extends({ }, { x: 32, y: 32 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: "ok", y: 32, extra: 100 diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.1.normal.js index 80ab9c0d133..80b2978a6bd 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.1.normal.js @@ -13,12 +13,10 @@ function _extends() { return _extends.apply(this, arguments); } // OK -/*#__PURE__*/ React.createElement("test1", _extends({ -}, { +/*#__PURE__*/ React.createElement("test1", _extends({}, { x: (n)=>0 })); // Error, no member 'len' on 'string' -/*#__PURE__*/ React.createElement("test1", _extends({ -}, { +/*#__PURE__*/ React.createElement("test1", _extends({}, { x: (n)=>n.len })); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.2.minified.js index a1a83d0f72b..4fad81fc551 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es2015.2.minified.js @@ -7,10 +7,8 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("test1", _extends({ -}, { +React.createElement("test1", _extends({}, { x: (n)=>0 -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: (n)=>n.len })); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.1.normal.js index 82264d8d5f5..765a25bee33 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.1.normal.js @@ -13,15 +13,13 @@ function _extends() { return _extends.apply(this, arguments); } // OK -/*#__PURE__*/ React.createElement("test1", _extends({ -}, { +/*#__PURE__*/ React.createElement("test1", _extends({}, { x: function(n) { return 0; } })); // Error, no member 'len' on 'string' -/*#__PURE__*/ React.createElement("test1", _extends({ -}, { +/*#__PURE__*/ React.createElement("test1", _extends({}, { x: function(n) { return n.len; } diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.2.minified.js index d74478d349c..aca4c4926c8 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution4x_es5.2.minified.js @@ -7,13 +7,11 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("test1", _extends({ -}, { +React.createElement("test1", _extends({}, { x: function(n) { return 0; } -})), React.createElement("test1", _extends({ -}, { +})), React.createElement("test1", _extends({}, { x: function(n) { return n.len; } diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.1.normal.js index c3a36aafd6e..1be39de481d 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.1.normal.js @@ -14,5 +14,4 @@ function _extends() { } var x; // Should be OK -/*#__PURE__*/ React.createElement("test1", _extends({ -}, x)); +/*#__PURE__*/ React.createElement("test1", _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.2.minified.js index 7c547bde035..02adf896460 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es2015.2.minified.js @@ -8,5 +8,4 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("test1", _extends({ -}, x)); +React.createElement("test1", _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.1.normal.js index c3a36aafd6e..1be39de481d 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.1.normal.js @@ -14,5 +14,4 @@ function _extends() { } var x; // Should be OK -/*#__PURE__*/ React.createElement("test1", _extends({ -}, x)); +/*#__PURE__*/ React.createElement("test1", _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.2.minified.js index 7c547bde035..02adf896460 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution8x_es5.2.minified.js @@ -8,5 +8,4 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("test1", _extends({ -}, x)); +React.createElement("test1", _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.1.normal.js index 87348f5dfb3..e8cfa3e0712 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.1.normal.js @@ -1,7 +1,6 @@ //@filename: file.tsx export class MyComponent { - render() { - } + render() {} } /*#__PURE__*/ React.createElement(MyComponent, { foo: "bar" diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.2.minified.js index fa8d0afb3f1..21037fb1a99 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es2015.2.minified.js @@ -1,6 +1,5 @@ export class MyComponent { - render() { - } + render() {} } React.createElement(MyComponent, { foo: "bar" diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.1.normal.js index 54c468fb7e4..67b3c726f0d 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.1.normal.js @@ -26,8 +26,7 @@ export var MyComponent = /*#__PURE__*/ function() { _createClass(MyComponent, [ { key: "render", - value: function render() { - } + value: function render() {} } ]); return MyComponent; diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.2.minified.js index 1ef9a36c651..67200eae377 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution9x_es5.2.minified.js @@ -15,8 +15,7 @@ export var MyComponent = function() { return protoProps = [ { key: "render", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = MyComponent).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), MyComponent; }(); diff --git a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.1.normal.js index c8054be9e40..8f94f071b21 100644 --- a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.2.minified.js index c311eb0df9b..f6a2be66e36 100644 --- a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1x_es5.2.minified.js @@ -32,8 +32,7 @@ export var _typeof, ShortDetails = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.1.normal.js index 3d6d30543ba..d33a15681d0 100644 --- a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.2.minified.js index d2256df97a8..75a2beed75a 100644 --- a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution1x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Poisoned = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.1.normal.js index 3d6d30543ba..d33a15681d0 100644 --- a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.2.minified.js index d2256df97a8..75a2beed75a 100644 --- a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution2x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Poisoned = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.1.normal.js index e415aecf6fd..72077050712 100644 --- a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.2.minified.js index d2256df97a8..75a2beed75a 100644 --- a/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDefaultAttributesResolution3x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), Poisoned = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.1.normal.js index 062a38c7f4c..0f1aa31548a 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.1.normal.js @@ -65,8 +65,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.2.minified.js index 3459400d98b..08faed9ff32 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5x_es5.2.minified.js @@ -33,8 +33,7 @@ export var _typeof, Text = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.1.normal.js index 89119e3a9e9..f302ae24c4d 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.1.normal.js @@ -65,8 +65,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.2.minified.js index 1cae254430e..ed0501188da 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7x_es5.2.minified.js @@ -33,8 +33,7 @@ export var _typeof, Text = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.1.normal.js index 86da37ccd83..fc6d2126f44 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.1.normal.js @@ -65,8 +65,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.2.minified.js index 5d4d964334e..65cb46dca20 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8x_es5.2.minified.js @@ -33,8 +33,7 @@ export var _typeof, Text = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.1.normal.js index 86da37ccd83..fc6d2126f44 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.1.normal.js @@ -65,8 +65,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.2.minified.js index 5d4d964334e..65cb46dca20 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9x_es5.2.minified.js @@ -33,8 +33,7 @@ export var _typeof, Text = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.1.normal.js index d3005945dc4..904bbee3ac9 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.1.normal.js @@ -25,11 +25,8 @@ var Obj3; x: 10 }); // Error var attributes; -/*#__PURE__*/ React.createElement(Obj3, _extends({ -}, attributes)); // Error -/*#__PURE__*/ React.createElement(Obj3, _extends({ -}, { -})); // OK +/*#__PURE__*/ React.createElement(Obj3, _extends({}, attributes)); // Error +/*#__PURE__*/ React.createElement(Obj3, _extends({}, {})); // OK var Obj4; /*#__PURE__*/ React.createElement(Obj4, { x: 10 diff --git a/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.2.minified.js index 286de6912b6..ec225d88356 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution12x_es2015.2.minified.js @@ -14,10 +14,7 @@ React.createElement(Obj1, { x: 10 }), React.createElement(Obj3, { x: 10 -}), React.createElement(Obj3, _extends({ -}, attributes)), React.createElement(Obj3, _extends({ -}, { -})), React.createElement(Obj4, { +}), React.createElement(Obj3, _extends({}, attributes)), React.createElement(Obj3, _extends({}, {})), React.createElement(Obj4, { x: 10 }), React.createElement(Obj4, { x: "10" diff --git a/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.1.normal.js index d3005945dc4..904bbee3ac9 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.1.normal.js @@ -25,11 +25,8 @@ var Obj3; x: 10 }); // Error var attributes; -/*#__PURE__*/ React.createElement(Obj3, _extends({ -}, attributes)); // Error -/*#__PURE__*/ React.createElement(Obj3, _extends({ -}, { -})); // OK +/*#__PURE__*/ React.createElement(Obj3, _extends({}, attributes)); // Error +/*#__PURE__*/ React.createElement(Obj3, _extends({}, {})); // OK var Obj4; /*#__PURE__*/ React.createElement(Obj4, { x: 10 diff --git a/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.2.minified.js index 286de6912b6..ec225d88356 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution12x_es5.2.minified.js @@ -14,10 +14,7 @@ React.createElement(Obj1, { x: 10 }), React.createElement(Obj3, { x: 10 -}), React.createElement(Obj3, _extends({ -}, attributes)), React.createElement(Obj3, _extends({ -}, { -})), React.createElement(Obj4, { +}), React.createElement(Obj3, _extends({}, attributes)), React.createElement(Obj3, _extends({}, {})), React.createElement(Obj4, { x: 10 }), React.createElement(Obj4, { x: "10" diff --git a/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.1.normal.js index dbae3c42d1e..029900b7189 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.1.normal.js @@ -2,8 +2,7 @@ var my; (function(my1) { var div; my1.div = div; -})(my || (my = { -})); +})(my || (my = {})); // OK /*#__PURE__*/ React.createElement(my.div, { n: "x" @@ -19,5 +18,4 @@ var q; }); // Error /*#__PURE__*/ React.createElement(mine.non, null); -})(q || (q = { -})); +})(q || (q = {})); diff --git a/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.2.minified.js index a3e3368cce2..2e6a5ac4b10 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution7x_es2015.2.minified.js @@ -2,13 +2,11 @@ var my, q; !function(my1) { var div; my1.div = div; -}(my || (my = { -})), React.createElement(my.div, { +}(my || (my = {})), React.createElement(my.div, { n: "x" }), React.createElement(my.other, null), (function(q) { var mine = my; React.createElement(mine.div, { n: "x" }), React.createElement(mine.non, null); -})(q || (q = { -})); +})(q || (q = {})); diff --git a/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.1.normal.js index dbae3c42d1e..029900b7189 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.1.normal.js @@ -2,8 +2,7 @@ var my; (function(my1) { var div; my1.div = div; -})(my || (my = { -})); +})(my || (my = {})); // OK /*#__PURE__*/ React.createElement(my.div, { n: "x" @@ -19,5 +18,4 @@ var q; }); // Error /*#__PURE__*/ React.createElement(mine.non, null); -})(q || (q = { -})); +})(q || (q = {})); diff --git a/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.2.minified.js index a3e3368cce2..2e6a5ac4b10 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution7x_es5.2.minified.js @@ -2,13 +2,11 @@ var my, q; !function(my1) { var div; my1.div = div; -}(my || (my = { -})), React.createElement(my.div, { +}(my || (my = {})), React.createElement(my.div, { n: "x" }), React.createElement(my.other, null), (function(q) { var mine = my; React.createElement(mine.div, { n: "x" }), React.createElement(mine.non, null); -})(q || (q = { -})); +})(q || (q = {})); diff --git a/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.1.normal.js index 76afe5b8b99..a597f4df005 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.1.normal.js @@ -7,8 +7,7 @@ var Dotted; class Name { } Dotted1.Name = Name; -})(Dotted || (Dotted = { -})); +})(Dotted || (Dotted = {})); // Should find the intrinsic element, not the class element var a = /*#__PURE__*/ React.createElement("foundFirst", { x: "hello" diff --git a/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.2.minified.js index c6162f56236..1f5252d4686 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxElementResolutionx_es2015.2.minified.js @@ -1,6 +1,5 @@ var Dotted; -(Dotted || (Dotted = { -})).Name = class { +(Dotted || (Dotted = {})).Name = class { }, React.createElement("foundFirst", { x: "hello" }), React.createElement("string_named", null), React.createElement(class { diff --git a/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.1.normal.js index 477f7d73263..76ffe6242ef 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.1.normal.js @@ -18,8 +18,7 @@ var Dotted; _classCallCheck(this, Name); }; Dotted1.Name = Name; -})(Dotted || (Dotted = { -})); +})(Dotted || (Dotted = {})); // Should find the intrinsic element, not the class element var a = /*#__PURE__*/ React.createElement("foundFirst", { x: "hello" diff --git a/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.2.minified.js index fc83ce1b6a5..a7fd3066259 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxElementResolutionx_es5.2.minified.js @@ -14,7 +14,6 @@ var Dotted, foundFirst = function() { _classCallCheck(this, Name); }; Dotted1.Name = Name; -})(Dotted || (Dotted = { -})), React.createElement("foundFirst", { +})(Dotted || (Dotted = {})), React.createElement("foundFirst", { x: "hello" }), React.createElement("string_named", null), React.createElement(Other, null), React.createElement(Dotted.Name, null); diff --git a/crates/swc/tests/tsc-references/tsxEmit2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxEmit2x_es2015.1.normal.js index e11be40face..e1491acadb9 100644 --- a/crates/swc/tests/tsc-references/tsxEmit2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxEmit2x_es2015.1.normal.js @@ -13,15 +13,12 @@ function _extends() { return _extends.apply(this, arguments); } var p1, p2, p3; -var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); -var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); +var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); +var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); var spreads3 = /*#__PURE__*/ React.createElement("div", _extends({ x: p3 }, p1), p2); -var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1, { +var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({}, p1, { x: p3 }), p2); var spreads5 = /*#__PURE__*/ React.createElement("div", _extends({ diff --git a/crates/swc/tests/tsc-references/tsxEmit2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxEmit2x_es2015.2.minified.js index 0f8e510b28b..f2b05af0a16 100644 --- a/crates/swc/tests/tsc-references/tsxEmit2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxEmit2x_es2015.2.minified.js @@ -8,12 +8,9 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ +React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({ x: p3 -}, p1), p2), React.createElement("div", _extends({ -}, p1, { +}, p1), p2), React.createElement("div", _extends({}, p1, { x: p3 }), p2), React.createElement("div", _extends({ x: p2 diff --git a/crates/swc/tests/tsc-references/tsxEmit2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxEmit2x_es5.1.normal.js index e11be40face..e1491acadb9 100644 --- a/crates/swc/tests/tsc-references/tsxEmit2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxEmit2x_es5.1.normal.js @@ -13,15 +13,12 @@ function _extends() { return _extends.apply(this, arguments); } var p1, p2, p3; -var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); -var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); +var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); +var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); var spreads3 = /*#__PURE__*/ React.createElement("div", _extends({ x: p3 }, p1), p2); -var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1, { +var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({}, p1, { x: p3 }), p2); var spreads5 = /*#__PURE__*/ React.createElement("div", _extends({ diff --git a/crates/swc/tests/tsc-references/tsxEmit2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxEmit2x_es5.2.minified.js index 0f8e510b28b..f2b05af0a16 100644 --- a/crates/swc/tests/tsc-references/tsxEmit2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxEmit2x_es5.2.minified.js @@ -8,12 +8,9 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ +React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({ x: p3 -}, p1), p2), React.createElement("div", _extends({ -}, p1, { +}, p1), p2), React.createElement("div", _extends({}, p1, { x: p3 }), p2), React.createElement("div", _extends({ x: p2 diff --git a/crates/swc/tests/tsc-references/tsxEmit3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxEmit3x_es2015.1.normal.js index 233891b17a0..d63e4f1fe8a 100644 --- a/crates/swc/tests/tsc-references/tsxEmit3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxEmit3x_es2015.1.normal.js @@ -1,8 +1,7 @@ var M; (function(M1) { class Foo { - constructor(){ - } + constructor(){} } M1.Foo = Foo; let S1; @@ -10,10 +9,8 @@ var M; class Bar { } S.Bar = Bar; - })(S1 = M1.S || (M1.S = { - })); -})(M || (M = { -})); + })(S1 = M1.S || (M1.S = {})); +})(M || (M = {})); (function(M2) { // Emit M.Foo Foo, /*#__PURE__*/ React.createElement(Foo, null); @@ -23,18 +20,14 @@ var M; Foo, /*#__PURE__*/ React.createElement(Foo, null); // Emit S.Bar Bar, /*#__PURE__*/ React.createElement(Bar, null); - })(S = M2.S || (M2.S = { - })); -})(M || (M = { -})); + })(S = M2.S || (M2.S = {})); +})(M || (M = {})); (function(M) { // Emit M.S.Bar S.Bar, /*#__PURE__*/ React.createElement(S.Bar, null); -})(M || (M = { -})); +})(M || (M = {})); (function(M) { var M3 = 100; // Emit M_1.Foo Foo, /*#__PURE__*/ React.createElement(Foo, null); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/tsxEmit3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxEmit3x_es2015.2.minified.js index c3d4f9f9c95..38995ed195c 100644 --- a/crates/swc/tests/tsc-references/tsxEmit3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxEmit3x_es2015.2.minified.js @@ -1,12 +1,5 @@ var M, M1, M2; -(M2 = M || (M = { -})).Foo = class { - constructor(){ - } -}, (M2.S || (M2.S = { -})).Bar = class { -}, M1 = M || (M = { -}), React.createElement(Foo, null), M1.S || (M1.S = { -}), React.createElement(Foo, null), React.createElement(Bar, null), M || (M = { -}), React.createElement(S.Bar, null), M || (M = { -}), React.createElement(Foo, null); +(M2 = M || (M = {})).Foo = class { + constructor(){} +}, (M2.S || (M2.S = {})).Bar = class { +}, M1 = M || (M = {}), React.createElement(Foo, null), M1.S || (M1.S = {}), React.createElement(Foo, null), React.createElement(Bar, null), M || (M = {}), React.createElement(S.Bar, null), M || (M = {}), React.createElement(Foo, null); diff --git a/crates/swc/tests/tsc-references/tsxEmit3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxEmit3x_es5.1.normal.js index c37246936c3..ffebbc757c8 100644 --- a/crates/swc/tests/tsc-references/tsxEmit3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxEmit3x_es5.1.normal.js @@ -17,10 +17,8 @@ var M; _classCallCheck(this, Bar); }; S.Bar = Bar; - })(S1 = M1.S || (M1.S = { - })); -})(M || (M = { -})); + })(S1 = M1.S || (M1.S = {})); +})(M || (M = {})); (function(M2) { // Emit M.Foo Foo, /*#__PURE__*/ React.createElement(Foo, null); @@ -30,18 +28,14 @@ var M; Foo, /*#__PURE__*/ React.createElement(Foo, null); // Emit S.Bar Bar, /*#__PURE__*/ React.createElement(Bar, null); - })(S = M2.S || (M2.S = { - })); -})(M || (M = { -})); + })(S = M2.S || (M2.S = {})); +})(M || (M = {})); (function(M) { // Emit M.S.Bar S.Bar, /*#__PURE__*/ React.createElement(S.Bar, null); -})(M || (M = { -})); +})(M || (M = {})); (function(M) { var M3 = 100; // Emit M_1.Foo Foo, /*#__PURE__*/ React.createElement(Foo, null); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/tsxEmit3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxEmit3x_es5.2.minified.js index 8f039b84fa4..325ae0e8251 100644 --- a/crates/swc/tests/tsc-references/tsxEmit3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxEmit3x_es5.2.minified.js @@ -7,14 +7,8 @@ function _classCallCheck(instance, Constructor) { "use strict"; _classCallCheck(this, Foo); }; - M2.Foo = Foo, S = M2.S || (M2.S = { - }), Bar = function() { + M2.Foo = Foo, S = M2.S || (M2.S = {}), Bar = function() { "use strict"; _classCallCheck(this, Bar); }, S.Bar = Bar; -}(M || (M = { -})), M1 = M || (M = { -}), React.createElement(Foo, null), M1.S || (M1.S = { -}), React.createElement(Foo, null), React.createElement(Bar, null), M || (M = { -}), React.createElement(S.Bar, null), M || (M = { -}), React.createElement(Foo, null); +}(M || (M = {})), M1 = M || (M = {}), React.createElement(Foo, null), M1.S || (M1.S = {}), React.createElement(Foo, null), React.createElement(Bar, null), M || (M = {}), React.createElement(S.Bar, null), M || (M = {}), React.createElement(Foo, null); diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.1.normal.js index b6b6174c7f2..8daeaa656ce 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.1.normal.js @@ -67,8 +67,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.2.minified.js index f8681304d5f..9cd951c1f9f 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1x_es5.2.minified.js @@ -38,8 +38,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.1.normal.js index 2e59c7cfede..e667e6fcb76 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.1.normal.js @@ -19,5 +19,4 @@ function _extends() { handler: Main }); // Should see mod_1['default'] in emit here -/*#__PURE__*/ React.createElement(Foo, _extends({ -}, Main)); +/*#__PURE__*/ React.createElement(Foo, _extends({}, Main)); diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.2.minified.js index 45b5e4bf772..41f917bbfb0 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es2015.2.minified.js @@ -10,5 +10,4 @@ function _extends() { } React.createElement(Foo, { handler: Main -}), React.createElement(Foo, _extends({ -}, Main)); +}), React.createElement(Foo, _extends({}, Main)); diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.1.normal.js index 2e59c7cfede..e667e6fcb76 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.1.normal.js @@ -19,5 +19,4 @@ function _extends() { handler: Main }); // Should see mod_1['default'] in emit here -/*#__PURE__*/ React.createElement(Foo, _extends({ -}, Main)); +/*#__PURE__*/ React.createElement(Foo, _extends({}, Main)); diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.2.minified.js index 45b5e4bf772..41f917bbfb0 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2x_es5.2.minified.js @@ -10,5 +10,4 @@ function _extends() { } React.createElement(Foo, { handler: Main -}), React.createElement(Foo, _extends({ -}, Main)); +}), React.createElement(Foo, _extends({}, Main)); diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es2015.1.normal.js index d4ae7a568e3..33ba1814e08 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es2015.1.normal.js @@ -19,13 +19,11 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts const React = require('react'); const decorator = function(Component) { - return (props)=>/*#__PURE__*/ React.createElement(Component, _extends({ - }, props)) + return (props)=>/*#__PURE__*/ React.createElement(Component, _extends({}, props)) ; }; const decorator2 = function(Component) { - return (props)=>/*#__PURE__*/ React.createElement(Component, _extends({ - }, props, { + return (props)=>/*#__PURE__*/ React.createElement(Component, _extends({}, props, { x: 2 })) ; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es5.1.normal.js index dc888edd65a..e43e091ea18 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType1x_es5.1.normal.js @@ -20,14 +20,12 @@ function _extends() { var React = require('react'); var decorator = function decorator(Component) { return function(props) { - /*#__PURE__*/ return React.createElement(Component, _extends({ - }, props)); + /*#__PURE__*/ return React.createElement(Component, _extends({}, props)); }; }; var decorator2 = function decorator2(Component) { return function(props) { - /*#__PURE__*/ return React.createElement(Component, _extends({ - }, props, { + /*#__PURE__*/ return React.createElement(Component, _extends({}, props, { x: 2 })); }; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es2015.1.normal.js index 1f7a62ba596..152c03be9b2 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es2015.1.normal.js @@ -19,8 +19,7 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts const React = require('react'); const decorator4 = function(Component) { - return (props)=>/*#__PURE__*/ React.createElement(Component, _extends({ - }, props, { + return (props)=>/*#__PURE__*/ React.createElement(Component, _extends({}, props, { y: "blah" })) ; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es5.1.normal.js index 2456c284f7b..901a66ed52a 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType2x_es5.1.normal.js @@ -20,8 +20,7 @@ function _extends() { var React = require('react'); var decorator4 = function decorator4(Component) { return function(props) { - /*#__PURE__*/ return React.createElement(Component, _extends({ - }, props, { + /*#__PURE__*/ return React.createElement(Component, _extends({}, props, { y: "blah" })); }; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.1.normal.js index 35e431c733e..f548468b171 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.1.normal.js @@ -25,8 +25,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.2.minified.js index 83588800d82..0b6a506d0b8 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es2015.2.minified.js @@ -15,8 +15,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.1.normal.js index acad9baea7b..07364677c27 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -133,8 +132,7 @@ var B = /*#__PURE__*/ function(_Component) { { key: "render", value: function render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.2.minified.js index 325c5ed796e..4bdce66b621 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType3x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -89,8 +88,7 @@ var React = require("react"), B1 = function(_Component) { { key: "render", value: function() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.1.normal.js index 35e431c733e..f548468b171 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.1.normal.js @@ -25,8 +25,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.2.minified.js index 83588800d82..0b6a506d0b8 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es2015.2.minified.js @@ -15,8 +15,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.1.normal.js index acad9baea7b..07364677c27 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -133,8 +132,7 @@ var B = /*#__PURE__*/ function(_Component) { { key: "render", value: function render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.2.minified.js index 325c5ed796e..4bdce66b621 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType4x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -89,8 +88,7 @@ var React = require("react"), B1 = function(_Component) { { key: "render", value: function() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.1.normal.js index 35e431c733e..f548468b171 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.1.normal.js @@ -25,8 +25,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.2.minified.js index 83588800d82..0b6a506d0b8 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es2015.2.minified.js @@ -15,8 +15,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.1.normal.js index acad9baea7b..07364677c27 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -133,8 +132,7 @@ var B = /*#__PURE__*/ function(_Component) { { key: "render", value: function render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.2.minified.js index 325c5ed796e..4bdce66b621 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType5x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -89,8 +88,7 @@ var React = require("react"), B1 = function(_Component) { { key: "render", value: function() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.1.normal.js index 35e431c733e..f548468b171 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.1.normal.js @@ -25,8 +25,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.2.minified.js index 83588800d82..0b6a506d0b8 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es2015.2.minified.js @@ -15,8 +15,7 @@ class B1 extends React.Component { } class B extends React.Component { render() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.1.normal.js index acad9baea7b..07364677c27 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -133,8 +132,7 @@ var B = /*#__PURE__*/ function(_Component) { { key: "render", value: function render() { - return(/*#__PURE__*/ React.createElement(B1, _extends({ - }, this.props, { + return(/*#__PURE__*/ React.createElement(B1, _extends({}, this.props, { x: "hi" }))); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.2.minified.js index 325c5ed796e..4bdce66b621 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType6x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -89,8 +88,7 @@ var React = require("react"), B1 = function(_Component) { { key: "render", value: function() { - return React.createElement(B1, _extends({ - }, this.props, { + return React.createElement(B1, _extends({}, this.props, { x: "hi" })); } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es2015.1.normal.js index e58777bd2c3..6ad5a3b010b 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es2015.1.normal.js @@ -19,12 +19,10 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts const React = require('react'); const decorator = function(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props))); }; const decorator1 = function(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props, { x: "hi" }))); }; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es5.1.normal.js index e84f26c6b77..d95804b8bf6 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType7x_es5.1.normal.js @@ -19,12 +19,10 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts var React = require('react'); var decorator = function decorator(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props))); }; var decorator1 = function decorator1(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props, { x: "hi" }))); }; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es2015.1.normal.js index 3ab8304d862..372205fabde 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es2015.1.normal.js @@ -19,11 +19,9 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts const React = require('react'); const decorator = function(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props))); }; const decorator1 = function(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props))); }; export { }; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es5.1.normal.js index 169596ee872..10717fcbb42 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType8x_es5.1.normal.js @@ -19,11 +19,9 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts var React = require('react'); var decorator = function decorator(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props))); }; var decorator1 = function decorator1(props) { - return(/*#__PURE__*/ React.createElement(Component, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(Component, _extends({}, props))); }; export { }; diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.1.normal.js index 333499b5967..2cbdd0adf0c 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.1.normal.js @@ -21,8 +21,7 @@ const React = require('react'); export function makeP(Ctor) { return class _class extends React.PureComponent { render() { - return(/*#__PURE__*/ React.createElement(Ctor, _extends({ - }, this.props))); + return(/*#__PURE__*/ React.createElement(Ctor, _extends({}, this.props))); } }; } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.2.minified.js index 6333fc60a0d..24157c6fab8 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es2015.2.minified.js @@ -11,8 +11,7 @@ const React = require("react"); export function makeP(Ctor) { return class extends React.PureComponent { render() { - return React.createElement(Ctor, _extends({ - }, this.props)); + return React.createElement(Ctor, _extends({}, this.props)); } }; } diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.1.normal.js index 9ab762b110b..21a3da2185f 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -116,8 +115,7 @@ export function makeP(Ctor) { { key: "render", value: function render() { - return(/*#__PURE__*/ React.createElement(Ctor, _extends({ - }, this.props))); + return(/*#__PURE__*/ React.createElement(Ctor, _extends({}, this.props))); } } ]); diff --git a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.2.minified.js index b6a762b55c2..5eaa1bb99a9 100644 --- a/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxGenericAttributesType9x_es5.2.minified.js @@ -43,8 +43,7 @@ export function makeP(Ctor) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -70,8 +69,7 @@ export function makeP(Ctor) { { key: "render", value: function() { - return React.createElement(Ctor, _extends({ - }, this.props)); + return React.createElement(Ctor, _extends({}, this.props)); } } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), _class; diff --git a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.1.normal.js index 889afa344c5..36569026eda 100644 --- a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.2.minified.js index 5c09f94324d..d7177ecdb83 100644 --- a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributesx_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.1.normal.js index ce2aa925570..98788ba33ed 100644 --- a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.1.normal.js @@ -8,13 +8,11 @@ var M; (function(M1) { var X; M1.X = X; -})(M || (M = { -})); +})(M || (M = {})); (function(M) { // Should emit 'M.X' in both opening and closing tags var y = /*#__PURE__*/ React.createElement(X, null); -})(M || (M = { -})); +})(M || (M = {})); //@module: amd //@jsx: preserve //@target: ES5 diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.2.minified.js index ea62710c6a8..99b0880326c 100644 --- a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es2015.2.minified.js @@ -3,7 +3,5 @@ var M, Route = ReactRouter.Route; React.createElement(Route, null), (function(M1) { var X; M1.X = X; -})(M || (M = { -})), M || (M = { -}), React.createElement(X, null); +})(M || (M = {})), M || (M = {}), React.createElement(X, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.1.normal.js index 11575c44cfb..839d4d21f03 100644 --- a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.1.normal.js @@ -8,13 +8,11 @@ var M; (function(M1) { var X; M1.X = X; -})(M || (M = { -})); +})(M || (M = {})); (function(M) { // Should emit 'M.X' in both opening and closing tags var y = /*#__PURE__*/ React.createElement(X, null); -})(M || (M = { -})); +})(M || (M = {})); //@module: amd //@jsx: preserve //@target: ES5 diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.2.minified.js index 2f7dceb3639..1d9564b6b92 100644 --- a/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1x_es5.2.minified.js @@ -2,7 +2,5 @@ var M, React = require("react"), Route = require("react-router").Route; React.createElement(Route, null), (function(M1) { var X; M1.X = X; -})(M || (M = { -})), M || (M = { -}), React.createElement(X, null); +})(M || (M = {})), M || (M = {}), React.createElement(X, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.1.normal.js index e11be40face..e1491acadb9 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.1.normal.js @@ -13,15 +13,12 @@ function _extends() { return _extends.apply(this, arguments); } var p1, p2, p3; -var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); -var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); +var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); +var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); var spreads3 = /*#__PURE__*/ React.createElement("div", _extends({ x: p3 }, p1), p2); -var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1, { +var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({}, p1, { x: p3 }), p2); var spreads5 = /*#__PURE__*/ React.createElement("div", _extends({ diff --git a/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.2.minified.js index 0f8e510b28b..f2b05af0a16 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit2x_es2015.2.minified.js @@ -8,12 +8,9 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ +React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({ x: p3 -}, p1), p2), React.createElement("div", _extends({ -}, p1, { +}, p1), p2), React.createElement("div", _extends({}, p1, { x: p3 }), p2), React.createElement("div", _extends({ x: p2 diff --git a/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.1.normal.js index e11be40face..e1491acadb9 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.1.normal.js @@ -13,15 +13,12 @@ function _extends() { return _extends.apply(this, arguments); } var p1, p2, p3; -var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); -var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1), p2); +var spreads1 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); +var spreads2 = /*#__PURE__*/ React.createElement("div", _extends({}, p1), p2); var spreads3 = /*#__PURE__*/ React.createElement("div", _extends({ x: p3 }, p1), p2); -var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p1, { +var spreads4 = /*#__PURE__*/ React.createElement("div", _extends({}, p1, { x: p3 }), p2); var spreads5 = /*#__PURE__*/ React.createElement("div", _extends({ diff --git a/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.2.minified.js index 0f8e510b28b..f2b05af0a16 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit2x_es5.2.minified.js @@ -8,12 +8,9 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ -}, p1), p2), React.createElement("div", _extends({ +React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({}, p1), p2), React.createElement("div", _extends({ x: p3 -}, p1), p2), React.createElement("div", _extends({ -}, p1, { +}, p1), p2), React.createElement("div", _extends({}, p1, { x: p3 }), p2), React.createElement("div", _extends({ x: p2 diff --git a/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.1.normal.js index 15ebd5e2026..2ed4f0f74c2 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.1.normal.js @@ -15,7 +15,6 @@ function _extends() { var p; var openClosed1 = /*#__PURE__*/ React.createElement("div", null, blah); // Should emit React.__spread({}, p, {x: 0}) -var spread1 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p, { +var spread1 = /*#__PURE__*/ React.createElement("div", _extends({}, p, { x: 0 })); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.2.minified.js index 4d51d02ff97..dac4411f72d 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit4x_es2015.2.minified.js @@ -8,7 +8,6 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("div", null, blah), React.createElement("div", _extends({ -}, p, { +React.createElement("div", null, blah), React.createElement("div", _extends({}, p, { x: 0 })); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.1.normal.js index 15ebd5e2026..2ed4f0f74c2 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.1.normal.js @@ -15,7 +15,6 @@ function _extends() { var p; var openClosed1 = /*#__PURE__*/ React.createElement("div", null, blah); // Should emit React.__spread({}, p, {x: 0}) -var spread1 = /*#__PURE__*/ React.createElement("div", _extends({ -}, p, { +var spread1 = /*#__PURE__*/ React.createElement("div", _extends({}, p, { x: 0 })); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.2.minified.js index 4d51d02ff97..dac4411f72d 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit4x_es5.2.minified.js @@ -8,7 +8,6 @@ function _extends() { return target; }).apply(this, arguments); } -React.createElement("div", null, blah), React.createElement("div", _extends({ -}, p, { +React.createElement("div", null, blah), React.createElement("div", _extends({}, p, { x: 0 })); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.1.normal.js index 9033271a103..9dfae38461c 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var React; M1.React = React; -})(M || (M = { -})); +})(M || (M = {})); (function(M) { // Should emit M.React.createElement // and M.React.__spread @@ -30,5 +29,4 @@ var M; })); // Quotes var x = /*#__PURE__*/ React.createElement("div", null, "This \"quote\" thing"); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.2.minified.js index 104137d1d18..df98d47a783 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit6x_es2015.2.minified.js @@ -11,13 +11,11 @@ function _extends() { !function(M1) { var React; M1.React = React; -}(M || (M = { -})), (function(M) { +}(M || (M = {})), (function(M) { var foo; React.createElement("div", _extends({ x: "" }, foo, { y: "" })), React.createElement("div", null, "This \"quote\" thing"); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.1.normal.js index 9033271a103..9dfae38461c 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var React; M1.React = React; -})(M || (M = { -})); +})(M || (M = {})); (function(M) { // Should emit M.React.createElement // and M.React.__spread @@ -30,5 +29,4 @@ var M; })); // Quotes var x = /*#__PURE__*/ React.createElement("div", null, "This \"quote\" thing"); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.2.minified.js index 104137d1d18..df98d47a783 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit6x_es5.2.minified.js @@ -11,13 +11,11 @@ function _extends() { !function(M1) { var React; M1.React = React; -}(M || (M = { -})), (function(M) { +}(M || (M = {})), (function(M) { var foo; React.createElement("div", _extends({ x: "" }, foo, { y: "" })), React.createElement("div", null, "This \"quote\" thing"); -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es2015.2.minified.js index 3d0fdcab6d8..f759948fa3a 100644 --- a/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es2015.2.minified.js @@ -1,5 +1,4 @@ const React = require("react"); React.createElement((props)=>void 0 -, null), React.createElement(function(x) { -}, null); +, null), React.createElement(function(x) {}, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es5.2.minified.js index f8a3730e46e..9aa75cfacd8 100644 --- a/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSfcReturnUndefinedStrictNullChecksx_es5.2.minified.js @@ -1,5 +1,3 @@ var React = require("react"); -React.createElement(function(props) { -}, null), React.createElement(function(x) { -}, null); +React.createElement(function(props) {}, null), React.createElement(function(x) {}, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.1.normal.js index 482a0e1f6ce..359d528df7c 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.1.normal.js @@ -23,22 +23,18 @@ class Opt extends React.Component { return(/*#__PURE__*/ React.createElement("div", null, "Hello")); } } -const obj = { -}; +const obj = {}; const obj1 = { x: 2 }; // Error -let y = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj, { +let y = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj, { x: 3 })); -let y1 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1, { +let y1 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1, { x: "Hi" })); -let y2 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1, { +let y2 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1, { x: 3 })); let y3 = /*#__PURE__*/ React.createElement(Opt, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.2.minified.js index bf9bc46ba4d..6b9b8b40424 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es2015.2.minified.js @@ -16,15 +16,11 @@ class Opt extends React.Component { const obj1 = { x: 2 }; -React.createElement(Opt, _extends({ -}, { -}, { +React.createElement(Opt, _extends({}, {}, { x: 3 -})), React.createElement(Opt, _extends({ -}, obj1, { +})), React.createElement(Opt, _extends({}, obj1, { x: "Hi" -})), React.createElement(Opt, _extends({ -}, obj1, { +})), React.createElement(Opt, _extends({}, obj1, { x: 3 })), React.createElement(Opt, { x: !0 diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.1.normal.js index fee8f58a24e..859358b2c53 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -121,22 +120,18 @@ var Opt = /*#__PURE__*/ function(_Component) { ]); return Opt; }(React.Component); -var obj = { -}; +var obj = {}; var obj1 = { x: 2 }; // Error -var y = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj, { +var y = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj, { x: 3 })); -var y1 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1, { +var y1 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1, { x: "Hi" })); -var y2 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1, { +var y2 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1, { x: 3 })); var y3 = /*#__PURE__*/ React.createElement(Opt, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.2.minified.js index 232babcb19c..3af52e0eebe 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution10x_es5.2.minified.js @@ -41,8 +41,7 @@ var React = require("react"), Opt = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,15 +74,11 @@ var React = require("react"), Opt = function(_Component) { }(React.Component), obj1 = { x: 2 }; -React.createElement(Opt, _extends({ -}, { -}, { +React.createElement(Opt, _extends({}, {}, { x: 3 -})), React.createElement(Opt, _extends({ -}, obj1, { +})), React.createElement(Opt, _extends({}, obj1, { x: "Hi" -})), React.createElement(Opt, _extends({ -}, obj1, { +})), React.createElement(Opt, _extends({}, obj1, { x: 3 })), React.createElement(Opt, { x: !0 diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.1.normal.js index edda3c7e6de..7e2f13b8897 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.1.normal.js @@ -18,8 +18,7 @@ function _extends() { // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts const React = require('react'); -const obj = { -}; +const obj = {}; const obj1 = { x: 2 }; @@ -34,13 +33,11 @@ class OverWriteAttr extends React.Component { } let anyobj; // OK -let x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj, { +let x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj, { y: true, overwrite: "hi" }, obj1)); -let x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj1, obj3)); +let x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj1, obj3)); let x2 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ x: 3, overwrite: "hi" @@ -56,14 +53,12 @@ let x3 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ x: 2, overwrite: "world" })); -let x4 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, { +let x4 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, { x: 2 }, { overwrite: "world" }, { y: true })); -let x5 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, anyobj)); +let x5 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, anyobj)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.2.minified.js index c8ec15302ab..919f6722ad7 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es2015.2.minified.js @@ -16,13 +16,10 @@ class OverWriteAttr extends React.Component { } } let anyobj; -React.createElement(OverWriteAttr, _extends({ -}, { -}, { +React.createElement(OverWriteAttr, _extends({}, {}, { y: !0, overwrite: "hi" -}, obj1)), React.createElement(OverWriteAttr, _extends({ -}, obj1, { +}, obj1)), React.createElement(OverWriteAttr, _extends({}, obj1, { y: !0, overwrite: "hi" })), React.createElement(OverWriteAttr, _extends({ @@ -38,13 +35,11 @@ React.createElement(OverWriteAttr, _extends({ y: !0, x: 2, overwrite: "world" -})), React.createElement(OverWriteAttr, _extends({ -}, { +})), React.createElement(OverWriteAttr, _extends({}, { x: 2 }, { overwrite: "world" }, { y: !0 -})), React.createElement(OverWriteAttr, _extends({ -}, anyobj)); +})), React.createElement(OverWriteAttr, _extends({}, anyobj)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.1.normal.js index e672d230039..0cccfbe1d8e 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -103,8 +102,7 @@ function _createSuper(Derived) { // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts var React = require('react'); -var obj = { -}; +var obj = {}; var obj1 = { x: 2 }; @@ -132,13 +130,11 @@ var OverWriteAttr = /*#__PURE__*/ function(_Component) { }(React.Component); var anyobj; // OK -var x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj, { +var x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj, { y: true, overwrite: "hi" }, obj1)); -var x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj1, obj3)); +var x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj1, obj3)); var x2 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ x: 3, overwrite: "hi" @@ -154,14 +150,12 @@ var x3 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ x: 2, overwrite: "world" })); -var x4 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, { +var x4 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, { x: 2 }, { overwrite: "world" }, { y: true })); -var x5 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, anyobj)); +var x5 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, anyobj)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.2.minified.js index df088c5fc15..5b5248bf67d 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution11x_es5.2.minified.js @@ -43,8 +43,7 @@ var anyobj, React = require("react"), obj1 = { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,13 +74,10 @@ var anyobj, React = require("react"), obj1 = { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), OverWriteAttr; }(React.Component); -React.createElement(OverWriteAttr, _extends({ -}, { -}, { +React.createElement(OverWriteAttr, _extends({}, {}, { y: !0, overwrite: "hi" -}, obj1)), React.createElement(OverWriteAttr, _extends({ -}, obj1, { +}, obj1)), React.createElement(OverWriteAttr, _extends({}, obj1, { y: !0, overwrite: "hi" })), React.createElement(OverWriteAttr, _extends({ @@ -97,13 +93,11 @@ React.createElement(OverWriteAttr, _extends({ y: !0, x: 2, overwrite: "world" -})), React.createElement(OverWriteAttr, _extends({ -}, { +})), React.createElement(OverWriteAttr, _extends({}, { x: 2 }, { overwrite: "world" }, { y: !0 -})), React.createElement(OverWriteAttr, _extends({ -}, anyobj)); +})), React.createElement(OverWriteAttr, _extends({}, anyobj)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.1.normal.js index 175fb880384..de7477a69fc 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.1.normal.js @@ -18,8 +18,7 @@ function _extends() { // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts const React = require('react'); -const obj = { -}; +const obj = {}; const obj1 = { x: 2 }; @@ -34,8 +33,7 @@ class OverWriteAttr extends React.Component { } let anyobj; // Error -let x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj, { +let x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj, { y: true, overwrite: "hi" }, obj1)); @@ -46,8 +44,7 @@ let x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ }, { y: true })); -let x2 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, anyobj, { +let x2 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, anyobj, { x: 3 })); let x3 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.2.minified.js index 7c5446ab182..78a3055f671 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es2015.2.minified.js @@ -16,9 +16,7 @@ class OverWriteAttr extends React.Component { } } let anyobj; -React.createElement(OverWriteAttr, _extends({ -}, { -}, { +React.createElement(OverWriteAttr, _extends({}, {}, { y: !0, overwrite: "hi" }, obj1)), React.createElement(OverWriteAttr, _extends({ @@ -27,8 +25,7 @@ React.createElement(OverWriteAttr, _extends({ x: 3 }, { y: !0 -})), React.createElement(OverWriteAttr, _extends({ -}, anyobj, { +})), React.createElement(OverWriteAttr, _extends({}, anyobj, { x: 3 })), React.createElement(OverWriteAttr, _extends({ overwrite: "hi" diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.1.normal.js index ca1e903d186..4d5784573f5 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -103,8 +102,7 @@ function _createSuper(Derived) { // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts var React = require('react'); -var obj = { -}; +var obj = {}; var obj1 = { x: 2 }; @@ -132,8 +130,7 @@ var OverWriteAttr = /*#__PURE__*/ function(_Component) { }(React.Component); var anyobj; // Error -var x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj, { +var x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj, { y: true, overwrite: "hi" }, obj1)); @@ -144,8 +141,7 @@ var x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ }, { y: true })); -var x2 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, anyobj, { +var x2 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, anyobj, { x: 3 })); var x3 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.2.minified.js index 267383c7da3..a9b3da4a6c4 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution12x_es5.2.minified.js @@ -43,8 +43,7 @@ var anyobj, React = require("react"), obj1 = { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,9 +74,7 @@ var anyobj, React = require("react"), obj1 = { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), OverWriteAttr; }(React.Component); -React.createElement(OverWriteAttr, _extends({ -}, { -}, { +React.createElement(OverWriteAttr, _extends({}, {}, { y: !0, overwrite: "hi" }, obj1)), React.createElement(OverWriteAttr, _extends({ @@ -86,8 +83,7 @@ React.createElement(OverWriteAttr, _extends({ x: 3 }, { y: !0 -})), React.createElement(OverWriteAttr, _extends({ -}, anyobj, { +})), React.createElement(OverWriteAttr, _extends({}, anyobj, { x: 3 })), React.createElement(OverWriteAttr, _extends({ overwrite: "hi" diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.1.normal.js index 15043c835ff..7e83f42ae92 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.1.normal.js @@ -21,11 +21,9 @@ const React = require('react'); export default function Component(props) { let condition1; if (condition1) { - return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({}, props))); } else { - return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({}, props, { property1: "NewString" }))); } diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.2.minified.js index d02bd4cc483..8f7058013c2 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es2015.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } const React = require("react"); export default function Component(props) { - return React.createElement(ChildComponent, _extends({ - }, props, { + return React.createElement(ChildComponent, _extends({}, props, { property1: "NewString" })); }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.1.normal.js index 677a0ba127c..8206675ec2a 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.1.normal.js @@ -21,11 +21,9 @@ var React = require('react'); export default function Component(props) { var condition1; if (condition1) { - return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({ - }, props))); + return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({}, props))); } else { - return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({}, props, { property1: "NewString" }))); } diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.2.minified.js index 39e09aab47d..0cffac921b0 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution13x_es5.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } var React = require("react"); export default function Component(props) { - return React.createElement(ChildComponent, _extends({ - }, props, { + return React.createElement(ChildComponent, _extends({}, props, { property1: "NewString" })); }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.1.normal.js index 1a20c4919e7..1fa92346a50 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.1.normal.js @@ -20,8 +20,7 @@ function _extends() { const React = require('react'); export default function Component(props) { return(// Error extra property - /*#__PURE__*/ React.createElement(AnotherComponent, _extends({ - }, props, { + /*#__PURE__*/ React.createElement(AnotherComponent, _extends({}, props, { Property1: true }))); }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.2.minified.js index 79e5279edd9..b2180be601f 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es2015.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } const React = require("react"); export default function Component(props) { - return React.createElement(AnotherComponent, _extends({ - }, props, { + return React.createElement(AnotherComponent, _extends({}, props, { Property1: !0 })); }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.1.normal.js index 22bcea78480..6b7bfe25ba5 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.1.normal.js @@ -20,8 +20,7 @@ function _extends() { var React = require('react'); export default function Component(props) { return(// Error extra property - /*#__PURE__*/ React.createElement(AnotherComponent, _extends({ - }, props, { + /*#__PURE__*/ React.createElement(AnotherComponent, _extends({}, props, { Property1: true }))); }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.2.minified.js index 969278d2862..a40790fa2e9 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution14x_es5.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } var React = require("react"); export default function Component(props) { - return React.createElement(AnotherComponent, _extends({ - }, props, { + return React.createElement(AnotherComponent, _extends({}, props, { Property1: !0 })); }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.1.normal.js index de96d966e80..a6492d123f4 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.1.normal.js @@ -19,8 +19,7 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts const React = require('react'); export default function Component(props) { - return(/*#__PURE__*/ React.createElement(AnotherComponent, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(AnotherComponent, _extends({}, props, { property2: true, AnotherProperty1: "hi" }))); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.2.minified.js index 64d71baa6f4..a71fd524439 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es2015.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } const React = require("react"); export default function Component(props) { - return React.createElement(AnotherComponent, _extends({ - }, props, { + return React.createElement(AnotherComponent, _extends({}, props, { property2: !0, AnotherProperty1: "hi" })); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.1.normal.js index bb8e7d5a3fe..f67fd0709ed 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.1.normal.js @@ -19,8 +19,7 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts var React = require('react'); export default function Component(props) { - return(/*#__PURE__*/ React.createElement(AnotherComponent, _extends({ - }, props, { + return(/*#__PURE__*/ React.createElement(AnotherComponent, _extends({}, props, { property2: true, AnotherProperty1: "hi" }))); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.2.minified.js index d2765097d06..0b86862a410 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution15x_es5.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } var React = require("react"); export default function Component(props) { - return React.createElement(AnotherComponent, _extends({ - }, props, { + return React.createElement(AnotherComponent, _extends({}, props, { property2: !0, AnotherProperty1: "hi" })); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.1.normal.js index 692fff74e01..afdfbe7b19b 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.1.normal.js @@ -20,8 +20,7 @@ function _extends() { const React = require('react'); export default function Component(props) { return(// Error: missing property - /*#__PURE__*/ React.createElement(AnotherComponent, _extends({ - }, props))); + /*#__PURE__*/ React.createElement(AnotherComponent, _extends({}, props))); }; function AnotherComponent({ property1 }) { return(/*#__PURE__*/ React.createElement("span", null, property1)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.2.minified.js index 7ecf2cec49b..fd19ad3fd0f 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es2015.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } const React = require("react"); export default function Component(props) { - return React.createElement(AnotherComponent, _extends({ - }, props)); + return React.createElement(AnotherComponent, _extends({}, props)); }; function AnotherComponent({ property1 }) { return React.createElement("span", null, property1); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.1.normal.js index dcf045bb46c..299d6a22ee1 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.1.normal.js @@ -20,8 +20,7 @@ function _extends() { var React = require('react'); export default function Component(props) { return(// Error: missing property - /*#__PURE__*/ React.createElement(AnotherComponent, _extends({ - }, props))); + /*#__PURE__*/ React.createElement(AnotherComponent, _extends({}, props))); }; function AnotherComponent(param) { var property1 = param.property1; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.2.minified.js index 8af33653fdd..053eb3355e7 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution16x_es5.2.minified.js @@ -9,8 +9,7 @@ function _extends() { } var React = require("react"); export default function Component(props) { - return React.createElement(AnotherComponent, _extends({ - }, props)); + return React.createElement(AnotherComponent, _extends({}, props)); }; function AnotherComponent(param) { var property1 = param.property1; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.1.normal.js index 1c0d5f29e08..46d2bbebb8a 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.1.normal.js @@ -18,5 +18,4 @@ export class Empty extends React.Component { } } // OK -let unionedSpread = /*#__PURE__*/ React.createElement(Empty, _extends({ -}, obj)); +let unionedSpread = /*#__PURE__*/ React.createElement(Empty, _extends({}, obj)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.2.minified.js index e92e4df0f41..98fe2b101e1 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es2015.2.minified.js @@ -12,5 +12,4 @@ export class Empty extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(Empty, _extends({ -}, obj)); +React.createElement(Empty, _extends({}, obj)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.1.normal.js index 0555240dd87..b98287e7b2d 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -116,5 +115,4 @@ export var Empty = /*#__PURE__*/ function(_Component) { return Empty; }(React.Component); // OK -var unionedSpread = /*#__PURE__*/ React.createElement(Empty, _extends({ -}, obj)); +var unionedSpread = /*#__PURE__*/ React.createElement(Empty, _extends({}, obj)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.2.minified.js index 74048459cce..2043bbcfedc 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17x_es5.2.minified.js @@ -41,8 +41,7 @@ export var _typeof, Empty = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,5 +72,4 @@ export var _typeof, Empty = function(_Component) { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Empty; }(React.Component); -React.createElement(Empty, _extends({ -}, obj)); +React.createElement(Empty, _extends({}, obj)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.1.normal.js index 8b0ebb1e36a..75fb5610787 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.1.normal.js @@ -23,10 +23,8 @@ class Poisoned extends React.Component { return(/*#__PURE__*/ React.createElement("div", null, "Hello")); } } -const obj = { -}; +const obj = {}; // OK -let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); let y = /*#__PURE__*/ React.createElement(Poisoned, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.2.minified.js index a12bf585b37..1f75c62b5eb 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es2015.2.minified.js @@ -13,7 +13,5 @@ class Poisoned extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(Poisoned, _extends({ -}, { -})), React.createElement(Poisoned, null); +React.createElement(Poisoned, _extends({}, {})), React.createElement(Poisoned, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.1.normal.js index 16a06a86f43..86879b64536 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -121,10 +120,8 @@ var Poisoned = /*#__PURE__*/ function(_Component) { ]); return Poisoned; }(React.Component); -var obj = { -}; +var obj = {}; // OK -var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); var y = /*#__PURE__*/ React.createElement(Poisoned, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.2.minified.js index ab9f4668ef5..346c512c164 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution1x_es5.2.minified.js @@ -41,8 +41,7 @@ var React = require("react"), Poisoned = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,7 +72,5 @@ var React = require("react"), Poisoned = function(_Component) { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Poisoned; }(React.Component); -React.createElement(Poisoned, _extends({ -}, { -})), React.createElement(Poisoned, null); +React.createElement(Poisoned, _extends({}, {})), React.createElement(Poisoned, null); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.1.normal.js index eff7347cf04..48b382cae20 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.1.normal.js @@ -23,29 +23,24 @@ class Poisoned extends React.Component { return(/*#__PURE__*/ React.createElement("div", null, "Hello")); } } -const obj = { -}; +const obj = {}; // OK -/*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, { +/*#__PURE__*/ React.createElement(Poisoned, _extends({}, { x: "ok", y: "2" })); // Error -let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); let y = /*#__PURE__*/ React.createElement(Poisoned, null); let z = /*#__PURE__*/ React.createElement(Poisoned, { x: true, y: true }); -let w = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, { +let w = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, { x: 5, y: "2" })); -let w1 = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, { +let w1 = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, { x: 5, y: "2" }, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.2.minified.js index e85ee6ffc2e..34612155c42 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es2015.2.minified.js @@ -13,21 +13,16 @@ class Poisoned extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "ok", y: "2" -})), React.createElement(Poisoned, _extends({ -}, { -})), React.createElement(Poisoned, null), React.createElement(Poisoned, { +})), React.createElement(Poisoned, _extends({}, {})), React.createElement(Poisoned, null), React.createElement(Poisoned, { x: !0, y: !0 -}), React.createElement(Poisoned, _extends({ -}, { +}), React.createElement(Poisoned, _extends({}, { x: 5, y: "2" -})), React.createElement(Poisoned, _extends({ -}, { +})), React.createElement(Poisoned, _extends({}, { x: 5, y: "2" }, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.1.normal.js index 12caa5cb66d..f08c4ca9f92 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -121,29 +120,24 @@ var Poisoned = /*#__PURE__*/ function(_Component) { ]); return Poisoned; }(React.Component); -var obj = { -}; +var obj = {}; // OK -/*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, { +/*#__PURE__*/ React.createElement(Poisoned, _extends({}, { x: "ok", y: "2" })); // Error -var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); var y = /*#__PURE__*/ React.createElement(Poisoned, null); var z = /*#__PURE__*/ React.createElement(Poisoned, { x: true, y: true }); -var w = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, { +var w = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, { x: 5, y: "2" })); -var w1 = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, { +var w1 = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, { x: 5, y: "2" }, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.2.minified.js index a1e2b79cc0b..361c20c00c7 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution2x_es5.2.minified.js @@ -41,8 +41,7 @@ var React = require("react"), Poisoned = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,21 +72,16 @@ var React = require("react"), Poisoned = function(_Component) { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Poisoned; }(React.Component); -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "ok", y: "2" -})), React.createElement(Poisoned, _extends({ -}, { -})), React.createElement(Poisoned, null), React.createElement(Poisoned, { +})), React.createElement(Poisoned, _extends({}, {})), React.createElement(Poisoned, null), React.createElement(Poisoned, { x: !0, y: !0 -}), React.createElement(Poisoned, _extends({ -}, { +}), React.createElement(Poisoned, _extends({}, { x: 5, y: "2" -})), React.createElement(Poisoned, _extends({ -}, { +})), React.createElement(Poisoned, _extends({}, { x: 5, y: "2" }, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.1.normal.js index 4f721742086..6d22b37f94c 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.1.normal.js @@ -28,8 +28,7 @@ const obj = { y: 2 }; // OK -let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); let y = /*#__PURE__*/ React.createElement(Poisoned, { x: "hi", y: 2 diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.2.minified.js index 0b495b436a6..fab0c87b542 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es2015.2.minified.js @@ -13,8 +13,7 @@ class Poisoned extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "hello world", y: 2 })), React.createElement(Poisoned, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.1.normal.js index cf874c92eeb..7f51123f431 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -126,8 +125,7 @@ var obj = { y: 2 }; // OK -var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); var y = /*#__PURE__*/ React.createElement(Poisoned, { x: "hi", y: 2 diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.2.minified.js index 099b451e95b..dca98212021 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution3x_es5.2.minified.js @@ -41,8 +41,7 @@ var React = require("react"), Poisoned = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,8 +72,7 @@ var React = require("react"), Poisoned = function(_Component) { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Poisoned; }(React.Component); -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "hello world", y: 2 })), React.createElement(Poisoned, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.1.normal.js index 0469d59cae4..d3cd0095ccf 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.1.normal.js @@ -28,8 +28,7 @@ const obj = { y: 2 }; // OK -let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); class EmptyProp extends React.Component { render() { return(/*#__PURE__*/ React.createElement("div", null, "Default hi")); @@ -37,13 +36,9 @@ class EmptyProp extends React.Component { } // OK let j; -let e1 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, { -})); -let e2 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, j)); -let e3 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, { +let e1 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, {})); +let e2 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, j)); +let e3 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, { ref: (input)=>{ this.textInput = input; } @@ -51,8 +46,7 @@ let e3 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ let e4 = /*#__PURE__*/ React.createElement(EmptyProp, { "data-prop": true }); -let e5 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, { +let e5 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, { "data-prop": true })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.2.minified.js index e4ead930316..94bec5a115f 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es2015.2.minified.js @@ -13,8 +13,7 @@ class Poisoned extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "hello world", y: 2 })); @@ -24,18 +23,13 @@ class EmptyProp extends React.Component { } } let j; -React.createElement(EmptyProp, _extends({ -}, { -})), React.createElement(EmptyProp, _extends({ -}, j)), React.createElement(EmptyProp, _extends({ -}, { +React.createElement(EmptyProp, _extends({}, {})), React.createElement(EmptyProp, _extends({}, j)), React.createElement(EmptyProp, _extends({}, { ref: (input)=>{ this.textInput = input; } })), React.createElement(EmptyProp, { "data-prop": !0 -}), React.createElement(EmptyProp, _extends({ -}, { +}), React.createElement(EmptyProp, _extends({}, { "data-prop": !0 })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.1.normal.js index c7365049f3a..d2e75501e7f 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -127,8 +126,7 @@ var obj = { y: 2 }; // OK -var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); var EmptyProp = /*#__PURE__*/ function(_Component) { "use strict"; _inherits(EmptyProp, _Component); @@ -149,13 +147,9 @@ var EmptyProp = /*#__PURE__*/ function(_Component) { }(React.Component); // OK var j; -var e1 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, { -})); -var e2 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, j)); -var e3 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, { +var e1 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, {})); +var e2 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, j)); +var e3 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, { ref: function(input) { _this.textInput = input; } @@ -163,8 +157,7 @@ var e3 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ var e4 = /*#__PURE__*/ React.createElement(EmptyProp, { "data-prop": true }); -var e5 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, { +var e5 = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, { "data-prop": true })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.2.minified.js index 66a240e0ebd..4ea347f69c5 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution4x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -79,8 +78,7 @@ var j, _this = this, React = require("react"), Poisoned = function(_Component) { } ]), Poisoned; }(React.Component); -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "hello world", y: 2 })); @@ -100,18 +98,13 @@ var EmptyProp = function(_Component) { } ]), EmptyProp; }(React.Component); -React.createElement(EmptyProp, _extends({ -}, { -})), React.createElement(EmptyProp, _extends({ -}, j)), React.createElement(EmptyProp, _extends({ -}, { +React.createElement(EmptyProp, _extends({}, {})), React.createElement(EmptyProp, _extends({}, j)), React.createElement(EmptyProp, _extends({}, { ref: function(input) { _this.textInput = input; } })), React.createElement(EmptyProp, { "data-prop": !0 -}), React.createElement(EmptyProp, _extends({ -}, { +}), React.createElement(EmptyProp, _extends({}, { "data-prop": !0 })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.1.normal.js index b87cef8640c..5d3d979c29c 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.1.normal.js @@ -28,8 +28,7 @@ let obj = { y: 2 }; // Error as "obj" has type { x: string; y: number } -let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +let p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); class EmptyProp extends React.Component { render() { return(/*#__PURE__*/ React.createElement("div", null, "Default hi")); @@ -39,6 +38,5 @@ let o = { prop1: false }; // Ok -let e = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, o)); +let e = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, o)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.2.minified.js index 788107a94f6..cafd6318697 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es2015.2.minified.js @@ -13,8 +13,7 @@ class Poisoned extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "hello world", y: 2 })); @@ -23,8 +22,7 @@ class EmptyProp extends React.Component { return React.createElement("div", null, "Default hi"); } } -React.createElement(EmptyProp, _extends({ -}, { +React.createElement(EmptyProp, _extends({}, { prop1: !1 })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.1.normal.js index 619671986b5..254401afda5 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -126,8 +125,7 @@ var obj = { y: 2 }; // Error as "obj" has type { x: string; y: number } -var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({ -}, obj)); +var p = /*#__PURE__*/ React.createElement(Poisoned, _extends({}, obj)); var EmptyProp = /*#__PURE__*/ function(_Component) { "use strict"; _inherits(EmptyProp, _Component); @@ -150,6 +148,5 @@ var o = { prop1: false }; // Ok -var e = /*#__PURE__*/ React.createElement(EmptyProp, _extends({ -}, o)); +var e = /*#__PURE__*/ React.createElement(EmptyProp, _extends({}, o)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.2.minified.js index 86a9d7cb3c8..ec92b24c409 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution5x_es5.2.minified.js @@ -45,8 +45,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -79,8 +78,7 @@ var React = require("react"), Poisoned = function(_Component) { } ]), Poisoned; }(React.Component); -React.createElement(Poisoned, _extends({ -}, { +React.createElement(Poisoned, _extends({}, { x: "hello world", y: 2 })); @@ -100,8 +98,7 @@ var EmptyProp = function(_Component) { } ]), EmptyProp; }(React.Component); -React.createElement(EmptyProp, _extends({ -}, { +React.createElement(EmptyProp, _extends({}, { prop1: !1 })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.1.normal.js index d99958cd379..e3299d829ae 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.2.minified.js index 83b936bdccc..bbbe4081bdd 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution6x_es5.2.minified.js @@ -32,8 +32,7 @@ var React = require("react"), TextComponent = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.1.normal.js index b81d8c704b4..3438a2b4d97 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.1.normal.js @@ -27,13 +27,10 @@ class TextComponent extends React.Component { const textPropsFalse = { editable: false }; -let y1 = /*#__PURE__*/ React.createElement(TextComponent, _extends({ -}, textPropsFalse)); +let y1 = /*#__PURE__*/ React.createElement(TextComponent, _extends({}, textPropsFalse)); const textPropsTrue = { editable: true, - onEdit: ()=>{ - } + onEdit: ()=>{} }; -let y2 = /*#__PURE__*/ React.createElement(TextComponent, _extends({ -}, textPropsTrue)); +let y2 = /*#__PURE__*/ React.createElement(TextComponent, _extends({}, textPropsTrue)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.2.minified.js index 37e9dc107b6..df68842de8d 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es2015.2.minified.js @@ -13,13 +13,10 @@ class TextComponent extends React.Component { return React.createElement("span", null, "Some Text.."); } } -React.createElement(TextComponent, _extends({ -}, { +React.createElement(TextComponent, _extends({}, { editable: !1 -})), React.createElement(TextComponent, _extends({ -}, { +})), React.createElement(TextComponent, _extends({}, { editable: !0, - onEdit: ()=>{ - } + onEdit: ()=>{} })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.1.normal.js index a4971a03958..9a1c95e86a7 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -125,13 +124,10 @@ var TextComponent = /*#__PURE__*/ function(_Component) { var textPropsFalse = { editable: false }; -var y1 = /*#__PURE__*/ React.createElement(TextComponent, _extends({ -}, textPropsFalse)); +var y1 = /*#__PURE__*/ React.createElement(TextComponent, _extends({}, textPropsFalse)); var textPropsTrue = { editable: true, - onEdit: function() { - } + onEdit: function() {} }; -var y2 = /*#__PURE__*/ React.createElement(TextComponent, _extends({ -}, textPropsTrue)); +var y2 = /*#__PURE__*/ React.createElement(TextComponent, _extends({}, textPropsTrue)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.2.minified.js index f7060a43c92..37281388153 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution7x_es5.2.minified.js @@ -41,8 +41,7 @@ var React = require("react"), TextComponent = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -73,13 +72,10 @@ var React = require("react"), TextComponent = function(_Component) { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), TextComponent; }(React.Component); -React.createElement(TextComponent, _extends({ -}, { +React.createElement(TextComponent, _extends({}, { editable: !1 -})), React.createElement(TextComponent, _extends({ -}, { +})), React.createElement(TextComponent, _extends({}, { editable: !0, - onEdit: function() { - } + onEdit: function() {} })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.1.normal.js index 307511e74fb..e6083f716ff 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.1.normal.js @@ -18,8 +18,7 @@ function _extends() { // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts const React = require('react'); -const obj = { -}; +const obj = {}; const obj1 = { x: 2 }; @@ -33,11 +32,9 @@ class OverWriteAttr extends React.Component { } } // OK -let x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj, { +let x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj, { y: true, overwrite: "hi" }, obj1)); -let x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj1, obj3)); +let x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj1, obj3)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.2.minified.js index e50dbbc5ea2..6a3013cafb7 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es2015.2.minified.js @@ -15,13 +15,10 @@ class OverWriteAttr extends React.Component { return React.createElement("div", null, "Hello"); } } -React.createElement(OverWriteAttr, _extends({ -}, { -}, { +React.createElement(OverWriteAttr, _extends({}, {}, { y: !0, overwrite: "hi" -}, obj1)), React.createElement(OverWriteAttr, _extends({ -}, obj1, { +}, obj1)), React.createElement(OverWriteAttr, _extends({}, obj1, { y: !0, overwrite: "hi" })); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.1.normal.js index 757ad311385..bd2f503d949 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -103,8 +102,7 @@ function _createSuper(Derived) { // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts var React = require('react'); -var obj = { -}; +var obj = {}; var obj1 = { x: 2 }; @@ -131,11 +129,9 @@ var OverWriteAttr = /*#__PURE__*/ function(_Component) { return OverWriteAttr; }(React.Component); // OK -var x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj, { +var x = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj, { y: true, overwrite: "hi" }, obj1)); -var x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({ -}, obj1, obj3)); +var x1 = /*#__PURE__*/ React.createElement(OverWriteAttr, _extends({}, obj1, obj3)); export { }; diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.2.minified.js index dc943c75d6b..c089eb88971 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution8x_es5.2.minified.js @@ -43,8 +43,7 @@ var React = require("react"), obj1 = { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,13 +74,10 @@ var React = require("react"), obj1 = { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), OverWriteAttr; }(React.Component); -React.createElement(OverWriteAttr, _extends({ -}, { -}, { +React.createElement(OverWriteAttr, _extends({}, {}, { y: !0, overwrite: "hi" -}, obj1)), React.createElement(OverWriteAttr, _extends({ -}, obj1, { +}, obj1)), React.createElement(OverWriteAttr, _extends({}, obj1, { y: !0, overwrite: "hi" })); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.1.normal.js index 3db007143ff..c0cb47cf9b7 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.1.normal.js @@ -23,19 +23,15 @@ class Opt extends React.Component { return(/*#__PURE__*/ React.createElement("div", null, "Hello")); } } -const obj = { -}; +const obj = {}; const obj1 = { x: 2 }; // OK let p = /*#__PURE__*/ React.createElement(Opt, null); -let y = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj)); -let y1 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1)); -let y2 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1, { +let y = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj)); +let y1 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1)); +let y2 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1, { y: true })); let y3 = /*#__PURE__*/ React.createElement(Opt, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.2.minified.js index 03935b4aa44..62d2d1f1cdb 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es2015.2.minified.js @@ -16,11 +16,7 @@ class Opt extends React.Component { const obj1 = { x: 2 }; -React.createElement(Opt, null), React.createElement(Opt, _extends({ -}, { -})), React.createElement(Opt, _extends({ -}, obj1)), React.createElement(Opt, _extends({ -}, obj1, { +React.createElement(Opt, null), React.createElement(Opt, _extends({}, {})), React.createElement(Opt, _extends({}, obj1)), React.createElement(Opt, _extends({}, obj1, { y: !0 })), React.createElement(Opt, { x: 2 diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.1.normal.js index 3f9f312e90e..126b2164bde 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.1.normal.js @@ -77,8 +77,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -121,19 +120,15 @@ var Opt = /*#__PURE__*/ function(_Component) { ]); return Opt; }(React.Component); -var obj = { -}; +var obj = {}; var obj1 = { x: 2 }; // OK var p = /*#__PURE__*/ React.createElement(Opt, null); -var y = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj)); -var y1 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1)); -var y2 = /*#__PURE__*/ React.createElement(Opt, _extends({ -}, obj1, { +var y = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj)); +var y1 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1)); +var y2 = /*#__PURE__*/ React.createElement(Opt, _extends({}, obj1, { y: true })); var y3 = /*#__PURE__*/ React.createElement(Opt, { diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.2.minified.js index 99d0d8c0d2d..8ecb2eafcf5 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution9x_es5.2.minified.js @@ -41,8 +41,7 @@ var React = require("react"), Opt = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -75,11 +74,7 @@ var React = require("react"), Opt = function(_Component) { }(React.Component), obj1 = { x: 2 }; -React.createElement(Opt, null), React.createElement(Opt, _extends({ -}, { -})), React.createElement(Opt, _extends({ -}, obj1)), React.createElement(Opt, _extends({ -}, obj1, { +React.createElement(Opt, null), React.createElement(Opt, _extends({}, {})), React.createElement(Opt, _extends({}, obj1)), React.createElement(Opt, _extends({}, obj1, { y: !0 })), React.createElement(Opt, { x: 2 diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.1.normal.js index 934953f59bb..c32c7d58021 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.1.normal.js @@ -23,5 +23,4 @@ function TodoListNoError({ todos }) { return(/*#__PURE__*/ React.createElement("div", null)); } let x; -/*#__PURE__*/ React.createElement(TodoList, _extends({ -}, x)); +/*#__PURE__*/ React.createElement(TodoList, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.2.minified.js index 544a1d7a5b0..c9e1b659260 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es2015.2.minified.js @@ -10,5 +10,4 @@ function _extends() { let x; React.createElement(function({ todos }) { return React.createElement("div", null); -}, _extends({ -}, x)); +}, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.1.normal.js index a43b96a2e7f..d052c97664f 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.1.normal.js @@ -25,5 +25,4 @@ function TodoListNoError(param) { return(/*#__PURE__*/ React.createElement("div", null)); } var x; -/*#__PURE__*/ React.createElement(TodoList, _extends({ -}, x)); +/*#__PURE__*/ React.createElement(TodoList, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.2.minified.js index 1c5d7a80eef..11a49d7c8f0 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidTypex_es5.2.minified.js @@ -10,5 +10,4 @@ function _extends() { } React.createElement(function(param) { return param.todos, React.createElement("div", null); -}, _extends({ -}, x)); +}, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.1.normal.js index 8891d55edc5..3e204f8ab42 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.1.normal.js @@ -19,5 +19,4 @@ function TodoList({ todos }) { return(/*#__PURE__*/ React.createElement("div", null)); } let x; -/*#__PURE__*/ React.createElement(TodoList, _extends({ -}, x)); +/*#__PURE__*/ React.createElement(TodoList, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.2.minified.js index 544a1d7a5b0..c9e1b659260 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es2015.2.minified.js @@ -10,5 +10,4 @@ function _extends() { let x; React.createElement(function({ todos }) { return React.createElement("div", null); -}, _extends({ -}, x)); +}, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.1.normal.js index b176eee04fe..2e3ffbf8daf 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.1.normal.js @@ -20,5 +20,4 @@ function TodoList(param) { return(/*#__PURE__*/ React.createElement("div", null)); } var x; -/*#__PURE__*/ React.createElement(TodoList, _extends({ -}, x)); +/*#__PURE__*/ React.createElement(TodoList, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.2.minified.js index 1c5d7a80eef..11a49d7c8f0 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenx_es5.2.minified.js @@ -10,5 +10,4 @@ function _extends() { } React.createElement(function(param) { return param.todos, React.createElement("div", null); -}, _extends({ -}, x)); +}, _extends({}, x)); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.1.normal.js index dfc8ffcc1a3..6695b99e655 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.1.normal.js @@ -33,37 +33,28 @@ let obj2 = { let defaultObj; // OK const c1 = /*#__PURE__*/ React.createElement(OneThing, null); -const c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj)); -const c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, { -})); -const c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj1, obj)); -const c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj1, { +const c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj)); +const c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, {})); +const c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj1, obj)); +const c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj1, { yy: 42 }, { yy1: "hi" })); -const c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj1, { +const c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj1, { yy: 10000, yy1: "true" })); -const c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, defaultObj, { +const c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, defaultObj, { yy: true }, obj)); // No error. should pick second overload const c8 = /*#__PURE__*/ React.createElement(OneThing, { "ignore-prop": 100 }); -const c9 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, { +const c9 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, { "ignore-prop": 200 })); -const c10 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj2, { +const c10 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj2, { yy1: "boo" })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.2.minified.js index 46f9398651d..c66b0d20f27 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es2015.2.minified.js @@ -14,29 +14,20 @@ let obj = { }, obj1 = { yy: !0 }, defaultObj; -React.createElement(OneThing, null), React.createElement(OneThing, _extends({ -}, obj)), React.createElement(OneThing, _extends({ -}, { -})), React.createElement(OneThing, _extends({ -}, obj1, obj)), React.createElement(OneThing, _extends({ -}, obj1, { +React.createElement(OneThing, null), React.createElement(OneThing, _extends({}, obj)), React.createElement(OneThing, _extends({}, {})), React.createElement(OneThing, _extends({}, obj1, obj)), React.createElement(OneThing, _extends({}, obj1, { yy: 42 }, { yy1: "hi" -})), React.createElement(OneThing, _extends({ -}, obj1, { +})), React.createElement(OneThing, _extends({}, obj1, { yy: 10000, yy1: "true" -})), React.createElement(OneThing, _extends({ -}, defaultObj, { +})), React.createElement(OneThing, _extends({}, defaultObj, { yy: !0 }, obj)), React.createElement(OneThing, { "ignore-prop": 100 -}), React.createElement(OneThing, _extends({ -}, { +}), React.createElement(OneThing, _extends({}, { "ignore-prop": 200 -})), React.createElement(OneThing, _extends({ -}, { +})), React.createElement(OneThing, _extends({}, { yy: 500, "ignore-prop": "hello" }, { diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.1.normal.js index ce711a223ea..726f06c992d 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.1.normal.js @@ -33,37 +33,28 @@ var obj2 = { var defaultObj; // OK var c1 = /*#__PURE__*/ React.createElement(OneThing, null); -var c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj)); -var c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, { -})); -var c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj1, obj)); -var c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj1, { +var c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj)); +var c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, {})); +var c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj1, obj)); +var c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj1, { yy: 42 }, { yy1: "hi" })); -var c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj1, { +var c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj1, { yy: 10000, yy1: "true" })); -var c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, defaultObj, { +var c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, defaultObj, { yy: true }, obj)); // No error. should pick second overload var c8 = /*#__PURE__*/ React.createElement(OneThing, { "ignore-prop": 100 }); -var c9 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, { +var c9 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, { "ignore-prop": 200 })); -var c10 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj2, { +var c10 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj2, { yy1: "boo" })); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.2.minified.js index bb5e89ef14b..2d29ba26705 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2x_es5.2.minified.js @@ -13,29 +13,20 @@ var defaultObj, React = require("react"), obj = { }, obj1 = { yy: !0 }; -React.createElement(OneThing, null), React.createElement(OneThing, _extends({ -}, obj)), React.createElement(OneThing, _extends({ -}, { -})), React.createElement(OneThing, _extends({ -}, obj1, obj)), React.createElement(OneThing, _extends({ -}, obj1, { +React.createElement(OneThing, null), React.createElement(OneThing, _extends({}, obj)), React.createElement(OneThing, _extends({}, {})), React.createElement(OneThing, _extends({}, obj1, obj)), React.createElement(OneThing, _extends({}, obj1, { yy: 42 }, { yy1: "hi" -})), React.createElement(OneThing, _extends({ -}, obj1, { +})), React.createElement(OneThing, _extends({}, obj1, { yy: 10000, yy1: "true" -})), React.createElement(OneThing, _extends({ -}, defaultObj, { +})), React.createElement(OneThing, _extends({}, defaultObj, { yy: !0 }, obj)), React.createElement(OneThing, { "ignore-prop": 100 -}), React.createElement(OneThing, _extends({ -}, { +}), React.createElement(OneThing, _extends({}, { "ignore-prop": 200 -})), React.createElement(OneThing, _extends({ -}, { +})), React.createElement(OneThing, _extends({}, { yy: 500, "ignore-prop": "hello" }, { diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.1.normal.js index efa2ee926a9..e640a59b5b9 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.1.normal.js @@ -19,13 +19,11 @@ const two2 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, { yy: 100, yy1: "hello" }); -const two3 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2)); // it is just any so we allow it to pass through +const two3 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({}, obj2)); // it is just any so we allow it to pass through const two4 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({ yy: 1000 }, obj2)); // it is just any so we allow it to pass through -const two5 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2, { +const two5 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({}, obj2, { yy: 1000 })); // it is just any so we allow it to pass through // OK @@ -36,7 +34,6 @@ const three1 = /*#__PURE__*/ React.createElement(ThreeThing, { const three2 = /*#__PURE__*/ React.createElement(ThreeThing, { y2: "Bye" }); -const three3 = /*#__PURE__*/ React.createElement(ThreeThing, _extends({ -}, obj2, { +const three3 = /*#__PURE__*/ React.createElement(ThreeThing, _extends({}, obj2, { y2: 10 })); // it is just any so we allow it to pass through diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.2.minified.js index 6b56c241dde..3e93aaf2374 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es2015.2.minified.js @@ -11,18 +11,15 @@ let obj2; React.createElement(ZeroThingOrTwoThing, null), React.createElement(ZeroThingOrTwoThing, { yy: 100, yy1: "hello" -}), React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({ +}), React.createElement(ZeroThingOrTwoThing, _extends({}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({ yy: 1000 -}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2, { +}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({}, obj2, { yy: 1000 })), React.createElement(ThreeThing, { yy: 99, yy1: "hello world" }), React.createElement(ThreeThing, { y2: "Bye" -}), React.createElement(ThreeThing, _extends({ -}, obj2, { +}), React.createElement(ThreeThing, _extends({}, obj2, { y2: 10 })); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.1.normal.js index 1707b04742b..be650df8abc 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.1.normal.js @@ -19,13 +19,11 @@ var two2 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, { yy: 100, yy1: "hello" }); -var two3 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2)); // it is just any so we allow it to pass through +var two3 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({}, obj2)); // it is just any so we allow it to pass through var two4 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({ yy: 1000 }, obj2)); // it is just any so we allow it to pass through -var two5 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2, { +var two5 = /*#__PURE__*/ React.createElement(ZeroThingOrTwoThing, _extends({}, obj2, { yy: 1000 })); // it is just any so we allow it to pass through // OK @@ -36,7 +34,6 @@ var three1 = /*#__PURE__*/ React.createElement(ThreeThing, { var three2 = /*#__PURE__*/ React.createElement(ThreeThing, { y2: "Bye" }); -var three3 = /*#__PURE__*/ React.createElement(ThreeThing, _extends({ -}, obj2, { +var three3 = /*#__PURE__*/ React.createElement(ThreeThing, _extends({}, obj2, { y2: 10 })); // it is just any so we allow it to pass through diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.2.minified.js index 8afb05e87f3..35c75a2bc46 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3x_es5.2.minified.js @@ -11,18 +11,15 @@ function _extends() { React.createElement(ZeroThingOrTwoThing, null), React.createElement(ZeroThingOrTwoThing, { yy: 100, yy1: "hello" -}), React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({ +}), React.createElement(ZeroThingOrTwoThing, _extends({}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({ yy: 1000 -}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({ -}, obj2, { +}, obj2)), React.createElement(ZeroThingOrTwoThing, _extends({}, obj2, { yy: 1000 })), React.createElement(ThreeThing, { yy: 99, yy1: "hello world" }), React.createElement(ThreeThing, { y2: "Bye" -}), React.createElement(ThreeThing, _extends({ -}, obj2, { +}), React.createElement(ThreeThing, _extends({}, obj2, { y2: 10 })); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.1.normal.js index 5defdd1f2f4..22dab54a8ff 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.1.normal.js @@ -31,28 +31,22 @@ const c0 = /*#__PURE__*/ React.createElement(OneThing, { const c1 = /*#__PURE__*/ React.createElement(OneThing, { yy: 10 }); // missing property; -const c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +const c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { yy1: true })); // type incompatible; -const c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +const c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { extra: "extra attr" })); // This is OK because all attribute are spread -const c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +const c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { y1: 10000 })); // extra property; -const c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +const c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { yy: true })); // type incompatible; -const c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj2, { +const c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj2, { extra: "extra attr" })); // Should error as there is extra attribute that doesn't match any. Current it is not -const c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj2, { +const c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj2, { yy: true })); // Should error as there is extra attribute that doesn't match any. Current it is not // Error diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.2.minified.js index 774890815f1..0a1b59c5bce 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es2015.2.minified.js @@ -16,23 +16,17 @@ React.createElement(OneThing, { extraProp: !0 }), React.createElement(OneThing, { yy: 10 -}), React.createElement(OneThing, _extends({ -}, obj, { +}), React.createElement(OneThing, _extends({}, obj, { yy1: !0 -})), React.createElement(OneThing, _extends({ -}, obj, { +})), React.createElement(OneThing, _extends({}, obj, { extra: "extra attr" -})), React.createElement(OneThing, _extends({ -}, obj, { +})), React.createElement(OneThing, _extends({}, obj, { y1: 10000 -})), React.createElement(OneThing, _extends({ -}, obj, { +})), React.createElement(OneThing, _extends({}, obj, { yy: !0 -})), React.createElement(OneThing, _extends({ -}, obj2, { +})), React.createElement(OneThing, _extends({}, obj2, { extra: "extra attr" -})), React.createElement(OneThing, _extends({ -}, obj2, { +})), React.createElement(OneThing, _extends({}, obj2, { yy: !0 })), React.createElement(TestingOneThing, { "extra-data": !0 diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.1.normal.js index 874022ff1c9..9292ba29d0b 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.1.normal.js @@ -31,28 +31,22 @@ var c0 = /*#__PURE__*/ React.createElement(OneThing, { var c1 = /*#__PURE__*/ React.createElement(OneThing, { yy: 10 }); // missing property; -var c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +var c2 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { yy1: true })); // type incompatible; -var c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +var c3 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { extra: "extra attr" })); // This is OK because all attribute are spread -var c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +var c4 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { y1: 10000 })); // extra property; -var c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj, { +var c5 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj, { yy: true })); // type incompatible; -var c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj2, { +var c6 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj2, { extra: "extra attr" })); // Should error as there is extra attribute that doesn't match any. Current it is not -var c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({ -}, obj2, { +var c7 = /*#__PURE__*/ React.createElement(OneThing, _extends({}, obj2, { yy: true })); // Should error as there is extra attribute that doesn't match any. Current it is not // Error diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.2.minified.js index 366394b632a..c875cd30c71 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4x_es5.2.minified.js @@ -15,23 +15,17 @@ React.createElement(OneThing, { extraProp: !0 }), React.createElement(OneThing, { yy: 10 -}), React.createElement(OneThing, _extends({ -}, obj, { +}), React.createElement(OneThing, _extends({}, obj, { yy1: !0 -})), React.createElement(OneThing, _extends({ -}, obj, { +})), React.createElement(OneThing, _extends({}, obj, { extra: "extra attr" -})), React.createElement(OneThing, _extends({ -}, obj, { +})), React.createElement(OneThing, _extends({}, obj, { y1: 10000 -})), React.createElement(OneThing, _extends({ -}, obj, { +})), React.createElement(OneThing, _extends({}, obj, { yy: !0 -})), React.createElement(OneThing, _extends({ -}, obj2, { +})), React.createElement(OneThing, _extends({}, obj2, { extra: "extra attr" -})), React.createElement(OneThing, _extends({ -}, obj2, { +})), React.createElement(OneThing, _extends({}, obj2, { yy: !0 })), React.createElement(TestingOneThing, { "extra-data": !0 diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.1.normal.js index ba24f4f8dbb..0baf9910e2d 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.1.normal.js @@ -27,8 +27,7 @@ let obj1 = { to: "boo" }; let obj2 = { - onClick: ()=>{ - } + onClick: ()=>{} }; let obj3; export function MainButton(props) { @@ -41,44 +40,32 @@ export function MainButton(props) { // Error const b0 = /*#__PURE__*/ React.createElement(MainButton, { to: "/some/path", - onClick: (e)=>{ - } + onClick: (e)=>{} }, "GO"); // extra property; const b1 = /*#__PURE__*/ React.createElement(MainButton, _extends({ - onClick: (e)=>{ - } + onClick: (e)=>{} }, obj0), "Hello world"); // extra property; -const b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +const b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { to: "10000" }, obj2)); // extra property -const b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +const b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { to: "10000" }, { - onClick: (k)=>{ - } + onClick: (k)=>{} })); // extra property -const b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj3, { +const b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj3, { to: true })); // Should error because Incorrect type; but attributes are any so everything is allowed -const b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick (e) { - } +const b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick (e) {} }, obj0)); // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes -const b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick (e) { - } +const b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick (e) {} }, { children: 10 })); // incorrect type for optional attribute -const b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick (e) { - } +const b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick (e) {} }, { children: "hello", className: true diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.2.minified.js index 710bc732142..046eee12160 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es2015.2.minified.js @@ -16,40 +16,27 @@ export function MainButton(props) { } React.createElement(MainButton, { to: "/some/path", - onClick: (e)=>{ - } + onClick: (e)=>{} }, "GO"), React.createElement(MainButton, _extends({ - onClick: (e)=>{ - } -}, obj0), "Hello world"), React.createElement(MainButton, _extends({ -}, { + onClick: (e)=>{} +}, obj0), "Hello world"), React.createElement(MainButton, _extends({}, { to: "10000" }, { - onClick: ()=>{ - } -})), React.createElement(MainButton, _extends({ -}, { + onClick: ()=>{} +})), React.createElement(MainButton, _extends({}, { to: "10000" }, { - onClick: (k)=>{ - } -})), React.createElement(MainButton, _extends({ -}, obj3, { + onClick: (k)=>{} +})), React.createElement(MainButton, _extends({}, obj3, { to: !0 -})), React.createElement(MainButton, _extends({ -}, { - onClick (e) { - } -}, obj0)), React.createElement(MainButton, _extends({ -}, { - onClick (e) { - } +})), React.createElement(MainButton, _extends({}, { + onClick (e) {} +}, obj0)), React.createElement(MainButton, _extends({}, { + onClick (e) {} }, { children: 10 -})), React.createElement(MainButton, _extends({ -}, { - onClick (e) { - } +})), React.createElement(MainButton, _extends({}, { + onClick (e) {} }, { children: "hello", className: !0 diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.1.normal.js index 9c3ff01b938..d41b128c9d8 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.1.normal.js @@ -27,8 +27,7 @@ var obj1 = { to: "boo" }; var obj2 = { - onClick: function() { - } + onClick: function() {} }; var obj3; export function MainButton(props) { @@ -41,44 +40,32 @@ export function MainButton(props) { // Error var b0 = /*#__PURE__*/ React.createElement(MainButton, { to: "/some/path", - onClick: function(e) { - } + onClick: function(e) {} }, "GO"); // extra property; var b1 = /*#__PURE__*/ React.createElement(MainButton, _extends({ - onClick: function(e) { - } + onClick: function(e) {} }, obj0), "Hello world"); // extra property; -var b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +var b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { to: "10000" }, obj2)); // extra property -var b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +var b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { to: "10000" }, { - onClick: function(k) { - } + onClick: function(k) {} })); // extra property -var b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj3, { +var b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj3, { to: true })); // Should error because Incorrect type; but attributes are any so everything is allowed -var b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick: function onClick(e) { - } +var b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick: function onClick(e) {} }, obj0)); // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes -var b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick: function onClick(e) { - } +var b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick: function onClick(e) {} }, { children: 10 })); // incorrect type for optional attribute -var b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick: function onClick(e) { - } +var b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick: function onClick(e) {} }, { children: "hello", className: true diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.2.minified.js index 586996d06a2..a02ed733e54 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload5x_es5.2.minified.js @@ -15,40 +15,27 @@ export function MainButton(props) { } React.createElement(MainButton, { to: "/some/path", - onClick: function(e) { - } + onClick: function(e) {} }, "GO"), React.createElement(MainButton, _extends({ - onClick: function(e) { - } -}, obj0), "Hello world"), React.createElement(MainButton, _extends({ -}, { + onClick: function(e) {} +}, obj0), "Hello world"), React.createElement(MainButton, _extends({}, { to: "10000" }, { - onClick: function() { - } -})), React.createElement(MainButton, _extends({ -}, { + onClick: function() {} +})), React.createElement(MainButton, _extends({}, { to: "10000" }, { - onClick: function(k) { - } -})), React.createElement(MainButton, _extends({ -}, obj3, { + onClick: function(k) {} +})), React.createElement(MainButton, _extends({}, obj3, { to: !0 -})), React.createElement(MainButton, _extends({ -}, { - onClick: function(e) { - } -}, obj0)), React.createElement(MainButton, _extends({ -}, { - onClick: function(e) { - } +})), React.createElement(MainButton, _extends({}, { + onClick: function(e) {} +}, obj0)), React.createElement(MainButton, _extends({}, { + onClick: function(e) {} }, { children: 10 -})), React.createElement(MainButton, _extends({ -}, { - onClick: function(e) { - } +})), React.createElement(MainButton, _extends({}, { + onClick: function(e) {} }, { children: "hello", className: !0 diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.1.normal.js index 001a45bb4b4..9fc72337821 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.1.normal.js @@ -25,8 +25,7 @@ let obj = { }; let obj1; let obj2 = { - onClick: ()=>{ - } + onClick: ()=>{} }; export function MainButton(props) { const linkProps = props; @@ -40,33 +39,24 @@ const b0 = /*#__PURE__*/ React.createElement(MainButton, { to: "/some/path" }, "GO"); const b1 = /*#__PURE__*/ React.createElement(MainButton, { - onClick: (e)=>{ - } + onClick: (e)=>{} }, "Hello world"); -const b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj)); -const b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +const b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj)); +const b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { to: 10000 }, obj)); -const b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj1)); // any; just pick the first overload -const b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj1, { +const b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj1)); // any; just pick the first overload +const b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj1, { to: "/to/somewhere" })); // should pick the second overload -const b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj2)); -const b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +const b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj2)); +const b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { onClick: ()=>{ console.log("hi"); } })); -const b8 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick () { - } +const b8 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick () {} })); // OK; method declaration get retained (See GitHub #13365) const b9 = /*#__PURE__*/ React.createElement(MainButton, { to: "/some/path", @@ -77,8 +67,7 @@ const b10 = /*#__PURE__*/ React.createElement(MainButton, { children: "hi" }); const b11 = /*#__PURE__*/ React.createElement(MainButton, { - onClick: (e)=>{ - }, + onClick: (e)=>{}, className: "hello", "data-format": true }, "Hello world"); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.2.minified.js index 733ac129fc8..ac1ae2e4de5 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es2015.2.minified.js @@ -18,29 +18,19 @@ export function MainButton(props) { React.createElement(MainButton, { to: "/some/path" }, "GO"), React.createElement(MainButton, { - onClick: (e)=>{ - } -}, "Hello world"), React.createElement(MainButton, _extends({ -}, obj)), React.createElement(MainButton, _extends({ -}, { + onClick: (e)=>{} +}, "Hello world"), React.createElement(MainButton, _extends({}, obj)), React.createElement(MainButton, _extends({}, { to: 10000 -}, obj)), React.createElement(MainButton, _extends({ -}, obj1)), React.createElement(MainButton, _extends({ -}, obj1, { +}, obj)), React.createElement(MainButton, _extends({}, obj1)), React.createElement(MainButton, _extends({}, obj1, { to: "/to/somewhere" -})), React.createElement(MainButton, _extends({ -}, { - onClick: ()=>{ - } -})), React.createElement(MainButton, _extends({ -}, { +})), React.createElement(MainButton, _extends({}, { + onClick: ()=>{} +})), React.createElement(MainButton, _extends({}, { onClick: ()=>{ console.log("hi"); } -})), React.createElement(MainButton, _extends({ -}, { - onClick () { - } +})), React.createElement(MainButton, _extends({}, { + onClick () {} })), React.createElement(MainButton, { to: "/some/path", "extra-prop": !0 @@ -48,8 +38,7 @@ React.createElement(MainButton, { to: "/some/path", children: "hi" }), React.createElement(MainButton, { - onClick: (e)=>{ - }, + onClick: (e)=>{}, className: "hello", "data-format": !0 }, "Hello world"), React.createElement(MainButton, { diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.1.normal.js index a3cd88fe1c2..da193c7e280 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.1.normal.js @@ -25,8 +25,7 @@ var obj = { }; var obj1; var obj2 = { - onClick: function() { - } + onClick: function() {} }; export function MainButton(props) { var linkProps = props; @@ -40,33 +39,24 @@ var b0 = /*#__PURE__*/ React.createElement(MainButton, { to: "/some/path" }, "GO"); var b1 = /*#__PURE__*/ React.createElement(MainButton, { - onClick: function(e) { - } + onClick: function(e) {} }, "Hello world"); -var b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj)); -var b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +var b2 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj)); +var b3 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { to: 10000 }, obj)); -var b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj1)); // any; just pick the first overload -var b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj1, { +var b4 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj1)); // any; just pick the first overload +var b5 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj1, { to: "/to/somewhere" })); // should pick the second overload -var b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, obj2)); -var b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { +var b6 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, obj2)); +var b7 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { onClick: function() { console.log("hi"); } })); -var b8 = /*#__PURE__*/ React.createElement(MainButton, _extends({ -}, { - onClick: function onClick() { - } +var b8 = /*#__PURE__*/ React.createElement(MainButton, _extends({}, { + onClick: function onClick() {} })); // OK; method declaration get retained (See GitHub #13365) var b9 = /*#__PURE__*/ React.createElement(MainButton, { to: "/some/path", @@ -77,8 +67,7 @@ var b10 = /*#__PURE__*/ React.createElement(MainButton, { children: "hi" }); var b11 = /*#__PURE__*/ React.createElement(MainButton, { - onClick: function(e) { - }, + onClick: function(e) {}, className: "hello", "data-format": true }, "Hello world"); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.2.minified.js index 134cfb35a7a..6191b3f4018 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload6x_es5.2.minified.js @@ -17,29 +17,19 @@ export function MainButton(props) { React.createElement(MainButton, { to: "/some/path" }, "GO"), React.createElement(MainButton, { - onClick: function(e) { - } -}, "Hello world"), React.createElement(MainButton, _extends({ -}, obj)), React.createElement(MainButton, _extends({ -}, { + onClick: function(e) {} +}, "Hello world"), React.createElement(MainButton, _extends({}, obj)), React.createElement(MainButton, _extends({}, { to: 10000 -}, obj)), React.createElement(MainButton, _extends({ -}, obj1)), React.createElement(MainButton, _extends({ -}, obj1, { +}, obj)), React.createElement(MainButton, _extends({}, obj1)), React.createElement(MainButton, _extends({}, obj1, { to: "/to/somewhere" -})), React.createElement(MainButton, _extends({ -}, { - onClick: function() { - } -})), React.createElement(MainButton, _extends({ -}, { +})), React.createElement(MainButton, _extends({}, { + onClick: function() {} +})), React.createElement(MainButton, _extends({}, { onClick: function() { console.log("hi"); } -})), React.createElement(MainButton, _extends({ -}, { - onClick: function() { - } +})), React.createElement(MainButton, _extends({}, { + onClick: function() {} })), React.createElement(MainButton, { to: "/some/path", "extra-prop": !0 @@ -47,8 +37,7 @@ React.createElement(MainButton, { to: "/some/path", children: "hi" }), React.createElement(MainButton, { - onClick: function(e) { - }, + onClick: function(e) {}, className: "hello", "data-format": !0 }, "Hello world"), React.createElement(MainButton, { diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.1.normal.js index 70abb9e4eee..1444261c566 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.2.minified.js index ac44a10df79..df59ad054da 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents2x_es5.2.minified.js @@ -36,8 +36,7 @@ var BigGreeter = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.1.normal.js index 254f72a21af..eb9cd700aa3 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.1.normal.js @@ -25,8 +25,7 @@ function Baz(key1, value) { key1: key1, value: value }); - let a1 = /*#__PURE__*/ React.createElement(ComponentWithTwoAttributes, _extends({ - }, { + let a1 = /*#__PURE__*/ React.createElement(ComponentWithTwoAttributes, _extends({}, { key1, value: value }, { @@ -52,7 +51,6 @@ let i = /*#__PURE__*/ React.createElement(InferParamComponent, { 3, 4 ], - selectHandler: (val)=>{ - } + selectHandler: (val)=>{} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.2.minified.js index d9857f04109..c8160c2b3b1 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es2015.2.minified.js @@ -15,7 +15,6 @@ React.createElement(InferParamComponent, { 3, 4 ], - selectHandler: (val)=>{ - } + selectHandler: (val)=>{} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.1.normal.js index 4b04095f0cf..72b12c6c41c 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.1.normal.js @@ -25,8 +25,7 @@ function Baz(key1, value) { key1: key1, value: value }); - var a1 = /*#__PURE__*/ React.createElement(ComponentWithTwoAttributes, _extends({ - }, { + var a1 = /*#__PURE__*/ React.createElement(ComponentWithTwoAttributes, _extends({}, { key1: key1, value: value }, { @@ -52,7 +51,6 @@ var i = /*#__PURE__*/ React.createElement(InferParamComponent, { 3, 4 ], - selectHandler: function(val) { - } + selectHandler: function(val) {} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.2.minified.js index 27ed126d0f8..9890d437e4f 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1x_es5.2.minified.js @@ -14,7 +14,6 @@ require("react").createElement(InferParamComponent, { 3, 4 ], - selectHandler: function(val) { - } + selectHandler: function(val) {} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.1.normal.js index e28f1b3083d..fb2a7f0bde7 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.1.normal.js @@ -21,15 +21,13 @@ function _extends() { const React = require('react'); // Error function Bar(arg) { - let a1 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({ - }, arg, { + let a1 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({}, arg, { "ignore-prop": 10 })); } // Error function Baz(arg) { - let a0 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({ - }, arg)); + let a0 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({}, arg)); } // Error function createLink(func) { @@ -45,7 +43,6 @@ let i = /*#__PURE__*/ React.createElement(InferParamComponent, { 3, 4 ], - selectHandler: (val)=>{ - } + selectHandler: (val)=>{} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.2.minified.js index d9857f04109..c8160c2b3b1 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es2015.2.minified.js @@ -15,7 +15,6 @@ React.createElement(InferParamComponent, { 3, 4 ], - selectHandler: (val)=>{ - } + selectHandler: (val)=>{} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.1.normal.js index 91f86178084..fc045fc6ca7 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.1.normal.js @@ -21,15 +21,13 @@ function _extends() { var React = require('react'); // Error function Bar(arg) { - var a1 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({ - }, arg, { + var a1 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({}, arg, { "ignore-prop": 10 })); } // Error function Baz(arg) { - var a0 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({ - }, arg)); + var a0 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({}, arg)); } // Error function createLink(func) { @@ -45,7 +43,6 @@ var i = /*#__PURE__*/ React.createElement(InferParamComponent, { 3, 4 ], - selectHandler: function(val) { - } + selectHandler: function(val) {} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.2.minified.js index 27ed126d0f8..9890d437e4f 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2x_es5.2.minified.js @@ -14,7 +14,6 @@ require("react").createElement(InferParamComponent, { 3, 4 ], - selectHandler: function(val) { - } + selectHandler: function(val) {} }); export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es2015.1.normal.js index 8f8e544ca1b..b4a75740f7a 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es2015.1.normal.js @@ -21,28 +21,22 @@ function _extends() { const React = require('react'); // OK function Baz(arg1, arg2) { - let a0 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg1, { + let a0 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg1, { a: "hello", "ignore-prop": true })); - let a1 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2, { + let a1 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2, { "ignore-pro": "hello world" })); - let a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2)); - let a3 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg1, { + let a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2)); + let a3 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg1, { "ignore-prop": true })); let a4 = /*#__PURE__*/ React.createElement(OverloadComponent, null); - let a5 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2, { + let a5 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2, { "ignore-prop": "hello" }, arg1)); - let a6 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2, { + let a6 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2, { "ignore-prop": true }, arg1)); } @@ -51,8 +45,7 @@ function createLink(func) { func: func }); let o1 = /*#__PURE__*/ React.createElement(Link, { - func: (a, b)=>{ - } + func: (a, b)=>{} }); } export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es5.1.normal.js index 52c80e33a93..83b3559fee6 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments3x_es5.1.normal.js @@ -21,28 +21,22 @@ function _extends() { var React = require('react'); // OK function Baz(arg1, arg2) { - var a0 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg1, { + var a0 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg1, { a: "hello", "ignore-prop": true })); - var a1 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2, { + var a1 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2, { "ignore-pro": "hello world" })); - var a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2)); - var a3 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg1, { + var a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2)); + var a3 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg1, { "ignore-prop": true })); var a4 = /*#__PURE__*/ React.createElement(OverloadComponent, null); - var a5 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2, { + var a5 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2, { "ignore-prop": "hello" }, arg1)); - var a6 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg2, { + var a6 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg2, { "ignore-prop": true }, arg1)); } @@ -51,8 +45,7 @@ function createLink(func) { func: func }); var o1 = /*#__PURE__*/ React.createElement(Link, { - func: function(a, b) { - } + func: function(a, b) {} }); } export { }; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es2015.1.normal.js index dda920b774b..119f0ea1035 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es2015.1.normal.js @@ -24,8 +24,7 @@ function Baz(arg1, arg2) { let a0 = /*#__PURE__*/ React.createElement(OverloadComponent, { a: arg1.b }); - let a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg1, { + let a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg1, { "ignore-prop": true })) // missing a ; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es5.1.normal.js index 765d11be452..e1026f07215 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments4x_es5.1.normal.js @@ -24,8 +24,7 @@ function Baz(arg1, arg2) { var a0 = /*#__PURE__*/ React.createElement(OverloadComponent, { a: arg1.b }); - var a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({ - }, arg1, { + var a2 = /*#__PURE__*/ React.createElement(OverloadComponent, _extends({}, arg1, { "ignore-prop": true })) // missing a ; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es2015.1.normal.js index e3ff5f05c7d..eae4eb26b9b 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es2015.1.normal.js @@ -20,28 +20,22 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts const React = require('react'); function createComponent(arg) { - let a1 = /*#__PURE__*/ React.createElement(Component, _extends({ - }, arg)); - let a2 = /*#__PURE__*/ React.createElement(Component, _extends({ - }, arg, { + let a1 = /*#__PURE__*/ React.createElement(Component, _extends({}, arg)); + let a2 = /*#__PURE__*/ React.createElement(Component, _extends({}, arg, { prop1: true })); } function Bar(arg) { - let a1 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({ - }, arg, { + let a1 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({}, arg, { "ignore-prop": "hi" })); // U is number - let a2 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({ - }, arg, { + let a2 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({}, arg, { "ignore-prop": 10 })); // U is number - let a3 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({ - }, arg, { + let a3 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({}, arg, { prop: "hello" })); // U is "hello" - let a4 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({ - }, arg, { + let a4 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({}, arg, { prop1: "hello" })); // U is "hello" } diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es5.1.normal.js index e0f5b17dfb8..91c334d6f80 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments5x_es5.1.normal.js @@ -20,28 +20,22 @@ function _extends() { // @libFiles: react.d.ts,lib.d.ts var React = require('react'); function createComponent(arg) { - var a1 = /*#__PURE__*/ React.createElement(Component, _extends({ - }, arg)); - var a2 = /*#__PURE__*/ React.createElement(Component, _extends({ - }, arg, { + var a1 = /*#__PURE__*/ React.createElement(Component, _extends({}, arg)); + var a2 = /*#__PURE__*/ React.createElement(Component, _extends({}, arg, { prop1: true })); } function Bar(arg) { - var a1 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({ - }, arg, { + var a1 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({}, arg, { "ignore-prop": "hi" })); // U is number - var a2 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({ - }, arg, { + var a2 = /*#__PURE__*/ React.createElement(ComponentSpecific1, _extends({}, arg, { "ignore-prop": 10 })); // U is number - var a3 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({ - }, arg, { + var a3 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({}, arg, { prop: "hello" })); // U is "hello" - var a4 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({ - }, arg, { + var a4 = /*#__PURE__*/ React.createElement(ComponentSpecific, _extends({}, arg, { prop1: "hello" })); // U is "hello" } diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.1.normal.js index 9d31fe36b3f..37b982f37f2 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.1.normal.js @@ -13,8 +13,7 @@ class RC2 extends React.Component { render() { return null; } - method() { - } + method() {} } class RC3 extends React.Component { render() { diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.2.minified.js index 67905b74e65..5f949c10eda 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es2015.2.minified.js @@ -8,8 +8,7 @@ class RC2 extends React.Component { render() { return null; } - method() { - } + method() {} } class RC3 extends React.Component { render() { diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.1.normal.js index 6ddc6c84b7d..7767840ef41 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -124,8 +123,7 @@ var RC2 = /*#__PURE__*/ function(_Component) { }, { key: "method", - value: function method() { - } + value: function method() {} } ]); return RC2; diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.2.minified.js index 0e473be6981..8f70f8f2ec3 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType3x_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -85,8 +84,7 @@ var React = require("react"), RC1 = function(_Component) { }, { key: "method", - value: function() { - } + value: function() {} } ]), RC2; }(React.Component), RC3 = function(_Component) { diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.1.normal.js index 786b1a714f1..22953086b1c 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.1.normal.js @@ -13,8 +13,7 @@ class RC2 extends React.Component { render() { return null; } - method() { - } + method() {} } class RC3 extends React.Component { render() { diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.2.minified.js index 46f79411535..c8628a4de36 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es2015.2.minified.js @@ -8,8 +8,7 @@ class RC2 extends React.Component { render() { return null; } - method() { - } + method() {} } class RC3 extends React.Component { render() { diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.1.normal.js index 470f5925a6c..ad5339df95b 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -124,8 +123,7 @@ var RC2 = /*#__PURE__*/ function(_Component) { }, { key: "method", - value: function method() { - } + value: function method() {} } ]); return RC2; diff --git a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.2.minified.js index e84ca1f9ab9..6223b8abb33 100644 --- a/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxUnionElementType4x_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -85,8 +84,7 @@ var React = require("react"), RC1 = function(_Component) { }, { key: "method", - value: function() { - } + value: function() {} } ]), RC2; }(React.Component), RC3 = function(_Component) { diff --git a/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.1.normal.js index 36bc44b0476..0ca8d588436 100644 --- a/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.2.minified.js index d7d50c4e34e..90f06a5b2fe 100644 --- a/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxUnionTypeComponent1x_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/tupleElementTypes2_es2015.1.normal.js b/crates/swc/tests/tsc-references/tupleElementTypes2_es2015.1.normal.js index 0a1a1a3ec0f..836474f7c3b 100644 --- a/crates/swc/tests/tsc-references/tupleElementTypes2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tupleElementTypes2_es2015.1.normal.js @@ -1,2 +1 @@ -function f([a, b]) { -} +function f([a, b]) {} diff --git a/crates/swc/tests/tsc-references/tupleElementTypes4_es2015.1.normal.js b/crates/swc/tests/tsc-references/tupleElementTypes4_es2015.1.normal.js index 746a87af1c6..a82f56d0880 100644 --- a/crates/swc/tests/tsc-references/tupleElementTypes4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/tupleElementTypes4_es2015.1.normal.js @@ -1,5 +1,4 @@ function f([a, b] = [ 0, undefined -]) { -} +]) {} diff --git a/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es2015.1.normal.js b/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es2015.1.normal.js index 77f82b83bcd..4d2d4ae5234 100644 --- a/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es2015.1.normal.js @@ -7,15 +7,12 @@ class C { } } class D { - static set x(v) { - } - static set x(v) { - } + static set x(v) {} + static set x(v) {} } class E { static get x() { return 1; } - static set x(v) { - } + static set x(v) {} } diff --git a/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.1.normal.js b/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.1.normal.js index 03774f9fd2e..ceb4db9d911 100644 --- a/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.1.normal.js @@ -40,8 +40,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, null, [ { key: "x", - set: function set(v) { - } // error + set: function set(v) {} // error } ]); return D; @@ -57,8 +56,7 @@ var E = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(v) { - } + set: function set(v) {} } ]); return E; diff --git a/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.2.minified.js b/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.2.minified.js index 92acefb0824..b912f286768 100644 --- a/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/twoAccessorsWithSameName2_es5.2.minified.js @@ -31,8 +31,7 @@ var C = function() { return _createClass(D, null, [ { key: "x", - set: function(v) { - } + set: function(v) {} } ]), D; }(), E = function() { @@ -46,8 +45,7 @@ var C = function() { get: function() { return 1; }, - set: function(v) { - } + set: function(v) {} } ]), E; }(); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.1.normal.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.1.normal.js index 80fa3d19186..8def5b6040b 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.1.normal.js @@ -9,13 +9,11 @@ var M; var b; var r3 = b.foo; // error var r4 = b.bar; - })(M2 || (M2 = { - })); + })(M2 || (M2 = {})); var a1; var r1 = a1.foo; var r2 = a1.bar; // error var b1; var r3 = b1.foo; var r4 = b1.bar; // error -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.2.minified.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.2.minified.js index d49c0c28c02..7d9a6cf8654 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es2015.2.minified.js @@ -2,7 +2,5 @@ var M; !function(M) { var a, b, a1, b1; let M2; - M2 || (M2 = { - }), a.foo, a.bar, b.foo, b.bar, a1.foo, a1.bar, b1.foo, b1.bar; -}(M || (M = { -})); + M2 || (M2 = {}), a.foo, a.bar, b.foo, b.bar, a1.foo, a1.bar, b1.foo, b1.bar; +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.1.normal.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.1.normal.js index 1032cff08d7..552a01ca813 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.1.normal.js @@ -9,13 +9,11 @@ var M; var b; var r3 = b.foo; // error var r4 = b.bar; - })(M2 || (M2 = { - })); + })(M2 || (M2 = {})); var a1; var r1 = a1.foo; var r2 = a1.bar; // error var b1; var r3 = b1.foo; var r4 = b1.bar; // error -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.2.minified.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.2.minified.js index ad91e3d6296..54618bd0865 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule2_es5.2.minified.js @@ -1,7 +1,5 @@ var M; !function(M) { var a, b, M2, a1, b1; - M2 || (M2 = { - }), a.foo, a.bar, b.foo, b.bar, a1.foo, a1.bar, b1.foo, b1.bar; -}(M || (M = { -})); + M2 || (M2 = {}), a.foo, a.bar, b.foo, b.bar, a1.foo, a1.bar, b1.foo, b1.bar; +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.1.normal.js index f160d085dea..ba60e21e711 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.1.normal.js @@ -6,5 +6,4 @@ var M2; var b; var r3 = b.foo; // error var r4 = b.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.2.minified.js index 2eafaf7b170..af5f6fd2997 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es2015.2.minified.js @@ -2,5 +2,4 @@ var M2; !function(M2) { var a, b; a.foo, a.bar, b.foo, b.bar; -}(M2 || (M2 = { -})); +}(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.1.normal.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.1.normal.js index f160d085dea..ba60e21e711 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.1.normal.js @@ -6,5 +6,4 @@ var M2; var b; var r3 = b.foo; // error var r4 = b.bar; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.2.minified.js b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.2.minified.js index 2eafaf7b170..af5f6fd2997 100644 --- a/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/twoInterfacesDifferentRootModule_es5.2.minified.js @@ -2,5 +2,4 @@ var M2; !function(M2) { var a, b; a.foo, a.bar, b.foo, b.bar; -}(M2 || (M2 = { -})); +}(M2 || (M2 = {})); diff --git a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.1.normal.js b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.1.normal.js index 5692f1e4f4e..d7758352ad0 100644 --- a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.1.normal.js @@ -9,5 +9,4 @@ var G; var r2 = a1(true); var r3 = a1(true, 2); var r4 = a1(1, true); -})(G || (G = { -})); +})(G || (G = {})); diff --git a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.2.minified.js b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.2.minified.js index 110d4c967b3..f6ed78c5cc0 100644 --- a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es2015.2.minified.js @@ -2,5 +2,4 @@ var a, G; a(), a(1), a(1, 2), (function(G) { var a1; a1(), a1(!0), a1(!0, 2), a1(1, !0); -})(G || (G = { -})); +})(G || (G = {})); diff --git a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.1.normal.js b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.1.normal.js index 5692f1e4f4e..d7758352ad0 100644 --- a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.1.normal.js @@ -9,5 +9,4 @@ var G; var r2 = a1(true); var r3 = a1(true, 2); var r4 = a1(1, true); -})(G || (G = { -})); +})(G || (G = {})); diff --git a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.2.minified.js b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.2.minified.js index 110d4c967b3..f6ed78c5cc0 100644 --- a/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/twoMergedInterfacesWithDifferingOverloads2_es5.2.minified.js @@ -2,5 +2,4 @@ var a, G; a(), a(1), a(1, 2), (function(G) { var a1; a1(), a1(!0), a1(!0, 2), a1(1, !0); -})(G || (G = { -})); +})(G || (G = {})); diff --git a/crates/swc/tests/tsc-references/typeAliases_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeAliases_es2015.1.normal.js index 3149511eea5..93e4f7f0692 100644 --- a/crates/swc/tests/tsc-references/typeAliases_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeAliases_es2015.1.normal.js @@ -30,8 +30,7 @@ var x14; var E; (function(E) { E[E["x"] = 10] = "x"; -})(E || (E = { -})); +})(E || (E = {})); f15(E.x).toLowerCase(); var x; f16(x); diff --git a/crates/swc/tests/tsc-references/typeAliases_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeAliases_es2015.2.minified.js index ee93b3b0cde..488e71d2a50 100644 --- a/crates/swc/tests/tsc-references/typeAliases_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeAliases_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, x13_1, x13_2, E, x; -foo13(x13_1, x13_2), foo13(x13_2, x13_1), (E = E || (E = { -}))[E.x = 10] = "x", f15(E.x).toLowerCase(), f16(x); +foo13(x13_1, x13_2), foo13(x13_2, x13_1), (E = E || (E = {}))[E.x = 10] = "x", f15(E.x).toLowerCase(), f16(x); diff --git a/crates/swc/tests/tsc-references/typeAliases_es5.1.normal.js b/crates/swc/tests/tsc-references/typeAliases_es5.1.normal.js index 72fe155bda1..81a2a7225cd 100644 --- a/crates/swc/tests/tsc-references/typeAliases_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeAliases_es5.1.normal.js @@ -37,8 +37,7 @@ var x14; var E; (function(E) { E[E["x"] = 10] = "x"; -})(E || (E = { -})); +})(E || (E = {})); f15(E.x).toLowerCase(); var x; f16(x); diff --git a/crates/swc/tests/tsc-references/typeAliases_es5.2.minified.js b/crates/swc/tests/tsc-references/typeAliases_es5.2.minified.js index e7321d23295..dd4559657a5 100644 --- a/crates/swc/tests/tsc-references/typeAliases_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeAliases_es5.2.minified.js @@ -4,5 +4,4 @@ var E, x13_1, x13_2, E, x, C7 = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C7); }; -foo13(x13_1, x13_2), foo13(x13_2, x13_1), (E = E || (E = { -}))[E.x = 10] = "x", f15(E.x).toLowerCase(), f16(x); +foo13(x13_1, x13_2), foo13(x13_2, x13_1), (E = E || (E = {}))[E.x = 10] = "x", f15(E.x).toLowerCase(), f16(x); diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures_es5.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures_es5.2.minified.js index 624f0d683fd..185dd48625c 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures_es5.2.minified.js @@ -13,8 +13,7 @@ new noParams(), new noParams(), new noParams(), new noGenericParams(""), new noG return n.substr(t * t); }), new someGenerics3(function() { return ""; -}), new someGenerics3(function() { -}), new someGenerics3(function() { +}), new someGenerics3(function() {}), new someGenerics3(function() { return 3; }), new someGenerics4(4, function() { return null; diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es2015.1.normal.js index c199e7f8d31..fb61274fda9 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es2015.1.normal.js @@ -1,20 +1,16 @@ // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +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) { -} +function someGenerics4(n, f) {} someGenerics4('', (x)=>'' ); // 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) { -} +function someGenerics5(n, f) {} someGenerics5('', (x)=>'' ); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} +function someGenerics6(a, b, c) {} someGenerics6((n)=>n , (n)=>n , (n)=>n diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es5.1.normal.js index 0c4caa358b1..4cf8b17c2ba 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceErrors_es5.1.normal.js @@ -1,22 +1,18 @@ // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +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) { -} +function someGenerics4(n, f) {} 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) { -} +function someGenerics5(n, f) {} 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) { -} +function someGenerics6(a, b, c) {} someGenerics6(function(n) { return n; }, function(n) { diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression1_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression1_es2015.2.minified.js index 56cab90b07e..3ace19aee2b 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression1_es2015.2.minified.js @@ -1,5 +1,4 @@ var _class; (function(x = class { -}) { -})(((_class = class { +}) {})(((_class = class { }).prop = "hello", _class)).length; diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression2_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression2_es2015.2.minified.js index 56cab90b07e..3ace19aee2b 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression2_es2015.2.minified.js @@ -1,5 +1,4 @@ var _class; (function(x = class { -}) { -})(((_class = class { +}) {})(((_class = class { }).prop = "hello", _class)).length; diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression3_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression3_es2015.2.minified.js index 8148dbcf5b7..35d11ce5f42 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithClassExpression3_es2015.2.minified.js @@ -1,6 +1,5 @@ (function(x = class { -}) { -})(class { +}) {})(class { constructor(){ this.prop = "hello"; } diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.1.normal.js index 0bdacbe39c4..31e5b7498bb 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.1.normal.js @@ -1,33 +1,28 @@ // Generic call with no parameters -function noParams() { -} +function noParams() {} noParams(); noParams(); noParams(); // Generic call with parameters but none use type parameter type -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams(''); // Valid noGenericParams(''); noGenericParams(''); // Error // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) {} someGenerics1(3, 4); // Valid someGenerics1(3, 4); // Error someGenerics1(3, 4); // Error someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type -function someGenerics2a(n) { -} +function someGenerics2a(n) {} someGenerics2a((n)=>n ); someGenerics2a((n)=>n ); someGenerics2a((n)=>n.substr(0) ); -function someGenerics2b(n) { -} +function someGenerics2b(n) {} someGenerics2b((n, x)=>n ); someGenerics2b((n, t)=>n @@ -35,8 +30,7 @@ someGenerics2b((n, t)=>n someGenerics2b((n, t)=>n.substr(t * 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) { -} +function someGenerics3(producer) {} someGenerics3(()=>'' ); // Error someGenerics3(()=>undefined @@ -44,8 +38,7 @@ someGenerics3(()=>undefined someGenerics3(()=>3 ); // 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) { -} +function someGenerics4(n, f) {} someGenerics4(4, ()=>null ); // Valid someGenerics4('', ()=>3 @@ -54,8 +47,7 @@ someGenerics4('', (x)=>'' ); // 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 -function someGenerics5(n, f) { -} +function someGenerics5(n, f) {} someGenerics5(4, ()=>null ); // Valid someGenerics5('', ()=>3 @@ -64,8 +56,7 @@ someGenerics5('', (x)=>'' ); // Error someGenerics5(null, null); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} +function someGenerics6(a, b, c) {} someGenerics6((n)=>n , (n)=>n , (n)=>n @@ -83,8 +74,7 @@ someGenerics6((n)=>n , (n)=>n ); // Generic call with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(a, b, c) { -} +function someGenerics7(a, b, c) {} someGenerics7((n)=>n , (n)=>n , (n)=>n diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.2.minified.js index 551cb8f73cf..9f273cbcebc 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es2015.2.minified.js @@ -1,24 +1,14 @@ var anyVar; -function noParams() { -} -function noGenericParams(n) { -} -function someGenerics1(n, m) { -} -function someGenerics2a(n) { -} -function someGenerics2b(n) { -} -function someGenerics3(producer) { -} -function someGenerics4(n, f) { -} -function someGenerics5(n, f) { -} -function someGenerics6(a, b, c) { -} -function someGenerics7(a, b, c) { -} +function noParams() {} +function noGenericParams(n) {} +function someGenerics1(n, m) {} +function someGenerics2a(n) {} +function someGenerics2b(n) {} +function someGenerics3(producer) {} +function someGenerics4(n, f) {} +function someGenerics5(n, f) {} +function someGenerics6(a, b, c) {} +function someGenerics7(a, b, c) {} function someGenerics9(a, b, c) { return null; } diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.1.normal.js index 7ad8509a6f8..76db3c310b7 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.1.normal.js @@ -1,25 +1,21 @@ // Generic call with no parameters -function noParams() { -} +function noParams() {} noParams(); noParams(); noParams(); // Generic call with parameters but none use type parameter type -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams(''); // Valid noGenericParams(''); noGenericParams(''); // Error // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) {} someGenerics1(3, 4); // Valid someGenerics1(3, 4); // Error someGenerics1(3, 4); // Error someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type -function someGenerics2a(n) { -} +function someGenerics2a(n) {} someGenerics2a(function(n) { return n; }); @@ -29,8 +25,7 @@ someGenerics2a(function(n) { someGenerics2a(function(n) { return n.substr(0); }); -function someGenerics2b(n) { -} +function someGenerics2b(n) {} someGenerics2b(function(n, x) { return n; }); @@ -41,8 +36,7 @@ someGenerics2b(function(n, t) { return n.substr(t * 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) { -} +function someGenerics3(producer) {} someGenerics3(function() { return ''; }); // Error @@ -53,8 +47,7 @@ someGenerics3(function() { return 3; }); // 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) { -} +function someGenerics4(n, f) {} someGenerics4(4, function() { return null; }); // Valid @@ -66,8 +59,7 @@ someGenerics4('', function(x) { }); // 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 -function someGenerics5(n, f) { -} +function someGenerics5(n, f) {} someGenerics5(4, function() { return null; }); // Valid @@ -79,8 +71,7 @@ someGenerics5('', function(x) { }); // Error someGenerics5(null, null); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} +function someGenerics6(a, b, c) {} someGenerics6(function(n) { return n; }, function(n) { @@ -110,8 +101,7 @@ someGenerics6(function(n) { return n; }); // Generic call with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(a, b, c) { -} +function someGenerics7(a, b, c) {} someGenerics7(function(n) { return n; }, function(n) { diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.2.minified.js index 6007004fd38..9655ba5626a 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints_es5.2.minified.js @@ -1,24 +1,14 @@ var anyVar; -function noParams() { -} -function noGenericParams(n) { -} -function someGenerics1(n, m) { -} -function someGenerics2a(n) { -} -function someGenerics2b(n) { -} -function someGenerics3(producer) { -} -function someGenerics4(n, f) { -} -function someGenerics5(n, f) { -} -function someGenerics6(a, b, c) { -} -function someGenerics7(a, b, c) { -} +function noParams() {} +function noGenericParams(n) {} +function someGenerics1(n, m) {} +function someGenerics2a(n) {} +function someGenerics2b(n) {} +function someGenerics3(producer) {} +function someGenerics4(n, f) {} +function someGenerics5(n, f) {} +function someGenerics6(a, b, c) {} +function someGenerics7(a, b, c) {} function someGenerics9(a, b, c) { return null; } @@ -36,8 +26,7 @@ noParams(), noParams(), noParams(), noGenericParams(""), noGenericParams(""), no return n.substr(t * t); }), someGenerics3(function() { return ""; -}), someGenerics3(function() { -}), someGenerics3(function() { +}), someGenerics3(function() {}), someGenerics3(function() { return 3; }), someGenerics4(4, function() { return null; diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.1.normal.js index 78dc7293b0c..0a1704b9fa3 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.1.normal.js @@ -1,5 +1,4 @@ -function foo(x) { -} +function foo(x) {} var s; // Calls below should infer string for T and then assign that type to the value parameter foo({ @@ -15,13 +14,11 @@ foo({ var E1; (function(E1) { E1[E1["X"] = 0] = "X"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["X"] = 0] = "X"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var v1; var v1 = f1({ w: (x)=>x diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.2.minified.js index caf962c788d..c5d4b322773 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es2015.2.minified.js @@ -1,6 +1,5 @@ var E1, E2, s, E1, E2; -function foo(x) { -} +function foo(x) {} foo({ read: ()=>s , @@ -9,9 +8,7 @@ foo({ write: (value)=>s = value , read: ()=>s -}), (E1 = E1 || (E1 = { -}))[E1.X = 0] = "X", (E2 = E2 || (E2 = { -}))[E2.X = 0] = "X", f1({ +}), (E1 = E1 || (E1 = {}))[E1.X = 0] = "X", (E2 = E2 || (E2 = {}))[E2.X = 0] = "X", f1({ w: (x)=>x , r: ()=>0 diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.1.normal.js index e94430d6cf7..1f35dc90898 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.1.normal.js @@ -1,5 +1,4 @@ -function foo(x) { -} +function foo(x) {} var s; // Calls below should infer string for T and then assign that type to the value parameter foo({ @@ -21,13 +20,11 @@ foo({ var E1; (function(E1) { E1[E1["X"] = 0] = "X"; -})(E1 || (E1 = { -})); +})(E1 || (E1 = {})); var E2; (function(E2) { E2[E2["X"] = 0] = "X"; -})(E2 || (E2 = { -})); +})(E2 || (E2 = {})); var v1; var v1 = f1({ w: function(x) { diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.2.minified.js index ab1a105f614..2c6d2c8e038 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithObjectLiteral_es5.2.minified.js @@ -1,6 +1,5 @@ var E1, E2, s, E1, E2; -function foo(x) { -} +function foo(x) {} foo({ read: function() { return s; @@ -15,9 +14,7 @@ foo({ read: function() { return s; } -}), (E1 = E1 || (E1 = { -}))[E1.X = 0] = "X", (E2 = E2 || (E2 = { -}))[E2.X = 0] = "X", f1({ +}), (E1 = E1 || (E1 = {}))[E1.X = 0] = "X", (E2 = E2 || (E2 = {}))[E2.X = 0] = "X", f1({ w: function(x) { return x; }, diff --git a/crates/swc/tests/tsc-references/typeArgumentInference_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInference_es2015.1.normal.js index 827291fd019..f9d92e2bf73 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInference_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInference_es2015.1.normal.js @@ -1,31 +1,26 @@ // Generic call with no parameters -function noParams() { -} +function noParams() {} noParams(); noParams(); noParams(); // Generic call with parameters but none use type parameter type -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams(''); noGenericParams(''); noGenericParams(''); // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) {} someGenerics1(3, 4); someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type -function someGenerics2a(n) { -} +function someGenerics2a(n) {} someGenerics2a((n)=>n ); someGenerics2a((n)=>n ); someGenerics2a((n)=>n.substr(0) ); -function someGenerics2b(n) { -} +function someGenerics2b(n) {} someGenerics2b((n, x)=>n ); someGenerics2b((n, t)=>n @@ -33,8 +28,7 @@ someGenerics2b((n, t)=>n someGenerics2b((n, t)=>n.substr(t * 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) { -} +function someGenerics3(producer) {} someGenerics3(()=>'' ); someGenerics3(()=>undefined @@ -42,24 +36,21 @@ someGenerics3(()=>undefined someGenerics3(()=>3 ); // 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) { -} +function someGenerics4(n, f) {} someGenerics4(4, ()=>null ); someGenerics4('', ()=>3 ); 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 -function someGenerics5(n, f) { -} +function someGenerics5(n, f) {} someGenerics5(4, ()=>null ); someGenerics5('', ()=>3 ); someGenerics5(null, null); // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} +function someGenerics6(a, b, c) {} someGenerics6((n)=>n , (n)=>n , (n)=>n @@ -73,8 +64,7 @@ someGenerics6((n)=>n , (n)=>n ); // Generic call with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(a, b, c) { -} +function someGenerics7(a, b, c) {} someGenerics7((n)=>n , (n)=>n , (n)=>n diff --git a/crates/swc/tests/tsc-references/typeArgumentInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInference_es2015.2.minified.js index eabe7d755bd..4efe52bb83c 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInference_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInference_es2015.2.minified.js @@ -1,24 +1,14 @@ var anyVar; -function noParams() { -} -function noGenericParams(n) { -} -function someGenerics1(n, m) { -} -function someGenerics2a(n) { -} -function someGenerics2b(n) { -} -function someGenerics3(producer) { -} -function someGenerics4(n, f) { -} -function someGenerics5(n, f) { -} -function someGenerics6(a, b, c) { -} -function someGenerics7(a, b, c) { -} +function noParams() {} +function noGenericParams(n) {} +function someGenerics1(n, m) {} +function someGenerics2a(n) {} +function someGenerics2b(n) {} +function someGenerics3(producer) {} +function someGenerics4(n, f) {} +function someGenerics5(n, f) {} +function someGenerics6(a, b, c) {} +function someGenerics7(a, b, c) {} function someGenerics9(a, b, c) { return null; } diff --git a/crates/swc/tests/tsc-references/typeArgumentInference_es5.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInference_es5.1.normal.js index 7b32f803fe9..38fb8b8e1cc 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInference_es5.1.normal.js @@ -1,23 +1,19 @@ // Generic call with no parameters -function noParams() { -} +function noParams() {} noParams(); noParams(); noParams(); // Generic call with parameters but none use type parameter type -function noGenericParams(n) { -} +function noGenericParams(n) {} noGenericParams(''); noGenericParams(''); noGenericParams(''); // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) {} someGenerics1(3, 4); someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type -function someGenerics2a(n) { -} +function someGenerics2a(n) {} someGenerics2a(function(n) { return n; }); @@ -27,8 +23,7 @@ someGenerics2a(function(n) { someGenerics2a(function(n) { return n.substr(0); }); -function someGenerics2b(n) { -} +function someGenerics2b(n) {} someGenerics2b(function(n, x) { return n; }); @@ -39,8 +34,7 @@ someGenerics2b(function(n, t) { return n.substr(t * 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) { -} +function someGenerics3(producer) {} someGenerics3(function() { return ''; }); @@ -51,8 +45,7 @@ someGenerics3(function() { return 3; }); // 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) { -} +function someGenerics4(n, f) {} someGenerics4(4, function() { return null; }); @@ -61,8 +54,7 @@ someGenerics4('', function() { }); 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 -function someGenerics5(n, f) { -} +function someGenerics5(n, f) {} someGenerics5(4, function() { return null; }); @@ -71,8 +63,7 @@ someGenerics5('', function() { }); someGenerics5(null, null); // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} +function someGenerics6(a, b, c) {} someGenerics6(function(n) { return n; }, function(n) { @@ -95,8 +86,7 @@ someGenerics6(function(n) { return n; }); // Generic call with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(a, b, c) { -} +function someGenerics7(a, b, c) {} someGenerics7(function(n) { return n; }, function(n) { diff --git a/crates/swc/tests/tsc-references/typeArgumentInference_es5.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInference_es5.2.minified.js index e2086a8550f..42a7da589aa 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInference_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInference_es5.2.minified.js @@ -1,24 +1,14 @@ var anyVar; -function noParams() { -} -function noGenericParams(n) { -} -function someGenerics1(n, m) { -} -function someGenerics2a(n) { -} -function someGenerics2b(n) { -} -function someGenerics3(producer) { -} -function someGenerics4(n, f) { -} -function someGenerics5(n, f) { -} -function someGenerics6(a, b, c) { -} -function someGenerics7(a, b, c) { -} +function noParams() {} +function noGenericParams(n) {} +function someGenerics1(n, m) {} +function someGenerics2a(n) {} +function someGenerics2b(n) {} +function someGenerics3(producer) {} +function someGenerics4(n, f) {} +function someGenerics5(n, f) {} +function someGenerics6(a, b, c) {} +function someGenerics7(a, b, c) {} function someGenerics9(a, b, c) { return null; } @@ -36,8 +26,7 @@ noParams(), noParams(), noParams(), noGenericParams(""), noGenericParams(""), no return n.substr(t * t); }), someGenerics3(function() { return ""; -}), someGenerics3(function() { -}), someGenerics3(function() { +}), someGenerics3(function() {}), someGenerics3(function() { return 3; }), someGenerics4(4, function() { return null; diff --git a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.1.normal.js index 70605a2f453..e3562d9127e 100644 --- a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.1.normal.js @@ -32,8 +32,7 @@ var n1; c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); -})(n1 || (n1 = { -})); +})(n1 || (n1 = {})); var n2; (function(n21) { var a = n21.a = fun1("Hello", "Hello"); @@ -59,8 +58,7 @@ var n2; c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); -})(n2 || (n2 = { -})); +})(n2 || (n2 = {})); var n3; (function(n31) { var a = n31.a = fun2("Hello", "World"); @@ -86,5 +84,4 @@ var n3; c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); -})(n3 || (n3 = { -})); +})(n3 || (n3 = {})); diff --git a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.2.minified.js index 8218314d6b7..43c49330a6f 100644 --- a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es2015.2.minified.js @@ -11,13 +11,10 @@ function fun3(...args) { !function(n11) { var a = n11.a = fun1("Hello", "World"), b = n11.b = fun1("Hello", "Hello"), c = n11.c = fun2("Hello", "World"), d = n11.d = fun2("Hello", "Hello"), e = n11.e = fun3("Hello", "Hello", "World", "Foo"); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); -}(n1 || (n1 = { -})), (function(n21) { +}(n1 || (n1 = {})), (function(n21) { var a = n21.a = fun1("Hello", "Hello"), b = n21.b = fun1("Hello", "World"), c = n21.c = fun2("Hello", "Hello"), d = n21.d = fun2("Hello", "World"), e = n21.e = fun3("Hello", "World"); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); -})(n2 || (n2 = { -})), (function(n31) { +})(n2 || (n2 = {})), (function(n31) { var a = n31.a = fun2("Hello", "World"), b = n31.b = fun2("World", "Hello"), c = n31.c = fun2("Hello", "Hello"), d = n31.d = fun2("World", "World"), e = n31.e = fun3("Hello", "World"); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); -})(n3 || (n3 = { -})); +})(n3 || (n3 = {})); diff --git a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.1.normal.js index 800d6ee1876..d732fc351f5 100644 --- a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.1.normal.js @@ -35,8 +35,7 @@ var n1; c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); -})(n1 || (n1 = { -})); +})(n1 || (n1 = {})); var n2; (function(n21) { var a = n21.a = fun1("Hello", "Hello"); @@ -62,8 +61,7 @@ var n2; c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); -})(n2 || (n2 = { -})); +})(n2 || (n2 = {})); var n3; (function(n31) { var a = n31.a = fun2("Hello", "World"); @@ -89,5 +87,4 @@ var n3; c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); -})(n3 || (n3 = { -})); +})(n3 || (n3 = {})); diff --git a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.2.minified.js index 13883758cac..f2ad9745638 100644 --- a/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentsWithStringLiteralTypes01_es5.2.minified.js @@ -12,13 +12,10 @@ function fun3() { !function(n11) { var a = n11.a = fun1("Hello", "World"), b = n11.b = fun1("Hello", "Hello"), c = n11.c = fun2("Hello", "World"), d = n11.d = fun2("Hello", "Hello"), e = n11.e = fun3("Hello", "Hello", "World", "Foo"); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); -}(n1 || (n1 = { -})), (function(n21) { +}(n1 || (n1 = {})), (function(n21) { var a = n21.a = fun1("Hello", "Hello"), b = n21.b = fun1("Hello", "World"), c = n21.c = fun2("Hello", "Hello"), d = n21.d = fun2("Hello", "World"), e = n21.e = fun3("Hello", "World"); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); -})(n2 || (n2 = { -})), (function(n31) { +})(n2 || (n2 = {})), (function(n31) { var a = n31.a = fun2("Hello", "World"), b = n31.b = fun2("World", "Hello"), c = n31.c = fun2("Hello", "Hello"), d = n31.d = fun2("World", "World"), e = n31.e = fun3("Hello", "World"); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); -})(n3 || (n3 = { -})); +})(n3 || (n3 = {})); diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.1.normal.js index 9192d865edf..bcbd41cecb6 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.1.normal.js @@ -13,18 +13,15 @@ function A() { var a = new A(); a.unknown = 1; a.unknown = true; -a.unknown = { -}; +a.unknown = {}; a.unknown = 'hi'; a.unknowable = 1; a.unknowable = true; -a.unknowable = { -}; +a.unknowable = {}; a.unknowable = 'hi'; a.empty.push(1); a.empty.push(true); -a.empty.push({ -}); +a.empty.push({}); a.empty.push('hi'); /** @type {number | undefined} */ var n; // should get any on parameter initialisers @@ -34,8 +31,7 @@ function f(a1 = null, b = n, l1 = []) { a1 = null; a1 = 1; a1 = true; - a1 = { - }; + a1 = {}; a1 = 'ok'; // b should be number | undefined, not any b = 1; @@ -51,7 +47,6 @@ var l = []; u = undefined; u = 1; u = true; -u = { -}; +u = {}; u = 'ok'; l.push('ok'); diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.2.minified.js index 9762da76cac..e36c3f8dedd 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer_es2015.2.minified.js @@ -1,7 +1,4 @@ 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"); diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.1.normal.js index f7e2bc3e0ca..15fb4f36a2a 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.1.normal.js @@ -13,18 +13,15 @@ function A() { var a = new A(); a.unknown = 1; a.unknown = true; -a.unknown = { -}; +a.unknown = {}; a.unknown = 'hi'; a.unknowable = 1; a.unknowable = true; -a.unknowable = { -}; +a.unknowable = {}; a.unknowable = 'hi'; a.empty.push(1); a.empty.push(true); -a.empty.push({ -}); +a.empty.push({}); a.empty.push('hi'); /** @type {number | undefined} */ var n; // should get any on parameter initialisers @@ -35,8 +32,7 @@ function f() { a1 = null; a1 = 1; a1 = true; - a1 = { - }; + a1 = {}; a1 = 'ok'; // b should be number | undefined, not any b = 1; @@ -52,7 +48,6 @@ var l = []; u = undefined; u = 1; u = true; -u = { -}; +u = {}; u = 'ok'; l.push('ok'); diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.2.minified.js index 9762da76cac..e36c3f8dedd 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer_es5.2.minified.js @@ -1,7 +1,4 @@ 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"); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.1.normal.js index 44960d4bca9..fa6c2a043f5 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.1.normal.js @@ -3,11 +3,9 @@ // @checkJs: true // @target: esnext // @Filename: module.js -var Outer = Outer !== null && Outer !== void 0 ? Outer : { -}; +var Outer = Outer !== null && Outer !== void 0 ? Outer : {}; var _app; -Outer.app = (_app = Outer.app) !== null && _app !== void 0 ? _app : { -}; +Outer.app = (_app = Outer.app) !== null && _app !== void 0 ? _app : {}; // @Filename: someview.js Outer.app.SomeView = (function() { var SomeView = function() { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js index 3c854c022d7..c9a2e2d4d01 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js @@ -1,8 +1,5 @@ -var _app, x, Outer = null != Outer ? Outer : { -}; -Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : { -}, Outer.app.SomeView = function() { -}, Outer.app.Inner = class { +var _app, x, Outer = null != Outer ? Outer : {}; +Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : {}, Outer.app.SomeView = function() {}, Outer.app.Inner = class { constructor(){ this.y = 12; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js index 0209c007188..73fb0ec19f9 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js @@ -8,11 +8,9 @@ function _classCallCheck(instance, Constructor) { // @checkJs: true // @target: esnext // @Filename: module.js -var Outer = Outer !== null && Outer !== void 0 ? Outer : { -}; +var Outer = Outer !== null && Outer !== void 0 ? Outer : {}; var _app; -Outer.app = (_app = Outer.app) !== null && _app !== void 0 ? _app : { -}; +Outer.app = (_app = Outer.app) !== null && _app !== void 0 ? _app : {}; // @Filename: someview.js Outer.app.SomeView = (function() { var SomeView = function SomeView() { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js index 03222112d84..b83d2765c96 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js @@ -1,8 +1,5 @@ -var _app, x, Outer = null != Outer ? Outer : { -}; -Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : { -}, Outer.app.SomeView = function() { -}, Outer.app.Inner = function _class() { +var _app, x, Outer = null != Outer ? Outer : {}; +Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : {}, Outer.app.SomeView = function() {}, Outer.app.Inner = function _class() { "use strict"; (function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.1.normal.js index b2cbd1df31e..b946a0546fd 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.1.normal.js @@ -3,10 +3,8 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Outer = Outer || { -}; -Outer.app = Outer.app || { -}; +var Outer = Outer || {}; +Outer.app = Outer.app || {}; // @Filename: someview.js Outer.app.SomeView = (function() { var SomeView = function() { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js index f68851e78c6..20c8fcbfc2e 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js @@ -1,8 +1,5 @@ -var x, Outer = Outer || { -}; -Outer.app = Outer.app || { -}, Outer.app.SomeView = function() { -}, Outer.app.Inner = class { +var x, Outer = Outer || {}; +Outer.app = Outer.app || {}, Outer.app.SomeView = function() {}, Outer.app.Inner = class { constructor(){ this.y = 12; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js index a7ecb22dcad..54202207366 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js @@ -8,10 +8,8 @@ function _classCallCheck(instance, Constructor) { // @checkJs: true // @target: es6 // @Filename: module.js -var Outer = Outer || { -}; -Outer.app = Outer.app || { -}; +var Outer = Outer || {}; +Outer.app = Outer.app || {}; // @Filename: someview.js Outer.app.SomeView = (function() { var SomeView = function SomeView() { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js index 1efe8aae283..51dd9d5bf96 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js @@ -1,8 +1,5 @@ -var x, Outer = Outer || { -}; -Outer.app = Outer.app || { -}, Outer.app.SomeView = function() { -}, Outer.app.Inner = function _class() { +var x, Outer = Outer || {}; +Outer.app = Outer.app || {}, Outer.app.SomeView = function() {}, Outer.app.Inner = function _class() { "use strict"; (function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.1.normal.js index 72e8eded609..22f36eb66b4 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.1.normal.js @@ -3,11 +3,9 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Inner = function() { -}; +var Inner = function() {}; Inner.prototype = { - m () { - }, + m () {}, i: 1 }; // incremental assignments still work diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.2.minified.js index f8f440f74f1..efc2f2e134c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es2015.2.minified.js @@ -1,8 +1,6 @@ -var Inner = function() { -}; +var Inner = function() {}; Inner.prototype = { - m () { - }, + m () {}, i: 1 }, Inner.prototype.j = 2, Inner.prototype.k; var inner = new Inner(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.1.normal.js index a51774c05ed..453ae665178 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.1.normal.js @@ -3,11 +3,9 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Inner = function Inner() { -}; +var Inner = function Inner() {}; Inner.prototype = { - m: function m() { - }, + m: function m() {}, i: 1 }; // incremental assignments still work diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.2.minified.js index 796d5ae51a8..cd4a10e8e19 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment11_es5.2.minified.js @@ -1,8 +1,6 @@ -var Inner = function() { -}; +var Inner = function() {}; Inner.prototype = { - m: function() { - }, + m: function() {}, i: 1 }, Inner.prototype.j = 2, Inner.prototype.k; var inner = new Inner(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.1.normal.js index 7081c1cfeda..9d1b644af72 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.1.normal.js @@ -3,11 +3,9 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Outer = function(element, config) { -}; +var Outer = function(element, config) {}; // @Filename: usage.js -/** @constructor */ Outer.Pos = function(line, ch) { -}; +/** @constructor */ Outer.Pos = function(line, ch) {}; /** @type {number} */ Outer.Pos.prototype.line; var pos = new Outer.Pos(1, 'x'); pos.line; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js index b270db4dd15..b257288318c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js @@ -1,4 +1,2 @@ -var Outer = function(element, config) { -}; -Outer.Pos = function(line, ch) { -}, Outer.Pos.prototype.line, new Outer.Pos(1, "x").line; +var Outer = function(element, config) {}; +Outer.Pos = function(line, ch) {}, Outer.Pos.prototype.line, new Outer.Pos(1, "x").line; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.1.normal.js index 7e689eeb645..6081de9e999 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.1.normal.js @@ -3,11 +3,9 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Outer = function Outer(element, config) { -}; +var Outer = function Outer(element, config) {}; // @Filename: usage.js -/** @constructor */ Outer.Pos = function(line, ch) { -}; +/** @constructor */ Outer.Pos = function(line, ch) {}; /** @type {number} */ Outer.Pos.prototype.line; var pos = new Outer.Pos(1, 'x'); pos.line; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js index b270db4dd15..b257288318c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js @@ -1,4 +1,2 @@ -var Outer = function(element, config) { -}; -Outer.Pos = function(line, ch) { -}, Outer.Pos.prototype.line, new Outer.Pos(1, "x").line; +var Outer = function(element, config) {}; +Outer.Pos = function(line, ch) {}, Outer.Pos.prototype.line, new Outer.Pos(1, "x").line; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.1.normal.js index 0800375593d..456e962d665 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.1.normal.js @@ -3,13 +3,10 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Outer = { -}; -Outer.Inner = function() { -}; +var Outer = {}; +Outer.Inner = function() {}; Outer.Inner.prototype = { - m () { - }, + m () {}, i: 1 }; // incremental assignments still work diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.2.minified.js index 8073e6b0e4f..868ccbea4df 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es2015.2.minified.js @@ -1,9 +1,6 @@ -var Outer = { -}; -Outer.Inner = function() { -}, Outer.Inner.prototype = { - m () { - }, +var Outer = {}; +Outer.Inner = function() {}, Outer.Inner.prototype = { + m () {}, i: 1 }, Outer.Inner.prototype.j = 2, Outer.Inner.prototype.k; var inner = new Outer.Inner(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.1.normal.js index 7bfd89b51e1..4ed7d5ac8d4 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.1.normal.js @@ -3,13 +3,10 @@ // @checkJs: true // @target: es6 // @Filename: module.js -var Outer = { -}; -Outer.Inner = function() { -}; +var Outer = {}; +Outer.Inner = function() {}; Outer.Inner.prototype = { - m: function m() { - }, + m: function m() {}, i: 1 }; // incremental assignments still work diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.2.minified.js index 0b7cb685b73..ced4dfb47a2 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment13_es5.2.minified.js @@ -1,9 +1,6 @@ -var Outer = { -}; -Outer.Inner = function() { -}, Outer.Inner.prototype = { - m: function() { - }, +var Outer = {}; +Outer.Inner = function() {}, Outer.Inner.prototype = { + m: function() {}, i: 1 }, Outer.Inner.prototype.j = 2, Outer.Inner.prototype.k; var inner = new Outer.Inner(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.1.normal.js index 91dd7694667..2ab562244af 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.1.normal.js @@ -2,15 +2,12 @@ // @allowJs: true // @checkJs: true // @Filename: def.js -var Outer = { -}; +var Outer = {}; // @Filename: work.js -Outer.Inner = function() { -}; +Outer.Inner = function() {}; Outer.Inner.prototype = { x: 1, - m () { - } + m () {} }; // @Filename: use.js /** @type {Outer.Inner} */ var inner; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js index 359157ef0c4..40ab0b0d323 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js @@ -1,10 +1,7 @@ -var inner, Outer = { -}; -Outer.Inner = function() { -}, Outer.Inner.prototype = { +var inner, Outer = {}; +Outer.Inner = function() {}, Outer.Inner.prototype = { x: 1, - m () { - } + m () {} }, inner.x, inner.m(); var inno = new Outer.Inner(); inno.x, inno.m(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.1.normal.js index 8c639af4b59..85a4ce5d300 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.1.normal.js @@ -2,15 +2,12 @@ // @allowJs: true // @checkJs: true // @Filename: def.js -var Outer = { -}; +var Outer = {}; // @Filename: work.js -Outer.Inner = function() { -}; +Outer.Inner = function() {}; Outer.Inner.prototype = { x: 1, - m: function m() { - } + m: function m() {} }; // @Filename: use.js /** @type {Outer.Inner} */ var inner; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js index a3b4dfbf568..0b9e16e0164 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js @@ -1,10 +1,7 @@ -var inner, Outer = { -}; -Outer.Inner = function() { -}, Outer.Inner.prototype = { +var inner, Outer = {}; +Outer.Inner = function() {}, Outer.Inner.prototype = { x: 1, - m: function() { - } + m: function() {} }, inner.x, inner.m(); var inno = new Outer.Inner(); inno.x, inno.m(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.1.normal.js index af5f3588520..013bb7e7247 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.1.normal.js @@ -2,11 +2,9 @@ // @allowJs: true // @checkJs: true // @Filename: a.js -var Outer = { -}; +var Outer = {}; Outer.Inner = class _class { - m() { - } + m() {} constructor(){ this.x = 1; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.2.minified.js index 4b7e8e9772d..448a2861409 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es2015.2.minified.js @@ -1,8 +1,6 @@ -var inner, Outer = { -}; +var inner, Outer = {}; Outer.Inner = class { - m() { - } + m() {} constructor(){ this.x = 1; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.1.normal.js index bcba6774615..f96a38635d8 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.1.normal.js @@ -21,8 +21,7 @@ function _createClass(Constructor, protoProps, staticProps) { // @allowJs: true // @checkJs: true // @Filename: a.js -var Outer = { -}; +var Outer = {}; Outer.Inner = /*#__PURE__*/ (function() { "use strict"; function _class() { @@ -32,8 +31,7 @@ Outer.Inner = /*#__PURE__*/ (function() { _createClass(_class, [ { key: "m", - value: function m() { - } + value: function m() {} } ]); return _class; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.2.minified.js index 488490cfcc2..e1fafd27853 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment15_es5.2.minified.js @@ -4,8 +4,7 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var inner, Outer = { -}; +var inner, Outer = {}; Outer.Inner = (function() { "use strict"; var Constructor, protoProps, staticProps; @@ -17,8 +16,7 @@ Outer.Inner = (function() { return protoProps = [ { key: "m", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = _class).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), _class; })(), inner.x, inner.m(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.1.normal.js index 6d19c9a0bd2..9e806b64a21 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.1.normal.js @@ -2,14 +2,11 @@ // @allowJs: true // @checkJs: true // @Filename: a.js -var Outer = { -}; -Outer.Inner = function() { -}; +var Outer = {}; +Outer.Inner = function() {}; Outer.Inner.prototype = { x: 1, - m () { - } + m () {} }; /** @type {Outer.Inner} */ var inner; inner.x; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.2.minified.js index 359157ef0c4..40ab0b0d323 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es2015.2.minified.js @@ -1,10 +1,7 @@ -var inner, Outer = { -}; -Outer.Inner = function() { -}, Outer.Inner.prototype = { +var inner, Outer = {}; +Outer.Inner = function() {}, Outer.Inner.prototype = { x: 1, - m () { - } + m () {} }, inner.x, inner.m(); var inno = new Outer.Inner(); inno.x, inno.m(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.1.normal.js index 5c1d0604dd4..2736e2997e4 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.1.normal.js @@ -2,14 +2,11 @@ // @allowJs: true // @checkJs: true // @Filename: a.js -var Outer = { -}; -Outer.Inner = function() { -}; +var Outer = {}; +Outer.Inner = function() {}; Outer.Inner.prototype = { x: 1, - m: function m() { - } + m: function m() {} }; /** @type {Outer.Inner} */ var inner; inner.x; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.2.minified.js index a3b4dfbf568..0b9e16e0164 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment16_es5.2.minified.js @@ -1,10 +1,7 @@ -var inner, Outer = { -}; -Outer.Inner = function() { -}, Outer.Inner.prototype = { +var inner, Outer = {}; +Outer.Inner = function() {}, Outer.Inner.prototype = { x: 1, - m: function() { - } + m: function() {} }, inner.x, inner.m(); var inno = new Outer.Inner(); inno.x, inno.m(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.1.normal.js index cb543cab541..c7472494363 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.1.normal.js @@ -6,15 +6,12 @@ minimatch.filter = filter; function filter() { return minimatch(); } -function minimatch() { -} +function minimatch() {} M.defaults = function(def) { return def; }; -M.prototype.m = function() { -}; -function M() { -} +M.prototype.m = function() {}; +function M() {} // @Filename: use.js /// var mini = require('./minimatch'); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.2.minified.js index df096f39e8b..1c497db1834 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es2015.2.minified.js @@ -1,12 +1,9 @@ -function minimatch() { -} -function M() { -} +function minimatch() {} +function M() {} module.exports = minimatch, minimatch.M = M, minimatch.filter = function() { return minimatch(); }, M.defaults = function(def) { return def; -}, M.prototype.m = function() { -}; +}, M.prototype.m = function() {}; var mini = require("./minimatch"); mini.M.defaults(), new mini.M().m(), mini.filter(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.1.normal.js index cb543cab541..c7472494363 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.1.normal.js @@ -6,15 +6,12 @@ minimatch.filter = filter; function filter() { return minimatch(); } -function minimatch() { -} +function minimatch() {} M.defaults = function(def) { return def; }; -M.prototype.m = function() { -}; -function M() { -} +M.prototype.m = function() {}; +function M() {} // @Filename: use.js /// var mini = require('./minimatch'); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.2.minified.js index df096f39e8b..1c497db1834 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17_es5.2.minified.js @@ -1,12 +1,9 @@ -function minimatch() { -} -function M() { -} +function minimatch() {} +function M() {} module.exports = minimatch, minimatch.M = M, minimatch.filter = function() { return minimatch(); }, M.defaults = function(def) { return def; -}, M.prototype.m = function() { -}; +}, M.prototype.m = function() {}; var mini = require("./minimatch"); mini.M.defaults(), new mini.M().m(), mini.filter(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.1.normal.js index a5078307a52..5e1ac1c8348 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.1.normal.js @@ -2,10 +2,8 @@ // @allowJs: true // @checkJs: true // @Filename: a.js -var GLOBSTAR = m.GLOBSTAR = { -}; -function m() { -} +var GLOBSTAR = m.GLOBSTAR = {}; +function m() {} GLOBSTAR.p = 1; m.GLOBSTAR.q = 2; GLOBSTAR.p; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.2.minified.js index 5be943131ca..827ce154b5c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es2015.2.minified.js @@ -1,5 +1,3 @@ -var GLOBSTAR = m.GLOBSTAR = { -}; -function m() { -} +var GLOBSTAR = m.GLOBSTAR = {}; +function m() {} GLOBSTAR.p = 1, m.GLOBSTAR.q = 2, GLOBSTAR.p, GLOBSTAR.q, m.GLOBSTAR.p, m.GLOBSTAR.q; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.1.normal.js index a5078307a52..5e1ac1c8348 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.1.normal.js @@ -2,10 +2,8 @@ // @allowJs: true // @checkJs: true // @Filename: a.js -var GLOBSTAR = m.GLOBSTAR = { -}; -function m() { -} +var GLOBSTAR = m.GLOBSTAR = {}; +function m() {} GLOBSTAR.p = 1; m.GLOBSTAR.q = 2; GLOBSTAR.p; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.2.minified.js index 5be943131ca..827ce154b5c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment18_es5.2.minified.js @@ -1,5 +1,3 @@ -var GLOBSTAR = m.GLOBSTAR = { -}; -function m() { -} +var GLOBSTAR = m.GLOBSTAR = {}; +function m() {} GLOBSTAR.p = 1, m.GLOBSTAR.q = 2, GLOBSTAR.p, GLOBSTAR.q, m.GLOBSTAR.p, m.GLOBSTAR.q; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es2015.2.minified.js index 3cdb38da17b..e5a5029a31d 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es2015.2.minified.js @@ -1,8 +1,7 @@ function Installer() { this.args = 0; } -Installer.prototype.loadArgMetadata = function(next) { -}; +Installer.prototype.loadArgMetadata = function(next) {}; var i = new Installer(); i.newProperty = i.args // ok, number ==> number | undefined ; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es5.2.minified.js index 3cdb38da17b..e5a5029a31d 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22_es5.2.minified.js @@ -1,8 +1,7 @@ function Installer() { this.args = 0; } -Installer.prototype.loadArgMetadata = function(next) { -}; +Installer.prototype.loadArgMetadata = function(next) {}; var i = new Installer(); i.newProperty = i.args // ok, number ==> number | undefined ; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.1.normal.js index f201ff37455..b985dc39634 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.1.normal.js @@ -3,8 +3,7 @@ // @allowJs: true // @Filename: a.js class B { - foo() { - } + foo() {} constructor(){ this.n = 1; } @@ -12,8 +11,7 @@ class B { class C extends B { } // this override should be fine (even if it's a little odd) -C.prototype.foo = function() { -}; +C.prototype.foo = function() {}; class D extends B { } D.prototype.foo = ()=>{ diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.2.minified.js index 4e3d0702450..104ac309e3e 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es2015.2.minified.js @@ -1,13 +1,11 @@ class B { - foo() { - } + foo() {} constructor(){ this.n = 1; } } (class extends B { -}).prototype.foo = function() { -}, (class extends B { +}).prototype.foo = function() {}, (class extends B { }).prototype.foo = ()=>{ this.n = "not checked, so no error"; }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.1.normal.js index 94b0470ef00..5e12e54f4ed 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -97,8 +96,7 @@ var B = // @noEmit: true _createClass(B, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return B; @@ -114,8 +112,7 @@ var C = /*#__PURE__*/ function(B) { return C; }(B); // this override should be fine (even if it's a little odd) -C.prototype.foo = function() { -}; +C.prototype.foo = function() {}; var D = /*#__PURE__*/ function(B) { "use strict"; _inherits(D, B); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.2.minified.js index b765ed988bc..99fda928508 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var _this = this, B = function() { return _createClass(B, [ { key: "foo", - value: function() { - } + value: function() {} } ]), B; }(), C = function(B) { @@ -75,8 +73,7 @@ var _this = this, B = function() { } return C; }(B); -C.prototype.foo = function() { -}; +C.prototype.foo = function() {}; var D = function(B) { "use strict"; _inherits(D, B); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.1.normal.js index a6977d09f02..b21d392acc9 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.1.normal.js @@ -3,15 +3,13 @@ // @allowJs: true // @Filename: usage.js // note that usage is first in the compilation -Outer.Inner.Message = function() { -}; +Outer.Inner.Message = function() {}; var y = new Outer.Inner(); y.name; /** @type {Outer.Inner} should be instance type, not static type */ var x; x.name; // @Filename: def.js -var Outer = { -}; +var Outer = {}; Outer.Inner = class _class { name() { return 'hi'; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js index db92edb0ac8..8087fada62f 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js @@ -1,8 +1,6 @@ var x; -Outer.Inner.Message = function() { -}, new Outer.Inner().name, x.name; -var Outer = { -}; +Outer.Inner.Message = function() {}, new Outer.Inner().name, x.name; +var Outer = {}; Outer.Inner = class { name() { return "hi"; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js index 0c3bb194149..a1f194f195c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js @@ -22,15 +22,13 @@ function _createClass(Constructor, protoProps, staticProps) { // @allowJs: true // @Filename: usage.js // note that usage is first in the compilation -Outer.Inner.Message = function() { -}; +Outer.Inner.Message = function() {}; var y = new Outer.Inner(); y.name; /** @type {Outer.Inner} should be instance type, not static type */ var x; x.name; // @Filename: def.js -var Outer = { -}; +var Outer = {}; Outer.Inner = /*#__PURE__*/ (function() { "use strict"; function _class() { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js index e906824aee7..f96375bb2b7 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js @@ -4,10 +4,8 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -Outer.Inner.Message = function() { -}, new Outer.Inner().name; -var x, Outer = { -}; +Outer.Inner.Message = function() {}, new Outer.Inner().name; +var x, Outer = {}; Outer.Inner = (function() { "use strict"; var Constructor, protoProps, staticProps; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.1.normal.js index bf41bba749b..3242b8e9d96 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.1.normal.js @@ -2,8 +2,7 @@ // @checkJs: true // @allowJs: true // @Filename: bug24703.js -var Common = { -}; +var Common = {}; Common.I = class _class { constructor(){ this.i = 1; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.2.minified.js index d08f8542748..82cd0787a9a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es2015.2.minified.js @@ -1,5 +1,4 @@ -var Common = { -}; +var Common = {}; Common.I = class { constructor(){ this.i = 1; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.1.normal.js index 3af5bf09399..9c9582da2d4 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -73,8 +72,7 @@ function _createSuper(Derived) { // @checkJs: true // @allowJs: true // @Filename: bug24703.js -var Common = { -}; +var Common = {}; Common.I = function _class() { "use strict"; _classCallCheck(this, _class); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.2.minified.js index d40e216ccb2..2b69625c4ed 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25_es5.2.minified.js @@ -11,8 +11,7 @@ function _setPrototypeOf(o1, p) { return o1.__proto__ = p, o1; }, _setPrototypeOf(o1, p); } -var Common = { -}; +var Common = {}; Common.I = function _class() { "use strict"; _classCallCheck(this, _class), this.i = 1; @@ -34,8 +33,7 @@ Common.I = function _class() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.1.normal.js index 7ba0fffca33..90492e76ca8 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.1.normal.js @@ -3,8 +3,7 @@ // @checkJs: true // @allowJs: true // @Filename: bug24730.js -var UI = { -}; +var UI = {}; UI.TreeElement = class _class { constructor(){ this.treeOutline = 12; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.2.minified.js index 87a2a0c9a6c..5c90ebf8e70 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es2015.2.minified.js @@ -1,5 +1,4 @@ -var UI = { -}; +var UI = {}; UI.TreeElement = class { constructor(){ this.treeOutline = 12; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.1.normal.js index 59440acb025..b882d3bf639 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -88,8 +87,7 @@ function _createSuper(Derived) { // @checkJs: true // @allowJs: true // @Filename: bug24730.js -var UI = { -}; +var UI = {}; UI.TreeElement = function _class() { "use strict"; _classCallCheck(this, _class); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.2.minified.js index 81cf2d8e059..ae081609650 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26_es5.2.minified.js @@ -17,8 +17,7 @@ function _setPrototypeOf(o, p) { return o.__proto__ = p, o; }, _setPrototypeOf(o, p); } -var UI = { -}; +var UI = {}; UI.TreeElement = function _class() { "use strict"; _classCallCheck(this, _class), this.treeOutline = 12; @@ -41,8 +40,7 @@ var C = function(_TreeElement) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.1.normal.js index 8a4b9bd61c9..cdf8e09a0d0 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.1.normal.js @@ -40,24 +40,20 @@ function ExpandoMerge(n8) { ExpandoMerge.p1 = 111; (function(ExpandoMerge1) { var p2 = ExpandoMerge1.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); (function(ExpandoMerge2) { var p3 = ExpandoMerge2.p3 = 333; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1); var Ns; (function(Ns1) { - function ExpandoNamespace() { - } + function ExpandoNamespace() {} ExpandoNamespace.p6 = 42; function foo() { return ExpandoNamespace; } Ns1.foo = foo; -})(Ns || (Ns = { -})); +})(Ns || (Ns = {})); // Should not work in Typescript -- must be const var ExpandoExpr2 = function(n9) { return n9.toString(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.2.minified.js index dc3267d350e..56819cf3534 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es2015.2.minified.js @@ -26,16 +26,12 @@ ExpandoArrow.prop = 2, ExpandoArrow.m = function(n) { return n + m; }; return nested.total = n + 1000000, nested; -}).also = -1, ExpandoMerge.p1 = 111, (ExpandoMerge || (ExpandoMerge = { -})).p2 = 222, (ExpandoMerge || (ExpandoMerge = { -})).p3 = 333, ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1), (function(Ns1) { - function ExpandoNamespace() { - } +}).also = -1, ExpandoMerge.p1 = 111, (ExpandoMerge || (ExpandoMerge = {})).p2 = 222, (ExpandoMerge || (ExpandoMerge = {})).p3 = 333, ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1), (function(Ns1) { + function ExpandoNamespace() {} ExpandoNamespace.p6 = 42, Ns1.foo = function() { return ExpandoNamespace; }; -})(Ns || (Ns = { -})); +})(Ns || (Ns = {})); var Ns, ExpandoExpr2 = function(n) { return n.toString(); }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.1.normal.js index 7e86f2b75e2..7b32dd18721 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.1.normal.js @@ -46,24 +46,20 @@ function ExpandoMerge(n8) { ExpandoMerge.p1 = 111; (function(ExpandoMerge1) { var p2 = ExpandoMerge1.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); (function(ExpandoMerge2) { var p3 = ExpandoMerge2.p3 = 333; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1); var Ns; (function(Ns1) { - var ExpandoNamespace = function ExpandoNamespace() { - }; + var ExpandoNamespace = function ExpandoNamespace() {}; var foo = function foo() { return ExpandoNamespace; }; ExpandoNamespace.p6 = 42; Ns1.foo = foo; -})(Ns || (Ns = { -})); +})(Ns || (Ns = {})); // Should not work in Typescript -- must be const var ExpandoExpr2 = function ExpandoExpr2(n9) { return n9.toString(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.2.minified.js index 4bf771a55a0..ce84da2f314 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment29_es5.2.minified.js @@ -30,16 +30,12 @@ ExpandoArrow.prop = 2, ExpandoArrow.m = function(n) { return n + m; }; return nested.total = n + 1000000, nested; -}).also = -1, ExpandoMerge.p1 = 111, (ExpandoMerge || (ExpandoMerge = { -})).p2 = 222, (ExpandoMerge || (ExpandoMerge = { -})).p3 = 333, ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1), (function(Ns1) { - var ExpandoNamespace = function() { - }; +}).also = -1, ExpandoMerge.p1 = 111, (ExpandoMerge || (ExpandoMerge = {})).p2 = 222, (ExpandoMerge || (ExpandoMerge = {})).p3 = 333, ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1), (function(Ns1) { + var ExpandoNamespace = function() {}; ExpandoNamespace.p6 = 42, Ns1.foo = function() { return ExpandoNamespace; }; -})(Ns || (Ns = { -})); +})(Ns || (Ns = {})); var ExpandoExpr2 = function(n) { return n.toString(); }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.1.normal.js index 397ea08c9b7..2481076e89d 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.1.normal.js @@ -1,5 +1,4 @@ const c = ()=>1 ; // should not be an expando object, but contextually typed by Combo.p -c.p = { -}; +c.p = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.2.minified.js index c1f3c954f44..3547f32d416 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es2015.2.minified.js @@ -1,4 +1,3 @@ const c = ()=>1 ; -c.p = { -}; +c.p = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.1.normal.js index 9f326b39200..e5ddf8fa962 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.1.normal.js @@ -2,5 +2,4 @@ var c = function() { return 1; }; // should not be an expando object, but contextually typed by Combo.p -c.p = { -}; +c.p = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.2.minified.js index 8ccfcd32bef..af545c66d76 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment30_es5.2.minified.js @@ -1,4 +1,3 @@ (function() { return 1; -}).p = { -}; +}).p = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.1.normal.js index a6beefe5e7c..489297e43f7 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.1.normal.js @@ -7,8 +7,7 @@ ExpandoMerge.m = function(n2) { }; (function(ExpandoMerge1) { var p2 = ExpandoMerge1.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); ExpandoMerge.p4 = 44444; // ok ExpandoMerge.p6 = 66666; // ok ExpandoMerge.p8 = false; // type error @@ -20,8 +19,7 @@ ExpandoMerge.p8 = false; // type error var p7 = ExpandoMerge2.p7 = 7; var p8 = ExpandoMerge2.p8 = 6; var p9 = ExpandoMerge2.p9 = 7; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); ExpandoMerge.p5 = 555555; // ok ExpandoMerge.p7 = 777777; // ok ExpandoMerge.p9 = false; // type error diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.2.minified.js index 4c34e5fcd0d..6783ca5e6ae 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es2015.2.minified.js @@ -4,6 +4,4 @@ function ExpandoMerge1(n) { } ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { return n + 1; -}, (ExpandoMerge1 || (ExpandoMerge1 = { -})).p2 = 222, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p8 = !1, (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = { -})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001); +}, (ExpandoMerge1 || (ExpandoMerge1 = {})).p2 = 222, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p8 = !1, (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = {})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.1.normal.js index a6beefe5e7c..489297e43f7 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.1.normal.js @@ -7,8 +7,7 @@ ExpandoMerge.m = function(n2) { }; (function(ExpandoMerge1) { var p2 = ExpandoMerge1.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); ExpandoMerge.p4 = 44444; // ok ExpandoMerge.p6 = 66666; // ok ExpandoMerge.p8 = false; // type error @@ -20,8 +19,7 @@ ExpandoMerge.p8 = false; // type error var p7 = ExpandoMerge2.p7 = 7; var p8 = ExpandoMerge2.p8 = 6; var p9 = ExpandoMerge2.p9 = 7; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); ExpandoMerge.p5 = 555555; // ok ExpandoMerge.p7 = 777777; // ok ExpandoMerge.p9 = false; // type error diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.2.minified.js index 4c34e5fcd0d..6783ca5e6ae 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment31_es5.2.minified.js @@ -4,6 +4,4 @@ function ExpandoMerge1(n) { } ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { return n + 1; -}, (ExpandoMerge1 || (ExpandoMerge1 = { -})).p2 = 222, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p8 = !1, (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = { -})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001); +}, (ExpandoMerge1 || (ExpandoMerge1 = {})).p2 = 222, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p8 = !1, (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = {})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js index b885d1b58af..e8580846915 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js @@ -21,9 +21,7 @@ var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + var p7 = ExpandoMerge1.p7 = 7; var p8 = ExpandoMerge1.p8 = 6; var p9 = ExpandoMerge1.p9 = 7; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); (function(ExpandoMerge2) { var p2 = ExpandoMerge2.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js index 6484f57bca2..4fbe10b3d73 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js @@ -4,6 +4,4 @@ function ExpandoMerge1(n) { } ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { return n + 1; -}, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p8 = !1, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001), (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = { -})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = { -})).p2 = 222; +}, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p8 = !1, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001), (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = {})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = {})).p2 = 222; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js index b885d1b58af..e8580846915 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js @@ -21,9 +21,7 @@ var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + var p7 = ExpandoMerge1.p7 = 7; var p8 = ExpandoMerge1.p8 = 6; var p9 = ExpandoMerge1.p9 = 7; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); (function(ExpandoMerge2) { var p2 = ExpandoMerge2.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js index 6484f57bca2..4fbe10b3d73 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js @@ -4,6 +4,4 @@ function ExpandoMerge1(n) { } ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { return n + 1; -}, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p8 = !1, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001), (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = { -})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = { -})).p2 = 222; +}, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p8 = !1, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001), (ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = {})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = {})).p2 = 222; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js index 69d78734cd5..281bf88007c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js @@ -6,12 +6,10 @@ var p7 = ExpandoMerge1.p7 = 7; var p8 = ExpandoMerge1.p8 = 6; var p9 = ExpandoMerge1.p9 = 7; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); (function(ExpandoMerge2) { var p2 = ExpandoMerge2.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); // @Filename: expando.ts function ExpandoMerge(n1) { return n1; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js index 0332ebd9364..29464dfecdb 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js @@ -2,8 +2,6 @@ var ExpandoMerge; function ExpandoMerge1(n) { return n; } -(ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = { -})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = { -})).p2 = 222, ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { +(ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = {})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = {})).p2 = 222, ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { return n + 1; }, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p8 = !1, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js index 69d78734cd5..281bf88007c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js @@ -6,12 +6,10 @@ var p7 = ExpandoMerge1.p7 = 7; var p8 = ExpandoMerge1.p8 = 6; var p9 = ExpandoMerge1.p9 = 7; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); (function(ExpandoMerge2) { var p2 = ExpandoMerge2.p2 = 222; -})(ExpandoMerge || (ExpandoMerge = { -})); +})(ExpandoMerge || (ExpandoMerge = {})); // @Filename: expando.ts function ExpandoMerge(n1) { return n1; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js index 0332ebd9364..29464dfecdb 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js @@ -2,8 +2,6 @@ var ExpandoMerge; function ExpandoMerge1(n) { return n; } -(ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = { -})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = { -})).p2 = 222, ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { +(ExpandoMerge = ExpandoMerge1 || (ExpandoMerge1 = {})).p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7, (ExpandoMerge1 || (ExpandoMerge1 = {})).p2 = 222, ExpandoMerge1.p1 = 111, ExpandoMerge1.m = function(n) { return n + 1; }, ExpandoMerge1.p4 = 44444, ExpandoMerge1.p5 = 555555, ExpandoMerge1.p6 = 66666, ExpandoMerge1.p7 = 777777, ExpandoMerge1.p8 = !1, ExpandoMerge1.p9 = !1, ExpandoMerge1.p1 + ExpandoMerge1.p2 + ExpandoMerge1.p3 + ExpandoMerge1.p4 + ExpandoMerge1.p5 + ExpandoMerge1.p6 + ExpandoMerge1.p7 + ExpandoMerge1.p8 + ExpandoMerge1.p9 + ExpandoMerge1.m(12) + ExpandoMerge1(1001); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.1.normal.js index 23dba2bbea8..5acb9189021 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.1.normal.js @@ -2,11 +2,8 @@ // @allowjs: true // @checkjs: true // @Filename: file1.js -var N = { -}; -N.commands = { -}; +var N = {}; +N.commands = {}; // @Filename: file2.js N.commands.a = 111; -N.commands.b = function() { -}; +N.commands.b = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js index de15294ee14..b116e6a03a0 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js @@ -1,5 +1,2 @@ -var N = { -}; -N.commands = { -}, N.commands.a = 111, N.commands.b = function() { -}; +var N = {}; +N.commands = {}, N.commands.a = 111, N.commands.b = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.1.normal.js index 23dba2bbea8..5acb9189021 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.1.normal.js @@ -2,11 +2,8 @@ // @allowjs: true // @checkjs: true // @Filename: file1.js -var N = { -}; -N.commands = { -}; +var N = {}; +N.commands = {}; // @Filename: file2.js N.commands.a = 111; -N.commands.b = function() { -}; +N.commands.b = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js index de15294ee14..b116e6a03a0 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js @@ -1,5 +1,2 @@ -var N = { -}; -N.commands = { -}, N.commands.a = 111, N.commands.b = function() { -}; +var N = {}; +N.commands = {}, N.commands.a = 111, N.commands.b = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.1.normal.js index 06896b7173a..a38b17bbb7e 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.1.normal.js @@ -13,6 +13,5 @@ Emu.D = class _class { } }; // @Filename: second.js -var Emu = { -}; +var Emu = {}; /** @type {string} */ Emu.D._wrapperInstance; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js index a4c49f95150..92c27e0ddfd 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js @@ -3,6 +3,5 @@ Emu.D = class { this._model = 1; } }; -var Emu = { -}; +var Emu = {}; Emu.D._wrapperInstance; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.1.normal.js index 4e106eb21f1..23a2b493415 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.1.normal.js @@ -18,6 +18,5 @@ Emu.D = function _class() { this._model = 1; }; // @Filename: second.js -var Emu = { -}; +var Emu = {}; /** @type {string} */ Emu.D._wrapperInstance; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js index 48912c4173a..445ea39958b 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js @@ -4,6 +4,5 @@ Emu.D = function _class() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, _class), this._model = 1; }; -var Emu = { -}; +var Emu = {}; Emu.D._wrapperInstance; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.1.normal.js index 167e6d3f8e8..cb017048f6a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.1.normal.js @@ -1,7 +1,6 @@ // @strict: true function f(b) { - function d1() { - } + function d1() {} d1.e = 12; d1.e; if (b) { @@ -28,8 +27,7 @@ function f(b) { } // OK to access possibly-unassigned properties outside the initialising scope var test = f(true).s; -function d() { -} +function d() {} d.e = 12; d.e; if (!!false) { @@ -49,8 +47,7 @@ if (!!false) { } d.r; // test function expressions too -const g = function() { -}; +const g = function() {}; if (!!false) { g.expando = 1; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.2.minified.js index e29616e76bb..2b73cfa8a78 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es2015.2.minified.js @@ -1,10 +1,7 @@ -function d() { -} +function d() {} (function(b) { - function d1() { - } + function d1() {} return d1.e = 12, b && (d1.q = !1), b ? d1.q = !1 : d1.q = !0, b ? d1.r = 1 : d1.r = 2, b && (d1.s = "hi"), d1; })(!0).s, d.e = 12, d.q = !0, d.r = 2; -const g = function() { -}; +const g = function() {}; g.expando, g.both = 0, g.both; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.1.normal.js index 7e439edab72..04329a4e551 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.1.normal.js @@ -1,7 +1,6 @@ // @strict: true function f(b) { - var d = function d() { - }; + var d = function d() {}; d.e = 12; d.e; if (b) { @@ -28,8 +27,7 @@ function f(b) { } // OK to access possibly-unassigned properties outside the initialising scope var test = f(true).s; -function d1() { -} +function d1() {} d1.e = 12; d1.e; if (!!false) { @@ -49,8 +47,7 @@ if (!!false) { } d1.r; // test function expressions too -var g = function g() { -}; +var g = function g() {}; if (!!false) { g.expando = 1; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.2.minified.js index 965c57675fb..947e876c182 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36_es5.2.minified.js @@ -1,10 +1,7 @@ -function d() { -} +function d() {} (function(b) { - var d1 = function() { - }; + var d1 = function() {}; return d1.e = 12, d1.e, b && (d1.q = !1), d1.q, b ? d1.q = !1 : d1.q = !0, d1.q, b ? d1.r = 1 : d1.r = 2, d1.r, b && (d1.s = "hi"), d1; })(!0).s, d.e = 12, d.q = !0, d.r = 2; -var g = function() { -}; +var g = function() {}; g.expando, g.both = 0, g.both; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.1.normal.js index 97b2b758307..4e991af289a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.1.normal.js @@ -2,11 +2,9 @@ // @allowJs: true // @checkJs: true // @Filename: mod.js -const util = exports = module.exports = { -}; +const util = exports = module.exports = {}; if (!!false) { - util.existy = function() { - }; + util.existy = function() {}; } // @Filename: use.js const util = require('./mod'); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js index 81dcb17db88..ec8ec9e0a39 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js @@ -1,4 +1,3 @@ -const util = exports = module.exports = { -}, util = require("./mod"); +const util = exports = module.exports = {}, util = require("./mod"); util.existy // no error ; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.1.normal.js index 668bd21b29d..be32954c8f5 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.1.normal.js @@ -2,11 +2,9 @@ // @allowJs: true // @checkJs: true // @Filename: mod.js -var util = exports = module.exports = { -}; +var util = exports = module.exports = {}; if (!!false) { - util.existy = function() { - }; + util.existy = function() {}; } // @Filename: use.js var util = require('./mod'); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js index 58380fa2bad..26b63e5dc96 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js @@ -1,4 +1,3 @@ -var util = exports = module.exports = { -}, util = require("./mod"); +var util = exports = module.exports = {}, util = require("./mod"); util.existy // no error ; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.1.normal.js index c181e7aba5d..58cc860c812 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.1.normal.js @@ -1,9 +1,7 @@ // @noEmit: true // @strict: true // @declaration: true -function F() { -} +function F() {} F["prop"] = 3; -const f = function() { -}; +const f = function() {}; f["prop"] = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.2.minified.js index d201d9a4509..deed2500625 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es2015.2.minified.js @@ -1,5 +1,3 @@ -(function() { -}).prop = 3; -const f = function() { -}; +(function() {}).prop = 3; +const f = function() {}; f.prop = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.1.normal.js index 74c03bce891..31cbd844d84 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.1.normal.js @@ -1,9 +1,7 @@ // @noEmit: true // @strict: true // @declaration: true -function F() { -} +function F() {} F["prop"] = 3; -var f = function f() { -}; +var f = function f() {}; f["prop"] = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.2.minified.js index 0f4d8384d5d..ab93c71973d 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment38_es5.2.minified.js @@ -1,3 +1 @@ -(function() { -}).prop = 3, (function() { -}).prop = 3; +(function() {}).prop = 3, (function() {}).prop = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.1.normal.js index a0ec0283372..9d35a5f932f 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.1.normal.js @@ -4,8 +4,6 @@ // @emitDeclarationOnly: true // @declaration: true // @Filename: a.js -const foo = { -}; -foo["baz"] = { -}; +const foo = {}; +foo["baz"] = {}; foo["baz"]["blah"] = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.2.minified.js index 9904e766c16..615f0eccde5 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es2015.2.minified.js @@ -1,4 +1,2 @@ -const foo = { -}; -foo.baz = { -}, foo.baz.blah = 3; +const foo = {}; +foo.baz = {}, foo.baz.blah = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.1.normal.js index d0f984d5876..c267b4ed70f 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.1.normal.js @@ -4,8 +4,6 @@ // @emitDeclarationOnly: true // @declaration: true // @Filename: a.js -var foo = { -}; -foo["baz"] = { -}; +var foo = {}; +foo["baz"] = {}; foo["baz"]["blah"] = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.2.minified.js index 5af8a92503e..3a8018ab446 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment39_es5.2.minified.js @@ -1,4 +1,2 @@ -var foo = { -}; -foo.baz = { -}, foo.baz.blah = 3; +var foo = {}; +foo.baz = {}, foo.baz.blah = 3; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.1.normal.js index ff9928add19..1540f7bc79a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: def.js -var Outer = { -}; +var Outer = {}; // @Filename: a.js Outer.Inner = class _class { constructor(){ diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js index 65151fd2cf6..57c9b332ff3 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js @@ -1,5 +1,4 @@ -var local, x, Outer = { -}; +var local, x, Outer = {}; Outer.Inner = class { constructor(){ this.y = 12; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js index 836f92ee700..4530f076b28 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js @@ -7,8 +7,7 @@ function _classCallCheck(instance, Constructor) { // @allowJs: true // @checkJs: true // @Filename: def.js -var Outer = { -}; +var Outer = {}; // @Filename: a.js Outer.Inner = function _class() { "use strict"; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js index effcae13b45..406f5587425 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js @@ -1,5 +1,4 @@ -var local, x, Outer = { -}; +var local, x, Outer = {}; Outer.Inner = function _class() { "use strict"; (function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.1.normal.js index c3f3aba6e87..3f8e343105b 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.1.normal.js @@ -5,8 +5,7 @@ import MC from './a'; // @checkJs: true // @Filename: a.js // @target: es6 -export default function MyClass() { -}; +export default function MyClass() {}; MyClass.bar = class C { }; MyClass.bar; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.2.minified.js index 4e7318130f5..9d3a2171c2a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es2015.2.minified.js @@ -1,5 +1,4 @@ import MC from "./a"; -export default function MyClass() { -}; +export default function MyClass() {}; MyClass.bar = class { }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.1.normal.js index b412531cbb1..0c547284c88 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.1.normal.js @@ -10,8 +10,7 @@ function _classCallCheck(instance, Constructor) { // @checkJs: true // @Filename: a.js // @target: es6 -export default function MyClass() { -}; +export default function MyClass() {}; MyClass.bar = function C() { "use strict"; _classCallCheck(this, C); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.2.minified.js index 9b152406caa..acd017c29d9 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment5_es5.2.minified.js @@ -1,6 +1,5 @@ import MC from "./a"; -export default function MyClass() { -}; +export default function MyClass() {}; MyClass.bar = function C() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.1.normal.js index aa97c069f02..4fa4b65ce8e 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.1.normal.js @@ -14,5 +14,4 @@ Outer.Inner = class I { /** @type {!Outer.Inner} */ Outer.i; // @Filename: b.js var msgs = Outer.i.messages(); -/** @param {Outer.Inner} inner */ function x(inner) { -} +/** @param {Outer.Inner} inner */ function x(inner) {} diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js index 26ef96cce46..3dce1701435 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js @@ -40,5 +40,4 @@ Outer.Inner = /*#__PURE__*/ (function() { /** @type {!Outer.Inner} */ Outer.i; // @Filename: b.js var msgs = Outer.i.messages(); -/** @param {Outer.Inner} inner */ function x(inner) { -} +/** @param {Outer.Inner} inner */ function x(inner) {} diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.1.normal.js index fcdd0c18b55..72405ca628a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.1.normal.js @@ -3,8 +3,7 @@ // @checkJs: true // @target: es6 // @Filename: a.js -var obj = { -}; +var obj = {}; obj.method = function(hunch) { return true; }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.2.minified.js index 3bf4eb7e075..c7c4ed06b16 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es2015.2.minified.js @@ -1,5 +1,4 @@ -var obj = { -}; +var obj = {}; obj.method = function(hunch) { return !0; }, obj.method(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.1.normal.js index fcdd0c18b55..72405ca628a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.1.normal.js @@ -3,8 +3,7 @@ // @checkJs: true // @target: es6 // @Filename: a.js -var obj = { -}; +var obj = {}; obj.method = function(hunch) { return true; }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.2.minified.js index 3bf4eb7e075..c7c4ed06b16 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment7_es5.2.minified.js @@ -1,5 +1,4 @@ -var obj = { -}; +var obj = {}; obj.method = function(hunch) { return !0; }, obj.method(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js index 552695bae86..2e9a6419b7d 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js @@ -4,11 +4,9 @@ // @target: esnext // @lib: es6,dom // @Filename: a.js -var my = my !== null && my !== void 0 ? my : { -}; +var my = my !== null && my !== void 0 ? my : {}; var _app; -my.app = (_app = my.app) !== null && _app !== void 0 ? _app : { -}; +my.app = (_app = my.app) !== null && _app !== void 0 ? _app : {}; my.app.Application = (function() { var Application = function() { //... @@ -18,11 +16,9 @@ my.app.Application = (function() { my.app.Application(); var _min; // @Filename: b.js -var min = (_min = window.min) !== null && _min !== void 0 ? _min : { -}; +var min = (_min = window.min) !== null && _min !== void 0 ? _min : {}; var _app1; -min.app = (_app1 = min.app) !== null && _app1 !== void 0 ? _app1 : { -}; +min.app = (_app1 = min.app) !== null && _app1 !== void 0 ? _app1 : {}; min.app.Application = (function() { var Application = function() { //... diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js index f27a5006b60..ca938d54433 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js @@ -1,10 +1,4 @@ -var _app, _min, _app1, my = null != my ? my : { -}; -my.app = null !== (_app = my.app) && void 0 !== _app ? _app : { -}, my.app.Application = function() { -}, my.app.Application(); -var min = null !== (_min = window.min) && void 0 !== _min ? _min : { -}; -min.app = null !== (_app1 = min.app) && void 0 !== _app1 ? _app1 : { -}, min.app.Application = function() { -}, min.app.Application(); +var _app, _min, _app1, my = null != my ? my : {}; +my.app = null !== (_app = my.app) && void 0 !== _app ? _app : {}, my.app.Application = function() {}, my.app.Application(); +var min = null !== (_min = window.min) && void 0 !== _min ? _min : {}; +min.app = null !== (_app1 = min.app) && void 0 !== _app1 ? _app1 : {}, min.app.Application = function() {}, min.app.Application(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js index 447a64df8c6..42e9357c573 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js @@ -4,11 +4,9 @@ // @target: esnext // @lib: es6,dom // @Filename: a.js -var my = my !== null && my !== void 0 ? my : { -}; +var my = my !== null && my !== void 0 ? my : {}; var _app; -my.app = (_app = my.app) !== null && _app !== void 0 ? _app : { -}; +my.app = (_app = my.app) !== null && _app !== void 0 ? _app : {}; my.app.Application = (function() { var Application = function Application() { //... @@ -18,11 +16,9 @@ my.app.Application = (function() { my.app.Application(); var _min; // @Filename: b.js -var min = (_min = window.min) !== null && _min !== void 0 ? _min : { -}; +var min = (_min = window.min) !== null && _min !== void 0 ? _min : {}; var _app1; -min.app = (_app1 = min.app) !== null && _app1 !== void 0 ? _app1 : { -}; +min.app = (_app1 = min.app) !== null && _app1 !== void 0 ? _app1 : {}; min.app.Application = (function() { var Application = function Application() { //... diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js index f27a5006b60..ca938d54433 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js @@ -1,10 +1,4 @@ -var _app, _min, _app1, my = null != my ? my : { -}; -my.app = null !== (_app = my.app) && void 0 !== _app ? _app : { -}, my.app.Application = function() { -}, my.app.Application(); -var min = null !== (_min = window.min) && void 0 !== _min ? _min : { -}; -min.app = null !== (_app1 = min.app) && void 0 !== _app1 ? _app1 : { -}, min.app.Application = function() { -}, min.app.Application(); +var _app, _min, _app1, my = null != my ? my : {}; +my.app = null !== (_app = my.app) && void 0 !== _app ? _app : {}, my.app.Application = function() {}, my.app.Application(); +var min = null !== (_min = window.min) && void 0 !== _min ? _min : {}; +min.app = null !== (_app1 = min.app) && void 0 !== _app1 ? _app1 : {}, min.app.Application = function() {}, min.app.Application(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.1.normal.js index 0eec767c261..129ac833727 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.1.normal.js @@ -4,10 +4,8 @@ // @target: es6 // @lib: es6,dom // @Filename: a.js -var my = my || { -}; -my.app = my.app || { -}; +var my = my || {}; +my.app = my.app || {}; my.app.Application = (function() { var Application = function() { //... @@ -16,10 +14,8 @@ my.app.Application = (function() { })(); my.app.Application(); // @Filename: b.js -var min = window.min || { -}; -min.app = min.app || { -}; +var min = window.min || {}; +min.app = min.app || {}; min.app.Application = (function() { var Application = function() { //... diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.2.minified.js index 2a11ec4b816..cefdcee8077 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es2015.2.minified.js @@ -1,10 +1,4 @@ -var my = my || { -}; -my.app = my.app || { -}, my.app.Application = function() { -}, my.app.Application(); -var min = window.min || { -}; -min.app = min.app || { -}, min.app.Application = function() { -}, min.app.Application(); +var my = my || {}; +my.app = my.app || {}, my.app.Application = function() {}, my.app.Application(); +var min = window.min || {}; +min.app = min.app || {}, min.app.Application = function() {}, min.app.Application(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.1.normal.js index 8efeec431f0..ea94338b794 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.1.normal.js @@ -4,10 +4,8 @@ // @target: es6 // @lib: es6,dom // @Filename: a.js -var my = my || { -}; -my.app = my.app || { -}; +var my = my || {}; +my.app = my.app || {}; my.app.Application = (function() { var Application = function Application() { //... @@ -16,10 +14,8 @@ my.app.Application = (function() { })(); my.app.Application(); // @Filename: b.js -var min = window.min || { -}; -min.app = min.app || { -}; +var min = window.min || {}; +min.app = min.app || {}; min.app.Application = (function() { var Application = function Application() { //... diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.2.minified.js index 2a11ec4b816..cefdcee8077 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_es5.2.minified.js @@ -1,10 +1,4 @@ -var my = my || { -}; -my.app = my.app || { -}, my.app.Application = function() { -}, my.app.Application(); -var min = window.min || { -}; -min.app = min.app || { -}, min.app.Application = function() { -}, min.app.Application(); +var my = my || {}; +my.app = my.app || {}, my.app.Application = function() {}, my.app.Application(); +var min = window.min || {}; +min.app = min.app || {}, min.app.Application = function() {}, min.app.Application(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.1.normal.js index 68c7d254a36..b0ff666c4b7 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.1.normal.js @@ -3,17 +3,14 @@ // @checkJs: true // @target: esnext // @Filename: a.js -var my = my !== null && my !== void 0 ? my : { -}; +var my = my !== null && my !== void 0 ? my : {}; /** @param {number} n */ my.method = function(n) { return n + 1; }; my.number = 1; -my.object = { -}; +my.object = {}; var _predicate; -my.predicate = (_predicate = my.predicate) !== null && _predicate !== void 0 ? _predicate : { -}; +my.predicate = (_predicate = my.predicate) !== null && _predicate !== void 0 ? _predicate : {}; my.predicate.query = function() { var me = this; me.property = false; @@ -36,14 +33,11 @@ my.predicate.type = class _class { }; var _min; // global-ish prefixes -var min = (_min = window.min) !== null && _min !== void 0 ? _min : { -}; +var min = (_min = window.min) !== null && _min !== void 0 ? _min : {}; var _nest; -min.nest = (_nest = this.min.nest) !== null && _nest !== void 0 ? _nest : function() { -}; +min.nest = (_nest = this.min.nest) !== null && _nest !== void 0 ? _nest : function() {}; var _other; min.nest.other = (_other = self.min.nest.other) !== null && _other !== void 0 ? _other : class { }; var _property; -min.property = (_property = global.min.property) !== null && _property !== void 0 ? _property : { -}; +min.property = (_property = global.min.property) !== null && _property !== void 0 ? _property : {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.2.minified.js index c151ef9e343..f34b7219df1 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es2015.2.minified.js @@ -1,10 +1,7 @@ -var _predicate, _sort, _min, _nest, _other, _property, my = null != my ? my : { -}; +var _predicate, _sort, _min, _nest, _other, _property, my = null != my ? my : {}; my.method = function(n) { return n + 1; -}, my.number = 1, my.object = { -}, my.predicate = null !== (_predicate = my.predicate) && void 0 !== _predicate ? _predicate : { -}, my.predicate.query = function() { +}, my.number = 1, my.object = {}, my.predicate = null !== (_predicate = my.predicate) && void 0 !== _predicate ? _predicate : {}, my.predicate.query = function() { var me = this; me.property = !1; }, new my.predicate.query(), my.predicate.query.another = function() { @@ -16,9 +13,6 @@ my.method = function(n) { return 101; } }; -var min = null !== (_min = window.min) && void 0 !== _min ? _min : { -}; -min.nest = null !== (_nest = this.min.nest) && void 0 !== _nest ? _nest : function() { -}, min.nest.other = null !== (_other = self.min.nest.other) && void 0 !== _other ? _other : class { -}, min.property = null !== (_property = global.min.property) && void 0 !== _property ? _property : { -}; +var min = null !== (_min = window.min) && void 0 !== _min ? _min : {}; +min.nest = null !== (_nest = this.min.nest) && void 0 !== _nest ? _nest : function() {}, min.nest.other = null !== (_other = self.min.nest.other) && void 0 !== _other ? _other : class { +}, min.property = null !== (_property = global.min.property) && void 0 !== _property ? _property : {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.1.normal.js index cc59cca6b8a..f039c3f9910 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.1.normal.js @@ -22,17 +22,14 @@ function _createClass(Constructor, protoProps, staticProps) { // @checkJs: true // @target: esnext // @Filename: a.js -var my = my !== null && my !== void 0 ? my : { -}; +var my = my !== null && my !== void 0 ? my : {}; /** @param {number} n */ my.method = function(n) { return n + 1; }; my.number = 1; -my.object = { -}; +my.object = {}; var _predicate; -my.predicate = (_predicate = my.predicate) !== null && _predicate !== void 0 ? _predicate : { -}; +my.predicate = (_predicate = my.predicate) !== null && _predicate !== void 0 ? _predicate : {}; my.predicate.query = function() { var me = this; me.property = false; @@ -65,16 +62,13 @@ my.predicate.type = /*#__PURE__*/ (function() { })(); var _min; // global-ish prefixes -var min = (_min = window.min) !== null && _min !== void 0 ? _min : { -}; +var min = (_min = window.min) !== null && _min !== void 0 ? _min : {}; var _nest; -min.nest = (_nest = this.min.nest) !== null && _nest !== void 0 ? _nest : function() { -}; +min.nest = (_nest = this.min.nest) !== null && _nest !== void 0 ? _nest : function() {}; var _other; min.nest.other = (_other = self.min.nest.other) !== null && _other !== void 0 ? _other : function _class() { "use strict"; _classCallCheck(this, _class); }; var _property; -min.property = (_property = global.min.property) !== null && _property !== void 0 ? _property : { -}; +min.property = (_property = global.min.property) !== null && _property !== void 0 ? _property : {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.2.minified.js index 63910cc8ce2..a7f723021d5 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_1_es5.2.minified.js @@ -7,13 +7,10 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var _predicate, _sort, _min, _nest, _other, _property, my = null != my ? my : { -}; +var _predicate, _sort, _min, _nest, _other, _property, my = null != my ? my : {}; my.method = function(n) { return n + 1; -}, my.number = 1, my.object = { -}, my.predicate = null !== (_predicate = my.predicate) && void 0 !== _predicate ? _predicate : { -}, my.predicate.query = function() { +}, my.number = 1, my.object = {}, my.predicate = null !== (_predicate = my.predicate) && void 0 !== _predicate ? _predicate : {}, my.predicate.query = function() { var me = this; me.property = !1; }, new my.predicate.query(), my.predicate.query.another = function() { @@ -35,11 +32,8 @@ my.method = function(n) { } ], _defineProperties((Constructor = _class).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), _class; })(); -var min = null !== (_min = window.min) && void 0 !== _min ? _min : { -}; -min.nest = null !== (_nest = this.min.nest) && void 0 !== _nest ? _nest : function() { -}, min.nest.other = null !== (_other = self.min.nest.other) && void 0 !== _other ? _other : function _class() { +var min = null !== (_min = window.min) && void 0 !== _min ? _min : {}; +min.nest = null !== (_nest = this.min.nest) && void 0 !== _nest ? _nest : function() {}, min.nest.other = null !== (_other = self.min.nest.other) && void 0 !== _other ? _other : function _class() { "use strict"; _classCallCheck(this, _class); -}, min.property = null !== (_property = global.min.property) && void 0 !== _property ? _property : { -}; +}, min.property = null !== (_property = global.min.property) && void 0 !== _property ? _property : {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.1.normal.js index 825b0586d54..04069a20928 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.1.normal.js @@ -3,16 +3,13 @@ // @checkJs: true // @target: es6 // @Filename: a.js -var my = my || { -}; +var my = my || {}; /** @param {number} n */ my.method = function(n) { return n + 1; }; my.number = 1; -my.object = { -}; -my.predicate = my.predicate || { -}; +my.object = {}; +my.predicate = my.predicate || {}; my.predicate.query = function() { var me = this; me.property = false; @@ -33,11 +30,8 @@ my.predicate.type = class _class { } }; // global-ish prefixes -var min = window.min || { -}; -min.nest = this.min.nest || function() { -}; +var min = window.min || {}; +min.nest = this.min.nest || function() {}; min.nest.other = self.min.nest.other || class { }; -min.property = global.min.property || { -}; +min.property = global.min.property || {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.2.minified.js index 95203e8a725..97788592da2 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es2015.2.minified.js @@ -1,10 +1,7 @@ -var my = my || { -}; +var my = my || {}; my.method = function(n) { return n + 1; -}, my.number = 1, my.object = { -}, my.predicate = my.predicate || { -}, my.predicate.query = function() { +}, my.number = 1, my.object = {}, my.predicate = my.predicate || {}, my.predicate.query = function() { var me = this; me.property = !1; }, new my.predicate.query(), my.predicate.query.another = function() { @@ -16,9 +13,6 @@ my.method = function(n) { return 101; } }; -var min = window.min || { -}; -min.nest = this.min.nest || function() { -}, min.nest.other = self.min.nest.other || class { -}, min.property = global.min.property || { -}; +var min = window.min || {}; +min.nest = this.min.nest || function() {}, min.nest.other = self.min.nest.other || class { +}, min.property = global.min.property || {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.1.normal.js index 3bb55f2f81b..35ba6baf643 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.1.normal.js @@ -22,16 +22,13 @@ function _createClass(Constructor, protoProps, staticProps) { // @checkJs: true // @target: es6 // @Filename: a.js -var my = my || { -}; +var my = my || {}; /** @param {number} n */ my.method = function(n) { return n + 1; }; my.number = 1; -my.object = { -}; -my.predicate = my.predicate || { -}; +my.object = {}; +my.predicate = my.predicate || {}; my.predicate.query = function() { var me = this; me.property = false; @@ -62,13 +59,10 @@ my.predicate.type = /*#__PURE__*/ (function() { return _class; })(); // global-ish prefixes -var min = window.min || { -}; -min.nest = this.min.nest || function() { -}; +var min = window.min || {}; +min.nest = this.min.nest || function() {}; min.nest.other = self.min.nest.other || function _class() { "use strict"; _classCallCheck(this, _class); }; -min.property = global.min.property || { -}; +min.property = global.min.property || {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.2.minified.js index bcbbef37cbd..194c7ae2deb 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment9_es5.2.minified.js @@ -7,13 +7,10 @@ function _defineProperties(target, props) { descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } -var my = my || { -}; +var my = my || {}; my.method = function(n) { return n + 1; -}, my.number = 1, my.object = { -}, my.predicate = my.predicate || { -}, my.predicate.query = function() { +}, my.number = 1, my.object = {}, my.predicate = my.predicate || {}, my.predicate.query = function() { var me = this; me.property = !1; }, new my.predicate.query(), my.predicate.query.another = function() { @@ -35,11 +32,8 @@ my.method = function(n) { } ], _defineProperties((Constructor = _class).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), _class; })(); -var min = window.min || { -}; -min.nest = this.min.nest || function() { -}, min.nest.other = self.min.nest.other || function _class() { +var min = window.min || {}; +min.nest = this.min.nest || function() {}, min.nest.other = self.min.nest.other || function _class() { "use strict"; _classCallCheck(this, _class); -}, min.property = global.min.property || { -}; +}, min.property = global.min.property || {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.1.normal.js index 5ad0b8328d6..a3a17cf130d 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.1.normal.js @@ -11,9 +11,6 @@ Workspace.Object = class extends Common.Object { }; /** @type {Workspace.Object} */ var am; // @filename: roots.js -var First = { -}; -var Common = { -}; -var Workspace = { -}; +var First = {}; +var Common = {}; +var Workspace = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js index 408449cc575..f40ab2603d8 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js @@ -2,7 +2,4 @@ First.Item = class { }, Common.Object = class extends First.Item { }, Workspace.Object = class extends Common.Object { }; -var First = { -}, Common = { -}, Workspace = { -}; +var First = {}, Common = {}, Workspace = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.1.normal.js index 1a235c718c8..19979caf430 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -100,9 +99,6 @@ Workspace.Object = /*#__PURE__*/ (function(_Object) { })(Common.Object); /** @type {Workspace.Object} */ var am; // @filename: roots.js -var First = { -}; -var Common = { -}; -var Workspace = { -}; +var First = {}; +var Common = {}; +var Workspace = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js index c4a12494f5f..31cf8bcd73c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -65,7 +64,4 @@ First.Item = function I() { } return _class; })(Common.Object); -var First = { -}, Common = { -}, Workspace = { -}; +var First = {}, Common = {}, Workspace = {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.1.normal.js index cc5c7a8d015..538012b20c5 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.1.normal.js @@ -3,10 +3,7 @@ // @Filename: a.js // @outDir: dist // this is a javascript file... -export const Adapter = { -}; -Adapter.prop = { -}; +export const Adapter = {}; +Adapter.prop = {}; // comment this out, and it works -Adapter.asyncMethod = function() { -}; +Adapter.asyncMethod = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.2.minified.js index 3a044d185cf..937df0ae95b 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es2015.2.minified.js @@ -1,5 +1,2 @@ -export const Adapter = { -}; -Adapter.prop = { -}, Adapter.asyncMethod = function() { -}; +export const Adapter = {}; +Adapter.prop = {}, Adapter.asyncMethod = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.1.normal.js index 349e1198330..8e1233ec7ed 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.1.normal.js @@ -3,10 +3,7 @@ // @Filename: a.js // @outDir: dist // this is a javascript file... -export var Adapter = { -}; -Adapter.prop = { -}; +export var Adapter = {}; +Adapter.prop = {}; // comment this out, and it works -Adapter.asyncMethod = function() { -}; +Adapter.asyncMethod = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.2.minified.js index a0bceaf735e..a8b861f8265 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentWithExport_es5.2.minified.js @@ -1,5 +1,2 @@ -export var Adapter = { -}; -Adapter.prop = { -}, Adapter.asyncMethod = function() { -}; +export var Adapter = {}; +Adapter.prop = {}, Adapter.asyncMethod = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.1.normal.js index 942edbb8395..bdc33ae25aa 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.1.normal.js @@ -3,12 +3,10 @@ // @checkJs: true // @Filename: a.js var Outer = class O { - m(x, y) { - } + m(x, y) {} }; Outer.Inner = class I { - n(a, b) { - } + n(a, b) {} }; /** @type {Outer} */ var si; si.m; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.2.minified.js index 8c7d14ea0aa..245d4e1468a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es2015.2.minified.js @@ -1,8 +1,6 @@ var si, oi; (class { - m(x, y) { - } + m(x, y) {} }).Inner = class { - n(a, b) { - } + n(a, b) {} }, si.m, oi.n; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.1.normal.js index 63c5b06cb7d..b0946a823ac 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.1.normal.js @@ -29,8 +29,7 @@ var Outer = /*#__PURE__*/ function() { _createClass(O, [ { key: "m", - value: function m(x, y) { - } + value: function m(x, y) {} } ]); return O; @@ -43,8 +42,7 @@ Outer.Inner = /*#__PURE__*/ (function() { _createClass(I, [ { key: "n", - value: function n(a, b) { - } + value: function n(a, b) {} } ]); return I; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.2.minified.js index 0f0cbe82481..40dca8094c8 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment_es5.2.minified.js @@ -19,8 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { return _createClass(O, [ { key: "m", - value: function(x, y) { - } + value: function(x, y) {} } ]), O; })().Inner = (function() { @@ -31,8 +30,7 @@ function _createClass(Constructor, protoProps, staticProps) { return _createClass(I, [ { key: "n", - value: function(a, b) { - } + value: function(a, b) {} } ]), I; })(), si.m, oi.n; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es2015.1.normal.js index 811facfd1cb..8f3480f9b2a 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es2015.1.normal.js @@ -7,8 +7,7 @@ // all references to _map, set, get, addon should be ok (function container() { /** @constructor */ var Multimap = function() { - this._map = { - }; + this._map = {}; this._map; this.set; this.get; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es5.1.normal.js index 21a97af94fa..672481cdbeb 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment2_es5.1.normal.js @@ -7,8 +7,7 @@ // all references to _map, set, get, addon should be ok (function container() { /** @constructor */ var Multimap = function Multimap() { - this._map = { - }; + this._map = {}; this._map; this.set; this.get; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.1.normal.js index 159a77cc985..432e686bf2d 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.1.normal.js @@ -4,8 +4,7 @@ // @Filename: bug26885.js // @strict: true function Multimap3() { - this._map = { - }; + this._map = {}; } Multimap3.prototype = { /** diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.2.minified.js index 71447556627..15611710e11 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es2015.2.minified.js @@ -1,6 +1,5 @@ function Multimap3() { - this._map = { - }; + this._map = {}; } Multimap3.prototype = { get (key) { diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.1.normal.js index fefa0d74fa8..6543ee05a2a 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.1.normal.js @@ -4,8 +4,7 @@ // @Filename: bug26885.js // @strict: true function Multimap3() { - this._map = { - }; + this._map = {}; } Multimap3.prototype = { /** diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.2.minified.js index 0ab5edbc6d5..a53b64d11d5 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3_es5.2.minified.js @@ -1,6 +1,5 @@ function Multimap3() { - this._map = { - }; + this._map = {}; } Multimap3.prototype = { get: function(key) { diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.1.normal.js index 58b40604682..d6cbab3a7c6 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.1.normal.js @@ -5,8 +5,7 @@ // @outDir: out // @Filename: a.js function Multimap4() { - this._map = { - }; + this._map = {}; } Multimap4["prototype"] = { /** @@ -16,12 +15,9 @@ Multimap4["prototype"] = { return this._map[key + '']; } }; -Multimap4["prototype"]["add-on"] = function() { -}; -Multimap4["prototype"]["addon"] = function() { -}; -Multimap4["prototype"]["__underscores__"] = function() { -}; +Multimap4["prototype"]["add-on"] = function() {}; +Multimap4["prototype"]["addon"] = function() {}; +Multimap4["prototype"]["__underscores__"] = function() {}; const map4 = new Multimap4(); map4.get(""); map4["add-on"](); diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.2.minified.js index b131955084c..9f1c782e4b4 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es2015.2.minified.js @@ -1,14 +1,10 @@ function Multimap4() { - this._map = { - }; + this._map = {}; } Multimap4.prototype = { get (key) { return this._map[key + ""]; } -}, Multimap4.prototype["add-on"] = function() { -}, Multimap4.prototype.addon = function() { -}, Multimap4.prototype["__underscores__"] = function() { -}; +}, Multimap4.prototype["add-on"] = function() {}, Multimap4.prototype.addon = function() {}, Multimap4.prototype["__underscores__"] = function() {}; const map4 = new Multimap4(); map4.get(""), map4["add-on"](), map4.addon(), map4.__underscores__(); diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.1.normal.js index 4bbb9510cee..8fe6b5bfd3b 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.1.normal.js @@ -5,8 +5,7 @@ // @outDir: out // @Filename: a.js function Multimap4() { - this._map = { - }; + this._map = {}; } Multimap4["prototype"] = { /** @@ -16,12 +15,9 @@ Multimap4["prototype"] = { return this._map[key + '']; } }; -Multimap4["prototype"]["add-on"] = function() { -}; -Multimap4["prototype"]["addon"] = function() { -}; -Multimap4["prototype"]["__underscores__"] = function() { -}; +Multimap4["prototype"]["add-on"] = function() {}; +Multimap4["prototype"]["addon"] = function() {}; +Multimap4["prototype"]["__underscores__"] = function() {}; var map4 = new Multimap4(); map4.get(""); map4["add-on"](); diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.2.minified.js index 16dc88cd39a..06190f42fd2 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4_es5.2.minified.js @@ -1,14 +1,10 @@ function Multimap4() { - this._map = { - }; + this._map = {}; } Multimap4.prototype = { get: function(key) { return this._map[key + ""]; } -}, Multimap4.prototype["add-on"] = function() { -}, Multimap4.prototype.addon = function() { -}, Multimap4.prototype["__underscores__"] = function() { -}; +}, Multimap4.prototype["add-on"] = function() {}, Multimap4.prototype.addon = function() {}, Multimap4.prototype["__underscores__"] = function() {}; var map4 = new Multimap4(); map4.get(""), map4["add-on"](), map4.addon(), map4.__underscores__(); diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.1.normal.js index 98eb491f403..f4a915e2675 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.1.normal.js @@ -5,8 +5,7 @@ // @strict: true // all references to _map, set, get, addon should be ok /** @constructor */ var Multimap = function() { - this._map = { - }; + this._map = {}; this._map; this.set; this.get; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.2.minified.js index 6617d441548..7b8aab96783 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es2015.2.minified.js @@ -1,6 +1,5 @@ var Multimap = function() { - this._map = { - }, this._map, this.set, this.get, this.addon; + this._map = {}, this._map, this.set, this.get, this.addon; }; Multimap.prototype = { set: function() { diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.1.normal.js index a65b24efcb2..c0b70642d13 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.1.normal.js @@ -5,8 +5,7 @@ // @strict: true // all references to _map, set, get, addon should be ok /** @constructor */ var Multimap = function Multimap() { - this._map = { - }; + this._map = {}; this._map; this.set; this.get; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.2.minified.js index 655ee156bee..3ff60a07b7f 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment_es5.2.minified.js @@ -1,6 +1,5 @@ var Multimap = function() { - this._map = { - }, this._map, this.set, this.get, this.addon; + this._map = {}, this._map, this.set, this.get, this.addon; }; Multimap.prototype = { set: function() { diff --git a/crates/swc/tests/tsc-references/typeGuardEnums_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardEnums_es2015.1.normal.js index 5ff069c2e19..586d19147c5 100644 --- a/crates/swc/tests/tsc-references/typeGuardEnums_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardEnums_es2015.1.normal.js @@ -1,11 +1,7 @@ var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); var V; -(function(V) { -})(V || (V = { -})); +(function(V) {})(V || (V = {})); let x; if (typeof x === "number") { x; // number|E|V diff --git a/crates/swc/tests/tsc-references/typeGuardEnums_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardEnums_es5.1.normal.js index 6c40a1935a4..239c95510a2 100644 --- a/crates/swc/tests/tsc-references/typeGuardEnums_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardEnums_es5.1.normal.js @@ -1,11 +1,7 @@ var E; -(function(E) { -})(E || (E = { -})); +(function(E) {})(E || (E = {})); var V; -(function(V) { -})(V || (V = { -})); +(function(V) {})(V || (V = {})); var x; if (typeof x === "number") { x; // number|E|V diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.1.normal.js index 8a1bbc6d11d..9b613340dd0 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.2.minified.js index 7c7a7b58983..7f345e4a437 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics_es5.2.minified.js @@ -35,8 +35,7 @@ var a, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.1.normal.js index 08daa96e1fc..207da0d29b4 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.1.normal.js @@ -8,12 +8,10 @@ class RoyalGuard { } } class LeadGuard extends RoyalGuard { - lead() { - } + lead() {} } class FollowerGuard extends RoyalGuard { - follow() { - } + follow() {} } let a = new FollowerGuard(); let b = new LeadGuard(); diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.2.minified.js index f7f5b2f057e..4ac2c0617f0 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es2015.2.minified.js @@ -7,12 +7,10 @@ class RoyalGuard { } } class LeadGuard extends RoyalGuard { - lead() { - } + lead() {} } class FollowerGuard extends RoyalGuard { - follow() { - } + follow() {} } let a = new FollowerGuard(), b = new LeadGuard(); function invalidGuard(c) { diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.1.normal.js index 48b431317b3..c8f7124680e 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.1.normal.js @@ -70,8 +70,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -123,8 +122,7 @@ var LeadGuard = /*#__PURE__*/ function(RoyalGuard) { _createClass(LeadGuard, [ { key: "lead", - value: function lead() { - } + value: function lead() {} } ]); return LeadGuard; @@ -140,8 +138,7 @@ var FollowerGuard = /*#__PURE__*/ function(RoyalGuard) { _createClass(FollowerGuard, [ { key: "follow", - value: function follow() { - } + value: function follow() {} } ]); return FollowerGuard; diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.2.minified.js index cf751afdb58..be23dcdd40a 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors_es5.2.minified.js @@ -39,8 +39,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -86,8 +85,7 @@ var c, RoyalGuard = function() { return _createClass(LeadGuard, [ { key: "lead", - value: function() { - } + value: function() {} } ]), LeadGuard; }(RoyalGuard), FollowerGuard = function(RoyalGuard) { @@ -100,8 +98,7 @@ var c, RoyalGuard = function() { return _createClass(FollowerGuard, [ { key: "follow", - value: function() { - } + value: function() {} } ]), FollowerGuard; }(RoyalGuard), a = new FollowerGuard(), b = new LeadGuard(); diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.1.normal.js index a8e5f47c62d..bf4006da6be 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.1.normal.js @@ -8,12 +8,10 @@ class RoyalGuard { } } class LeadGuard extends RoyalGuard { - lead() { - } + lead() {} } class FollowerGuard extends RoyalGuard { - follow() { - } + follow() {} } let a = new FollowerGuard(); if (a.isLeader()) { @@ -58,12 +56,10 @@ class ArrowGuard { } } class ArrowElite extends ArrowGuard { - defend() { - } + defend() {} } class ArrowMedic extends ArrowGuard { - heal() { - } + heal() {} } let guard = new ArrowGuard(); if (guard.isElite()) { @@ -89,12 +85,10 @@ class MimicGuard { } } class MimicLeader extends MimicGuard { - lead() { - } + lead() {} } class MimicFollower extends MimicGuard { - follow() { - } + follow() {} } let mimic = new MimicGuard(); a.isLeader = mimic.isLeader; diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.2.minified.js index b0930424e84..3cecae87337 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es2015.2.minified.js @@ -7,12 +7,10 @@ class RoyalGuard { } } class LeadGuard extends RoyalGuard { - lead() { - } + lead() {} } class FollowerGuard extends RoyalGuard { - follow() { - } + follow() {} } let a = new FollowerGuard(); a.isLeader() ? a.lead() : a.isFollower() && a.follow(); @@ -30,12 +28,10 @@ class ArrowGuard { } } class ArrowElite extends ArrowGuard { - defend() { - } + defend() {} } class ArrowMedic extends ArrowGuard { - heal() { - } + heal() {} } let guard = new ArrowGuard(); guard.isElite() ? guard.defend() : guard.isMedic() && guard.heal(); @@ -50,12 +46,10 @@ class MimicGuard { } } class MimicLeader extends MimicGuard { - lead() { - } + lead() {} } class MimicFollower extends MimicGuard { - follow() { - } + follow() {} } let mimic = new MimicGuard(); a.isLeader = mimic.isLeader, a.isFollower = mimic.isFollower, mimic.isFollower() && (mimic.follow(), mimic.isFollower = a.isFollower); diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.1.normal.js index 0a849c20274..7fdd86eba4b 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.1.normal.js @@ -70,8 +70,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -123,8 +122,7 @@ var LeadGuard = /*#__PURE__*/ function(RoyalGuard) { _createClass(LeadGuard, [ { key: "lead", - value: function lead() { - } + value: function lead() {} } ]); return LeadGuard; @@ -140,8 +138,7 @@ var FollowerGuard = /*#__PURE__*/ function(RoyalGuard) { _createClass(FollowerGuard, [ { key: "follow", - value: function follow() { - } + value: function follow() {} } ]); return FollowerGuard; @@ -200,8 +197,7 @@ var ArrowElite = /*#__PURE__*/ function(ArrowGuard) { _createClass(ArrowElite, [ { key: "defend", - value: function defend() { - } + value: function defend() {} } ]); return ArrowElite; @@ -217,8 +213,7 @@ var ArrowMedic = /*#__PURE__*/ function(ArrowGuard) { _createClass(ArrowMedic, [ { key: "heal", - value: function heal() { - } + value: function heal() {} } ]); return ArrowMedic; @@ -270,8 +265,7 @@ var MimicLeader = /*#__PURE__*/ function(MimicGuard) { _createClass(MimicLeader, [ { key: "lead", - value: function lead() { - } + value: function lead() {} } ]); return MimicLeader; @@ -287,8 +281,7 @@ var MimicFollower = /*#__PURE__*/ function(MimicGuard) { _createClass(MimicFollower, [ { key: "follow", - value: function follow() { - } + value: function follow() {} } ]); return MimicFollower; diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.2.minified.js index af8b881bab8..3e72629bf28 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis_es5.2.minified.js @@ -39,8 +39,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -86,8 +85,7 @@ var b, crate, RoyalGuard = function() { return _createClass(LeadGuard, [ { key: "lead", - value: function() { - } + value: function() {} } ]), LeadGuard; }(RoyalGuard), FollowerGuard = function(RoyalGuard) { @@ -100,8 +98,7 @@ var b, crate, RoyalGuard = function() { return _createClass(FollowerGuard, [ { key: "follow", - value: function() { - } + value: function() {} } ]), FollowerGuard; }(RoyalGuard), a = new FollowerGuard(); @@ -128,8 +125,7 @@ var ArrowGuard = function() { return _createClass(ArrowElite, [ { key: "defend", - value: function() { - } + value: function() {} } ]), ArrowElite; }(ArrowGuard), ArrowMedic = function(ArrowGuard2) { @@ -142,8 +138,7 @@ var ArrowGuard = function() { return _createClass(ArrowMedic, [ { key: "heal", - value: function() { - } + value: function() {} } ]), ArrowMedic; }(ArrowGuard), guard = new ArrowGuard(); @@ -177,8 +172,7 @@ var MimicGuard = function() { return _createClass(MimicLeader, [ { key: "lead", - value: function() { - } + value: function() {} } ]), MimicLeader; }(MimicGuard), MimicFollower = function(MimicGuard) { @@ -191,8 +185,7 @@ var MimicGuard = function() { return _createClass(MimicFollower, [ { key: "follow", - value: function() { - } + value: function() {} } ]), MimicFollower; }(MimicGuard), mimic = new MimicGuard(); diff --git a/crates/swc/tests/tsc-references/typeGuardFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunction_es5.1.normal.js index 2146ed3bcd6..ba1fbe40a9c 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardFunction_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typeGuardFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunction_es5.2.minified.js index 3bbd0ead4d8..ee8cbc3d2e2 100644 --- a/crates/swc/tests/tsc-references/typeGuardFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardFunction_es5.2.minified.js @@ -41,8 +41,7 @@ var a, subType, union, union2, A = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es2015.1.normal.js index 9b402005b22..1d65a48f851 100644 --- a/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es2015.1.normal.js @@ -5,9 +5,7 @@ if (isNonBlank(value)) { doThat(value); } var Tag2; -(function(Tag2) { -})(Tag2 || (Tag2 = { -})); +(function(Tag2) {})(Tag2 || (Tag2 = {})); if (isNonBlank2(value)) { doThis2(value); } else { diff --git a/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es5.1.normal.js index aef5b393769..a65080c21a3 100644 --- a/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardNarrowsPrimitiveIntersection_es5.1.normal.js @@ -5,9 +5,7 @@ if (isNonBlank(value)) { doThat(value); } var Tag2; -(function(Tag2) { -})(Tag2 || (Tag2 = { -})); +(function(Tag2) {})(Tag2 || (Tag2 = {})); if (isNonBlank2(value)) { doThis2(value); } else { diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es2015.1.normal.js index 78ad09a38b1..3476b97a549 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es2015.1.normal.js @@ -45,7 +45,6 @@ if (ctor5 instanceof C1) { ctor5.p2; // C2 } var ctor6; -if (ctor6 instanceof C1 || ctor6 instanceof C2) { -} else { +if (ctor6 instanceof C1 || ctor6 instanceof C2) {} else { ctor6.p4; // C3 } diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.1.normal.js index ec13e2eb8c6..ea3fa96ef99 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.1.normal.js @@ -56,8 +56,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -132,7 +131,6 @@ if (_instanceof(ctor5, C1)) { ctor5.p2; // C2 } var ctor6; -if (_instanceof(ctor6, C1) || _instanceof(ctor6, C2)) { -} else { +if (_instanceof(ctor6, C1) || _instanceof(ctor6, C2)) {} else { ctor6.p4; // C3 } diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.2.minified.js index f17fe6bfd53..196aa7ea5fa 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf_es5.2.minified.js @@ -38,8 +38,7 @@ var ctor1, ctor2, ctor3, ctor4, ctor5, ctor6, C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.1.normal.js index 8c6807a81d1..39186a75cce 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.2.minified.js index 841f669f88c..7da1aff747d 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFormIsType_es5.2.minified.js @@ -35,8 +35,7 @@ var c1Orc2, c2Ord1, C1 = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es2015.1.normal.js index db534ee40b8..8e322006852 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es2015.1.normal.js @@ -77,8 +77,7 @@ class SelfAssert { inThis() { if ("a" in this) { let y = this.a; - } else { - } + } else {} } } function f(i) { diff --git a/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es5.1.normal.js index 122f23a99c4..db87190acf9 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFromPropNameInUnionType_es5.1.normal.js @@ -136,8 +136,7 @@ var SelfAssert = // added for completeness value: function inThis() { if ("a" in this) { var y = this.a; - } else { - } + } else {} } } ]); diff --git a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.1.normal.js index 1d450ca95a6..0a4fe02dbf2 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.1.normal.js @@ -50,10 +50,8 @@ var m; y = typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } - })(m2 || (m2 = { - })); -})(m || (m = { -})); + })(m2 || (m2 = {})); +})(m || (m = {})); var m1; (function(m1) { var x; @@ -70,9 +68,6 @@ var m1; y = typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } - })(m3 = m2.m3 || (m2.m3 = { - })); - })(m21 || (m21 = { - })); -})(m1 || (m1 = { -})); + })(m3 = m2.m3 || (m2.m3 = {})); + })(m21 || (m21 = {})); +})(m1 || (m1 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.2.minified.js index 40c6aab4662..0533fe7884e 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es2015.2.minified.js @@ -2,14 +2,9 @@ var m, m1; !function(m) { var x; let m2; - m2 || (m2 = { - }), "string" == typeof x || ("boolean" == typeof x, x.toString()); -}(m || (m = { -})), (function(m1) { + m2 || (m2 = {}), "string" == typeof x || ("boolean" == typeof x, x.toString()); +}(m || (m = {})), (function(m1) { var x, m2; let m21; - (m2 = m21 || (m21 = { - })).m3 || (m2.m3 = { - }), "string" == typeof x || ("boolean" == typeof x, x.toString()); -})(m1 || (m1 = { -})); + (m2 = m21 || (m21 = {})).m3 || (m2.m3 = {}), "string" == typeof x || ("boolean" == typeof x, x.toString()); +})(m1 || (m1 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.1.normal.js index d9021b2d5fb..8ce3fe24dd4 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.1.normal.js @@ -50,10 +50,8 @@ var m; y = typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } - })(m2 || (m2 = { - })); -})(m || (m = { -})); + })(m2 || (m2 = {})); +})(m || (m = {})); var m1; (function(m1) { var x; @@ -70,9 +68,6 @@ var m1; y = typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } - })(m3 = m2.m3 || (m2.m3 = { - })); - })(m21 || (m21 = { - })); -})(m1 || (m1 = { -})); + })(m3 = m2.m3 || (m2.m3 = {})); + })(m21 || (m21 = {})); +})(m1 || (m1 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.2.minified.js index c41c69c82b4..5c74f011327 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock_es5.2.minified.js @@ -1,13 +1,8 @@ var m, m1; !function(m) { var x, m2; - m2 || (m2 = { - }), "string" == typeof x || ("boolean" == typeof x, x.toString()); -}(m || (m = { -})), (function(m1) { + m2 || (m2 = {}), "string" == typeof x || ("boolean" == typeof x, x.toString()); +}(m || (m = {})), (function(m1) { var x, m2, m21; - (m21 = m2 || (m2 = { - })).m3 || (m21.m3 = { - }), "string" == typeof x || ("boolean" == typeof x, x.toString()); -})(m1 || (m1 = { -})); + (m21 = m2 || (m2 = {})).m3 || (m21.m3 = {}), "string" == typeof x || ("boolean" == typeof x, x.toString()); +})(m1 || (m1 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.1.normal.js index 1b8726f4276..0d10fa3fb95 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.1.normal.js @@ -23,8 +23,7 @@ var m1; strOrNum = var3; // string | number } m11.var3 = var3; -})(m1 || (m1 = { -})); +})(m1 || (m1 = {})); // local module var m2; (function(m21) { @@ -52,11 +51,9 @@ var m2; strOrNum = var5; // string | number } m32.var5 = var5; - })(m31 || (m31 = { - })); + })(m31 || (m31 = {})); m21.var3 = var3; -})(m2 || (m2 = { -})); +})(m2 || (m2 = {})); // Dotted module var m3; (function(m33) { @@ -78,7 +75,5 @@ var m3; strOrNum = var3; // string | number } m4.var3 = var3; - })(m41 = m33.m4 || (m33.m4 = { - })); -})(m3 || (m3 = { -})); + })(m41 = m33.m4 || (m33.m4 = {})); +})(m3 || (m3 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.2.minified.js index fe5a39274f9..ae226a94266 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardsInModule_es2015.2.minified.js @@ -2,16 +2,11 @@ var num, strOrNum, var1, m1, m2, m3; !function(m11) { var var2, var3; num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m11.var3 = var3; -}(m1 || (m1 = { -})), (function(m21) { +}(m1 || (m1 = {})), (function(m21) { var var2, var3, m32, var4, var5; let m31; - m32 = m31 || (m31 = { - }), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m32.var5 = var5, m21.var3 = var3; -})(m2 || (m2 = { -})), (function(m33) { + m32 = m31 || (m31 = {}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m32.var5 = var5, m21.var3 = var3; +})(m2 || (m2 = {})), (function(m33) { var m4, var2, var3; - m4 = m33.m4 || (m33.m4 = { - }), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m4.var3 = var3; -})(m3 || (m3 = { -})); + m4 = m33.m4 || (m33.m4 = {}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m4.var3 = var3; +})(m3 || (m3 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInModule_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsInModule_es5.1.normal.js index d45ebe70a71..a83074328d7 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInModule_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsInModule_es5.1.normal.js @@ -23,8 +23,7 @@ var m1; strOrNum = var3; // string | number } m11.var3 = var3; -})(m1 || (m1 = { -})); +})(m1 || (m1 = {})); // local module var m2; (function(m21) { @@ -52,11 +51,9 @@ var m2; strOrNum = var5; // string | number } m32.var5 = var5; - })(m31 || (m31 = { - })); + })(m31 || (m31 = {})); m21.var3 = var3; -})(m2 || (m2 = { -})); +})(m2 || (m2 = {})); // Dotted module var m3; (function(m33) { @@ -78,7 +75,5 @@ var m3; strOrNum = var3; // string | number } m4.var3 = var3; - })(m41 = m33.m4 || (m33.m4 = { - })); -})(m3 || (m3 = { -})); + })(m41 = m33.m4 || (m33.m4 = {})); +})(m3 || (m3 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsInModule_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardsInModule_es5.2.minified.js index c5c2afb9d80..bc0ea0ea8c8 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInModule_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardsInModule_es5.2.minified.js @@ -2,15 +2,10 @@ var num, strOrNum, var1, m1, m2, m3; !function(m11) { var var2, var3; num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m11.var3 = var3; -}(m1 || (m1 = { -})), (function(m21) { +}(m1 || (m1 = {})), (function(m21) { var var2, var3, m32, m31, var4, var5; - m31 = m32 || (m32 = { - }), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m31.var5 = var5, m21.var3 = var3; -})(m2 || (m2 = { -})), (function(m33) { + m31 = m32 || (m32 = {}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m31.var5 = var5, m21.var3 = var3; +})(m2 || (m2 = {})), (function(m33) { var m4, var2, var3; - m4 = m33.m4 || (m33.m4 = { - }), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m4.var3 = var3; -})(m3 || (m3 = { -})); + m4 = m33.m4 || (m33.m4 = {}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m4.var3 = var3; +})(m3 || (m3 = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es2015.1.normal.js index 9268fd7ac90..2456134aa75 100644 --- a/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es2015.1.normal.js @@ -15,8 +15,6 @@ var o = { prop1: "string", prop2: true }; -if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) { -} +if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} var prop1 = o.prop1; -if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { -} +if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) {} diff --git a/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es5.1.normal.js index 8d3bf2d6dcc..a6d6159a428 100644 --- a/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsOnClassProperty_es5.1.normal.js @@ -47,8 +47,6 @@ var o = { prop1: "string", prop2: true }; -if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) { -} +if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} var prop1 = o.prop1; -if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { -} +if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) {} diff --git a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es2015.1.normal.js index b5cb922eb72..05df721bde9 100644 --- a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es2015.1.normal.js @@ -2,12 +2,10 @@ var result; var result2; if (!(result instanceof RegExp)) { result = result2; -} else if (!result.global) { -} +} else if (!result.global) {} class C { validate() { - return { - }; + return {}; } } function foo() { @@ -19,7 +17,6 @@ function foo() { v // Validator & Partial via subtype reduction ; if (v.onChanges) { - v.onChanges({ - }); + v.onChanges({}); } } diff --git a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.1.normal.js index be4d363c2e3..2de6b1bc0f0 100644 --- a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.1.normal.js @@ -28,8 +28,7 @@ var result; var result2; if (!_instanceof(result, RegExp)) { result = result2; -} else if (!result.global) { -} +} else if (!result.global) {} var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -39,8 +38,7 @@ var C = /*#__PURE__*/ function() { { key: "validate", value: function validate() { - return { - }; + return {}; } } ]); @@ -55,7 +53,6 @@ function foo() { v // Validator & Partial via subtype reduction ; if (v.onChanges) { - v.onChanges({ - }); + v.onChanges({}); } } diff --git a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.2.minified.js b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.2.minified.js index 14bc425ba9e..0f76bf65222 100644 --- a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf_es5.2.minified.js @@ -17,8 +17,7 @@ var left, right, result, result2, C = function() { { key: "validate", value: function() { - return { - }; + return {}; } } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; diff --git a/crates/swc/tests/tsc-references/typeLookupInIIFE_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeLookupInIIFE_es2015.1.normal.js index 850041ce6ee..802db687a7d 100644 --- a/crates/swc/tests/tsc-references/typeLookupInIIFE_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeLookupInIIFE_es2015.1.normal.js @@ -4,6 +4,5 @@ // @noImplicitAny: true // @Filename: a.js // #22973 -var ns = function() { -}(); +var ns = function() {}(); /** @type {ns.NotFound} */ var crash; diff --git a/crates/swc/tests/tsc-references/typeLookupInIIFE_es5.1.normal.js b/crates/swc/tests/tsc-references/typeLookupInIIFE_es5.1.normal.js index 850041ce6ee..802db687a7d 100644 --- a/crates/swc/tests/tsc-references/typeLookupInIIFE_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeLookupInIIFE_es5.1.normal.js @@ -4,6 +4,5 @@ // @noImplicitAny: true // @Filename: a.js // #22973 -var ns = function() { -}(); +var ns = function() {}(); /** @type {ns.NotFound} */ var crash; diff --git a/crates/swc/tests/tsc-references/typeOfThisInConstructorParamList_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInConstructorParamList_es2015.1.normal.js index 24bd7caa4cd..3212458ef71 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInConstructorParamList_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInConstructorParamList_es2015.1.normal.js @@ -1,6 +1,5 @@ //type of 'this' in constructor param list is the class instance type (error) class ErrClass { // Should be an error - constructor(f = this){ - } + constructor(f = this){} } diff --git a/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es2015.1.normal.js index cc7cf8f679c..45bd9bbc98b 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es2015.1.normal.js @@ -37,5 +37,4 @@ var M; var x = this; var x; }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.1.normal.js index 53ce11c865f..50a8340cbd0 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.1.normal.js @@ -42,5 +42,4 @@ var M; var x = this; var x; }; -})(M || (M = { -})); +})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.2.minified.js index 5ceebc20625..1cc70aea5cf 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeOfThisInFunctionExpression_es5.2.minified.js @@ -2,7 +2,5 @@ var C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, C), this.x = function() { - }, this.y = function() { - }; + }(this, C), this.x = function() {}, this.y = function() {}; }; diff --git a/crates/swc/tests/tsc-references/typeOfThisInMemberFunctions_es5.2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInMemberFunctions_es5.2.minified.js index 2eb34d61546..95b0de901af 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInMemberFunctions_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeOfThisInMemberFunctions_es5.2.minified.js @@ -18,14 +18,12 @@ var C = function() { return _createClass(C, [ { key: "foo", - value: function() { - } + value: function() {} } ], [ { key: "bar", - value: function() { - } + value: function() {} } ]), C; }(), D = function() { @@ -36,14 +34,12 @@ var C = function() { return _createClass(D, [ { key: "foo", - value: function() { - } + value: function() {} } ], [ { key: "bar", - value: function() { - } + value: function() {} } ]), D; }(), E = function() { @@ -54,14 +50,12 @@ var C = function() { return _createClass(E, [ { key: "foo", - value: function() { - } + value: function() {} } ], [ { key: "bar", - value: function() { - } + value: function() {} } ]), E; }(); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.1.normal.js index 094cdab9def..dd0c159ebeb 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.1.normal.js @@ -4,8 +4,7 @@ class C { var t = this; return this; } - constructor(x){ - } + constructor(x){} } var t = C.bar(); // all ok @@ -18,8 +17,7 @@ class C2 { var t = this; return this; } - constructor(x){ - } + constructor(x){} } var t2 = C2.bar(); // all ok diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.2.minified.js index a4a0097f855..8aa7f644a94 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers_es2015.2.minified.js @@ -2,15 +2,13 @@ var t = (class { static bar() { return this; } - constructor(x){ - } + constructor(x){} }).bar(); t.foo + 1, t.bar(), new t(1); var t2 = (class { static bar() { return this; } - constructor(x){ - } + constructor(x){} }).bar(); t2.foo + 1, t2.bar(), new t2(""); diff --git a/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es2015.1.normal.js index 3cf8d935038..eb35b7a3c09 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es2015.1.normal.js @@ -1,7 +1,6 @@ class SomeClass { method() { - while(0){ - } + while(0){} this.state.data; if (this.state.type === "stringVariant") { const s = this.state.data; @@ -12,8 +11,7 @@ class SomeClass2 { method() { var ref; const c = false; - while(c){ - } + while(c){} if (this.state.type === "numberVariant") { this.state.data; } diff --git a/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es5.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es5.1.normal.js index 3f369b9bebf..47c05ffc8f7 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInstanceMemberNarrowedWithLoopAntecedent_es5.1.normal.js @@ -26,8 +26,7 @@ var SomeClass = /*#__PURE__*/ function() { { key: "method", value: function method() { - while(0){ - } + while(0){} this.state.data; if (this.state.type === "stringVariant") { var s = this.state.data; @@ -48,8 +47,7 @@ var SomeClass2 = /*#__PURE__*/ function() { value: function method() { var ref; var c = false; - while(c){ - } + while(c){} if (this.state.type === "numberVariant") { this.state.data; } diff --git a/crates/swc/tests/tsc-references/typeOfThis_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeOfThis_es2015.2.minified.js index bd0c8c11d34..8a7bef778d0 100644 --- a/crates/swc/tests/tsc-references/typeOfThis_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeOfThis_es2015.2.minified.js @@ -1,6 +1,5 @@ class MyTestClass { - memberFunc(t = this) { - } + memberFunc(t = this) {} get prop() { return this; } @@ -22,13 +21,11 @@ class MyTestClass { p.staticCanary; } constructor(){ - this.someFunc = ()=>{ - }, this.canary, this.canary = 3; + this.someFunc = ()=>{}, this.canary, this.canary = 3; } } class MyGenericTestClass { - memberFunc(t = this) { - } + memberFunc(t = this) {} get prop() { return this; } @@ -50,8 +47,7 @@ class MyGenericTestClass { p.staticCanary; } constructor(){ - this.someFunc = ()=>{ - }, this.canary, this.canary = 3; + this.someFunc = ()=>{}, this.canary, this.canary = 3; } } this.spaaaaace = 4; diff --git a/crates/swc/tests/tsc-references/typeOfThis_es5.2.minified.js b/crates/swc/tests/tsc-references/typeOfThis_es5.2.minified.js index 9d137139721..8aa75edbced 100644 --- a/crates/swc/tests/tsc-references/typeOfThis_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeOfThis_es5.2.minified.js @@ -13,8 +13,7 @@ function _createClass(Constructor, protoProps, staticProps) { var MyTestClass = function() { "use strict"; function MyTestClass() { - _classCallCheck(this, MyTestClass), this.someFunc = function() { - }, this.canary, this.canary = 3; + _classCallCheck(this, MyTestClass), this.someFunc = function() {}, this.canary, this.canary = 3; } return _createClass(MyTestClass, [ { @@ -57,8 +56,7 @@ var MyTestClass = function() { }(), MyGenericTestClass = function() { "use strict"; function MyGenericTestClass() { - _classCallCheck(this, MyGenericTestClass), this.someFunc = function() { - }, this.canary, this.canary = 3; + _classCallCheck(this, MyGenericTestClass), this.someFunc = function() {}, this.canary, this.canary = 3; } return _createClass(MyGenericTestClass, [ { diff --git a/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.1.normal.js index f1626de435a..ba4cc2f8f56 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.2.minified.js index 1eb040fa63f..6299b45621f 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsBaseType_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.1.normal.js index 6aca8472087..2bf043460a5 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.1.normal.js @@ -4,8 +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); function foo2(x, y) { @@ -15,8 +14,7 @@ foo2(1, { length: '' }); foo2(1, { - length: { - } + length: {} }); foo2([], [ '' diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.2.minified.js index 333e6581c81..cbe62e56c9a 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es2015.2.minified.js @@ -4,12 +4,10 @@ function foo(x, y) { function foo2(x, y) { return y; } -foo(1, ""), foo(1, { -}), foo(1, void 0), foo2(1, { +foo(1, ""), foo(1, {}), foo(1, void 0), foo2(1, { length: "" }), foo2(1, { - length: { - } + length: {} }), foo2([], [ "" ]); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.1.normal.js index 6aca8472087..2bf043460a5 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.1.normal.js @@ -4,8 +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); function foo2(x, y) { @@ -15,8 +14,7 @@ foo2(1, { length: '' }); foo2(1, { - length: { - } + length: {} }); foo2([], [ '' diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.2.minified.js index 333e6581c81..cbe62e56c9a 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2_es5.2.minified.js @@ -4,12 +4,10 @@ function foo(x, y) { function foo2(x, y) { return y; } -foo(1, ""), foo(1, { -}), foo(1, void 0), foo2(1, { +foo(1, ""), foo(1, {}), foo(1, void 0), foo2(1, { length: "" }), foo2(1, { - length: { - } + length: {} }), foo2([], [ "" ]); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.1.normal.js index ea2b1baff4f..d4bc80794c9 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.1.normal.js @@ -22,10 +22,7 @@ foo(a, { bar: '', hm: true }, b); -foo((x, y)=>{ -}, (x, y)=>{ -}, ()=>{ -}); +foo((x, y)=>{}, (x, y)=>{}, ()=>{}); function foo2(x, y, z) { return z; } diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.2.minified.js index bb0ae754d8c..fbb25159b4b 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es2015.2.minified.js @@ -15,7 +15,4 @@ foo(1, 2, ""), foo({ foo: 1, bar: "", hm: !0 -}, b), foo((x, y)=>{ -}, (x, y)=>{ -}, ()=>{ -}), foo(b, a, c), foo(c, c, a); +}, b), foo((x, y)=>{}, (x, y)=>{}, ()=>{}), foo(b, a, c), foo(c, c, a); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.1.normal.js index 137c19e690b..aa8144aedc4 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.1.normal.js @@ -22,10 +22,7 @@ foo(a, { bar: '', hm: true }, b); -foo(function(x, y) { -}, function(x, y) { -}, function() { -}); +foo(function(x, y) {}, function(x, y) {}, function() {}); function foo2(x, y, z) { return z; } diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.2.minified.js index 499b5ecf1e3..0efba3c9b95 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2_es5.2.minified.js @@ -15,7 +15,4 @@ foo(1, 2, ""), foo({ foo: 1, bar: "", hm: !0 -}, b), foo(function(x, y) { -}, function(x, y) { -}, function() { -}), foo(b, a, c), foo(c, c, a); +}, b), foo(function(x, y) {}, function(x, y) {}, function() {}), foo(b, a, c), foo(c, c, a); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.1.normal.js index 84dfe2e6901..35cac9947f6 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.1.normal.js @@ -22,10 +22,7 @@ foo(a, b, { bar: '', hm: true }); -foo((x, y)=>{ -}, (x)=>{ -}, ()=>{ -}); +foo((x, y)=>{}, (x)=>{}, ()=>{}); function foo2(x, y, z) { return z; } diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.2.minified.js index 3d6d596c7d3..f6f7b04231c 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es2015.2.minified.js @@ -15,10 +15,7 @@ foo(1, 2, 3), foo({ foo: 1, bar: "", hm: !0 -}), foo((x, y)=>{ -}, (x)=>{ -}, ()=>{ -}), foo(a, a, a), foo(a, b, c), foo(b, b, { +}), foo((x, y)=>{}, (x)=>{}, ()=>{}), foo(a, a, a), foo(a, b, c), foo(b, b, { foo: 1, bar: "", hm: "" diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.1.normal.js index ce18d151397..8e35849262e 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.1.normal.js @@ -22,10 +22,7 @@ foo(a, b, { bar: '', hm: true }); -foo(function(x, y) { -}, function(x) { -}, function() { -}); +foo(function(x, y) {}, function(x) {}, function() {}); function foo2(x, y, z) { return z; } diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.2.minified.js index 3d3d9a4f530..dee64d547f7 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively_es5.2.minified.js @@ -15,10 +15,7 @@ foo(1, 2, 3), foo({ foo: 1, bar: "", hm: !0 -}), foo(function(x, y) { -}, function(x) { -}, function() { -}), foo(a, a, a), foo(a, b, c), foo(b, b, { +}), foo(function(x, y) {}, function(x) {}, function() {}), foo(a, a, a), foo(a, b, c), foo(b, b, { foo: 1, bar: "", hm: "" diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.1.normal.js index 5b393f674c3..4cde7ff6637 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.1.normal.js @@ -4,8 +4,7 @@ function foo(x, y) { return y; } var r = foo(1, 2); -var r = foo({ -}, 1); +var r = foo({}, 1); var a; var b; var r2 = foo(a, b); @@ -19,8 +18,7 @@ function foo2(x, y) { return y; } foo2(1, ''); -foo2({ -}, { +foo2({}, { length: 2 }); foo2(1, { diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.2.minified.js index 6ddbd1d1323..f14d479d47b 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es2015.2.minified.js @@ -5,14 +5,12 @@ function foo(x, y) { function foo2(x, y) { return y; } -foo(1, 2), foo({ -}, 1), foo(a, b), foo({ +foo(1, 2), foo({}, 1), foo(a, b), foo({ x: 1 }, { x: 2, y: 3 -}), foo2(1, ""), foo2({ -}, { +}), foo2(1, ""), foo2({}, { length: 2 }), foo2(1, { width: 3, diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.1.normal.js index 5b393f674c3..4cde7ff6637 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.1.normal.js @@ -4,8 +4,7 @@ function foo(x, y) { return y; } var r = foo(1, 2); -var r = foo({ -}, 1); +var r = foo({}, 1); var a; var b; var r2 = foo(a, b); @@ -19,8 +18,7 @@ function foo2(x, y) { return y; } foo2(1, ''); -foo2({ -}, { +foo2({}, { length: 2 }); foo2(1, { diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.2.minified.js index 6ddbd1d1323..f14d479d47b 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint_es5.2.minified.js @@ -5,14 +5,12 @@ function foo(x, y) { function foo2(x, y) { return y; } -foo(1, 2), foo({ -}, 1), foo(a, b), foo({ +foo(1, 2), foo({}, 1), foo(a, b), foo({ x: 1 }, { x: 2, y: 3 -}), foo2(1, ""), foo2({ -}, { +}), foo2(1, ""), foo2({}, { length: 2 }), foo2(1, { width: 3, diff --git a/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es2015.1.normal.js index 655e904b638..0edbcb3eb69 100644 --- a/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es2015.1.normal.js @@ -3,12 +3,8 @@ class C { } class C2 { } -function f() { -} -function f2() { -} +function f() {} +function f2() {} var a; -var b = ()=>{ -}; -var b2 = ()=>{ -}; +var b = ()=>{}; +var b2 = ()=>{}; diff --git a/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es5.1.normal.js index a923801d391..d542079334e 100644 --- a/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterDirectlyConstrainedToItself_es5.1.normal.js @@ -11,12 +11,8 @@ var C2 = function C2() { "use strict"; _classCallCheck(this, C2); }; -function f() { -} -function f2() { -} +function f() {} +function f2() {} var a; -var b = function() { -}; -var b2 = function() { -}; +var b = function() {}; +var b2 = function() {}; diff --git a/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es2015.1.normal.js index dfb3b18ae6f..c1c8f287174 100644 --- a/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es2015.1.normal.js @@ -2,16 +2,11 @@ class C { } class C2 { } -function f() { -} -function f2() { -} +function f() {} +function f2() {} var a; -var b = ()=>{ -}; -var b2 = ()=>{ -}; +var b = ()=>{}; +var b2 = ()=>{}; class D { } -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es5.1.normal.js index cc90ccd9fa9..1aa0782d525 100644 --- a/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterIndirectlyConstrainedToItself_es5.1.normal.js @@ -11,18 +11,13 @@ var C2 = function C2() { "use strict"; _classCallCheck(this, C2); }; -function f() { -} -function f2() { -} +function f() {} +function f2() {} var a; -var b = function() { -}; -var b2 = function() { -}; +var b = function() {}; +var b2 = function() {}; var D = function D() { "use strict"; _classCallCheck(this, D); }; -function foo() { -} +function foo() {} diff --git a/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es2015.1.normal.js index 0075e4c777b..570051b1e97 100644 --- a/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es2015.1.normal.js @@ -10,30 +10,18 @@ class C5 { } class C6 { } -function f() { -} -function f2() { -} -function f3() { -} -function f4() { -} -function f5() { -} -function f6() { -} -var e = ()=>{ -}; -var e2 = ()=>{ -}; -var e3 = ()=>{ -}; -var e4 = ()=>{ -}; -var e5 = ()=>{ -}; -var e6 = ()=>{ -}; +function f() {} +function f2() {} +function f3() {} +function f4() {} +function f5() {} +function f6() {} +var e = ()=>{}; +var e2 = ()=>{}; +var e3 = ()=>{}; +var e4 = ()=>{}; +var e5 = ()=>{}; +var e6 = ()=>{}; var a; var a2; var a3; diff --git a/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es5.1.normal.js index 0fc246e1729..acb564d2999 100644 --- a/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterUsedAsConstraint_es5.1.normal.js @@ -27,30 +27,18 @@ var C6 = function C6() { "use strict"; _classCallCheck(this, C6); }; -function f() { -} -function f2() { -} -function f3() { -} -function f4() { -} -function f5() { -} -function f6() { -} -var e = function() { -}; -var e2 = function() { -}; -var e3 = function() { -}; -var e4 = function() { -}; -var e5 = function() { -}; -var e6 = function() { -}; +function f() {} +function f2() {} +function f3() {} +function f4() {} +function f5() {} +function f6() {} +var e = function() {}; +var e2 = function() {}; +var e3 = function() {}; +var e4 = function() {}; +var e5 = function() {}; +var e6 = function() {}; var a; var a2; var a3; diff --git a/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es2015.1.normal.js index 49d083abb23..0199cc1cdcf 100644 --- a/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es2015.1.normal.js @@ -1,28 +1,17 @@ -function foo1(x) { -} -function foo2(x) { -} +function foo1(x) {} +function foo2(x) {} function foo3(x, y) { - function inner(x) { - } - function inner2(x) { - } + function inner(x) {} + function inner2(x) {} } class C { - foo1(x) { - } - foo2(a, x) { - } - foo3(x) { - } - foo4(x) { - } + foo1(x) {} + foo2(a, x) {} + foo3(x) {} + foo4(x) {} } class C2 { - foo1(x) { - } - foo2(a, x) { - } - foo3(x) { - } + foo1(x) {} + foo2(a, x) {} + foo3(x) {} } diff --git a/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.1.normal.js b/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.1.normal.js index 0ffdecf9f35..5ad67092313 100644 --- a/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.1.normal.js @@ -17,15 +17,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function foo1(x) { -} -function foo2(x) { -} +function foo1(x) {} +function foo2(x) {} function foo3(x, y) { - var inner = function inner(x) { - }; - var inner2 = function inner2(x) { - }; + var inner = function inner(x) {}; + var inner2 = function inner2(x) {}; } var C = /*#__PURE__*/ function() { "use strict"; @@ -35,23 +31,19 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo1", - value: function foo1(x) { - } + value: function foo1(x) {} }, { key: "foo2", - value: function foo2(a, x) { - } + value: function foo2(a, x) {} }, { key: "foo3", - value: function foo3(x) { - } + value: function foo3(x) {} }, { key: "foo4", - value: function foo4(x) { - } + value: function foo4(x) {} } ]); return C; @@ -64,18 +56,15 @@ var C2 = /*#__PURE__*/ function() { _createClass(C2, [ { key: "foo1", - value: function foo1(x) { - } + value: function foo1(x) {} }, { key: "foo2", - value: function foo2(a, x) { - } + value: function foo2(a, x) {} }, { key: "foo3", - value: function foo3(x) { - } + value: function foo3(x) {} } ]); return C2; diff --git a/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.2.minified.js index 9474f786950..7625a4f9e49 100644 --- a/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParametersAreIdenticalToThemselves_es5.2.minified.js @@ -18,23 +18,19 @@ var C = function() { return _createClass(C, [ { key: "foo1", - value: function(x) { - } + value: function(x) {} }, { key: "foo2", - value: function(a, x) { - } + value: function(a, x) {} }, { key: "foo3", - value: function(x) { - } + value: function(x) {} }, { key: "foo4", - value: function(x) { - } + value: function(x) {} } ]), C; }(), C2 = function() { @@ -45,18 +41,15 @@ var C = function() { return _createClass(C2, [ { key: "foo1", - value: function(x) { - } + value: function(x) {} }, { key: "foo2", - value: function(a, x) { - } + value: function(a, x) {} }, { key: "foo3", - value: function(x) { - } + value: function(x) {} } ]), C2; }(); diff --git a/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es2015.2.minified.js index c1593102235..0bbc204105f 100644 --- a/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es2015.2.minified.js @@ -1,9 +1,7 @@ var c = new class { - foo() { - } + foo() {} constructor(){ - this.x = (a)=>{ - }; + this.x = (a)=>{}; } }(); c.data = c.x(null), c.data = c.foo(); diff --git a/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es5.2.minified.js b/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es5.2.minified.js index 5e3e5519e78..cf21c065d62 100644 --- a/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParametersAvailableInNestedScope_es5.2.minified.js @@ -10,14 +10,12 @@ var C = function() { function C() { !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, C), this.x = function(a) { - }; + }(this, C), this.x = function(a) {}; } return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = C).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(), c = new C(); diff --git a/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.1.normal.js index 43b8799c58d..966685e69eb 100644 --- a/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.1.normal.js @@ -1,13 +1,10 @@ class C { - static foo(x) { - } - static bar(x) { - } + static foo(x) {} + static bar(x) {} static get sc() { return 1; } - static set sc(x) { - } + static set sc(x) {} static get sd() { return 1; } @@ -17,8 +14,7 @@ class C { get ic() { return 1; } - set ic(x) { - } + set ic(x) {} get id() { return 1; } @@ -37,8 +33,7 @@ var c; var r1; var r2; class D { - foo() { - } + foo() {} constructor(y){ this.y = y; } diff --git a/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.2.minified.js index b972b96f42d..a85a8fad31c 100644 --- a/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeQueryOnClass_es2015.2.minified.js @@ -1,13 +1,10 @@ class C { - static foo(x) { - } - static bar(x) { - } + static foo(x) {} + static bar(x) {} static get sc() { return 1; } - static set sc(x) { - } + static set sc(x) {} static get sd() { return 1; } @@ -17,8 +14,7 @@ class C { get ic() { return 1; } - set ic(x) { - } + set ic(x) {} get id() { return 1; } diff --git a/crates/swc/tests/tsc-references/typeQueryOnClass_es5.1.normal.js b/crates/swc/tests/tsc-references/typeQueryOnClass_es5.1.normal.js index eb681351e34..f43d287c370 100644 --- a/crates/swc/tests/tsc-references/typeQueryOnClass_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeQueryOnClass_es5.1.normal.js @@ -40,8 +40,7 @@ var C = /*#__PURE__*/ function() { get: function get() { return 1; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "id", @@ -52,21 +51,18 @@ var C = /*#__PURE__*/ function() { ], [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} }, { key: "bar", - value: function bar(x) { - } + value: function bar(x) {} }, { key: "sc", get: function get() { return 1; }, - set: function set(x) { - } + set: function set(x) {} }, { key: "sd", @@ -94,8 +90,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/typeQueryOnClass_es5.2.minified.js b/crates/swc/tests/tsc-references/typeQueryOnClass_es5.2.minified.js index 58952152fc7..93da9bcb003 100644 --- a/crates/swc/tests/tsc-references/typeQueryOnClass_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeQueryOnClass_es5.2.minified.js @@ -30,8 +30,7 @@ var C = function() { get: function() { return 1; }, - set: function(x) { - } + set: function(x) {} }, { key: "id", @@ -42,21 +41,18 @@ var C = function() { ], [ { key: "foo", - value: function(x) { - } + value: function(x) {} }, { key: "bar", - value: function(x) { - } + value: function(x) {} }, { key: "sc", get: function() { return 1; }, - set: function(x) { - } + set: function(x) {} }, { key: "sd", @@ -77,8 +73,7 @@ var D = function() { return _createClass(D, [ { key: "foo", - value: function() { - } + value: function() {} } ]), D; }(); diff --git a/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es2015.1.normal.js index 972766e9f25..b4f98da9f95 100644 --- a/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es2015.1.normal.js @@ -1,8 +1,5 @@ class Controller { - create() { - } - delete() { - } - var() { - } + create() {} + delete() {} + var() {} } diff --git a/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.1.normal.js b/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.1.normal.js index dcb37dcd198..4dd7f977c85 100644 --- a/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.1.normal.js @@ -25,18 +25,15 @@ var Controller = /*#__PURE__*/ function() { _createClass(Controller, [ { key: "create", - value: function create() { - } + value: function create() {} }, { key: "delete", - value: function _delete() { - } + value: function _delete() {} }, { key: "var", - value: function _var() { - } + value: function _var() {} } ]); return Controller; diff --git a/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.2.minified.js b/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.2.minified.js index 193ac1c0531..36ea8bf7ccd 100644 --- a/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeQueryWithReservedWords_es5.2.minified.js @@ -15,18 +15,15 @@ var Controller = function() { return protoProps = [ { key: "create", - value: function() { - } + value: function() {} }, { key: "delete", - value: function() { - } + value: function() {} }, { key: "var", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = Controller).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Controller; }(); diff --git a/crates/swc/tests/tsc-references/typeRelationships_es5.1.normal.js b/crates/swc/tests/tsc-references/typeRelationships_es5.1.normal.js index 7e905eaa8a1..1b71c2df140 100644 --- a/crates/swc/tests/tsc-references/typeRelationships_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeRelationships_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typeRelationships_es5.2.minified.js b/crates/swc/tests/tsc-references/typeRelationships_es5.2.minified.js index 7c4b6722935..98ddd984ad7 100644 --- a/crates/swc/tests/tsc-references/typeRelationships_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeRelationships_es5.2.minified.js @@ -73,8 +73,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.1.normal.js index 14c7213be86..9cff2c378a3 100644 --- a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.1.normal.js @@ -4,7 +4,5 @@ // @Filename: bug27346.js /** * @type {MyClass} - */ function MyClass() { -} -MyClass.prototype = { -}; + */ function MyClass() {} +MyClass.prototype = {}; diff --git a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.2.minified.js index 2b7357aadf5..69b6c03cd65 100644 --- a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es2015.2.minified.js @@ -1,3 +1 @@ -(function() { -}).prototype = { -}; +(function() {}).prototype = {}; diff --git a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.1.normal.js index 14c7213be86..9cff2c378a3 100644 --- a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.1.normal.js @@ -4,7 +4,5 @@ // @Filename: bug27346.js /** * @type {MyClass} - */ function MyClass() { -} -MyClass.prototype = { -}; + */ function MyClass() {} +MyClass.prototype = {}; diff --git a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.2.minified.js index 2b7357aadf5..69b6c03cd65 100644 --- a/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeTagCircularReferenceOnConstructorFunction_es5.2.minified.js @@ -1,3 +1 @@ -(function() { -}).prototype = { -}; +(function() {}).prototype = {}; diff --git a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.1.normal.js index 02581fe7ade..ba489470b25 100644 --- a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.1.normal.js @@ -2,6 +2,5 @@ // @noEmit: true // @allowJs: true // @checkJs: true -function C() { -} +function C() {} /** @type {string} */ C.prototype = 12; diff --git a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.2.minified.js index 479c157b59f..5fa1cca4527 100644 --- a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es2015.2.minified.js @@ -1,2 +1 @@ -(function() { -}).prototype = 12; +(function() {}).prototype = 12; diff --git a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.1.normal.js index 02581fe7ade..ba489470b25 100644 --- a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.1.normal.js @@ -2,6 +2,5 @@ // @noEmit: true // @allowJs: true // @checkJs: true -function C() { -} +function C() {} /** @type {string} */ C.prototype = 12; diff --git a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.2.minified.js index 479c157b59f..5fa1cca4527 100644 --- a/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeTagPrototypeAssignment_es5.2.minified.js @@ -1,2 +1 @@ -(function() { -}).prototype = 12; +(function() {}).prototype = 12; diff --git a/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.1.normal.js b/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.1.normal.js index fc533104fc5..7620849b823 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.1.normal.js @@ -2,8 +2,7 @@ // @allowJs: true // @checkJs: true // @Filename: mod2.js -/** @typedef {number} Foo */ const ns = { -}; +/** @typedef {number} Foo */ const ns = {}; ns.Foo = class { }; module.exports = ns; diff --git a/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.2.minified.js index 7e718ab0f0a..6f9e35af734 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule3_es2015.2.minified.js @@ -1,4 +1,3 @@ -const ns = { -}; +const ns = {}; ns.Foo = class { }, module.exports = ns; diff --git a/crates/swc/tests/tsc-references/typedefCrossModule3_es5.1.normal.js b/crates/swc/tests/tsc-references/typedefCrossModule3_es5.1.normal.js index 020362155cd..4884920a8f9 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule3_es5.1.normal.js @@ -7,8 +7,7 @@ function _classCallCheck(instance, Constructor) { // @allowJs: true // @checkJs: true // @Filename: mod2.js -/** @typedef {number} Foo */ var ns = { -}; +/** @typedef {number} Foo */ var ns = {}; ns.Foo = function _class() { "use strict"; _classCallCheck(this, _class); diff --git a/crates/swc/tests/tsc-references/typedefCrossModule3_es5.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule3_es5.2.minified.js index 3487b152166..0ee86ceb413 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule3_es5.2.minified.js @@ -1,5 +1,4 @@ -var ns = { -}; +var ns = {}; ns.Foo = function _class() { "use strict"; !function(instance, Constructor) { diff --git a/crates/swc/tests/tsc-references/typedefInnerNamepaths_es2015.1.normal.js b/crates/swc/tests/tsc-references/typedefInnerNamepaths_es2015.1.normal.js index 843d00809a3..cfdc5a6a580 100644 --- a/crates/swc/tests/tsc-references/typedefInnerNamepaths_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefInnerNamepaths_es2015.1.normal.js @@ -6,6 +6,5 @@ class C { /** * @typedef {C~A} C~B * @typedef {object} C~A - */ /** @param {C~A} o */ constructor(o){ - } + */ /** @param {C~A} o */ constructor(o){} } diff --git a/crates/swc/tests/tsc-references/typedefTagTypeResolution_es2015.1.normal.js b/crates/swc/tests/tsc-references/typedefTagTypeResolution_es2015.1.normal.js index b160f1c6e23..e637f716076 100644 --- a/crates/swc/tests/tsc-references/typedefTagTypeResolution_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefTagTypeResolution_es2015.1.normal.js @@ -17,7 +17,5 @@ */ /** * @template V * @param {V} vvvvv - */ function g(vvvvv) { -} -/** @type {Cb} */ const cb = (x)=>{ -}; + */ function g(vvvvv) {} +/** @type {Cb} */ const cb = (x)=>{}; diff --git a/crates/swc/tests/tsc-references/typedefTagTypeResolution_es5.1.normal.js b/crates/swc/tests/tsc-references/typedefTagTypeResolution_es5.1.normal.js index f039c9744cc..9809f91421f 100644 --- a/crates/swc/tests/tsc-references/typedefTagTypeResolution_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefTagTypeResolution_es5.1.normal.js @@ -17,7 +17,5 @@ */ /** * @template V * @param {V} vvvvv - */ function g(vvvvv) { -} -/** @type {Cb} */ var cb = function(x) { -}; + */ function g(vvvvv) {} +/** @type {Cb} */ var cb = function(x) {}; diff --git a/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.1.normal.js index b92c133db2f..e6e0e095cca 100644 --- a/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.1.normal.js @@ -21,8 +21,7 @@ var M; class C1 { } M1.C = C1; -})(M || (M = { -})); +})(M || (M = {})); export var r6; export var r7; export var r8; @@ -30,18 +29,15 @@ export var r9; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); export var r10; export var r11; export var r12; -function foo() { -} +function foo() {} (function(foo1) { var y = foo1.y = 1; class C2 { } foo1.C = C2; -})(foo || (foo = { -})); +})(foo || (foo = {})); export var r13; diff --git a/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.2.minified.js index a5dd9e97113..da9804de317 100644 --- a/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofANonExportedType_es2015.2.minified.js @@ -1,9 +1,5 @@ var M, E, M1, E, foo; -function foo1() { -} -(M1 = M || (M = { -})).foo = "", M1.C = class { -}, (E = E || (E = { -}))[E.A = 0] = "A", (foo = foo1 || (foo1 = { -})).y = 1, foo.C = class { +function foo1() {} +(M1 = M || (M = {})).foo = "", M1.C = class { +}, (E = E || (E = {}))[E.A = 0] = "A", (foo = foo1 || (foo1 = {})).y = 1, foo.C = class { }; diff --git a/crates/swc/tests/tsc-references/typeofANonExportedType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofANonExportedType_es5.1.normal.js index b9e7535c38d..e31c203b241 100644 --- a/crates/swc/tests/tsc-references/typeofANonExportedType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofANonExportedType_es5.1.normal.js @@ -30,8 +30,7 @@ var M; _classCallCheck(this, C); }; M1.C = C; -})(M || (M = { -})); +})(M || (M = {})); export var r6; export var r7; export var r8; @@ -39,13 +38,11 @@ export var r9; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); export var r10; export var r11; export var r12; -function foo() { -} +function foo() {} (function(foo1) { var y = foo1.y = 1; var C = function C() { @@ -53,6 +50,5 @@ function foo() { _classCallCheck(this, C); }; foo1.C = C; -})(foo || (foo = { -})); +})(foo || (foo = {})); export var r13; diff --git a/crates/swc/tests/tsc-references/typeofANonExportedType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofANonExportedType_es5.2.minified.js index 453180f7d1c..25a30244c70 100644 --- a/crates/swc/tests/tsc-references/typeofANonExportedType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofANonExportedType_es5.2.minified.js @@ -5,8 +5,7 @@ var M, E, E, C = function() { "use strict"; _classCallCheck(this, C); }; -function foo() { -} +function foo() {} !function(M1) { M1.foo = ""; var C1 = function() { @@ -14,14 +13,11 @@ function foo() { _classCallCheck(this, C1); }; M1.C = C1; -}(M || (M = { -})), (E = E || (E = { -}))[E.A = 0] = "A", (function(foo1) { +}(M || (M = {})), (E = E || (E = {}))[E.A = 0] = "A", (function(foo1) { foo1.y = 1; var C2 = function() { "use strict"; _classCallCheck(this, C2); }; foo1.C = C2; -})(foo || (foo = { -})); +})(foo || (foo = {})); diff --git a/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.1.normal.js index a30038f9027..267b15d940e 100644 --- a/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.1.normal.js @@ -21,8 +21,7 @@ export var M; class C1 { } M1.C = C1; -})(M || (M = { -})); +})(M || (M = {})); export var r6; export var r7; export var Z = M; @@ -31,18 +30,15 @@ export var r9; export var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); export var r10; export var r11; export var r12; -export function foo() { -} +export function foo() {} (function(foo1) { var y = foo1.y = 1; class C2 { } foo1.C = C2; -})(foo || (foo = { -})); +})(foo || (foo = {})); export var r13; diff --git a/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.2.minified.js index a62ea253a5d..94b4382e033 100644 --- a/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofAnExportedType_es2015.2.minified.js @@ -5,15 +5,11 @@ export var y = { }; export class C { } -(M = M1 || (M1 = { -})).foo = "", M.C = class { +(M = M1 || (M1 = {})).foo = "", M.C = class { }; export var Z = M1; -(E = E || (E = { -}))[E.A = 0] = "A"; -function foo1() { -} +(E = E || (E = {}))[E.A = 0] = "A"; +function foo1() {} export { foo1 as foo }; -(foo = foo1 || (foo1 = { -})).y = 1, foo.C = class { +(foo = foo1 || (foo1 = {})).y = 1, foo.C = class { }; diff --git a/crates/swc/tests/tsc-references/typeofAnExportedType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofAnExportedType_es5.1.normal.js index f87d47f956a..31024d5ace4 100644 --- a/crates/swc/tests/tsc-references/typeofAnExportedType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofAnExportedType_es5.1.normal.js @@ -30,8 +30,7 @@ export var M; _classCallCheck(this, C); }; M1.C = C; -})(M || (M = { -})); +})(M || (M = {})); export var r6; export var r7; export var Z = M; @@ -40,13 +39,11 @@ export var r9; export var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); export var r10; export var r11; export var r12; -export function foo() { -} +export function foo() {} (function(foo1) { var y = foo1.y = 1; var C = function C() { @@ -54,6 +51,5 @@ export function foo() { _classCallCheck(this, C); }; foo1.C = C; -})(foo || (foo = { -})); +})(foo || (foo = {})); export var r13; diff --git a/crates/swc/tests/tsc-references/typeofAnExportedType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofAnExportedType_es5.2.minified.js index e2e0048eb55..0b7406d95d3 100644 --- a/crates/swc/tests/tsc-references/typeofAnExportedType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofAnExportedType_es5.2.minified.js @@ -16,13 +16,10 @@ export var C = function() { _classCallCheck(this, C1); }; M1.C = C1; -}(M || (M = { -})); +}(M || (M = {})); export var Z = M; -(E = E || (E = { -}))[E.A = 0] = "A"; -export function foo() { -} +(E = E || (E = {}))[E.A = 0] = "A"; +export function foo() {} !function(foo1) { foo1.y = 1; var C2 = function() { @@ -30,5 +27,4 @@ export function foo() { _classCallCheck(this, C2); }; foo1.C = C2; -}(foo || (foo = { -})); +}(foo || (foo = {})); diff --git a/crates/swc/tests/tsc-references/typeofClass2_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofClass2_es2015.1.normal.js index deb320f5363..2749c2be32d 100644 --- a/crates/swc/tests/tsc-references/typeofClass2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofClass2_es2015.1.normal.js @@ -1,16 +1,11 @@ class C { - static foo(x) { - } - static bar(x) { - } - constructor(x){ - } + static foo(x) {} + static bar(x) {} + constructor(x){} } class D extends C { - static baz(x) { - } - foo() { - } + static baz(x) {} + foo() {} } var d; var r1; diff --git a/crates/swc/tests/tsc-references/typeofClass2_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofClass2_es5.1.normal.js index db733310522..b1f849e6242 100644 --- a/crates/swc/tests/tsc-references/typeofClass2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofClass2_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -91,13 +90,11 @@ var C = /*#__PURE__*/ function() { _createClass(C, null, [ { key: "foo", - value: function foo(x) { - } + value: function foo(x) {} }, { key: "bar", - value: function bar(x) { - } + value: function bar(x) {} } ]); return C; @@ -113,14 +110,12 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ], [ { key: "baz", - value: function baz(x) { - } + value: function baz(x) {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/typeofClass2_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofClass2_es5.2.minified.js index e3277073c77..2b7b28bae9a 100644 --- a/crates/swc/tests/tsc-references/typeofClass2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofClass2_es5.2.minified.js @@ -28,13 +28,11 @@ var C = function() { return _createClass(C, null, [ { key: "foo", - value: function(x) { - } + value: function(x) {} }, { key: "bar", - value: function(x) { - } + value: function(x) {} } ]), C; }(), D = function(C) { @@ -55,8 +53,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -79,14 +76,12 @@ var C = function() { return _createClass(D, [ { key: "foo", - value: function() { - } + value: function() {} } ], [ { key: "baz", - value: function(x) { - } + value: function(x) {} } ]), D; }(C); diff --git a/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es2015.1.normal.js index 3d9584874d0..6158c1b13f2 100644 --- a/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es2015.1.normal.js @@ -3,6 +3,5 @@ var M; var x = 1; class C { } -})(M || (M = { -})); +})(M || (M = {})); var r; diff --git a/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.1.normal.js index 75eab222b36..6f77aed463e 100644 --- a/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.1.normal.js @@ -10,6 +10,5 @@ var M; "use strict"; _classCallCheck(this, C); }; -})(M || (M = { -})); +})(M || (M = {})); var r; diff --git a/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.2.minified.js index 09c13a2c05d..51dd2884f71 100644 --- a/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofModuleWithoutExports_es5.2.minified.js @@ -6,5 +6,4 @@ var M; if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -}(M || (M = { -})); +}(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.1.normal.js index 592417818b1..7cebd0d2054 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.1.normal.js @@ -8,8 +8,7 @@ var ANY2 = [ var obj; var obj1 = { x: "a", - y: ()=>{ - } + y: ()=>{} }; function foo() { var a; @@ -25,8 +24,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsString1 = typeof ANY1; @@ -38,8 +36,7 @@ var ResultIsString6 = typeof obj1; // any type literal var ResultIsString7 = typeof undefined; var ResultIsString8 = typeof null; -var ResultIsString9 = typeof { -}; +var ResultIsString9 = typeof {}; // any type expressions var ResultIsString10 = typeof ANY2[0]; var ResultIsString11 = typeof objA.a; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.2.minified.js index 6b1accebe1e..c8ca67264c0 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es2015.2.minified.js @@ -3,14 +3,12 @@ var M, ANY2 = [ "" ]; class A { - static foo() { - } + static foo() {} } !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; z: ; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.1.normal.js index 312e5383bde..e2f5309936f 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.1.normal.js @@ -30,8 +30,7 @@ var ANY2 = [ var obj; var obj1 = { x: "a", - y: function() { - } + y: function() {} }; function foo() { var a; @@ -57,8 +56,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsString1 = typeof ANY1 === "undefined" ? "undefined" : _typeof(ANY1); @@ -70,8 +68,7 @@ var ResultIsString6 = typeof obj1 === "undefined" ? "undefined" : _typeof(obj1); // any type literal var ResultIsString7 = typeof undefined === "undefined" ? "undefined" : _typeof(undefined); var ResultIsString8 = _typeof(null); -var ResultIsString9 = _typeof({ -}); +var ResultIsString9 = _typeof({}); // any type expressions var ResultIsString10 = _typeof(ANY2[0]); var ResultIsString11 = _typeof(objA.a); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.2.minified.js index 1793c8d01ad..13fafd8ed02 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithAnyOtherType_es5.2.minified.js @@ -19,19 +19,16 @@ var ANY, ANY1, obj, M, _typeof = function(obj1) { })(Constructor = A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(); !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); -void 0 === ANY1 || _typeof(ANY1), void 0 === M || _typeof(M), void 0 === obj || _typeof(obj), _typeof(null), _typeof({ -}), _typeof(ANY2[0]), _typeof(objA.a), _typeof("a"), _typeof(M.n), _typeof(void 0), _typeof(A.foo()), _typeof(ANY + ANY1), _typeof(NaN), _typeof(0), _typeof(NaN), _typeof(void 0 === ANY ? "undefined" : _typeof(ANY)), _typeof(_typeof(_typeof(ANY + ANY1))), void 0 === ANY || _typeof(ANY), void 0 === ANY1 || _typeof(ANY1), _typeof(ANY2[0]), void 0 === ANY || _typeof(ANY), _typeof("a"), _typeof(objA.a), _typeof(M.n); +void 0 === ANY1 || _typeof(ANY1), void 0 === M || _typeof(M), void 0 === obj || _typeof(obj), _typeof(null), _typeof({}), _typeof(ANY2[0]), _typeof(objA.a), _typeof("a"), _typeof(M.n), _typeof(void 0), _typeof(A.foo()), _typeof(ANY + ANY1), _typeof(NaN), _typeof(0), _typeof(NaN), _typeof(void 0 === ANY ? "undefined" : _typeof(ANY)), _typeof(_typeof(_typeof(ANY + ANY1))), void 0 === ANY || _typeof(ANY), void 0 === ANY1 || _typeof(ANY1), _typeof(ANY2[0]), void 0 === ANY || _typeof(ANY), _typeof("a"), _typeof(objA.a), _typeof(M.n); z: void 0 === ANY || _typeof(ANY); x: ; r: ; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.1.normal.js index c7c345c7736..53c074b5dfd 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.1.normal.js @@ -13,8 +13,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsString1 = typeof BOOLEAN; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.2.minified.js index 35106b043e9..18798c5c0eb 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es2015.2.minified.js @@ -9,8 +9,7 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var M, objA = new A(); objA.a, foo(), A.foo(), foo(), objA.a; z: ; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.1.normal.js index 7fc2c0c0f83..ee8cd3c5bd5 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsString1 = typeof BOOLEAN === "undefined" ? "undefined" : _typeof(BOOLEAN); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.2.minified.js index a6023acb047..9b209e6bdff 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithBooleanType_es5.2.minified.js @@ -29,8 +29,7 @@ var A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); void 0 === BOOLEAN || _typeof(BOOLEAN), _typeof(!0), _typeof({ x: !0, diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.1.normal.js index 35a4a4af959..121129e544d 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.1.normal.js @@ -1,16 +1,13 @@ var // @allowUnusedLabels: true // typeof operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsString1 = typeof ENUM; var ResultIsString2 = typeof ENUM1; @@ -27,8 +24,6 @@ typeof ENUM1["B"]; typeof ENUM, ENUM1; var // use typeof in type query z; -(function(z) { -})(z || (z = { -})); +(function(z) {})(z || (z = {})); z: typeof ENUM; z: typeof ENUM1; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.2.minified.js index f297a4d7bc4..5115ce30396 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es2015.2.minified.js @@ -1,5 +1,4 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM[0] + ENUM1.B, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM[0] + ENUM1.B, ENUM1.B; z: ; z: ; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.1.normal.js index 61f77a05240..b8743f6c8d8 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.1.normal.js @@ -4,16 +4,13 @@ var _typeof = function(obj) { var // @allowUnusedLabels: true // typeof operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsString1 = typeof ENUM === "undefined" ? "undefined" : _typeof(ENUM); var ResultIsString2 = typeof ENUM1 === "undefined" ? "undefined" : _typeof(ENUM1); @@ -30,8 +27,6 @@ _typeof(ENUM1["B"]); typeof ENUM === "undefined" ? "undefined" : _typeof(ENUM), ENUM1; var // use typeof in type query z; -(function(z) { -})(z || (z = { -})); +(function(z) {})(z || (z = {})); z: typeof ENUM === "undefined" ? "undefined" : _typeof(ENUM); z: typeof ENUM1 === "undefined" ? "undefined" : _typeof(ENUM1); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.2.minified.js index 21c26f24de5..b4b47c48085 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithEnumType_es5.2.minified.js @@ -1,7 +1,6 @@ var ENUM1, ENUM, ENUM1, _typeof = function(obj) { return obj && "undefined" != typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj; }; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", void 0 === ENUM || _typeof(ENUM), void 0 === ENUM1 || _typeof(ENUM1), _typeof(ENUM1.A), _typeof(ENUM[0] + ENUM1.B), _typeof(void 0 === ENUM ? "undefined" : _typeof(ENUM)), _typeof(_typeof(_typeof(ENUM[0] + ENUM1.B))), void 0 === ENUM || _typeof(ENUM), void 0 === ENUM1 || _typeof(ENUM1), _typeof(ENUM1.B), void 0 === ENUM || _typeof(ENUM); +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", void 0 === ENUM || _typeof(ENUM), void 0 === ENUM1 || _typeof(ENUM1), _typeof(ENUM1.A), _typeof(ENUM[0] + ENUM1.B), _typeof(void 0 === ENUM ? "undefined" : _typeof(ENUM)), _typeof(_typeof(_typeof(ENUM[0] + ENUM1.B))), void 0 === ENUM || _typeof(ENUM), void 0 === ENUM1 || _typeof(ENUM1), _typeof(ENUM1.B), void 0 === ENUM || _typeof(ENUM); z: void 0 === ENUM || _typeof(ENUM); z: void 0 === ENUM1 || _typeof(ENUM1); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.1.normal.js index 3dc8e0cb1b0..bd8aee2999f 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.1.normal.js @@ -17,8 +17,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsString1 = typeof NUMBER; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.2.minified.js index 2a1a9257547..b860ddf9f27 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es2015.2.minified.js @@ -7,8 +7,7 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; z: ; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.1.normal.js index cccc63c179f..8f96258a106 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.1.normal.js @@ -49,8 +49,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsString1 = typeof NUMBER === "undefined" ? "undefined" : _typeof(NUMBER); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.2.minified.js index 1734229b5a9..494b57c21c5 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithNumberType_es5.2.minified.js @@ -25,8 +25,7 @@ var NUMBER, M, _typeof = function(obj) { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); void 0 === NUMBER || _typeof(NUMBER), _typeof(1), _typeof({ x: 1, diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.1.normal.js index 9f36d50af14..1e86d1c1d8e 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsString1 = typeof STRING; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.2.minified.js index da8ffd278cd..4ae90a4bd99 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es2015.2.minified.js @@ -10,8 +10,7 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; z: ; diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.1.normal.js index c9a4d42cf84..59f506b1115 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.1.normal.js @@ -48,8 +48,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsString1 = typeof STRING === "undefined" ? "undefined" : _typeof(STRING); diff --git a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.2.minified.js index a16d7b1aac5..175e8d33d86 100644 --- a/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofOperatorWithStringType_es5.2.minified.js @@ -29,8 +29,7 @@ var A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); void 0 === STRING || _typeof(STRING), _typeof(""), _typeof({ x: "", diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.1.normal.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.1.normal.js index 2f00bd94e79..577549096c8 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.1.normal.js @@ -97,8 +97,7 @@ function _inferReturnType1() { _inferReturnType1 = // @target: es2018 // @lib: esnext // @noEmit: true - _wrapAsyncGenerator(function*() { - }); + _wrapAsyncGenerator(function*() {}); return _inferReturnType1.apply(this, arguments); } function inferReturnType2() { diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js index 404fdfc4d5d..16f125e3604 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js @@ -61,8 +61,7 @@ function _wrapAsyncGenerator(fn) { }; } function _inferReturnType1() { - return (_inferReturnType1 = _wrapAsyncGenerator(function*() { - })).apply(this, arguments); + return (_inferReturnType1 = _wrapAsyncGenerator(function*() {})).apply(this, arguments); } function _inferReturnType2() { return (_inferReturnType2 = _wrapAsyncGenerator(function*() { diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.1.normal.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.1.normal.js index e38e59755c3..6a6065fc389 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.1.normal.js @@ -95,8 +95,7 @@ function _inferReturnType1() { // @lib: esnext // @noEmit: true _wrapAsyncGenerator(function*() { - yield* { - }; + yield* {}; }); return _inferReturnType1.apply(this, arguments); } @@ -336,8 +335,7 @@ function yieldStar() { } function _yieldStar() { _yieldStar = _wrapAsyncGenerator(function*() { - yield* { - }; + yield* {}; }); return _yieldStar.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js index 56368ac0acd..c3bb482fe8f 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js @@ -59,8 +59,7 @@ function _wrapAsyncGenerator(fn) { } function _inferReturnType1() { return (_inferReturnType1 = _wrapAsyncGenerator(function*() { - yield* { - }; + yield* {}; })).apply(this, arguments); } function _inferReturnType2() { @@ -155,8 +154,7 @@ function _explicitReturnType12() { } function _yieldStar() { return (_yieldStar = _wrapAsyncGenerator(function*() { - yield* { - }; + yield* {}; })).apply(this, arguments); } "function" == typeof Symbol && Symbol.asyncIterator && (AsyncGenerator.prototype[Symbol.asyncIterator] = function() { diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js index 666d68aedd3..f3fb525b03f 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js @@ -99,8 +99,7 @@ function _inferReturnType1() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield({ - }, "t0", 1); + return _ctx.delegateYield({}, "t0", 1); case 1: case "end": return _ctx.stop(); @@ -595,8 +594,7 @@ function _yieldStar() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield({ - }, "t0", 1); + return _ctx.delegateYield({}, "t0", 1); case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js index 5ab8a0bcb4d..e07452b52dd 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js @@ -63,8 +63,7 @@ function _inferReturnType1() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield({ - }, "t0", 1); + return _ctx.delegateYield({}, "t0", 1); case 1: case "end": return _ctx.stop(); @@ -304,8 +303,7 @@ function _yieldStar() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield({ - }, "t0", 1); + return _ctx.delegateYield({}, "t0", 1); case 1: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.1.normal.js index 1ffa3cb34b6..6aa0bbd7e00 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.1.normal.js @@ -51,8 +51,7 @@ function _f() { { var _iteratorAbruptCompletion = false, _didIteratorError = false, _iteratorError; try { - for(var _iterator = _asyncIterator({ - }), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false){ + for(var _iterator = _asyncIterator({}), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false){ let _value = _step.value; const x = _value; } @@ -74,8 +73,7 @@ function _f() { { var _iteratorAbruptCompletion1 = false, _didIteratorError1 = false, _iteratorError1; try { - for(var _iterator1 = _asyncIterator({ - }), _step1; _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = false){ + for(var _iterator1 = _asyncIterator({}), _step1; _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = false){ let _value = _step1.value; y = _value; } @@ -138,10 +136,8 @@ function _f() { } } } - for (const x of asyncIterable){ - } - for (y of asyncIterable){ - } + for (const x of asyncIterable){} + for (y of asyncIterable){} }); return _f.apply(this, arguments); } diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.2.minified.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.2.minified.js index 1abc82fe33b..2ece0a73ae6 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es2015.2.minified.js @@ -34,8 +34,7 @@ function _f() { let y; var _iteratorError, _iteratorAbruptCompletion = !1, _didIteratorError = !1; try { - for(var _step, _iterator = _asyncIterator({ - }); _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = !1)_step.value; + for(var _step, _iterator = _asyncIterator({}); _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = !1)_step.value; } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally{ @@ -47,8 +46,7 @@ function _f() { } var _iteratorError1, _iteratorAbruptCompletion1 = !1, _didIteratorError1 = !1; try { - for(var _step1, _iterator1 = _asyncIterator({ - }); _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = !1)_step1.value; + for(var _step1, _iterator1 = _asyncIterator({}); _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = !1)_step1.value; } catch (err1) { _didIteratorError1 = !0, _iteratorError1 = err1; } finally{ diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js index c05f3a753cb..c58a267db46 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js @@ -55,8 +55,7 @@ function _f() { ; _iteratorAbruptCompletion = false, _didIteratorError = false; _ctx.prev = 3; - _iterator = _asyncIterator({ - }); + _iterator = _asyncIterator({}); case 5: _ctx.next = 7; return _iterator.next(); @@ -104,8 +103,7 @@ function _f() { case 28: _iteratorAbruptCompletion1 = false, _didIteratorError1 = false; _ctx.prev = 29; - _iterator1 = _asyncIterator({ - }); + _iterator1 = _asyncIterator({}); case 31: _ctx.next = 33; return _iterator1.next(); diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.2.minified.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.2.minified.js index 3cd81859b32..27a618cb8f9 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.2.minified.js @@ -36,8 +36,7 @@ function _f() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _iteratorAbruptCompletion = !1, _didIteratorError = !1, _ctx.prev = 3, _iterator = _asyncIterator({ - }); + _iteratorAbruptCompletion = !1, _didIteratorError = !1, _ctx.prev = 3, _iterator = _asyncIterator({}); case 5: return _ctx.next = 7, _iterator.next(); case 7: @@ -71,8 +70,7 @@ function _f() { case 27: return _ctx.finish(18); case 28: - _iteratorAbruptCompletion1 = !1, _didIteratorError1 = !1, _ctx.prev = 29, _iterator1 = _asyncIterator({ - }); + _iteratorAbruptCompletion1 = !1, _didIteratorError1 = !1, _ctx.prev = 29, _iterator1 = _asyncIterator({}); case 31: return _ctx.next = 33, _iterator1.next(); case 33: diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.1.normal.js index cb50fa393cc..b6ea1b932dc 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.1.normal.js @@ -145,8 +145,7 @@ function _f1() { { var _iteratorAbruptCompletion = false, _didIteratorError = false, _iteratorError; try { - for(var _iterator = _asyncIterator({ - }), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false){ + for(var _iterator = _asyncIterator({}), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false){ let _value = _step.value; const x = _value; } @@ -168,8 +167,7 @@ function _f1() { { var _iteratorAbruptCompletion1 = false, _didIteratorError1 = false, _iteratorError1; try { - for(var _iterator1 = _asyncIterator({ - }), _step1; _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = false){ + for(var _iterator1 = _asyncIterator({}), _step1; _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = false){ let _value = _step1.value; y = _value; } @@ -200,8 +198,7 @@ function _f2() { { var _iteratorAbruptCompletion = false, _didIteratorError = false, _iteratorError; try { - for(var _iterator = _asyncIterator({ - }), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = false){ + for(var _iterator = _asyncIterator({}), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = false){ let _value = _step.value; const x = _value; } @@ -223,8 +220,7 @@ function _f2() { { var _iteratorAbruptCompletion2 = false, _didIteratorError2 = false, _iteratorError2; try { - for(var _iterator2 = _asyncIterator({ - }), _step2; _iteratorAbruptCompletion2 = !(_step2 = yield _awaitAsyncGenerator(_iterator2.next())).done; _iteratorAbruptCompletion2 = false){ + for(var _iterator2 = _asyncIterator({}), _step2; _iteratorAbruptCompletion2 = !(_step2 = yield _awaitAsyncGenerator(_iterator2.next())).done; _iteratorAbruptCompletion2 = false){ let _value = _step2.value; y = _value; } diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.2.minified.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.2.minified.js index 83e179badcc..faf28ee1fc9 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es2015.2.minified.js @@ -90,8 +90,7 @@ function _f1() { })(function*() { var _iteratorError, _iteratorAbruptCompletion = !1, _didIteratorError = !1; try { - for(var _step, _iterator = _asyncIterator({ - }); _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = !1)_step.value; + for(var _step, _iterator = _asyncIterator({}); _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = !1)_step.value; } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally{ @@ -103,8 +102,7 @@ function _f1() { } var _iteratorError1, _iteratorAbruptCompletion1 = !1, _didIteratorError1 = !1; try { - for(var _step1, _iterator1 = _asyncIterator({ - }); _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = !1)_step1.value; + for(var _step1, _iterator1 = _asyncIterator({}); _iteratorAbruptCompletion1 = !(_step1 = yield _iterator1.next()).done; _iteratorAbruptCompletion1 = !1)_step1.value; } catch (err1) { _didIteratorError1 = !0, _iteratorError1 = err1; } finally{ @@ -124,8 +122,7 @@ function _f2() { })(function*() { var _iteratorError, _iteratorAbruptCompletion = !1, _didIteratorError = !1; try { - for(var _step, _iterator = _asyncIterator({ - }); _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = !1)_step.value; + for(var _step, _iterator = _asyncIterator({}); _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = !1)_step.value; } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally{ @@ -137,8 +134,7 @@ function _f2() { } var _iteratorError2, _iteratorAbruptCompletion2 = !1, _didIteratorError2 = !1; try { - for(var _step2, _iterator2 = _asyncIterator({ - }); _iteratorAbruptCompletion2 = !(_step2 = yield _awaitAsyncGenerator(_iterator2.next())).done; _iteratorAbruptCompletion2 = !1)_step2.value; + for(var _step2, _iterator2 = _asyncIterator({}); _iteratorAbruptCompletion2 = !(_step2 = yield _awaitAsyncGenerator(_iterator2.next())).done; _iteratorAbruptCompletion2 = !1)_step2.value; } catch (err2) { _didIteratorError2 = !0, _iteratorError2 = err2; } finally{ diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js index f1b6e35b6d4..a8e6f4ab79c 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js @@ -149,8 +149,7 @@ function _f1() { ; _iteratorAbruptCompletion = false, _didIteratorError = false; _ctx.prev = 2; - _iterator = _asyncIterator({ - }); + _iterator = _asyncIterator({}); case 4: _ctx.next = 6; return _iterator.next(); @@ -198,8 +197,7 @@ function _f1() { case 27: _iteratorAbruptCompletion1 = false, _didIteratorError1 = false; _ctx.prev = 28; - _iterator1 = _asyncIterator({ - }); + _iterator1 = _asyncIterator({}); case 30: _ctx.next = 32; return _iterator1.next(); @@ -289,8 +287,7 @@ function _f2() { ; _iteratorAbruptCompletion = false, _didIteratorError = false; _ctx.prev = 2; - _iterator = _asyncIterator({ - }); + _iterator = _asyncIterator({}); case 4: _ctx.next = 6; return _awaitAsyncGenerator(_iterator.next()); @@ -338,8 +335,7 @@ function _f2() { case 27: _iteratorAbruptCompletion2 = false, _didIteratorError2 = false; _ctx.prev = 28; - _iterator2 = _asyncIterator({ - }); + _iterator2 = _asyncIterator({}); case 30: _ctx.next = 32; return _awaitAsyncGenerator(_iterator2.next()); diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.2.minified.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.2.minified.js index 4152b906e5f..374404ab698 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.2.minified.js @@ -93,8 +93,7 @@ function _f1() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _iteratorAbruptCompletion = !1, _didIteratorError = !1, _ctx.prev = 2, _iterator = _asyncIterator({ - }); + _iteratorAbruptCompletion = !1, _didIteratorError = !1, _ctx.prev = 2, _iterator = _asyncIterator({}); case 4: return _ctx.next = 6, _iterator.next(); case 6: @@ -128,8 +127,7 @@ function _f1() { case 26: return _ctx.finish(17); case 27: - _iteratorAbruptCompletion1 = !1, _didIteratorError1 = !1, _ctx.prev = 28, _iterator1 = _asyncIterator({ - }); + _iteratorAbruptCompletion1 = !1, _didIteratorError1 = !1, _ctx.prev = 28, _iterator1 = _asyncIterator({}); case 30: return _ctx.next = 32, _iterator1.next(); case 32: @@ -204,8 +202,7 @@ function _f2() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _iteratorAbruptCompletion = !1, _didIteratorError = !1, _ctx.prev = 2, _iterator = _asyncIterator({ - }); + _iteratorAbruptCompletion = !1, _didIteratorError = !1, _ctx.prev = 2, _iterator = _asyncIterator({}); case 4: return _ctx.next = 6, _awaitAsyncGenerator(_iterator.next()); case 6: @@ -239,8 +236,7 @@ function _f2() { case 26: return _ctx.finish(17); case 27: - _iteratorAbruptCompletion2 = !1, _didIteratorError2 = !1, _ctx.prev = 28, _iterator2 = _asyncIterator({ - }); + _iteratorAbruptCompletion2 = !1, _didIteratorError2 = !1, _ctx.prev = 28, _iterator2 = _asyncIterator({}); case 30: return _ctx.next = 32, _awaitAsyncGenerator(_iterator2.next()); case 32: diff --git a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js index 336666de7ec..7ba09df12bd 100644 --- a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js @@ -1,8 +1,7 @@ // @Filename: foo_1.ts const foo0 = require('./foo_0'); // Per 11.2.3, foo_0 should still be "instantiated", albeit with no members -var x = { -}; +var x = {}; var y = foo0; // @module: commonjs // @Filename: foo_0.ts diff --git a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js index 7f1bb96cea6..58e29e24166 100644 --- a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js @@ -1,8 +1,7 @@ // @Filename: foo_1.ts var foo0 = require('./foo_0'); // Per 11.2.3, foo_0 should still be "instantiated", albeit with no members -var x = { -}; +var x = {}; var y = foo0; // @module: commonjs // @Filename: foo_0.ts diff --git a/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es2015.1.normal.js index c34b05c8ff6..54f87140b3d 100644 --- a/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es2015.1.normal.js @@ -2,7 +2,5 @@ class C { } class C2 { } -function f() { -} -function f2() { -} +function f() {} +function f2() {} diff --git a/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es5.1.normal.js index 63a04efd316..7db5a05adcf 100644 --- a/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithDuplicateTypeParameters_es5.1.normal.js @@ -11,7 +11,5 @@ var C2 = function C2() { "use strict"; _classCallCheck(this, C2); }; -function f() { -} -function f2() { -} +function f() {} +function f2() {} diff --git a/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.1.normal.js b/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.1.normal.js index 9483f452809..c6f86aed751 100644 --- a/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.1.normal.js @@ -1,13 +1,11 @@ // @declaration: true class C { - constructor(){ - } + constructor(){} } var c = new C(); // error C is private var r = c.constructor; class C2 { - constructor(x){ - } + constructor(x){} } var c2 = new C2(); // error C2 is private var r2 = c2.constructor; diff --git a/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.2.minified.js b/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.2.minified.js index c333c54795c..40eec7fb69a 100644 --- a/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithPrivateConstructor_es2015.2.minified.js @@ -1,7 +1,5 @@ new class { - constructor(){ - } + constructor(){} }().constructor, new class { - constructor(x){ - } + constructor(x){} }().constructor; diff --git a/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.1.normal.js b/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.1.normal.js index a77328f86d7..a72af3a012f 100644 --- a/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.1.normal.js @@ -1,13 +1,11 @@ // @declaration: true class C { - constructor(){ - } + constructor(){} } var c = new C(); // error C is protected var r = c.constructor; class C2 { - constructor(x){ - } + constructor(x){} } var c2 = new C2(); // error C2 is protected var r2 = c2.constructor; diff --git a/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.2.minified.js b/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.2.minified.js index c333c54795c..40eec7fb69a 100644 --- a/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithProtectedConstructor_es2015.2.minified.js @@ -1,7 +1,5 @@ new class { - constructor(){ - } + constructor(){} }().constructor, new class { - constructor(x){ - } + constructor(x){} }().constructor; diff --git a/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.1.normal.js b/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.1.normal.js index e9cdb739e75..cb076b902ef 100644 --- a/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.1.normal.js @@ -1,13 +1,11 @@ // public is allowed on a constructor but is not meaningful class C { - constructor(){ - } + constructor(){} } var c = new C(); var r = c.constructor; class C2 { - constructor(x){ - } + constructor(x){} } var c2 = new C2(); var r2 = c2.constructor; diff --git a/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.2.minified.js b/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.2.minified.js index c333c54795c..40eec7fb69a 100644 --- a/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithPublicConstructor_es2015.2.minified.js @@ -1,7 +1,5 @@ new class { - constructor(){ - } + constructor(){} }().constructor, new class { - constructor(x){ - } + constructor(x){} }().constructor; diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.1.normal.js index e8e3c1d197a..8204962449d 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.2.minified.js b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.2.minified.js index 3c18f86a905..e2e9ec8f1ea 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures_es5.2.minified.js @@ -33,8 +33,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.1.normal.js b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.1.normal.js index 0fb9c7ee028..48c0bbee9d4 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.2.minified.js b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.2.minified.js index 1e6d67e1c9f..68910493456 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.1.normal.js b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.1.normal.js index 2008766c811..726f6e6d45a 100644 --- a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.1.normal.js @@ -2,27 +2,21 @@ // @checkJs: true // @noEmit: true // @Filename: test.js -function f(x) { -} +function f(x) {} f(); // Always been ok class C { - static m(x) { - } - m(x) { - } + static m(x) {} + m(x) {} constructor(){ - this.p = (x)=>{ - }; + this.p = (x)=>{}; } } C.m(); // Always been ok new C().m(); // Regression #39261 new C().p(); // Regression #39261 const obj = { - m (x) { - }, - p: (x)=>{ - } + m (x) {}, + p: (x)=>{} }; obj.m(); // Always been ok obj.p(); // Always been ok diff --git a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.2.minified.js b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.2.minified.js index 4a3700eb4fd..6cfa42e9521 100644 --- a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es2015.2.minified.js @@ -1,18 +1,13 @@ class C { - static m(x) { - } - m(x) { - } + static m(x) {} + m(x) {} constructor(){ - this.p = (x)=>{ - }; + this.p = (x)=>{}; } } C.m(), new C().m(), new C().p(); const obj = { - m (x) { - }, - p: (x)=>{ - } + m (x) {}, + p: (x)=>{} }; obj.m(), obj.p(); diff --git a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.1.normal.js b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.1.normal.js index 9444e543b02..184b349c486 100644 --- a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.1.normal.js @@ -21,27 +21,23 @@ function _createClass(Constructor, protoProps, staticProps) { // @checkJs: true // @noEmit: true // @Filename: test.js -function f(x) { -} +function f(x) {} f(); // Always been ok var C = /*#__PURE__*/ function() { "use strict"; function C() { _classCallCheck(this, C); - this.p = function(x) { - }; + this.p = function(x) {}; } _createClass(C, [ { key: "m", - value: function m(x) { - } + value: function m(x) {} } ], [ { key: "m", - value: function m(x) { - } + value: function m(x) {} } ]); return C; @@ -50,10 +46,8 @@ C.m(); // Always been ok new C().m(); // Regression #39261 new C().p(); // Regression #39261 var obj = { - m: function m(x) { - }, - p: function(x) { - } + m: function m(x) {}, + p: function(x) {} }; obj.m(); // Always been ok obj.p(); // Always been ok diff --git a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.2.minified.js b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.2.minified.js index 1d030290ecd..159f9342d19 100644 --- a/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unannotatedParametersAreOptional_es5.2.minified.js @@ -10,28 +10,23 @@ var C = function() { function C() { !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); - }(this, C), this.p = function(x) { - }; + }(this, C), this.p = function(x) {}; } return Constructor = C, protoProps = [ { key: "m", - value: function(x) { - } + value: function(x) {} } ], staticProps = [ { key: "m", - value: function(x) { - } + value: function(x) {} } ], protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C; }(); C.m(), new C().m(), new C().p(); var obj = { - m: function(x) { - }, - p: function(x) { - } + m: function(x) {}, + p: function(x) {} }; obj.m(), obj.p(); diff --git a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.1.normal.js b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.1.normal.js index 550ef7d2fe7..e1bf001f268 100644 --- a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.1.normal.js @@ -5,8 +5,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b = undefined; var c = undefined; diff --git a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.2.minified.js b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.2.minified.js index 4dac4549ce1..5f410993c04 100644 --- a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.1.normal.js b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.1.normal.js index 04a965730b5..08714cba50c 100644 --- a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.1.normal.js @@ -12,8 +12,7 @@ var ai; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var ae; var b = undefined; var c = undefined; diff --git a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.2.minified.js b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.2.minified.js index b3226de6741..f70e6cc54e8 100644 --- a/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/undefinedAssignableToEveryType_es5.2.minified.js @@ -4,5 +4,4 @@ var E, E, C = function() { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.1.normal.js b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.1.normal.js index 675bcc96d45..581c30a44fe 100644 --- a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.1.normal.js @@ -34,24 +34,20 @@ class D10 extends Base { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); class D11 extends Base { } -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class D12 extends Base { } class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); class D13 extends Base { } class D14 extends Base { diff --git a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.2.minified.js b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.2.minified.js index a2e87ad744c..3f3700c80c3 100644 --- a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es2015.2.minified.js @@ -1,10 +1,6 @@ var E, E; -function f() { -} -(E = E || (E = { -}))[E.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E = E || (E = {}))[E.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.1.normal.js b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.1.normal.js index 59b9eeb4b88..5f2a774e0e4 100644 --- a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.1.normal.js @@ -49,8 +49,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -226,8 +225,7 @@ var D10 = /*#__PURE__*/ function(Base) { var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var D11 = /*#__PURE__*/ function(Base) { "use strict"; _inherits(D11, Base); @@ -238,12 +236,10 @@ var D11 = /*#__PURE__*/ function(Base) { } return D11; }(Base); -function f() { -} +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var D12 = /*#__PURE__*/ function(Base) { "use strict"; _inherits(D12, Base); @@ -260,8 +256,7 @@ var c = function c() { }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); var D13 = /*#__PURE__*/ function(Base) { "use strict"; _inherits(D13, Base); diff --git a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.2.minified.js b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.2.minified.js index dd80336202b..f0e91475252 100644 --- a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything_es5.2.minified.js @@ -27,8 +27,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -169,8 +168,7 @@ var E, E, Base = function() { } return D10; }(Base); -(E = E || (E = { -}))[E.A = 0] = "A"; +(E = E || (E = {}))[E.A = 0] = "A"; var D11 = function(Base16) { "use strict"; _inherits(D11, Base16); @@ -180,10 +178,8 @@ var D11 = function(Base16) { } return D11; }(Base); -function f() { -} -(f || (f = { -})).bar = 1; +function f() {} +(f || (f = {})).bar = 1; var D12 = function(Base17) { "use strict"; _inherits(D12, Base17); @@ -196,8 +192,7 @@ var D12 = function(Base17) { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; var D13 = function(Base18) { "use strict"; _inherits(D13, Base18); diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.1.normal.js index 6472f50cebd..fd22cda00d1 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.1.normal.js @@ -47,11 +47,9 @@ const createTest = ()=>{ let x1 = f1('a'); let x2 = f2('a', 'b'); // Repro from #30442 -const func = ()=>{ -}; +const func = ()=>{}; const assign = (a, b)=>Object.assign(a, b) ; -const res = assign(()=>{ -}, { +const res = assign(()=>{}, { func }); diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.2.minified.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.2.minified.js index e8742fd9fa0..fdb57a803c8 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es2015.2.minified.js @@ -3,8 +3,6 @@ var a, b, y = void 0; return something === y ? haveY(y) : haveValue(something); }(Math.random() > 0.5 ? "hey!" : void 0, (text)=>"string" , (y)=>"other one" -), null.toUpperCase(), pigify(mbp).oinks, pigify(mbp).walks, f1("a"), f2("a", "b"), a = ()=>{ -}, b = { - func: ()=>{ - } +), null.toUpperCase(), pigify(mbp).oinks, pigify(mbp).walks, f1("a"), f2("a", "b"), a = ()=>{}, b = { + func: ()=>{} }, Object.assign(a, b); diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.1.normal.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.1.normal.js index dbb25f353c2..a3900b792f0 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.1.normal.js @@ -51,12 +51,10 @@ var createTest = function() { var x1 = f1('a'); var x2 = f2('a', 'b'); // Repro from #30442 -var func = function() { -}; +var func = function() {}; var assign = function(a, b) { return Object.assign(a, b); }; -var res = assign(function() { -}, { +var res = assign(function() {}, { func: func }); diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.2.minified.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.2.minified.js index fa4e09d99bb..89e50263146 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference1_es5.2.minified.js @@ -7,8 +7,6 @@ var y = void 0; return "other one"; }), null.toUpperCase(), pigify(mbp).oinks, pigify(mbp).walks, f1("a"), f2("a", "b"), (function(a, b) { Object.assign(a, b); -})(function() { -}, { - func: function() { - } +})(function() {}, { + func: function() {} }); diff --git a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.1.normal.js index 1af74033fd8..5e49cc684d2 100644 --- a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.1.normal.js @@ -2,8 +2,7 @@ var e; (function(e) { e[e["e1"] = 0] = "e1"; e[e["e2"] = 1] = "e2"; -})(e || (e = { -})); +})(e || (e = {})); class A { } class A2 { @@ -11,17 +10,13 @@ class A2 { var E2; (function(E2) { E2[E2["A"] = 0] = "A"; -})(E2 || (E2 = { -})); -function f() { -} +})(E2 || (E2 = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); class c { } (function(c1) { var bar = c1.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.2.minified.js b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.2.minified.js index b3c301fab3b..6c1bc53ca54 100644 --- a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es2015.2.minified.js @@ -1,11 +1,6 @@ var e, E2, e, E2; -function f() { -} -(e = e || (e = { -}))[e.e1 = 0] = "e1", e[e.e2 = 1] = "e2", (E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(e = e || (e = {}))[e.e1 = 0] = "e1", e[e.e2 = 1] = "e2", (E2 = E2 || (E2 = {}))[E2.A = 0] = "A", (f || (f = {})).bar = 1; class c { } -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.1.normal.js b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.1.normal.js index 1cd6e5f8737..7b504b30b05 100644 --- a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.1.normal.js @@ -7,8 +7,7 @@ var e; (function(e) { e[e["e1"] = 0] = "e1"; e[e["e2"] = 1] = "e2"; -})(e || (e = { -})); +})(e || (e = {})); var A = function A() { "use strict"; _classCallCheck(this, A); @@ -20,19 +19,15 @@ var A2 = function A2() { var E2; (function(E2) { E2[E2["A"] = 0] = "A"; -})(E2 || (E2 = { -})); -function f() { -} +})(E2 || (E2 = {})); +function f() {} (function(f1) { var bar = f1.bar = 1; -})(f || (f = { -})); +})(f || (f = {})); var c = function c() { "use strict"; _classCallCheck(this, c); }; (function(c) { var bar = c.bar = 1; -})(c || (c = { -})); +})(c || (c = {})); diff --git a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.2.minified.js b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.2.minified.js index 28c6465b3cd..b7a3a9fdd03 100644 --- a/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype_es5.2.minified.js @@ -1,8 +1,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } -(e = e || (e = { -}))[e.e1 = 0] = "e1", e[e.e2 = 1] = "e2"; +(e = e || (e = {}))[e.e1 = 0] = "e1", e[e.e2 = 1] = "e2"; var e, e, E2, E2, A = function() { "use strict"; _classCallCheck(this, A); @@ -10,14 +9,10 @@ var e, e, E2, E2, A = function() { "use strict"; _classCallCheck(this, A2); }; -function f() { -} -(E2 = E2 || (E2 = { -}))[E2.A = 0] = "A", (f || (f = { -})).bar = 1; +function f() {} +(E2 = E2 || (E2 = {}))[E2.A = 0] = "A", (f || (f = {})).bar = 1; var c = function() { "use strict"; _classCallCheck(this, c); }; -(c || (c = { -})).bar = 1; +(c || (c = {})).bar = 1; diff --git a/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es2015.1.normal.js index f3e95afd16f..8b8d595fc88 100644 --- a/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es2015.1.normal.js @@ -1,16 +1,9 @@ -function f1(s) { -} -function f2(s) { -} -function f3(...s) { -} -function f4(s, s2) { -} -function f5(s, n) { -} -function f6(s, ...n) { -} -function f7(s, ...sRest) { -} +function f1(s) {} +function f2(s) {} +function f3(...s) {} +function f4(s, s2) {} +function f5(s, n) {} +function f6(s, ...n) {} +function f7(s, ...sRest) {} var fUnion; fUnion(""); // All constituents can be called by passing a single string. diff --git a/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es5.1.normal.js b/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es5.1.normal.js index bd29792c273..e73caf2b201 100644 --- a/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeCallSignatures3_es5.1.normal.js @@ -1,16 +1,12 @@ -function f1(s) { -} -function f2(s) { -} +function f1(s) {} +function f2(s) {} function f3() { for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++){ s[_key] = arguments[_key]; } } -function f4(s, s2) { -} -function f5(s, n) { -} +function f4(s, s2) {} +function f5(s, n) {} function f6(s) { for(var _len = arguments.length, n = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ n[_key - 1] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/unionTypeEquivalence_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionTypeEquivalence_es2015.1.normal.js index f9acc9cc854..be5301a3059 100644 --- a/crates/swc/tests/tsc-references/unionTypeEquivalence_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeEquivalence_es2015.1.normal.js @@ -2,8 +2,7 @@ class C { } class D extends C { - foo() { - } + foo() {} } var x; var x; diff --git a/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.1.normal.js b/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.1.normal.js index 965e2202ff1..9cf61b49910 100644 --- a/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -98,8 +97,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return D; diff --git a/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.2.minified.js b/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.2.minified.js index b7966b65657..1280e290326 100644 --- a/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unionTypeEquivalence_es5.2.minified.js @@ -38,8 +38,7 @@ var C = function() { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var C = function() { return protoProps = [ { key: "foo", - value: function() { - } + value: function() {} } ], _defineProperties((Constructor = D).prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), D; }(C); diff --git a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es2015.1.normal.js index 382ce6e79bc..9ac846884fb 100644 --- a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es2015.1.normal.js @@ -30,20 +30,16 @@ var arr5Tuple = [ "any" ]; // Tuple class C { - foo() { - } + foo() {} } class D { - foo2() { - } + foo2() {} } class E extends C { - foo3() { - } + foo3() {} } class F extends C { - foo4() { - } + foo4() {} } var c, d, e, f; var arr6 = [ diff --git a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.1.normal.js b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.1.normal.js index f7c73f38a62..9ca2520c0a3 100644 --- a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -122,8 +121,7 @@ var C = /*#__PURE__*/ function() { _createClass(C, [ { key: "foo", - value: function foo() { - } + value: function foo() {} } ]); return C; @@ -136,8 +134,7 @@ var D = /*#__PURE__*/ function() { _createClass(D, [ { key: "foo2", - value: function foo2() { - } + value: function foo2() {} } ]); return D; @@ -153,8 +150,7 @@ var E = /*#__PURE__*/ function(C) { _createClass(E, [ { key: "foo3", - value: function foo3() { - } + value: function foo3() {} } ]); return E; @@ -170,8 +166,7 @@ var F = /*#__PURE__*/ function(C) { _createClass(F, [ { key: "foo4", - value: function foo4() { - } + value: function foo4() {} } ]); return F; diff --git a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.2.minified.js b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.2.minified.js index 6b69b79f7bc..a18bef04b7d 100644 --- a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -62,8 +61,7 @@ var C = function() { return _createClass(C, [ { key: "foo", - value: function() { - } + value: function() {} } ]), C; }(), D = function() { @@ -74,8 +72,7 @@ var C = function() { return _createClass(D, [ { key: "foo2", - value: function() { - } + value: function() {} } ]), D; }(), E = function(C) { @@ -88,8 +85,7 @@ var C = function() { return _createClass(E, [ { key: "foo3", - value: function() { - } + value: function() {} } ]), E; }(C), F = function(C) { @@ -102,8 +98,7 @@ var C = function() { return _createClass(F, [ { key: "foo4", - value: function() { - } + value: function() {} } ]), F; }(C); diff --git a/crates/swc/tests/tsc-references/unionTypeReduction2_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionTypeReduction2_es2015.1.normal.js index 15dd6041935..6d989e7fd9b 100644 --- a/crates/swc/tests/tsc-references/unionTypeReduction2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeReduction2_es2015.1.normal.js @@ -35,8 +35,7 @@ function f11(a, b) { z.f('hello'); } const k = { - something () { - } + something () {} }; function run(options) { var _something; diff --git a/crates/swc/tests/tsc-references/unionTypeReduction2_es5.1.normal.js b/crates/swc/tests/tsc-references/unionTypeReduction2_es5.1.normal.js index ce2ddb3c663..3447e70e0c6 100644 --- a/crates/swc/tests/tsc-references/unionTypeReduction2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeReduction2_es5.1.normal.js @@ -35,8 +35,7 @@ function f11(a, b) { z.f('hello'); } var k = { - something: function something() { - } + something: function something() {} }; function run(options) { var _something; diff --git a/crates/swc/tests/tsc-references/unionTypesAssignability_es2015.1.normal.js b/crates/swc/tests/tsc-references/unionTypesAssignability_es2015.1.normal.js index 49205aeda91..726427636c2 100644 --- a/crates/swc/tests/tsc-references/unionTypesAssignability_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypesAssignability_es2015.1.normal.js @@ -2,12 +2,10 @@ var unionNumberString; class C { } class D extends C { - foo1() { - } + foo1() {} } class E extends C { - foo2() { - } + foo2() {} } var unionDE; var num; diff --git a/crates/swc/tests/tsc-references/unionTypesAssignability_es5.1.normal.js b/crates/swc/tests/tsc-references/unionTypesAssignability_es5.1.normal.js index bb0c4804505..f1fbe231b3d 100644 --- a/crates/swc/tests/tsc-references/unionTypesAssignability_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypesAssignability_es5.1.normal.js @@ -63,8 +63,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -99,8 +98,7 @@ var D = /*#__PURE__*/ function(C) { _createClass(D, [ { key: "foo1", - value: function foo1() { - } + value: function foo1() {} } ]); return D; @@ -116,8 +114,7 @@ var E = /*#__PURE__*/ function(C) { _createClass(E, [ { key: "foo2", - value: function foo2() { - } + value: function foo2() {} } ]); return E; diff --git a/crates/swc/tests/tsc-references/unionTypesAssignability_es5.2.minified.js b/crates/swc/tests/tsc-references/unionTypesAssignability_es5.2.minified.js index f14e3f210ca..12af49301de 100644 --- a/crates/swc/tests/tsc-references/unionTypesAssignability_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unionTypesAssignability_es5.2.minified.js @@ -36,8 +36,7 @@ function _createSuper(Derived) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -67,8 +66,7 @@ var unionNumberString, unionDE, num, str, c, d, e, anyVar, C = function() { return _createClass(D, [ { key: "foo1", - value: function() { - } + value: function() {} } ]), D; }(C), E = function(C2) { @@ -81,8 +79,7 @@ var unionNumberString, unionDE, num, str, c, d, e, anyVar, C = function() { return _createClass(E, [ { key: "foo2", - value: function() { - } + value: function() {} } ]), E; }(C); diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.1.normal.js index 29c2a713990..fef84524ab6 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.1.normal.js @@ -22,21 +22,17 @@ export class ClassWithPrivateNamedProperties { } var tmp = s, tmp1 = s; export class ClassWithPrivateNamedMethods { - [tmp]() { - } - static [tmp1]() { - } + [tmp]() {} + static [tmp1]() {} } var tmp2 = s, tmp3 = s, tmp4 = s, tmp5 = s; export class ClassWithPrivateNamedAccessors { get [tmp2]() { return undefined; } - set [tmp3](v) { - } + set [tmp3](v) {} static get [tmp4]() { return undefined; } - static set [tmp5](v) { - } + static set [tmp5](v) {} } diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.2.minified.js index 295f99ffc66..3183e9ae22a 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es2015.2.minified.js @@ -20,18 +20,12 @@ export function funcInferredReturnType(obj1) { export class ClassWithPrivateNamedProperties { } export class ClassWithPrivateNamedMethods { - [s]() { - } - static [s]() { - } + [s]() {} + static [s]() {} } export class ClassWithPrivateNamedAccessors { - get [s]() { - } - set [s](v) { - } - static get [s]() { - } - static set [s](v) { - } + get [s]() {} + set [s](v) {} + static get [s]() {} + static set [s](v) {} } diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.1.normal.js index 618c88073c3..2cecc48198d 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.1.normal.js @@ -63,14 +63,12 @@ export var ClassWithPrivateNamedMethods = /*#__PURE__*/ function() { _createClass(ClassWithPrivateNamedMethods, [ { key: tmp, - value: function value() { - } + value: function value() {} } ], [ { key: tmp1, - value: function value() { - } + value: function value() {} } ]); return ClassWithPrivateNamedMethods; @@ -90,8 +88,7 @@ export var ClassWithPrivateNamedAccessors = /*#__PURE__*/ function() { }, { key: tmp3, - set: function set(v) { - } + set: function set(v) {} } ], [ { @@ -102,8 +99,7 @@ export var ClassWithPrivateNamedAccessors = /*#__PURE__*/ function() { }, { key: tmp5, - set: function set(v) { - } + set: function set(v) {} } ]); return ClassWithPrivateNamedAccessors; diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.2.minified.js index 4bebe8b2e89..e10861159f7 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors_es5.2.minified.js @@ -54,14 +54,12 @@ export var ClassWithPrivateNamedMethods = function() { return _createClass(ClassWithPrivateNamedMethods, [ { key: tmp, - value: function() { - } + value: function() {} } ], [ { key: tmp1, - value: function() { - } + value: function() {} } ]), ClassWithPrivateNamedMethods; }(); @@ -74,24 +72,20 @@ export var ClassWithPrivateNamedAccessors = function() { return _createClass(ClassWithPrivateNamedAccessors, [ { key: tmp2, - get: function() { - } + get: function() {} }, { key: tmp3, - set: function(v) { - } + set: function(v) {} } ], [ { key: tmp4, - get: function() { - } + get: function() {} }, { key: tmp5, - set: function(v) { - } + set: function(v) {} } ]), ClassWithPrivateNamedAccessors; }(); diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js index a9f965ef494..0e7eb05d8b0 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js @@ -559,8 +559,7 @@ Math.random() * 2 ? N.s : "a"; Math.random() * 2 ? N["s"] : "a"; var _obj; // computed property names -(_obj = { -}, _defineProperty(_obj, s, "a"), _defineProperty(_obj, N.s, "b"), _obj); +(_obj = {}, _defineProperty(_obj, s, "a"), _defineProperty(_obj, N.s, "b"), _obj); var C1 = function C1() { "use strict"; _classCallCheck(this, C1); diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js index 4a14a9f9d98..5baa1e82c89 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js @@ -311,8 +311,7 @@ var C0 = function() { } ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C0; }(); -C0.a = s, C0.b = N.s, C0.c = N.s, C0.d = s, C0.e = N.s, C0.f = N.s, o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), _defineProperty(_obj = { -}, s, "a"), _defineProperty(_obj, N.s, "b"); +C0.a = s, C0.b = N.s, C0.c = N.s, C0.d = s, C0.e = N.s, C0.f = N.s, o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), _defineProperty(_obj = {}, s, "a"), _defineProperty(_obj, N.s, "b"); var C1 = function() { "use strict"; _classCallCheck(this, C1); diff --git a/crates/swc/tests/tsc-references/uniqueSymbols_es2015.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbols_es2015.1.normal.js index 2253dad917e..84c9ac5184c 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbols_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbols_es2015.1.normal.js @@ -143,8 +143,7 @@ const constInitToConstCallWithTypeQuery = constCall; const constInitToConstDeclAmbientWithTypeQuery = constType; // assignment from any // https://github.com/Microsoft/TypeScript/issues/29108 -const fromAny = { -}; +const fromAny = {}; // function return inference function funcReturnConstCall() { return constCall; diff --git a/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js index 3e7364625a3..262a10f8a09 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js @@ -180,8 +180,7 @@ var constInitToConstCallWithTypeQuery = constCall; var constInitToConstDeclAmbientWithTypeQuery = constType; // assignment from any // https://github.com/Microsoft/TypeScript/issues/29108 -var fromAny = { -}; +var fromAny = {}; // function return inference function funcReturnConstCall() { return constCall; @@ -563,8 +562,7 @@ Math.random() * 2 ? N.s : "a"; Math.random() * 2 ? N["s"] : "a"; var _obj; // computed property names -(_obj = { -}, _defineProperty(_obj, s, "a"), _defineProperty(_obj, N.s, "b"), _obj); +(_obj = {}, _defineProperty(_obj, s, "a"), _defineProperty(_obj, N.s, "b"), _obj); var C1 = function C1() { "use strict"; _classCallCheck(this, C1); diff --git a/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js index cb48583b990..6c321fcaa4f 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js @@ -313,8 +313,7 @@ var C0 = function() { } ]), C0; }(); -C0.a = s, C0.b = N.s, C0.c = N.s, C0.d = s, C0.e = N.s, C0.f = N.s, o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), _defineProperty(_obj = { -}, s, "a"), _defineProperty(_obj, N.s, "b"); +C0.a = s, C0.b = N.s, C0.c = N.s, C0.d = s, C0.e = N.s, C0.f = N.s, o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), _defineProperty(_obj = {}, s, "a"), _defineProperty(_obj, N.s, "b"); var C1 = function() { "use strict"; _classCallCheck(this, C1); diff --git a/crates/swc/tests/tsc-references/unknownType1_es2015.1.normal.js b/crates/swc/tests/tsc-references/unknownType1_es2015.1.normal.js index 09bdd93e26e..64224359e64 100644 --- a/crates/swc/tests/tsc-references/unknownType1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unknownType1_es2015.1.normal.js @@ -27,8 +27,7 @@ function _extends() { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -104,8 +103,7 @@ function f23(x) { } // Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x) { - x = { - }; + x = {}; x = { a: 5 }; @@ -137,12 +135,10 @@ function f26(x, y, z) { }, z); // any } // Functions with unknown return type don't need return expressions -function f27() { -} +function f27() {} // Rest type cannot be created from unknown function f28(x) { - let a = _extends({ - }, x); // Error + let a = _extends({}, x); // Error } // Class properties of type unknown don't need definite assignment class C1 { diff --git a/crates/swc/tests/tsc-references/unknownType1_es5.1.normal.js b/crates/swc/tests/tsc-references/unknownType1_es5.1.normal.js index 2560a3f6d51..212ccb05523 100644 --- a/crates/swc/tests/tsc-references/unknownType1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unknownType1_es5.1.normal.js @@ -39,8 +39,7 @@ function _instanceof(left, right) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -116,8 +115,7 @@ function f23(x) { } // Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x) { - x = { - }; + x = {}; x = { a: 5 }; @@ -149,12 +147,10 @@ function f26(x, y, z) { }, z); // any } // Functions with unknown return type don't need return expressions -function f27() { -} +function f27() {} // Rest type cannot be created from unknown function f28(x) { - var a = _extends({ - }, x); // Error + var a = _extends({}, x); // Error } var C1 = function C1() { "use strict"; diff --git a/crates/swc/tests/tsc-references/unknownType2_es2015.1.normal.js b/crates/swc/tests/tsc-references/unknownType2_es2015.1.normal.js index 368008bf192..484f2e1af89 100644 --- a/crates/swc/tests/tsc-references/unknownType2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/unknownType2_es2015.1.normal.js @@ -16,16 +16,11 @@ if (u === null) { if (u === symb) { const symbolAlias = u; } -if (!(u === 42)) { -} -if (u !== 42) { -} -if (u == 42) { -} -if (u == true) { -} -if (u == Object) { -} +if (!(u === 42)) {} +if (u !== 42) {} +if (u == 42) {} +if (u == true) {} +if (u == Object) {} if (u === aString) { let uString = u; } @@ -41,10 +36,8 @@ if (u === anObject) { if (u === anObjectLiteral) { let uObjectLiteral = u; } -if (u === aUnion) { -} -if (u === anIntersection) { -} +if (u === aUnion) {} +if (u === anIntersection) {} if (u === aFunction) { let uFunction = u; } @@ -53,15 +46,13 @@ var NumberEnum; NumberEnum[NumberEnum["A"] = 0] = "A"; NumberEnum[NumberEnum["B"] = 1] = "B"; NumberEnum[NumberEnum["C"] = 2] = "C"; -})(NumberEnum || (NumberEnum = { -})); +})(NumberEnum || (NumberEnum = {})); var StringEnum; (function(StringEnum) { StringEnum["A"] = "A"; StringEnum["B"] = "B"; StringEnum["C"] = "C"; -})(StringEnum || (StringEnum = { -})); +})(StringEnum || (StringEnum = {})); if (u === NumberEnum || u === StringEnum) { let enumObj = u; } @@ -172,21 +163,17 @@ function f2(x) { return x; } function notNotEquals(u1) { - if (u1 !== NumberEnum) { - } else { + if (u1 !== NumberEnum) {} else { const o = u1; } - if (u1 !== NumberEnum.A) { - } else { + if (u1 !== NumberEnum.A) {} else { const a = u1; } - if (u1 !== NumberEnum.A && u1 !== NumberEnum.B && u1 !== StringEnum.A) { - } else { + if (u1 !== NumberEnum.A && u1 !== NumberEnum.B && u1 !== StringEnum.A) {} else { const aOrB = u1; } // equivalent to - if (!(u1 === NumberEnum.A || u1 === NumberEnum.B || u1 === StringEnum.A)) { - } else { + if (!(u1 === NumberEnum.A || u1 === NumberEnum.B || u1 === StringEnum.A)) {} else { const aOrB = u1; } } diff --git a/crates/swc/tests/tsc-references/unknownType2_es2015.2.minified.js b/crates/swc/tests/tsc-references/unknownType2_es2015.2.minified.js index dcd4c50af2f..6136913a9f7 100644 --- a/crates/swc/tests/tsc-references/unknownType2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/unknownType2_es2015.2.minified.js @@ -1,5 +1,3 @@ var NumberEnum, StringEnum, NumberEnum, StringEnum; const u = void 0; -5 === u && u.toString(10), !0 === u || !1 === u, void 0 === u, null === u, u === symb, 42 !== u, 42 !== u, 42 == u, !0 == u, u == Object, u === aString, u === aBoolean, u === aNumber, u === anObject, u === anObjectLiteral, u === aUnion, u === anIntersection, u === aFunction, (NumberEnum = NumberEnum || (NumberEnum = { -}))[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum.C = 2] = "C", (StringEnum = StringEnum || (StringEnum = { -})).A = "A", StringEnum.B = "B", StringEnum.C = "C", u === NumberEnum || u === StringEnum, u === NumberEnum.A, u === StringEnum.B; +5 === u && u.toString(10), !0 === u || !1 === u, void 0 === u, null === u, u === symb, 42 !== u, 42 !== u, 42 == u, !0 == u, u == Object, u === aString, u === aBoolean, u === aNumber, u === anObject, u === anObjectLiteral, u === aUnion, u === anIntersection, u === aFunction, (NumberEnum = NumberEnum || (NumberEnum = {}))[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum.C = 2] = "C", (StringEnum = StringEnum || (StringEnum = {})).A = "A", StringEnum.B = "B", StringEnum.C = "C", u === NumberEnum || u === StringEnum, u === NumberEnum.A, u === StringEnum.B; diff --git a/crates/swc/tests/tsc-references/unknownType2_es5.1.normal.js b/crates/swc/tests/tsc-references/unknownType2_es5.1.normal.js index 3ba378a2ce7..4577c5c2daa 100644 --- a/crates/swc/tests/tsc-references/unknownType2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unknownType2_es5.1.normal.js @@ -17,16 +17,11 @@ if (u === null) { if (u === symb) { var symbolAlias = u; } -if (!(u === 42)) { -} -if (u !== 42) { -} -if (u == 42) { -} -if (u == true) { -} -if (u == Object) { -} +if (!(u === 42)) {} +if (u !== 42) {} +if (u == 42) {} +if (u == true) {} +if (u == Object) {} if (u === aString) { var uString = u; } @@ -42,10 +37,8 @@ if (u === anObject) { if (u === anObjectLiteral) { var uObjectLiteral = u; } -if (u === aUnion) { -} -if (u === anIntersection) { -} +if (u === aUnion) {} +if (u === anIntersection) {} if (u === aFunction) { var uFunction = u; } @@ -54,15 +47,13 @@ var NumberEnum; NumberEnum[NumberEnum["A"] = 0] = "A"; NumberEnum[NumberEnum["B"] = 1] = "B"; NumberEnum[NumberEnum["C"] = 2] = "C"; -})(NumberEnum || (NumberEnum = { -})); +})(NumberEnum || (NumberEnum = {})); var StringEnum; (function(StringEnum) { StringEnum["A"] = "A"; StringEnum["B"] = "B"; StringEnum["C"] = "C"; -})(StringEnum || (StringEnum = { -})); +})(StringEnum || (StringEnum = {})); if (u === NumberEnum || u === StringEnum) { var enumObj = u; } @@ -173,21 +164,17 @@ function f2(x) { return x; } function notNotEquals(u1) { - if (u1 !== NumberEnum) { - } else { + if (u1 !== NumberEnum) {} else { var o = u1; } - if (u1 !== NumberEnum.A) { - } else { + if (u1 !== NumberEnum.A) {} else { var a = u1; } - if (u1 !== NumberEnum.A && u1 !== NumberEnum.B && u1 !== StringEnum.A) { - } else { + if (u1 !== NumberEnum.A && u1 !== NumberEnum.B && u1 !== StringEnum.A) {} else { var aOrB = u1; } // equivalent to - if (!(u1 === NumberEnum.A || u1 === NumberEnum.B || u1 === StringEnum.A)) { - } else { + if (!(u1 === NumberEnum.A || u1 === NumberEnum.B || u1 === StringEnum.A)) {} else { var aOrB1 = u1; } } diff --git a/crates/swc/tests/tsc-references/unknownType2_es5.2.minified.js b/crates/swc/tests/tsc-references/unknownType2_es5.2.minified.js index 4b9417427eb..c5ca8619709 100644 --- a/crates/swc/tests/tsc-references/unknownType2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unknownType2_es5.2.minified.js @@ -1,4 +1,2 @@ var NumberEnum, StringEnum, NumberEnum, StringEnum, u = void 0; -5 === u && u.toString(10), !0 === u || !1 === u, void 0 === u, null === u, u === symb, 42 !== u, 42 !== u, 42 == u, !0 == u, u == Object, u === aString, u === aBoolean, u === aNumber, u === anObject, u === anObjectLiteral, u === aUnion, u === anIntersection, u === aFunction, (NumberEnum = NumberEnum || (NumberEnum = { -}))[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum.C = 2] = "C", (StringEnum = StringEnum || (StringEnum = { -})).A = "A", StringEnum.B = "B", StringEnum.C = "C", u === NumberEnum || u === StringEnum, u === NumberEnum.A, u === StringEnum.B; +5 === u && u.toString(10), !0 === u || !1 === u, void 0 === u, null === u, u === symb, 42 !== u, 42 !== u, 42 == u, !0 == u, u == Object, u === aString, u === aBoolean, u === aNumber, u === anObject, u === anObjectLiteral, u === aUnion, u === anIntersection, u === aFunction, (NumberEnum = NumberEnum || (NumberEnum = {}))[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum.C = 2] = "C", (StringEnum = StringEnum || (StringEnum = {})).A = "A", StringEnum.B = "B", StringEnum.C = "C", u === NumberEnum || u === StringEnum, u === NumberEnum.A, u === StringEnum.B; diff --git a/crates/swc/tests/tsc-references/validEnumAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/validEnumAssignments_es2015.1.normal.js index c7ab4d4a4de..0825fea1f7c 100644 --- a/crates/swc/tests/tsc-references/validEnumAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/validEnumAssignments_es2015.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; -})(E || (E = { -})); +})(E || (E = {})); var n; var a; var e; diff --git a/crates/swc/tests/tsc-references/validEnumAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/validEnumAssignments_es2015.2.minified.js index ea5a7566d62..e785289e755 100644 --- a/crates/swc/tests/tsc-references/validEnumAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/validEnumAssignments_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, n, e, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", n = e, n = E.A, E.A, e = e, e = E.A, e = E.B, e = n, e = null, e = void 0, e = 1, e = 1, e = 1, e = -1; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", n = e, n = E.A, E.A, e = e, e = E.A, e = E.B, e = n, e = null, e = void 0, e = 1, e = 1, e = 1, e = -1; diff --git a/crates/swc/tests/tsc-references/validEnumAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/validEnumAssignments_es5.1.normal.js index c7ab4d4a4de..0825fea1f7c 100644 --- a/crates/swc/tests/tsc-references/validEnumAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/validEnumAssignments_es5.1.normal.js @@ -2,8 +2,7 @@ var E; (function(E) { E[E["A"] = 0] = "A"; E[E["B"] = 1] = "B"; -})(E || (E = { -})); +})(E || (E = {})); var n; var a; var e; diff --git a/crates/swc/tests/tsc-references/validEnumAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/validEnumAssignments_es5.2.minified.js index ea5a7566d62..e785289e755 100644 --- a/crates/swc/tests/tsc-references/validEnumAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/validEnumAssignments_es5.2.minified.js @@ -1,3 +1,2 @@ var E, n, e, E; -(E = E || (E = { -}))[E.A = 0] = "A", E[E.B = 1] = "B", n = e, n = E.A, E.A, e = e, e = E.A, e = E.B, e = n, e = null, e = void 0, e = 1, e = 1, e = 1, e = -1; +(E = E || (E = {}))[E.A = 0] = "A", E[E.B = 1] = "B", n = e, n = E.A, E.A, e = e, e = E.A, e = E.B, e = n, e = null, e = void 0, e = 1, e = 1, e = 1, e = -1; diff --git a/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es2015.1.normal.js index 2330ee7abab..411766fc2d2 100644 --- a/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es2015.1.normal.js @@ -3,8 +3,7 @@ var x; var x = 2; if (true) { var x = 3; - for(var x = 0;;){ - } + for(var x = 0;;){} } var x = undefined; // new declaration space, making redeclaring x as a string valid diff --git a/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es5.1.normal.js index b2ed28952c3..8500cf15e60 100644 --- a/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/validMultipleVariableDeclarations_es5.1.normal.js @@ -3,8 +3,7 @@ var x; var x = 2; if (true) { var x = 3; - for(var x = 0;;){ - } + for(var x = 0;;){} } var x = undefined; // new declaration space, making redeclaring x as a string valid diff --git a/crates/swc/tests/tsc-references/validNullAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/validNullAssignments_es2015.1.normal.js index a692d965083..e26946f2d99 100644 --- a/crates/swc/tests/tsc-references/validNullAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/validNullAssignments_es2015.1.normal.js @@ -7,8 +7,7 @@ e = null; // ok var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E.A = null; // error class C { } @@ -21,8 +20,7 @@ I = null; // error var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = null; // error var h = null; function i(a1) { diff --git a/crates/swc/tests/tsc-references/validNullAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/validNullAssignments_es2015.2.minified.js index d0bebcb257b..3b3518c699a 100644 --- a/crates/swc/tests/tsc-references/validNullAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/validNullAssignments_es2015.2.minified.js @@ -1,4 +1,2 @@ var E, M, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A = null, I = null, (M || (M = { -})).x = 1, M = null; +(E = E || (E = {}))[E.A = 0] = "A", E.A = null, I = null, (M || (M = {})).x = 1, M = null; diff --git a/crates/swc/tests/tsc-references/validNullAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/validNullAssignments_es5.1.normal.js index 683b370846a..3a66bcfeed5 100644 --- a/crates/swc/tests/tsc-references/validNullAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/validNullAssignments_es5.1.normal.js @@ -12,8 +12,7 @@ e = null; // ok var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); E.A = null; // error var C = function C() { "use strict"; @@ -28,8 +27,7 @@ I = null; // error var M; (function(M1) { var x = M1.x = 1; -})(M || (M = { -})); +})(M || (M = {})); M = null; // error var h = null; function i(a1) { diff --git a/crates/swc/tests/tsc-references/validNullAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/validNullAssignments_es5.2.minified.js index 0d8ed415cb5..b8721b8cbeb 100644 --- a/crates/swc/tests/tsc-references/validNullAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/validNullAssignments_es5.2.minified.js @@ -1,11 +1,9 @@ var E, M, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A = null; +(E = E || (E = {}))[E.A = 0] = "A", E.A = null; var C = function() { "use strict"; !function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }(this, C); }; -C = null, I = null, (M || (M = { -})).x = 1, M = null; +C = null, I = null, (M || (M = {})).x = 1, M = null; diff --git a/crates/swc/tests/tsc-references/validNumberAssignments_es2015.1.normal.js b/crates/swc/tests/tsc-references/validNumberAssignments_es2015.1.normal.js index 1805071de84..c9bcf0a7f37 100644 --- a/crates/swc/tests/tsc-references/validNumberAssignments_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/validNumberAssignments_es2015.1.normal.js @@ -5,8 +5,7 @@ var c = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var d = x; var e = E.A; e = x; diff --git a/crates/swc/tests/tsc-references/validNumberAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/validNumberAssignments_es2015.2.minified.js index ed7528b1b1c..9b0af19df18 100644 --- a/crates/swc/tests/tsc-references/validNumberAssignments_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/validNumberAssignments_es2015.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A; +(E = E || (E = {}))[E.A = 0] = "A", E.A; diff --git a/crates/swc/tests/tsc-references/validNumberAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/validNumberAssignments_es5.1.normal.js index 1805071de84..c9bcf0a7f37 100644 --- a/crates/swc/tests/tsc-references/validNumberAssignments_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/validNumberAssignments_es5.1.normal.js @@ -5,8 +5,7 @@ var c = x; var E; (function(E) { E[E["A"] = 0] = "A"; -})(E || (E = { -})); +})(E || (E = {})); var d = x; var e = E.A; e = x; diff --git a/crates/swc/tests/tsc-references/validNumberAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/validNumberAssignments_es5.2.minified.js index ed7528b1b1c..9b0af19df18 100644 --- a/crates/swc/tests/tsc-references/validNumberAssignments_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/validNumberAssignments_es5.2.minified.js @@ -1,3 +1,2 @@ var E, E; -(E = E || (E = { -}))[E.A = 0] = "A", E.A; +(E = E || (E = {}))[E.A = 0] = "A", E.A; diff --git a/crates/swc/tests/tsc-references/variadicTuples1_es2015.1.normal.js b/crates/swc/tests/tsc-references/variadicTuples1_es2015.1.normal.js index e99745d10f0..91e088fe008 100644 --- a/crates/swc/tests/tsc-references/variadicTuples1_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/variadicTuples1_es2015.1.normal.js @@ -289,8 +289,7 @@ function f23(args) { } const b = a.bind("", 1); // Desc<[boolean], object> function callApi(method) { - return (...args)=>method(...args, { - }) + return (...args)=>method(...args, {}) ; } callApi(getUser); diff --git a/crates/swc/tests/tsc-references/variadicTuples1_es2015.2.minified.js b/crates/swc/tests/tsc-references/variadicTuples1_es2015.2.minified.js index 09cf1f8c13d..af06e6098f8 100644 --- a/crates/swc/tests/tsc-references/variadicTuples1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/variadicTuples1_es2015.2.minified.js @@ -12,8 +12,7 @@ function curry2(f, t, u) { return f(...t, ...u); } function callApi(method) { - return (...args)=>method(...args, { - }) + return (...args)=>method(...args, {}) ; } concat([], []), concat([ diff --git a/crates/swc/tests/tsc-references/variadicTuples1_es5.1.normal.js b/crates/swc/tests/tsc-references/variadicTuples1_es5.1.normal.js index 811322fcd08..bdda56b87f1 100644 --- a/crates/swc/tests/tsc-references/variadicTuples1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/variadicTuples1_es5.1.normal.js @@ -379,8 +379,7 @@ function callApi(method) { args[_key] = arguments[_key]; } return method.apply(void 0, _toConsumableArray(args).concat([ - { - } + {} ])); }; } diff --git a/crates/swc/tests/tsc-references/variadicTuples1_es5.2.minified.js b/crates/swc/tests/tsc-references/variadicTuples1_es5.2.minified.js index 628ad6748a2..beb70457fb5 100644 --- a/crates/swc/tests/tsc-references/variadicTuples1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/variadicTuples1_es5.2.minified.js @@ -110,8 +110,7 @@ function callApi(method) { return function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key]; return method.apply(void 0, _toConsumableArray(args).concat([ - { - } + {} ])); }; } diff --git a/crates/swc/tests/tsc-references/variance_es2015.1.normal.js b/crates/swc/tests/tsc-references/variance_es2015.1.normal.js index 01ac7afed02..1f6d12e5293 100644 --- a/crates/swc/tests/tsc-references/variance_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/variance_es2015.1.normal.js @@ -6,8 +6,7 @@ const y = foo; const z = x; // Repro from #30118 class Bar { - cast(_name) { - } + cast(_name) {} pushThis() { Bar.instance.push(this); } diff --git a/crates/swc/tests/tsc-references/variance_es2015.2.minified.js b/crates/swc/tests/tsc-references/variance_es2015.2.minified.js index c34766e80b5..404b49cb318 100644 --- a/crates/swc/tests/tsc-references/variance_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/variance_es2015.2.minified.js @@ -1,6 +1,5 @@ class Bar { - cast(_name) { - } + cast(_name) {} pushThis() { Bar.instance.push(this); } diff --git a/crates/swc/tests/tsc-references/variance_es5.1.normal.js b/crates/swc/tests/tsc-references/variance_es5.1.normal.js index be6ea95fd27..92794e9d130 100644 --- a/crates/swc/tests/tsc-references/variance_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/variance_es5.1.normal.js @@ -32,8 +32,7 @@ var Bar = // Repro from #30118 _createClass(Bar, [ { key: "cast", - value: function cast(_name) { - } + value: function cast(_name) {} }, { key: "pushThis", diff --git a/crates/swc/tests/tsc-references/variance_es5.2.minified.js b/crates/swc/tests/tsc-references/variance_es5.2.minified.js index 3c0c51ed014..09bc51e369d 100644 --- a/crates/swc/tests/tsc-references/variance_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/variance_es5.2.minified.js @@ -15,8 +15,7 @@ var Bar = function() { return Constructor = Bar, protoProps = [ { key: "cast", - value: function(_name) { - } + value: function(_name) {} }, { key: "pushThis", diff --git a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.1.normal.js index ec606653e8b..b3a26f2f1ac 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.1.normal.js @@ -24,8 +24,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsAny1 = void ANY1; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.2.minified.js index 99ba8271e54..03fe15fc6de 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es2015.2.minified.js @@ -3,13 +3,11 @@ var M, ANY2 = [ "" ]; class A { - static foo() { - } + static foo() {} } !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.1.normal.js index dfb7231df59..c67417d939a 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.1.normal.js @@ -53,8 +53,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // any type var var ResultIsAny1 = void ANY1; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.2.minified.js index e8b40403252..b553f61ca1b 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithAnyOtherType_es5.2.minified.js @@ -17,15 +17,13 @@ var M, ANY2 = [ })(Constructor = A, [ { key: "foo", - value: function() { - } + value: function() {} } ]), A; }(); !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); ANY2[0], objA.a, M.n, A.foo(), ANY2[0], objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.1.normal.js index e4407655bec..72ea945d77f 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.1.normal.js @@ -12,8 +12,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsAny1 = void BOOLEAN; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.2.minified.js index 65b9f6c5a71..294503578a1 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es2015.2.minified.js @@ -9,7 +9,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var M, objA = new A(); objA.a, foo(), A.foo(), foo(), objA.a; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.1.normal.js index 67f7f88afd4..4a8a5f49fa7 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.1.normal.js @@ -41,8 +41,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // boolean type var var ResultIsAny1 = void BOOLEAN; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.2.minified.js index c6311cece82..823b28e436b 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithBooleanType_es5.2.minified.js @@ -26,7 +26,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.1.normal.js index a609783713b..553be661101 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.1.normal.js @@ -1,15 +1,12 @@ var // void operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsAny1 = void ENUM; var ResultIsAny2 = void ENUM1; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.2.minified.js index ac8e327a192..57c0449e7bb 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es2015.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM[0] + ENUM1.B, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM[0] + ENUM1.B, ENUM1.B; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.1.normal.js index a609783713b..553be661101 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.1.normal.js @@ -1,15 +1,12 @@ var // void operator on enum type ENUM; -(function(ENUM) { -})(ENUM || (ENUM = { -})); +(function(ENUM) {})(ENUM || (ENUM = {})); var ENUM1; (function(ENUM1) { ENUM1[ENUM1["A"] = 0] = "A"; ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; -})(ENUM1 || (ENUM1 = { -})); +})(ENUM1 || (ENUM1 = {})); // enum type var var ResultIsAny1 = void ENUM; var ResultIsAny2 = void ENUM1; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.2.minified.js index ac8e327a192..57c0449e7bb 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithEnumType_es5.2.minified.js @@ -1,3 +1,2 @@ var ENUM1, ENUM, ENUM1; -(ENUM1 = ENUM1 || (ENUM1 = { -}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM[0] + ENUM1.B, ENUM1.B; +(ENUM1 = ENUM1 || (ENUM1 = {}))[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "", ENUM1.A, ENUM[0] + ENUM1.B, ENUM[0] + ENUM1.B, ENUM1.B; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.1.normal.js index fec3410c4af..c8ec339a634 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsAny1 = void NUMBER; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.2.minified.js index e9a7fe8a25d..483281d8468 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es2015.2.minified.js @@ -7,7 +7,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.1.normal.js index 1dc850b6bfd..bb69d30c190 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // number type var var ResultIsAny1 = void NUMBER; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.2.minified.js index a0266fa2414..5782b25902c 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithNumberType_es5.2.minified.js @@ -23,7 +23,6 @@ var M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, A.foo(), objA.a, M.n, objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.1.normal.js index f64d4847f4e..4e04f06b68b 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.1.normal.js @@ -16,8 +16,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsAny1 = void STRING; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.2.minified.js index 582da0d7546..8d3ce9882d7 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es2015.2.minified.js @@ -10,7 +10,6 @@ class A { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.1.normal.js index bc2d7bcf2ee..268ab9440ac 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.1.normal.js @@ -45,8 +45,7 @@ var M; (function(M1) { var n; M1.n = n; -})(M || (M = { -})); +})(M || (M = {})); var objA = new A(); // string type var var ResultIsAny1 = void STRING; diff --git a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.2.minified.js index 9a048b7824d..8e87a47ca9a 100644 --- a/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/voidOperatorWithStringType_es5.2.minified.js @@ -26,7 +26,6 @@ var STRING, M, A = function() { !function(M1) { var n; M1.n = n; -}(M || (M = { -})); +}(M || (M = {})); var objA = new A(); objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/whileBreakStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/whileBreakStatements_es2015.1.normal.js index 7a0abc26b85..75a45be8149 100644 --- a/crates/swc/tests/tsc-references/whileBreakStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/whileBreakStatements_es2015.1.normal.js @@ -19,7 +19,6 @@ while(true){ } SEVEN: while(true)while(true)while(true)break SEVEN; EIGHT: while(true){ - var fn = function() { - }; + var fn = function() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/whileBreakStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/whileBreakStatements_es5.1.normal.js index 89815b10131..0220b237584 100644 --- a/crates/swc/tests/tsc-references/whileBreakStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/whileBreakStatements_es5.1.normal.js @@ -19,7 +19,6 @@ while(true){ } SEVEN: while(true)while(true)while(true)break SEVEN; EIGHT: while(true){ - var fn = function fn() { - }; + var fn = function fn() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/whileContinueStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/whileContinueStatements_es2015.1.normal.js index 77a58f62687..e15f8a8ceb6 100644 --- a/crates/swc/tests/tsc-references/whileContinueStatements_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/whileContinueStatements_es2015.1.normal.js @@ -22,8 +22,7 @@ while(true){ } SEVEN: while(true)while(true)while(true)continue SEVEN; EIGHT: while(true){ - var fn = function() { - }; + var fn = function() {}; continue EIGHT; } NINE: while(true){ diff --git a/crates/swc/tests/tsc-references/whileContinueStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/whileContinueStatements_es5.1.normal.js index c28e03502ab..e9c9287badd 100644 --- a/crates/swc/tests/tsc-references/whileContinueStatements_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/whileContinueStatements_es5.1.normal.js @@ -22,8 +22,7 @@ while(true){ } SEVEN: while(true)while(true)while(true)continue SEVEN; EIGHT: while(true){ - var fn = function fn() { - }; + var fn = function fn() {}; continue EIGHT; } NINE: while(true){ diff --git a/crates/swc/tests/tsc-references/witness_es2015.1.normal.js b/crates/swc/tests/tsc-references/witness_es2015.1.normal.js index bc7ce558fdd..05e9ae1150e 100644 --- a/crates/swc/tests/tsc-references/witness_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/witness_es2015.1.normal.js @@ -101,8 +101,7 @@ var M2; var x = M21.x = M2.x; var y = x; var y; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); // Property access of class instance type class C2 { constructor(){ diff --git a/crates/swc/tests/tsc-references/witness_es2015.2.minified.js b/crates/swc/tests/tsc-references/witness_es2015.2.minified.js index 3da023196f1..84d31b30cb8 100644 --- a/crates/swc/tests/tsc-references/witness_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/witness_es2015.2.minified.js @@ -19,8 +19,7 @@ fnCall(), fn5(); var propAcc1 = { m: propAcc1.m }; -(M2 || (M2 = { -})).x = M2.x, new class { +(M2 || (M2 = {})).x = M2.x, new class { constructor(){ this.n = this.n; } diff --git a/crates/swc/tests/tsc-references/witness_es5.1.normal.js b/crates/swc/tests/tsc-references/witness_es5.1.normal.js index 27388b8e5e8..040d642a8b6 100644 --- a/crates/swc/tests/tsc-references/witness_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/witness_es5.1.normal.js @@ -145,8 +145,7 @@ var M2; var x = M21.x = M2.x; var y = x; var y; -})(M2 || (M2 = { -})); +})(M2 || (M2 = {})); var C2 = function C2() { "use strict"; _classCallCheck(this, C2); diff --git a/crates/swc/tests/tsc-references/witness_es5.2.minified.js b/crates/swc/tests/tsc-references/witness_es5.2.minified.js index 1125cf5736f..d99925d40d5 100644 --- a/crates/swc/tests/tsc-references/witness_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/witness_es5.2.minified.js @@ -72,8 +72,7 @@ fn5(); var propAcc1 = { m: propAcc1.m }; -(M2 || (M2 = { -})).x = M2.x; +(M2 || (M2 = {})).x = M2.x; var C2 = function() { "use strict"; _classCallCheck(this, C2), this.n = this.n; diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.1.normal.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.1.normal.js index 016cec25e03..12c0550602d 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.1.normal.js @@ -1,6 +1,5 @@ class C { - constructor(x){ - } + constructor(x){} } var c = new C(1); var c = new C(new C('')); // error diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.2.minified.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.2.minified.js index 00b38776b63..5b61b094962 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2_es2015.2.minified.js @@ -1,5 +1,4 @@ class C { - constructor(x){ - } + constructor(x){} } new C(1), new C(new C("")); diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.1.normal.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.1.normal.js index 4b2c99174ef..9506dd3fbde 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.1.normal.js @@ -6,8 +6,7 @@ class C { } return bar; } - constructor(x){ - } + constructor(x){} } var c = new C({ length: 2 diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.2.minified.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.2.minified.js index 8277228c5ec..1b847f331ee 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3_es2015.2.minified.js @@ -4,8 +4,7 @@ new class { return x; }; } - constructor(x){ - } + constructor(x){} }({ length: 2 }).foo({ diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.1.normal.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.1.normal.js index 60d2a18cc07..651fa2e3319 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.1.normal.js @@ -5,8 +5,7 @@ class C { } return bar; } - constructor(x){ - } + constructor(x){} } var c = new C({ length: 2 diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.2.minified.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.2.minified.js index 02f7d1e058c..bf2de656982 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4_es2015.2.minified.js @@ -4,8 +4,7 @@ new class { return x; }; } - constructor(x){ - } + constructor(x){} }({ length: 2 }).foo("")({ diff --git a/crates/swc/tests/vercel/full/firebase/dist/1/output/index.js b/crates/swc/tests/vercel/full/firebase/dist/1/output/index.js index 3d87db611b2..a04a34e0a6d 100644 --- a/crates/swc/tests/vercel/full/firebase/dist/1/output/index.js +++ b/crates/swc/tests/vercel/full/firebase/dist/1/output/index.js @@ -68,8 +68,7 @@ var a, b = require("@firebase/util"), c = require("tslib"), d = require("@fireba options: this.options }; }, a; -}(), i = ((a = { -})["no-app"] = "No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()", a["invalid-app-argument"] = "firebase.{$appName}() takes either no argument or a Firebase App instance.", a), j = new b.ErrorFactory("app-compat", "Firebase", i); +}(), i = ((a = {})["no-app"] = "No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()", a["invalid-app-argument"] = "firebase.{$appName}() takes either no argument or a Firebase App instance.", a), j = new b.ErrorFactory("app-compat", "Firebase", i); function k() { var a = function(a) { var c = function(a) { @@ -77,12 +76,10 @@ function k() { appName: a }); return d[a]; - }, d = { - }, e = { + }, d = {}, e = { __esModule: !0, initializeApp: function(c, f) { - void 0 === f && (f = { - }); + void 0 === f && (f = {}); var h = g.initializeApp(c, f); if (b.contains(d, h.name)) return d[h.name]; var i = new a(h, e); @@ -128,8 +125,7 @@ function k() { } }), c.App = a, e; }(h); - return a.INTERNAL = c.__assign(c.__assign({ - }, a.INTERNAL), { + return a.INTERNAL = c.__assign(c.__assign({}, a.INTERNAL), { createFirebaseNamespace: k, extendNamespace: function(c) { b.deepExtend(a, c); diff --git a/crates/swc/tests/vercel/full/react-autosuggest/1/output/index.js b/crates/swc/tests/vercel/full/react-autosuggest/1/output/index.js index 532957e5da9..15ca6f04cde 100644 --- a/crates/swc/tests/vercel/full/react-autosuggest/1/output/index.js +++ b/crates/swc/tests/vercel/full/react-autosuggest/1/output/index.js @@ -12,8 +12,7 @@ var _react = function(obj) { }; var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - }, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + var newObj = {}, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for(var key in obj)if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key]; @@ -105,8 +104,7 @@ var ItemsList = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -151,8 +149,7 @@ var ItemsList = function(_Component) { itemIndex: itemIndex }) : itemProps, allItemProps = function(target) { for(var _arguments = arguments, _loop = function(i) { - var source = null != _arguments[i] ? _arguments[i] : { - }; + var source = null != _arguments[i] ? _arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -163,10 +160,8 @@ var ItemsList = function(_Component) { }({ id: getItemId(sectionIndex, itemIndex), "aria-selected": isHighlighted - }, theme(itemKey, "item", 0 === itemIndex && "itemFirst", isHighlighted && "itemHighlighted"), { - }, itemPropsObj); - return isHighlighted && (allItemProps.ref = _this2.storeHighlightedItemReference), _react.default.createElement(_Item.default, _extends({ - }, allItemProps, { + }, theme(itemKey, "item", 0 === itemIndex && "itemFirst", isHighlighted && "itemHighlighted"), {}, itemPropsObj); + return isHighlighted && (allItemProps.ref = _this2.storeHighlightedItemReference), _react.default.createElement(_Item.default, _extends({}, allItemProps, { sectionIndex: sectionIndex, isHighlighted: isHighlighted, itemIndex: itemIndex, diff --git a/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js b/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js index cd4c61f1991..ca8196b24bb 100644 --- a/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js +++ b/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js @@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", { }), exports.default = void 0; var a = require("react/jsx-runtime"), b = function(a) { if (a && a.__esModule) return a; - var b = { - }; + var b = {}; if (null != a) { for(var c in a)if (Object.prototype.hasOwnProperty.call(a, c)) { - var d = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(a, c) : { - }; + var d = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(a, c) : {}; d.get || d.set ? Object.defineProperty(b, c, d) : b[c] = a[c]; } } @@ -40,8 +38,7 @@ function f(a) { } function g(a) { for(var c = 1; c < arguments.length; c++){ - var d = null != arguments[c] ? arguments[c] : { - }, f = Object.keys(d); + var d = null != arguments[c] ? arguments[c] : {}, f = Object.keys(d); "function" == typeof Object.getOwnPropertySymbols && (f = f.concat(Object.getOwnPropertySymbols(d).filter(function(a) { return Object.getOwnPropertyDescriptor(d, a).enumerable; }))), f.forEach(function(c) { @@ -73,8 +70,7 @@ var i = function(b) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (a) { return !1; } @@ -121,8 +117,7 @@ var i = function(b) { id: k(i, d), "aria-selected": m }, l(p, "item", 0 === d && "itemFirst", m && "itemHighlighted"), q); - return m && (r.ref = b.storeHighlightedItemReference), a.jsx(Item, g({ - }, r, { + return m && (r.ref = b.storeHighlightedItemReference), a.jsx(Item, g({}, r, { sectionIndex: i, isHighlighted: m, itemIndex: d, diff --git a/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js b/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js index 7f39b50bcab..55f533201b6 100644 --- a/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js +++ b/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js @@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", { }), exports.default = void 0; var a = require("react/jsx-runtime"), b = function(a) { if (a && a.__esModule) return a; - var b = { - }; + var b = {}; if (null != a) { for(var c in a)if (Object.prototype.hasOwnProperty.call(a, c)) { - var d = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(a, c) : { - }; + var d = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(a, c) : {}; d.get || d.set ? Object.defineProperty(b, c, d) : b[c] = a[c]; } } @@ -36,8 +34,7 @@ function e(a) { } function f(a) { for(var c = 1; c < arguments.length; c++){ - var e = null != arguments[c] ? arguments[c] : { - }, f = Object.keys(e); + var e = null != arguments[c] ? arguments[c] : {}, f = Object.keys(e); "function" == typeof Object.getOwnPropertySymbols && (f = f.concat(Object.getOwnPropertySymbols(e).filter(function(a) { return Object.getOwnPropertyDescriptor(e, a).enumerable; }))), f.forEach(function(c) { @@ -69,8 +66,7 @@ var h = function(b) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (a) { return !1; } @@ -119,8 +115,7 @@ var h = function(b) { id: k(i, d), "aria-selected": m }, l(p, "item", 0 === d && "itemFirst", m && "itemHighlighted"), q); - return m && (r.ref = b.storeHighlightedItemReference), a.jsx(Item, f({ - }, r, { + return m && (r.ref = b.storeHighlightedItemReference), a.jsx(Item, f({}, r, { sectionIndex: i, isHighlighted: m, itemIndex: d, diff --git a/crates/swc/tests/vercel/full/react-hooks/1/output/index.js b/crates/swc/tests/vercel/full/react-hooks/1/output/index.js index 1afb91748c2..97bdcd5fb53 100644 --- a/crates/swc/tests/vercel/full/react-hooks/1/output/index.js +++ b/crates/swc/tests/vercel/full/react-hooks/1/output/index.js @@ -5,6 +5,5 @@ import { useProject as e } from "@swr/use-project"; import f from "@swr/use-team"; export default function g() { var c = e(d().query.project).data; - return f().teamSlug, useProjectBranches(null == c ? void 0 : c.id).data, a(b, { - }); + return f().teamSlug, useProjectBranches(null == c ? void 0 : c.id).data, a(b, {}); }; diff --git a/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js b/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js index c4e96fd3129..33a1a66c4f2 100644 --- a/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js +++ b/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js @@ -51,11 +51,8 @@ export default function n(e) { return b || c; }).sort(m).reduce(function(b, c) { var d = i(c) ? c.props.indexContextValue.targetedIndex : c.props.indexId, e = b[d] || []; - return a.objectSpread({ - }, b, a.defineProperty({ - }, d, e.concat(c))); - }, { - }), e = Object.keys(d).map(function(a) { + return a.objectSpread({}, b, a.defineProperty({}, d, e.concat(c))); + }, {}), e = Object.keys(d).map(function(a) { return { parameters: d[a].reduce(function(a, b) { return b.getSearchParameters(a); @@ -84,19 +81,14 @@ export default function n(e) { }, u = function(b) { var c = b.indexId; return function(b) { - var d = G.getState(), e = !y.derivedHelpers.length, f = d.results ? d.results : { - }; - f = !e && f.getFacetByName ? { - } : f, f = e ? b.results : a.objectSpread({ - }, f, a.defineProperty({ - }, c, b.results)); + var d = G.getState(), e = !y.derivedHelpers.length, f = d.results ? d.results : {}; + f = !e && f.getFacetByName ? {} : f, f = e ? b.results : a.objectSpread({}, f, a.defineProperty({}, c, b.results)); var g = G.getState(), h = g.isSearchStalled; y.hasPendingRequests() || (clearTimeout(A), A = null, h = !1), g.resultsFacetValues; var i = a.objectWithoutProperties(g, [ "resultsFacetValues" ]); - G.setState(a.objectSpread({ - }, i, { + G.setState(a.objectSpread({}, i, { results: f, isSearchStalled: h, searching: !1, @@ -109,8 +101,7 @@ export default function n(e) { var f = a.objectWithoutProperties(d, [ "resultsFacetValues" ]); - G.setState(a.objectSpread({ - }, f, { + G.setState(a.objectSpread({}, f, { isSearchStalled: e, error: c, searching: !1 @@ -146,9 +137,7 @@ export default function n(e) { })); }, []) })); - b.cache = a.objectSpread({ - }, b.cache, a.defineProperty({ - }, d, JSON.stringify({ + b.cache = a.objectSpread({}, b.cache, a.defineProperty({}, d, JSON.stringify({ results: c.reduce(function(a, b) { return a.concat(b.rawResults); }, []) @@ -178,20 +167,16 @@ export default function n(e) { }; }) })); - b.cache = a.objectSpread({ - }, b.cache, a.defineProperty({ - }, d, JSON.stringify({ + b.cache = a.objectSpread({}, b.cache, a.defineProperty({}, d, JSON.stringify({ results: c.rawResults }))); - }, y = b(n, f, a.objectSpread({ - }, d)); + }, y = b(n, f, a.objectSpread({}, d)); h(n), y.on("search", function() { A || (A = setTimeout(function() { var b = G.getState(), c = b.resultsFacetValues, d = a.objectWithoutProperties(b, [ "resultsFacetValues" ]); - G.setState(a.objectSpread({ - }, d, { + G.setState(a.objectSpread({}, d, { isSearchStalled: !0 })); }, q)); @@ -200,8 +185,7 @@ export default function n(e) { })).on("error", v); var z = !1, A = null, B = y.state, C = c(function() { var b = r(G.getState().widgets); - G.setState(a.objectSpread({ - }, G.getState(), { + G.setState(a.objectSpread({}, G.getState(), { metadata: b, searching: !0 })), t(); @@ -214,8 +198,7 @@ export default function n(e) { b.search = function(c) { for(var e = arguments.length, f = new Array(e > 1 ? e - 1 : 0), g = 1; g < e; g++)f[g - 1] = arguments[g]; var h = c.map(function(b) { - return a.objectSpread({ - }, b, { + return a.objectSpread({}, b, { params: function(a) { var b = function(a) { for(var b = arguments.length, c = new Array(b > 1 ? b - 1 : 0), d = 1; d < b; d++)c[d - 1] = arguments[d]; @@ -251,15 +234,11 @@ export default function n(e) { } }(n, p); var D, E, F, G = (E = { - widgets: void 0 === g ? { - } : g, + widgets: void 0 === g ? {} : g, metadata: o(p), results: (D = p) ? Array.isArray(D.results) ? D.results.reduce(function(c, d) { - return a.objectSpread({ - }, c, a.defineProperty({ - }, d._internalIndexId, new b.SearchResults(new b.SearchParameters(d.state), d.rawResults))); - }, { - }) : new b.SearchResults(new b.SearchParameters(D.state), D.rawResults) : null, + return a.objectSpread({}, c, a.defineProperty({}, d._internalIndexId, new b.SearchResults(new b.SearchParameters(d.state), d.rawResults))); + }, {}) : new b.SearchResults(new b.SearchParameters(D.state), D.rawResults) : null, error: null, searching: !1, isSearchStalled: !0, @@ -290,22 +269,17 @@ export default function n(e) { getSearchParameters: s, onSearchForFacetValues: function(b) { var c = b.facetName, d = b.query, e = b.maxFacetHits; - G.setState(a.objectSpread({ - }, G.getState(), { + G.setState(a.objectSpread({}, G.getState(), { searchingForFacetValues: !0 })), y.searchForFacetValues(c, d, Math.max(1, Math.min(void 0 === e ? 10 : e, 100))).then(function(b) { var e; - G.setState(a.objectSpread({ - }, G.getState(), { + G.setState(a.objectSpread({}, G.getState(), { error: null, searchingForFacetValues: !1, - resultsFacetValues: a.objectSpread({ - }, G.getState().resultsFacetValues, (e = { - }, a.defineProperty(e, c, b.facetHits), a.defineProperty(e, "query", d), e)) + resultsFacetValues: a.objectSpread({}, G.getState().resultsFacetValues, (e = {}, a.defineProperty(e, c, b.facetHits), a.defineProperty(e, "query", d), e)) })); }, function(b) { - G.setState(a.objectSpread({ - }, G.getState(), { + G.setState(a.objectSpread({}, G.getState(), { searchingForFacetValues: !1, error: b })); @@ -317,8 +291,7 @@ export default function n(e) { }, onExternalStateUpdate: function(b) { var c = r(b); - G.setState(a.objectSpread({ - }, G.getState(), { + G.setState(a.objectSpread({}, G.getState(), { widgets: b, metadata: c, searching: !0 @@ -350,22 +323,19 @@ function o(b) { return b ? b.metadata.map(function(b) { return a.objectSpread({ value: function() { - return { - }; + return {}; } }, b, { items: b.items && b.items.map(function(b) { return a.objectSpread({ value: function() { - return { - }; + return {}; } }, b, { items: b.items && b.items.map(function(b) { return a.objectSpread({ value: function() { - return { - }; + return {}; } }, b); }) diff --git a/crates/swc/tests/vercel/loader-only/2/output/index.js b/crates/swc/tests/vercel/loader-only/2/output/index.js index 1040a825c43..6a723aef7c2 100644 --- a/crates/swc/tests/vercel/loader-only/2/output/index.js +++ b/crates/swc/tests/vercel/loader-only/2/output/index.js @@ -9,8 +9,7 @@ export default function MyComp() { var teamSlug = useTeam().teamSlug; var projectId = projectInfo === null || projectInfo === void 0 ? void 0 : projectInfo.id; var ref1 = useProjectBranches(projectId), branches = ref1.data; - return(/*#__PURE__*/ _jsx(_Fragment, { - })); + return(/*#__PURE__*/ _jsx(_Fragment, {})); }; for(var i = 0; i < points.length; i++){ var point = points[i]; diff --git a/crates/swc/tests/vercel/loader-only/next-31627/1/output/index.js b/crates/swc/tests/vercel/loader-only/next-31627/1/output/index.js index d944e53fe20..1c699a7416f 100644 --- a/crates/swc/tests/vercel/loader-only/next-31627/1/output/index.js +++ b/crates/swc/tests/vercel/loader-only/next-31627/1/output/index.js @@ -11,19 +11,15 @@ export default function Home() { /*#__PURE__*/ _jsxs("g", { className: "group", children: [ - /*#__PURE__*/ _jsx("path", { - }), - /*#__PURE__*/ _jsx("path", { - }) + /*#__PURE__*/ _jsx("path", {}), + /*#__PURE__*/ _jsx("path", {}) ] }), /*#__PURE__*/ _jsxs("g", { className: "group", children: [ - /*#__PURE__*/ _jsx("path", { - }), - /*#__PURE__*/ _jsx("path", { - }) + /*#__PURE__*/ _jsx("path", {}), + /*#__PURE__*/ _jsx("path", {}) ] }) ] diff --git a/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js b/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js index 4896e9adae0..6ff6a3957d5 100644 --- a/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js +++ b/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js @@ -62,8 +62,7 @@ function _inherits(subClass, superClass) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { @@ -97,8 +96,7 @@ function _isNativeReflectConstruct() { if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true; } catch (e) { return false; @@ -165,8 +163,7 @@ var ItemsList = /*#__PURE__*/ function(Component1) { allItemProps.ref = _this.storeHighlightedItemReference; } // `key` is provided by theme() - /* eslint-disable react/jsx-key */ return(/*#__PURE__*/ _jsx(Item, _objectSpread({ - }, allItemProps, { + /* eslint-disable react/jsx-key */ return(/*#__PURE__*/ _jsx(Item, _objectSpread({}, allItemProps, { sectionIndex: sectionIndex, isHighlighted: isHighlighted, itemIndex: itemIndex, diff --git a/crates/swc/tests/vercel/loader-only/react-instantsearch/1/output/index.js b/crates/swc/tests/vercel/loader-only/react-instantsearch/1/output/index.js index da6bf19aa2e..5c83cffe201 100644 --- a/crates/swc/tests/vercel/loader-only/react-instantsearch/1/output/index.js +++ b/crates/swc/tests/vercel/loader-only/react-instantsearch/1/output/index.js @@ -68,8 +68,7 @@ function serializeQueryParameters(parameters) { * @param {number} stalledSearchDelay - time (in ms) after the search is stalled * @return {InstantSearchManager} a new instance of InstantSearchManager */ export default function createInstantSearchManager(param1) { - var indexName = param1.indexName, _initialState = param1.initialState, initialState1 = _initialState === void 0 ? { - } : _initialState, searchClient = param1.searchClient, resultsState = param1.resultsState, stalledSearchDelay = param1.stalledSearchDelay; + var indexName = param1.indexName, _initialState = param1.initialState, initialState1 = _initialState === void 0 ? {} : _initialState, searchClient = param1.searchClient, resultsState = param1.resultsState, stalledSearchDelay = param1.stalledSearchDelay; var createStore = function createStore(initialState) { var state = initialState; var listeners = []; @@ -140,11 +139,8 @@ function serializeQueryParameters(parameters) { .sort(sortIndexWidgetsFirst).reduce(function(indices, widget) { var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId; var widgets = indices[indexId] || []; - return swcHelpers.objectSpread({ - }, indices, swcHelpers.defineProperty({ - }, indexId, widgets.concat(widget))); - }, { - }); + return swcHelpers.objectSpread({}, indices, swcHelpers.defineProperty({}, indexId, widgets.concat(widget))); + }, {}); var derivedParameters = Object.keys(derivedIndices).map(function(indexId) { return { parameters: derivedIndices[indexId].reduce(function(res, widget) { @@ -200,17 +196,13 @@ function serializeQueryParameters(parameters) { return function(event) { var state = store.getState(); var isDerivedHelpersEmpty = !helper.derivedHelpers.length; - var results = state.results ? state.results : { - }; + var results = state.results ? state.results : {}; // Switching from mono index to multi index and vice versa must reset the // results to an empty object, otherwise we keep reference of stalled and // unused results. - results = !isDerivedHelpersEmpty && results.getFacetByName ? { - } : results; + results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results; if (!isDerivedHelpersEmpty) { - results = swcHelpers.objectSpread({ - }, results, swcHelpers.defineProperty({ - }, indexId, event.results)); + results = swcHelpers.objectSpread({}, results, swcHelpers.defineProperty({}, indexId, event.results)); } else { results = event.results; } @@ -224,8 +216,7 @@ function serializeQueryParameters(parameters) { var resultsFacetValues = currentState.resultsFacetValues, partialState = swcHelpers.objectWithoutProperties(currentState, [ "resultsFacetValues" ]); - store.setState(swcHelpers.objectSpread({ - }, partialState, { + store.setState(swcHelpers.objectSpread({}, partialState, { results: results, isSearchStalled: nextIsSearchStalled, searching: false, @@ -244,8 +235,7 @@ function serializeQueryParameters(parameters) { var resultsFacetValues = currentState.resultsFacetValues, partialState = swcHelpers.objectWithoutProperties(currentState, [ "resultsFacetValues" ]); - store.setState(swcHelpers.objectSpread({ - }, partialState, { + store.setState(swcHelpers.objectSpread({}, partialState, { isSearchStalled: nextIsSearchStalled, error: error, searching: false @@ -258,8 +248,7 @@ function serializeQueryParameters(parameters) { var _ref = store.getState(), resultsFacetValues = _ref.resultsFacetValues, partialState = swcHelpers.objectWithoutProperties(_ref, [ "resultsFacetValues" ]); - store.setState(swcHelpers.objectSpread({ - }, partialState, { + store.setState(swcHelpers.objectSpread({}, partialState, { isSearchStalled: true })); }, stalledSearchDelay), stalledSearchTimer = _tmp, _tmp; @@ -290,8 +279,7 @@ function serializeQueryParameters(parameters) { methodArgs[_key - 1] = arguments[_key]; } var requestsWithSerializedParams = requests.map(function(request) { - return swcHelpers.objectSpread({ - }, request, { + return swcHelpers.objectSpread({}, request, { params: serializeQueryParameters(request.params) }); }); @@ -352,9 +340,7 @@ function serializeQueryParameters(parameters) { })); }, []) })); - client.cache = swcHelpers.objectSpread({ - }, client.cache, swcHelpers.defineProperty({ - }, key, JSON.stringify({ + client.cache = swcHelpers.objectSpread({}, client.cache, swcHelpers.defineProperty({}, key, JSON.stringify({ results: results.reduce(function(acc, result) { return acc.concat(result.rawResults); }, []) @@ -393,9 +379,7 @@ function serializeQueryParameters(parameters) { }; }) })); - client.cache = swcHelpers.objectSpread({ - }, client.cache, swcHelpers.defineProperty({ - }, key, JSON.stringify({ + client.cache = swcHelpers.objectSpread({}, client.cache, swcHelpers.defineProperty({}, key, JSON.stringify({ results: results.rawResults }))); }; @@ -405,19 +389,15 @@ function serializeQueryParameters(parameters) { } if (Array.isArray(results.results)) { return results.results.reduce(function(acc, result) { - return swcHelpers.objectSpread({ - }, acc, swcHelpers.defineProperty({ - }, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults))); - }, { - }); + return swcHelpers.objectSpread({}, acc, swcHelpers.defineProperty({}, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults))); + }, {}); } return new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results.state), results.rawResults); }; var onWidgetsUpdate = // Called whenever a widget has been rendered with new props. function onWidgetsUpdate() { var metadata = getMetadata(store.getState().widgets); - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { metadata: metadata, searching: true })); @@ -435,8 +415,7 @@ function serializeQueryParameters(parameters) { }; var onExternalStateUpdate = function onExternalStateUpdate(nextSearchState) { var metadata = getMetadata(nextSearchState); - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { widgets: nextSearchState, metadata: metadata, searching: true @@ -448,23 +427,18 @@ function serializeQueryParameters(parameters) { // The values 1, 100 are the min / max values that the engine accepts. // see: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits var maxFacetHitsWithinRange = Math.max(1, Math.min(maxFacetHits, 100)); - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { searchingForFacetValues: true })); helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function(content) { var _obj; - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { error: null, searchingForFacetValues: false, - resultsFacetValues: swcHelpers.objectSpread({ - }, store.getState().resultsFacetValues, (_obj = { - }, swcHelpers.defineProperty(_obj, facetName, content.facetHits), swcHelpers.defineProperty(_obj, "query", query), _obj)) + resultsFacetValues: swcHelpers.objectSpread({}, store.getState().resultsFacetValues, (_obj = {}, swcHelpers.defineProperty(_obj, facetName, content.facetHits), swcHelpers.defineProperty(_obj, "query", query), _obj)) })); }, function(error) { - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { searchingForFacetValues: false, error: error })); @@ -487,8 +461,7 @@ function serializeQueryParameters(parameters) { return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res; }, []); }; - var helper = algoliasearchHelper(searchClient, indexName, swcHelpers.objectSpread({ - }, HIGHLIGHT_TAGS)); + var helper = algoliasearchHelper(searchClient, indexName, swcHelpers.objectSpread({}, HIGHLIGHT_TAGS)); addAlgoliaAgents(searchClient); helper.on('search', handleNewSearch).on('result', handleSearchSuccess({ indexId: indexName @@ -529,22 +502,19 @@ function hydrateMetadata(resultsState) { return resultsState.metadata.map(function(datum) { return swcHelpers.objectSpread({ value: function() { - return { - }; + return {}; } }, datum, { items: datum.items && datum.items.map(function(item) { return swcHelpers.objectSpread({ value: function() { - return { - }; + return {}; } }, item, { items: item.items && item.items.map(function(nestedItem) { return swcHelpers.objectSpread({ value: function() { - return { - }; + return {}; } }, nestedItem); }) diff --git a/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.inlined.ts index 697909794e3..0dab3a9f5b1 100644 --- a/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.inlined.ts @@ -1,13 +1,10 @@ -let badfunc = ()=>{ -}; +let badfunc = ()=>{}; function f1() { - badfunc = function badfunc() { - }; + badfunc = function badfunc() {}; badfunc(); f2(); } function f2() { - badfunc = ()=>{ - }; + badfunc = ()=>{}; f1(); } diff --git a/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.ts index 697909794e3..0dab3a9f5b1 100644 --- a/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-10141/case1/output/entry.ts @@ -1,13 +1,10 @@ -let badfunc = ()=>{ -}; +let badfunc = ()=>{}; function f1() { - badfunc = function badfunc() { - }; + badfunc = function badfunc() {}; badfunc(); f2(); } function f2() { - badfunc = ()=>{ - }; + badfunc = ()=>{}; f1(); } diff --git a/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.inlined.ts index d377b60cf54..66227c38309 100644 --- a/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.inlined.ts @@ -1,6 +1,5 @@ const dbPool = 1; -function d() { -} +function d() {} async function fn() { d(); } diff --git a/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.ts index d377b60cf54..66227c38309 100644 --- a/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-10820/case1/output/entry.ts @@ -1,6 +1,5 @@ const dbPool = 1; -function d() { -} +function d() {} async function fn() { d(); } diff --git a/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.inlined.ts index c97d4ae298e..05b313640f8 100644 --- a/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.inlined.ts @@ -1,5 +1,4 @@ -async function foo() { -} +async function foo() {} const mod = { foo: foo }; diff --git a/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.ts index c97d4ae298e..05b313640f8 100644 --- a/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-8148/test-2/output/entry.ts @@ -1,5 +1,4 @@ -async function foo() { -} +async function foo() {} const mod = { foo: foo }; diff --git a/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.inlined.ts index 8f4f677a252..069de753f91 100644 --- a/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.inlined.ts @@ -88,8 +88,7 @@ function pick(obj, keys) { return keys.reduce((a, k)=>{ a[k] = obj[k]; return a; - }, { - }); + }, {}); } function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); @@ -210,8 +209,7 @@ function asNumber(value) { return numericValue; } function normalizeObject(obj, normalizer, nonUnitKeys) { - const normalized = { - }; + const normalized = {}; for(const u in obj){ if (hasOwnProperty(obj, u)) { if (nonUnitKeys.indexOf(u) >= 0) continue; @@ -720,8 +718,7 @@ const macroTokenToFormatOpts = { FFFF: DATETIME_HUGE_WITH_SECONDS }; class Formatter { - static create(locale, opts = { - }) { + static create(locale, opts = {}) { return new Formatter(locale, opts); } static parseFormat(fmt) { @@ -774,34 +771,26 @@ class Formatter { if (this.systemLoc === null) { this.systemLoc = this.loc.redefaultToSystem(); } - const df = this.systemLoc.dtFormatter(dt1, Object.assign({ - }, this.opts, opts)); + const df = this.systemLoc.dtFormatter(dt1, Object.assign({}, this.opts, opts)); return df.format(); } - formatDateTime(dt2, opts = { - }) { - const df = this.loc.dtFormatter(dt2, Object.assign({ - }, this.opts, opts)); + formatDateTime(dt2, opts = {}) { + const df = this.loc.dtFormatter(dt2, Object.assign({}, this.opts, opts)); return df.format(); } - formatDateTimeParts(dt3, opts = { - }) { - const df = this.loc.dtFormatter(dt3, Object.assign({ - }, this.opts, opts)); + formatDateTimeParts(dt3, opts = {}) { + const df = this.loc.dtFormatter(dt3, Object.assign({}, this.opts, opts)); return df.formatToParts(); } - resolvedOptions(dt4, opts = { - }) { - const df = this.loc.dtFormatter(dt4, Object.assign({ - }, this.opts, opts)); + resolvedOptions(dt4, opts = {}) { + const df = this.loc.dtFormatter(dt4, Object.assign({}, this.opts, opts)); return df.resolvedOptions(); } num(n3, p = 0) { if (this.opts.forceSimple) { return padStart(n3, p); } - const opts = Object.assign({ - }, this.opts); + const opts = Object.assign({}, this.opts); if (p > 0) { opts.padTo = p; } @@ -1105,8 +1094,7 @@ class FixedOffsetZone extends Zone { } } const matchingRegex = RegExp(`^${ianaRegex.source}$`); -let dtfCache = { -}; +let dtfCache = {}; function makeDTF(zone) { if (!dtfCache[zone]) { dtfCache[zone] = new Intl.DateTimeFormat("en-US", { @@ -1151,8 +1139,7 @@ function partsOffset(dtf, date3) { } return filled; } -let ianaZoneCache = { -}; +let ianaZoneCache = {}; class IANAZone extends Zone { static create(name) { if (!ianaZoneCache[name]) { @@ -1161,10 +1148,8 @@ class IANAZone extends Zone { return ianaZoneCache[name]; } static resetCache() { - ianaZoneCache = { - }; - dtfCache = { - }; + ianaZoneCache = {}; + dtfCache = {}; } static isValidSpecifier(s3) { return !!(s3 && s3.match(matchingRegex)); @@ -1472,8 +1457,7 @@ function combineExtractors(...extractors) { next ]; }, [ - { - }, + {}, null, 1 ]).slice(0, 2) @@ -1499,8 +1483,7 @@ function parse(s4, ...patterns) { } function simpleParse(...keys) { return (match2, cursor)=>{ - const ret = { - }; + const ret = {}; let i; for(i = 0; i < keys.length; i++){ ret[keys[i]] = parseInteger(match2[cursor + i]); @@ -1545,8 +1528,7 @@ function extractISOTime(match5, cursor) { function extractISOOffset(match6, cursor) { const local = !match6[cursor] && !match6[cursor + 1], fullOffset = signedOffset(match6[cursor + 1], match6[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset); return [ - { - }, + {}, zone, cursor + 3 ]; @@ -1554,8 +1536,7 @@ function extractISOOffset(match6, cursor) { function extractIANAZone(match7, cursor) { const zone = match7[cursor] ? IANAZone.create(match7[cursor]) : null; return [ - { - }, + {}, zone, cursor + 1 ]; @@ -1838,8 +1819,7 @@ function hasInvalidTimeData(obj) { } const INVALID = "Invalid DateTime"; const INVALID1 = "Invalid Duration"; -let intlDTCache = { -}; +let intlDTCache = {}; let now = ()=>Date.now() , defaultZone = null, defaultLocale = null, defaultNumberingSystem = null, defaultOutputCalendar = null, throwOnInvalid = false; const INVALID2 = "Invalid Interval"; @@ -1858,28 +1838,22 @@ class Info { static normalizeZone(input) { return normalizeZone(input, Settings.defaultZone); } - static months(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = { - }) { + static months(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = {}) { return Locale.create(locale, numberingSystem, outputCalendar).months(length); } - static monthsFormat(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = { - }) { + static monthsFormat(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = {}) { return Locale.create(locale, numberingSystem, outputCalendar).months(length, true); } - static weekdays(length = "long", { locale =null , numberingSystem =null } = { - }) { + static weekdays(length = "long", { locale =null , numberingSystem =null } = {}) { return Locale.create(locale, numberingSystem, null).weekdays(length); } - static weekdaysFormat(length = "long", { locale =null , numberingSystem =null } = { - }) { + static weekdaysFormat(length = "long", { locale =null , numberingSystem =null } = {}) { return Locale.create(locale, numberingSystem, null).weekdays(length, true); } - static meridiems({ locale =null } = { - }) { + static meridiems({ locale =null } = {}) { return Locale.create(locale).meridiems(); } - static eras(length = "short", { locale =null } = { - }) { + static eras(length = "short", { locale =null } = {}) { return Locale.create(locale, null, "gregory").eras(length); } static features() { @@ -2001,9 +1975,7 @@ const orderedUnits = [ const reverseUnits = orderedUnits.slice(0).reverse(); function clone(dur, alts, clear = false) { const conf = { - values: clear ? alts.values : Object.assign({ - }, dur.values, alts.values || { - }), + values: clear ? alts.values : Object.assign({}, dur.values, alts.values || {}), loc: dur.loc.clone(alts.loc), conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy }; @@ -2114,20 +2086,15 @@ class Duration { get numberingSystem() { return this.isValid ? this.loc.numberingSystem : null; } - toFormat(fmt, opts = { - }) { - const fmtOpts = Object.assign({ - }, opts, { + toFormat(fmt, opts = {}) { + const fmtOpts = Object.assign({}, opts, { floor: opts.round !== false && opts.floor !== false }); return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID1; } - toObject(opts = { - }) { - if (!this.isValid) return { - }; - const base = Object.assign({ - }, this.values); + toObject(opts = {}) { + if (!this.isValid) return {}; + const base = Object.assign({}, this.values); if (opts.includeConfig) { base.conversionAccuracy = this.conversionAccuracy; base.numberingSystem = this.loc.numberingSystem; @@ -2160,8 +2127,7 @@ class Duration { } plus(duration) { if (!this.isValid) return this; - const dur = friendlyDuration(duration), result = { - }; + const dur = friendlyDuration(duration), result = {}; for (const k of orderedUnits){ if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { result[k] = dur.get(k) + this.get(k); @@ -2178,8 +2144,7 @@ class Duration { } mapUnits(fn) { if (!this.isValid) return this; - const result = { - }; + const result = {}; for (const k of Object.keys(this.values)){ result[k] = asNumber(fn(this.values[k], k)); } @@ -2197,8 +2162,7 @@ class Duration { values: mixed }); } - reconfigure({ locale , numberingSystem , conversionAccuracy } = { - }) { + reconfigure({ locale , numberingSystem , conversionAccuracy } = {}) { const loc = this.loc.clone({ locale, numberingSystem @@ -2228,9 +2192,7 @@ class Duration { } units = units.map((u)=>Duration.normalizeUnit(u) ); - const built = { - }, accumulated = { - }, vals = this.toObject(); + const built = {}, accumulated = {}, vals = this.toObject(); let lastUnit; for (const k of orderedUnits){ if (units.indexOf(k) >= 0) { @@ -2266,8 +2228,7 @@ class Duration { } negate() { if (!this.isValid) return this; - const negated = { - }; + const negated = {}; for (const k of Object.keys(this.values)){ negated[k] = -this.values[k]; } @@ -2352,8 +2313,7 @@ function clone1(inst, alts) { loc: inst.loc, invalid: inst.invalid }; - return new DateTime(Object.assign({ - }, current, alts, { + return new DateTime(Object.assign({}, current, alts, { old: current })); } @@ -2396,8 +2356,7 @@ function objToTS(obj, offset7, zone) { return fixOffset(objToLocalTS(obj), offset7, zone); } function adjustTime(inst, dur) { - const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = Object.assign({ - }, inst.c, { + const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = Object.assign({}, inst.c, { year, month, day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 @@ -2650,8 +2609,7 @@ class DateTime { }, FixedOffsetZone.utcInstance); } } - static fromJSDate(date5, options = { - }) { + static fromJSDate(date5, options = {}) { const ts = isDate(date5) ? date5.valueOf() : NaN; if (Number.isNaN(ts)) { return DateTime.invalid("invalid input"); @@ -2666,8 +2624,7 @@ class DateTime { loc: Locale.fromObject(options) }); } - static fromMillis(milliseconds, options = { - }) { + static fromMillis(milliseconds, options = {}) { if (!isNumber(milliseconds)) { throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`); } else if (milliseconds < -8640000000000000 || milliseconds > 8640000000000000) { @@ -2680,8 +2637,7 @@ class DateTime { }); } } - static fromSeconds(seconds, options = { - }) { + static fromSeconds(seconds, options = {}) { if (!isNumber(seconds)) { throw new InvalidArgumentError("fromSeconds requires a numerical input"); } else { @@ -2749,23 +2705,19 @@ class DateTime { } return inst; } - static fromISO(text, opts = { - }) { + static fromISO(text, opts = {}) { const [vals, parsedZone] = parseISODate(text); return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); } - static fromRFC2822(text, opts = { - }) { + static fromRFC2822(text, opts = {}) { const [vals, parsedZone] = parseRFC2822Date(text); return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); } - static fromHTTP(text, opts = { - }) { + static fromHTTP(text, opts = {}) { const [vals, parsedZone] = parseHTTPDate(text); return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); } - static fromFormat(text, fmt, opts = { - }) { + static fromFormat(text, fmt, opts = {}) { if (isUndefined(text) || isUndefined(fmt)) { throw new InvalidArgumentError("fromFormat requires an input string and a format"); } @@ -2780,12 +2732,10 @@ class DateTime { return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text); } } - static fromString(text, fmt, opts = { - }) { + static fromString(text, fmt, opts = {}) { return DateTime.fromFormat(text, fmt, opts); } - static fromSQL(text, opts = { - }) { + static fromSQL(text, opts = {}) { const [vals, parsedZone] = parseSQL(text); return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); } @@ -2937,8 +2887,7 @@ class DateTime { get weeksInWeekYear() { return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; } - resolvedLocaleOpts(opts = { - }) { + resolvedLocaleOpts(opts = {}) { const { locale , numberingSystem , calendar } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this); return { locale, @@ -2946,15 +2895,13 @@ class DateTime { outputCalendar: calendar }; } - toUTC(offset8 = 0, opts = { - }) { + toUTC(offset8 = 0, opts = {}) { return this.setZone(FixedOffsetZone.instance(offset8), opts); } toLocal() { return this.setZone(Settings.defaultZone); } - setZone(zone, { keepLocalTime =false , keepCalendarTime =false } = { - }) { + setZone(zone, { keepLocalTime =false , keepCalendarTime =false } = {}) { zone = normalizeZone(zone, Settings.defaultZone); if (zone.equals(this.zone)) { return this; @@ -2973,8 +2920,7 @@ class DateTime { }); } } - reconfigure({ locale , numberingSystem , outputCalendar } = { - }) { + reconfigure({ locale , numberingSystem , outputCalendar } = {}) { const loc = this.loc.clone({ locale, numberingSystem, @@ -3021,8 +2967,7 @@ class DateTime { } startOf(unit) { if (!this.isValid) return this; - const o = { - }, normalizedUnit = Duration.normalizeUnit(unit); + const o = {}, normalizedUnit = Duration.normalizeUnit(unit); switch(normalizedUnit){ case "years": o.month = 1; @@ -3056,26 +3001,22 @@ class DateTime { [unit]: 1 }).startOf(unit).minus(1) : this; } - toFormat(fmt, opts = { - }) { + toFormat(fmt, opts = {}) { return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; } toLocaleString(opts = DATE_SHORT) { return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTime(this) : INVALID; } - toLocaleParts(opts = { - }) { + toLocaleParts(opts = {}) { return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; } - toISO(opts = { - }) { + toISO(opts = {}) { if (!this.isValid) { return null; } return `${this.toISODate(opts)}T${this.toISOTime(opts)}`; } - toISODate({ format ="extended" } = { - }) { + toISODate({ format ="extended" } = {}) { let fmt = format === "basic" ? "yyyyMMdd" : "yyyy-MM-dd"; if (this.year > 9999) { fmt = "+" + fmt; @@ -3085,8 +3026,7 @@ class DateTime { toISOWeekDate() { return toTechFormat(this, "kkkk-'W'WW-c"); } - toISOTime({ suppressMilliseconds =false , suppressSeconds =false , includeOffset =true , format ="extended" } = { - }) { + toISOTime({ suppressMilliseconds =false , suppressSeconds =false , includeOffset =true , format ="extended" } = {}) { return toTechTimeFormat(this, { suppressSeconds, suppressMilliseconds, @@ -3103,16 +3043,14 @@ class DateTime { toSQLDate() { return toTechFormat(this, "yyyy-MM-dd"); } - toSQLTime({ includeOffset =true , includeZone =false } = { - }) { + toSQLTime({ includeOffset =true , includeZone =false } = {}) { return toTechTimeFormat(this, { includeOffset, includeZone, spaceZone: true }); } - toSQL(opts = { - }) { + toSQL(opts = {}) { if (!this.isValid) { return null; } @@ -3136,12 +3074,9 @@ class DateTime { toBSON() { return this.toJSDate(); } - toObject(opts = { - }) { - if (!this.isValid) return { - }; - const base = Object.assign({ - }, this.c); + toObject(opts = {}) { + if (!this.isValid) return {}; + const base = Object.assign({}, this.c); if (opts.includeConfig) { base.outputCalendar = this.outputCalendar; base.numberingSystem = this.loc.numberingSystem; @@ -3152,8 +3087,7 @@ class DateTime { toJSDate() { return new Date(this.isValid ? this.ts : NaN); } - diff(otherDateTime, unit = "milliseconds", opts = { - }) { + diff(otherDateTime, unit = "milliseconds", opts = {}) { if (!this.isValid || !otherDateTime.isValid) { return Duration.invalid(this.invalid || otherDateTime.invalid, "created by diffing an invalid DateTime"); } @@ -3164,8 +3098,7 @@ class DateTime { const units = maybeArray(unit).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = __default(earlier, later, units, durOpts); return otherIsLater ? diffed.negate() : diffed; } - diffNow(unit = "milliseconds", opts = { - }) { + diffNow(unit = "milliseconds", opts = {}) { return this.diff(DateTime.local(), unit, opts); } until(otherDateTime) { @@ -3183,8 +3116,7 @@ class DateTime { equals(other) { return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); } - toRelative(options = { - }) { + toRelative(options = {}) { if (!this.isValid) return null; const base = options.base || DateTime.fromObject({ zone: this.zone @@ -3201,8 +3133,7 @@ class DateTime { ] })); } - toRelativeCalendar(options = { - }) { + toRelativeCalendar(options = {}) { if (!this.isValid) return null; return diffRelative(options.base || DateTime.fromObject({ zone: this.zone @@ -3230,8 +3161,7 @@ class DateTime { return bestBy(dateTimes, (i)=>i.valueOf() , Math.max); } - static fromFormatExplain(text, fmt, options = { - }) { + static fromFormatExplain(text, fmt, options = {}) { const { locale =null , numberingSystem =null } = options, localeToUse = Locale.fromOpts({ locale, numberingSystem, @@ -3239,8 +3169,7 @@ class DateTime { }); return explainFromTokens(localeToUse, text, fmt); } - static fromStringExplain(text, fmt, options = { - }) { + static fromStringExplain(text, fmt, options = {}) { return DateTime.fromFormatExplain(text, fmt, options); } static get DATE_SHORT() { @@ -3321,8 +3250,7 @@ function friendlyDateTime(dateTimeish) { throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`); } } -function getCachedDTF(locString, opts = { -}) { +function getCachedDTF(locString, opts = {}) { const key = JSON.stringify([ locString, opts @@ -3334,10 +3262,8 @@ function getCachedDTF(locString, opts = { } return dtf; } -let intlNumCache = { -}; -function getCachedINF(locString, opts = { -}) { +let intlNumCache = {}; +function getCachedINF(locString, opts = {}) { const key = JSON.stringify([ locString, opts @@ -3349,10 +3275,8 @@ function getCachedINF(locString, opts = { } return inf; } -let intlRelCache = { -}; -function getCachedRTF(locString, opts = { -}) { +let intlRelCache = {}; +function getCachedRTF(locString, opts = {}) { const { base , ...cacheKeyOpts } = opts; const key = JSON.stringify([ locString, @@ -3492,8 +3416,7 @@ class PolyDateFormatter { z = dt12.zone.name; } if (this.hasIntl) { - const intlOpts = Object.assign({ - }, this.opts); + const intlOpts = Object.assign({}, this.opts); if (z) { intlOpts.timeZone = z; } @@ -3561,15 +3484,11 @@ class Locale { } static resetCache() { sysLocaleCache = null; - intlDTCache = { - }; - intlNumCache = { - }; - intlRelCache = { - }; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; } - static fromObject({ locale , numberingSystem , outputCalendar } = { - }) { + static fromObject({ locale , numberingSystem , outputCalendar } = {}) { return Locale.create(locale, numberingSystem, outputCalendar); } constructor(locale, numbering, outputCalendar, specifiedLocale){ @@ -3579,20 +3498,15 @@ class Locale { this.outputCalendar = outputCalendar || parsedOutputCalendar || null; this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); this.weekdaysCache = { - format: { - }, - standalone: { - } + format: {}, + standalone: {} }; this.monthsCache = { - format: { - }, - standalone: { - } + format: {}, + standalone: {} }; this.meridiemCache = null; - this.eraCache = { - }; + this.eraCache = {}; this.specifiedLocale = specifiedLocale; this.fastNumbersCached = null; } @@ -3619,17 +3533,13 @@ class Locale { return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, alts.defaultToEN || false); } } - redefaultToEN(alts = { - }) { - return this.clone(Object.assign({ - }, alts, { + redefaultToEN(alts = {}) { + return this.clone(Object.assign({}, alts, { defaultToEN: true })); } - redefaultToSystem(alts = { - }) { - return this.clone(Object.assign({ - }, alts, { + redefaultToSystem(alts = {}) { + return this.clone(Object.assign({}, alts, { defaultToEN: false })); } @@ -3702,16 +3612,13 @@ class Locale { ); return matching ? matching.value : null; } - numberFormatter(opts = { - }) { + numberFormatter(opts = {}) { return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); } - dtFormatter(dt18, intlOpts = { - }) { + dtFormatter(dt18, intlOpts = {}) { return new PolyDateFormatter(dt18, this.intl, intlOpts); } - relFormatter(opts = { - }) { + relFormatter(opts = {}) { return new PolyRelFormatter(this.intl, this.isEnglish(), opts); } isEnglish() { @@ -3901,8 +3808,7 @@ class Interval { if (!this.isValid) return false; return this.s <= dateTime && this.e > dateTime; } - set({ start , end } = { - }) { + set({ start , end } = {}) { if (!this.isValid) return this; return Interval.fromDateTimes(start || this.s, end || this.e); } @@ -4053,8 +3959,7 @@ class Interval { if (!this.isValid) return INVALID2; return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; } - toFormat(dateFormat, { separator =" – " } = { - }) { + toFormat(dateFormat, { separator =" – " } = {}) { if (!this.isValid) return INVALID2; return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; } @@ -4090,8 +3995,7 @@ function highOrderDiffs(cursor, later, units) { dayDiff ] ]; - const results = { - }; + const results = {}; let lowestOrder, highWater; for (const [unit, differ] of differs){ if (units.indexOf(unit) >= 0) { @@ -4370,8 +4274,7 @@ function buildRegex(units) { function match(input, regex, handlers) { const matches = input.match(regex); if (matches) { - const all = { - }; + const all = {}; let matchIndex = 1; for(const i in handlers){ if (hasOwnProperty(handlers, i)) { @@ -4389,8 +4292,7 @@ function match(input, regex, handlers) { } else { return [ matches, - { - } + {} ]; } } @@ -4458,8 +4360,7 @@ function dateTimeFromMatches(matches) { r[f] = matches[k]; } return r; - }, { - }); + }, {}); return [ vals, zone diff --git a/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.ts index ba6faef2480..005dce21cd3 100644 --- a/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-8211-3/output/entry.ts @@ -88,8 +88,7 @@ function pick(obj, keys) { return keys.reduce((a, k)=>{ a[k] = obj[k]; return a; - }, { - }); + }, {}); } function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); @@ -210,8 +209,7 @@ function asNumber(value) { return numericValue; } function normalizeObject(obj, normalizer, nonUnitKeys) { - const normalized = { - }; + const normalized = {}; for(const u in obj){ if (hasOwnProperty(obj, u)) { if (nonUnitKeys.indexOf(u) >= 0) continue; @@ -720,8 +718,7 @@ const macroTokenToFormatOpts = { FFFF: DATETIME_HUGE_WITH_SECONDS }; class Formatter { - static create(locale, opts = { - }) { + static create(locale, opts = {}) { return new Formatter(locale, opts); } static parseFormat(fmt) { @@ -774,34 +771,26 @@ class Formatter { if (this.systemLoc === null) { this.systemLoc = this.loc.redefaultToSystem(); } - const df = this.systemLoc.dtFormatter(dt1, Object.assign({ - }, this.opts, opts)); + const df = this.systemLoc.dtFormatter(dt1, Object.assign({}, this.opts, opts)); return df.format(); } - formatDateTime(dt2, opts = { - }) { - const df = this.loc.dtFormatter(dt2, Object.assign({ - }, this.opts, opts)); + formatDateTime(dt2, opts = {}) { + const df = this.loc.dtFormatter(dt2, Object.assign({}, this.opts, opts)); return df.format(); } - formatDateTimeParts(dt3, opts = { - }) { - const df = this.loc.dtFormatter(dt3, Object.assign({ - }, this.opts, opts)); + formatDateTimeParts(dt3, opts = {}) { + const df = this.loc.dtFormatter(dt3, Object.assign({}, this.opts, opts)); return df.formatToParts(); } - resolvedOptions(dt4, opts = { - }) { - const df = this.loc.dtFormatter(dt4, Object.assign({ - }, this.opts, opts)); + resolvedOptions(dt4, opts = {}) { + const df = this.loc.dtFormatter(dt4, Object.assign({}, this.opts, opts)); return df.resolvedOptions(); } num(n3, p = 0) { if (this.opts.forceSimple) { return padStart(n3, p); } - const opts = Object.assign({ - }, this.opts); + const opts = Object.assign({}, this.opts); if (p > 0) { opts.padTo = p; } @@ -1105,8 +1094,7 @@ class FixedOffsetZone extends Zone { } } const matchingRegex = RegExp(`^${ianaRegex.source}$`); -let dtfCache = { -}; +let dtfCache = {}; function makeDTF(zone) { if (!dtfCache[zone]) { dtfCache[zone] = new Intl.DateTimeFormat("en-US", { @@ -1151,8 +1139,7 @@ function partsOffset(dtf, date3) { } return filled; } -let ianaZoneCache = { -}; +let ianaZoneCache = {}; class IANAZone extends Zone { static create(name) { if (!ianaZoneCache[name]) { @@ -1161,10 +1148,8 @@ class IANAZone extends Zone { return ianaZoneCache[name]; } static resetCache() { - ianaZoneCache = { - }; - dtfCache = { - }; + ianaZoneCache = {}; + dtfCache = {}; } static isValidSpecifier(s3) { return !!(s3 && s3.match(matchingRegex)); @@ -1472,8 +1457,7 @@ function combineExtractors(...extractors) { next ]; }, [ - { - }, + {}, null, 1 ]).slice(0, 2) @@ -1499,8 +1483,7 @@ function parse(s4, ...patterns) { } function simpleParse(...keys) { return (match2, cursor)=>{ - const ret = { - }; + const ret = {}; let i; for(i = 0; i < keys.length; i++){ ret[keys[i]] = parseInteger(match2[cursor + i]); @@ -1545,8 +1528,7 @@ function extractISOTime(match5, cursor) { function extractISOOffset(match6, cursor) { const local = !match6[cursor] && !match6[cursor + 1], fullOffset = signedOffset(match6[cursor + 1], match6[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset); return [ - { - }, + {}, zone, cursor + 3 ]; @@ -1554,8 +1536,7 @@ function extractISOOffset(match6, cursor) { function extractIANAZone(match7, cursor) { const zone = match7[cursor] ? IANAZone.create(match7[cursor]) : null; return [ - { - }, + {}, zone, cursor + 1 ]; @@ -1838,8 +1819,7 @@ function hasInvalidTimeData(obj) { } const INVALID = "Invalid DateTime"; const INVALID1 = "Invalid Duration"; -let intlDTCache = { -}; +let intlDTCache = {}; let now = ()=>Date.now() , defaultZone = null, defaultLocale = null, defaultNumberingSystem = null, defaultOutputCalendar = null, throwOnInvalid = false; const INVALID2 = "Invalid Interval"; @@ -1858,28 +1838,22 @@ class Info { static normalizeZone(input) { return normalizeZone(input, Settings.defaultZone); } - static months(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = { - }) { + static months(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = {}) { return Locale.create(locale, numberingSystem, outputCalendar).months(length); } - static monthsFormat(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = { - }) { + static monthsFormat(length = "long", { locale =null , numberingSystem =null , outputCalendar ="gregory" } = {}) { return Locale.create(locale, numberingSystem, outputCalendar).months(length, true); } - static weekdays(length = "long", { locale =null , numberingSystem =null } = { - }) { + static weekdays(length = "long", { locale =null , numberingSystem =null } = {}) { return Locale.create(locale, numberingSystem, null).weekdays(length); } - static weekdaysFormat(length = "long", { locale =null , numberingSystem =null } = { - }) { + static weekdaysFormat(length = "long", { locale =null , numberingSystem =null } = {}) { return Locale.create(locale, numberingSystem, null).weekdays(length, true); } - static meridiems({ locale =null } = { - }) { + static meridiems({ locale =null } = {}) { return Locale.create(locale).meridiems(); } - static eras(length = "short", { locale =null } = { - }) { + static eras(length = "short", { locale =null } = {}) { return Locale.create(locale, null, "gregory").eras(length); } static features() { @@ -2001,9 +1975,7 @@ const orderedUnits = [ const reverseUnits = orderedUnits.slice(0).reverse(); function clone(dur, alts, clear = false) { const conf = { - values: clear ? alts.values : Object.assign({ - }, dur.values, alts.values || { - }), + values: clear ? alts.values : Object.assign({}, dur.values, alts.values || {}), loc: dur.loc.clone(alts.loc), conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy }; @@ -2114,20 +2086,15 @@ class Duration { get numberingSystem() { return this.isValid ? this.loc.numberingSystem : null; } - toFormat(fmt, opts = { - }) { - const fmtOpts = Object.assign({ - }, opts, { + toFormat(fmt, opts = {}) { + const fmtOpts = Object.assign({}, opts, { floor: opts.round !== false && opts.floor !== false }); return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID1; } - toObject(opts = { - }) { - if (!this.isValid) return { - }; - const base = Object.assign({ - }, this.values); + toObject(opts = {}) { + if (!this.isValid) return {}; + const base = Object.assign({}, this.values); if (opts.includeConfig) { base.conversionAccuracy = this.conversionAccuracy; base.numberingSystem = this.loc.numberingSystem; @@ -2160,8 +2127,7 @@ class Duration { } plus(duration) { if (!this.isValid) return this; - const dur = friendlyDuration(duration), result = { - }; + const dur = friendlyDuration(duration), result = {}; for (const k of orderedUnits){ if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { result[k] = dur.get(k) + this.get(k); @@ -2178,8 +2144,7 @@ class Duration { } mapUnits(fn) { if (!this.isValid) return this; - const result = { - }; + const result = {}; for (const k of Object.keys(this.values)){ result[k] = asNumber(fn(this.values[k], k)); } @@ -2197,8 +2162,7 @@ class Duration { values: mixed }); } - reconfigure({ locale , numberingSystem , conversionAccuracy } = { - }) { + reconfigure({ locale , numberingSystem , conversionAccuracy } = {}) { const loc = this.loc.clone({ locale, numberingSystem @@ -2228,9 +2192,7 @@ class Duration { } units = units.map((u)=>Duration.normalizeUnit(u) ); - const built = { - }, accumulated = { - }, vals = this.toObject(); + const built = {}, accumulated = {}, vals = this.toObject(); let lastUnit; for (const k of orderedUnits){ if (units.indexOf(k) >= 0) { @@ -2266,8 +2228,7 @@ class Duration { } negate() { if (!this.isValid) return this; - const negated = { - }; + const negated = {}; for (const k of Object.keys(this.values)){ negated[k] = -this.values[k]; } @@ -2353,8 +2314,7 @@ function clone1(inst, alts) { loc: inst.loc, invalid: inst.invalid }; - return new DateTime(Object.assign({ - }, current, alts, { + return new DateTime(Object.assign({}, current, alts, { old: current })); } @@ -2397,8 +2357,7 @@ function objToTS(obj, offset7, zone) { return fixOffset(objToLocalTS(obj), offset7, zone); } function adjustTime(inst, dur) { - const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = Object.assign({ - }, inst.c, { + const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = Object.assign({}, inst.c, { year, month, day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 @@ -2651,8 +2610,7 @@ class DateTime { }, FixedOffsetZone.utcInstance); } } - static fromJSDate(date5, options = { - }) { + static fromJSDate(date5, options = {}) { const ts = isDate(date5) ? date5.valueOf() : NaN; if (Number.isNaN(ts)) { return DateTime.invalid("invalid input"); @@ -2667,8 +2625,7 @@ class DateTime { loc: Locale.fromObject(options) }); } - static fromMillis(milliseconds, options = { - }) { + static fromMillis(milliseconds, options = {}) { if (!isNumber(milliseconds)) { throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`); } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { @@ -2681,8 +2638,7 @@ class DateTime { }); } } - static fromSeconds(seconds, options = { - }) { + static fromSeconds(seconds, options = {}) { if (!isNumber(seconds)) { throw new InvalidArgumentError("fromSeconds requires a numerical input"); } else { @@ -2750,23 +2706,19 @@ class DateTime { } return inst; } - static fromISO(text, opts = { - }) { + static fromISO(text, opts = {}) { const [vals, parsedZone] = parseISODate(text); return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); } - static fromRFC2822(text, opts = { - }) { + static fromRFC2822(text, opts = {}) { const [vals, parsedZone] = parseRFC2822Date(text); return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); } - static fromHTTP(text, opts = { - }) { + static fromHTTP(text, opts = {}) { const [vals, parsedZone] = parseHTTPDate(text); return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); } - static fromFormat(text, fmt, opts = { - }) { + static fromFormat(text, fmt, opts = {}) { if (isUndefined(text) || isUndefined(fmt)) { throw new InvalidArgumentError("fromFormat requires an input string and a format"); } @@ -2781,12 +2733,10 @@ class DateTime { return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text); } } - static fromString(text, fmt, opts = { - }) { + static fromString(text, fmt, opts = {}) { return DateTime.fromFormat(text, fmt, opts); } - static fromSQL(text, opts = { - }) { + static fromSQL(text, opts = {}) { const [vals, parsedZone] = parseSQL(text); return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); } @@ -2938,8 +2888,7 @@ class DateTime { get weeksInWeekYear() { return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; } - resolvedLocaleOpts(opts = { - }) { + resolvedLocaleOpts(opts = {}) { const { locale , numberingSystem , calendar } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this); return { locale, @@ -2947,15 +2896,13 @@ class DateTime { outputCalendar: calendar }; } - toUTC(offset8 = 0, opts = { - }) { + toUTC(offset8 = 0, opts = {}) { return this.setZone(FixedOffsetZone.instance(offset8), opts); } toLocal() { return this.setZone(Settings.defaultZone); } - setZone(zone, { keepLocalTime =false , keepCalendarTime =false } = { - }) { + setZone(zone, { keepLocalTime =false , keepCalendarTime =false } = {}) { zone = normalizeZone(zone, Settings.defaultZone); if (zone.equals(this.zone)) { return this; @@ -2974,8 +2921,7 @@ class DateTime { }); } } - reconfigure({ locale , numberingSystem , outputCalendar } = { - }) { + reconfigure({ locale , numberingSystem , outputCalendar } = {}) { const loc = this.loc.clone({ locale, numberingSystem, @@ -3022,8 +2968,7 @@ class DateTime { } startOf(unit) { if (!this.isValid) return this; - const o = { - }, normalizedUnit = Duration.normalizeUnit(unit); + const o = {}, normalizedUnit = Duration.normalizeUnit(unit); switch(normalizedUnit){ case "years": o.month = 1; @@ -3057,26 +3002,22 @@ class DateTime { [unit]: 1 }).startOf(unit).minus(1) : this; } - toFormat(fmt, opts = { - }) { + toFormat(fmt, opts = {}) { return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; } toLocaleString(opts = DATE_SHORT) { return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTime(this) : INVALID; } - toLocaleParts(opts = { - }) { + toLocaleParts(opts = {}) { return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; } - toISO(opts = { - }) { + toISO(opts = {}) { if (!this.isValid) { return null; } return `${this.toISODate(opts)}T${this.toISOTime(opts)}`; } - toISODate({ format ="extended" } = { - }) { + toISODate({ format ="extended" } = {}) { let fmt = format === "basic" ? "yyyyMMdd" : "yyyy-MM-dd"; if (this.year > 9999) { fmt = "+" + fmt; @@ -3086,8 +3027,7 @@ class DateTime { toISOWeekDate() { return toTechFormat(this, "kkkk-'W'WW-c"); } - toISOTime({ suppressMilliseconds =false , suppressSeconds =false , includeOffset =true , format ="extended" } = { - }) { + toISOTime({ suppressMilliseconds =false , suppressSeconds =false , includeOffset =true , format ="extended" } = {}) { return toTechTimeFormat(this, { suppressSeconds, suppressMilliseconds, @@ -3104,16 +3044,14 @@ class DateTime { toSQLDate() { return toTechFormat(this, "yyyy-MM-dd"); } - toSQLTime({ includeOffset =true , includeZone =false } = { - }) { + toSQLTime({ includeOffset =true , includeZone =false } = {}) { return toTechTimeFormat(this, { includeOffset, includeZone, spaceZone: true }); } - toSQL(opts = { - }) { + toSQL(opts = {}) { if (!this.isValid) { return null; } @@ -3137,12 +3075,9 @@ class DateTime { toBSON() { return this.toJSDate(); } - toObject(opts = { - }) { - if (!this.isValid) return { - }; - const base = Object.assign({ - }, this.c); + toObject(opts = {}) { + if (!this.isValid) return {}; + const base = Object.assign({}, this.c); if (opts.includeConfig) { base.outputCalendar = this.outputCalendar; base.numberingSystem = this.loc.numberingSystem; @@ -3153,8 +3088,7 @@ class DateTime { toJSDate() { return new Date(this.isValid ? this.ts : NaN); } - diff(otherDateTime, unit = "milliseconds", opts = { - }) { + diff(otherDateTime, unit = "milliseconds", opts = {}) { if (!this.isValid || !otherDateTime.isValid) { return Duration.invalid(this.invalid || otherDateTime.invalid, "created by diffing an invalid DateTime"); } @@ -3165,8 +3099,7 @@ class DateTime { const units = maybeArray(unit).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = __default(earlier, later, units, durOpts); return otherIsLater ? diffed.negate() : diffed; } - diffNow(unit = "milliseconds", opts = { - }) { + diffNow(unit = "milliseconds", opts = {}) { return this.diff(DateTime.local(), unit, opts); } until(otherDateTime) { @@ -3184,8 +3117,7 @@ class DateTime { equals(other) { return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); } - toRelative(options = { - }) { + toRelative(options = {}) { if (!this.isValid) return null; const base = options.base || DateTime.fromObject({ zone: this.zone @@ -3202,8 +3134,7 @@ class DateTime { ] })); } - toRelativeCalendar(options = { - }) { + toRelativeCalendar(options = {}) { if (!this.isValid) return null; return diffRelative(options.base || DateTime.fromObject({ zone: this.zone @@ -3231,8 +3162,7 @@ class DateTime { return bestBy(dateTimes, (i)=>i.valueOf() , Math.max); } - static fromFormatExplain(text, fmt, options = { - }) { + static fromFormatExplain(text, fmt, options = {}) { const { locale =null , numberingSystem =null } = options, localeToUse = Locale.fromOpts({ locale, numberingSystem, @@ -3240,8 +3170,7 @@ class DateTime { }); return explainFromTokens(localeToUse, text, fmt); } - static fromStringExplain(text, fmt, options = { - }) { + static fromStringExplain(text, fmt, options = {}) { return DateTime.fromFormatExplain(text, fmt, options); } static get DATE_SHORT() { @@ -3322,8 +3251,7 @@ function friendlyDateTime(dateTimeish) { throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`); } } -function getCachedDTF(locString, opts = { -}) { +function getCachedDTF(locString, opts = {}) { const key = JSON.stringify([ locString, opts @@ -3335,10 +3263,8 @@ function getCachedDTF(locString, opts = { } return dtf; } -let intlNumCache = { -}; -function getCachedINF(locString, opts = { -}) { +let intlNumCache = {}; +function getCachedINF(locString, opts = {}) { const key = JSON.stringify([ locString, opts @@ -3350,10 +3276,8 @@ function getCachedINF(locString, opts = { } return inf; } -let intlRelCache = { -}; -function getCachedRTF(locString, opts = { -}) { +let intlRelCache = {}; +function getCachedRTF(locString, opts = {}) { const { base , ...cacheKeyOpts } = opts; const key = JSON.stringify([ locString, @@ -3493,8 +3417,7 @@ class PolyDateFormatter { z = dt12.zone.name; } if (this.hasIntl) { - const intlOpts = Object.assign({ - }, this.opts); + const intlOpts = Object.assign({}, this.opts); if (z) { intlOpts.timeZone = z; } @@ -3562,15 +3485,11 @@ class Locale { } static resetCache() { sysLocaleCache = null; - intlDTCache = { - }; - intlNumCache = { - }; - intlRelCache = { - }; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; } - static fromObject({ locale , numberingSystem , outputCalendar } = { - }) { + static fromObject({ locale , numberingSystem , outputCalendar } = {}) { return Locale.create(locale, numberingSystem, outputCalendar); } constructor(locale, numbering, outputCalendar, specifiedLocale){ @@ -3580,20 +3499,15 @@ class Locale { this.outputCalendar = outputCalendar || parsedOutputCalendar || null; this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); this.weekdaysCache = { - format: { - }, - standalone: { - } + format: {}, + standalone: {} }; this.monthsCache = { - format: { - }, - standalone: { - } + format: {}, + standalone: {} }; this.meridiemCache = null; - this.eraCache = { - }; + this.eraCache = {}; this.specifiedLocale = specifiedLocale; this.fastNumbersCached = null; } @@ -3620,17 +3534,13 @@ class Locale { return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, alts.defaultToEN || false); } } - redefaultToEN(alts = { - }) { - return this.clone(Object.assign({ - }, alts, { + redefaultToEN(alts = {}) { + return this.clone(Object.assign({}, alts, { defaultToEN: true })); } - redefaultToSystem(alts = { - }) { - return this.clone(Object.assign({ - }, alts, { + redefaultToSystem(alts = {}) { + return this.clone(Object.assign({}, alts, { defaultToEN: false })); } @@ -3703,16 +3613,13 @@ class Locale { ); return matching ? matching.value : null; } - numberFormatter(opts = { - }) { + numberFormatter(opts = {}) { return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); } - dtFormatter(dt18, intlOpts = { - }) { + dtFormatter(dt18, intlOpts = {}) { return new PolyDateFormatter(dt18, this.intl, intlOpts); } - relFormatter(opts = { - }) { + relFormatter(opts = {}) { return new PolyRelFormatter(this.intl, this.isEnglish(), opts); } isEnglish() { @@ -3902,8 +3809,7 @@ class Interval { if (!this.isValid) return false; return this.s <= dateTime && this.e > dateTime; } - set({ start , end } = { - }) { + set({ start , end } = {}) { if (!this.isValid) return this; return Interval.fromDateTimes(start || this.s, end || this.e); } @@ -4054,8 +3960,7 @@ class Interval { if (!this.isValid) return INVALID2; return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; } - toFormat(dateFormat, { separator =" – " } = { - }) { + toFormat(dateFormat, { separator =" – " } = {}) { if (!this.isValid) return INVALID2; return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; } @@ -4091,8 +3996,7 @@ function highOrderDiffs(cursor, later, units) { dayDiff ] ]; - const results = { - }; + const results = {}; let lowestOrder, highWater; for (const [unit, differ] of differs){ if (units.indexOf(unit) >= 0) { @@ -4371,8 +4275,7 @@ function buildRegex(units) { function match(input, regex, handlers) { const matches = input.match(regex); if (matches) { - const all = { - }; + const all = {}; let matchIndex = 1; for(const i in handlers){ if (hasOwnProperty(handlers, i)) { @@ -4390,8 +4293,7 @@ function match(input, regex, handlers) { } else { return [ matches, - { - } + {} ]; } } @@ -4459,8 +4361,7 @@ function dateTimeFromMatches(matches) { r[f] = matches[k]; } return r; - }, { - }); + }, {}); return [ vals, zone diff --git a/crates/swc_bundler/tests/fixture/deno-8478/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-8478/output/entry.inlined.ts index 9a5940e560d..3bac8d21d4f 100644 --- a/crates/swc_bundler/tests/fixture/deno-8478/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-8478/output/entry.inlined.ts @@ -4,6 +4,5 @@ var Bar; console.log("foo"); } Bar1.foo = foo; -})(Bar || (Bar = { -})); +})(Bar || (Bar = {})); export { Bar as Bar }; diff --git a/crates/swc_bundler/tests/fixture/deno-8478/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-8478/output/entry.ts index 9a5940e560d..3bac8d21d4f 100644 --- a/crates/swc_bundler/tests/fixture/deno-8478/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-8478/output/entry.ts @@ -4,6 +4,5 @@ var Bar; console.log("foo"); } Bar1.foo = foo; -})(Bar || (Bar = { -})); +})(Bar || (Bar = {})); export { Bar as Bar }; diff --git a/crates/swc_bundler/tests/fixture/deno-8574/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-8574/output/entry.inlined.ts index c04218dde58..b404adbcd53 100644 --- a/crates/swc_bundler/tests/fixture/deno-8574/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-8574/output/entry.inlined.ts @@ -27,8 +27,7 @@ if (typeof window !== "undefined") { } else if (typeof self !== "undefined") { globalContext = self; } else { - globalContext = { - }; + globalContext = {}; } if (typeof globalContext.setTimeout === "function") { cachedSetTimeout = setTimeout; @@ -136,14 +135,10 @@ var platform = "browser"; var browser = true; var argv = []; var version = ""; -var versions = { -}; -var release = { -}; -var config = { -}; -function noop() { -} +var versions = {}; +var release = {}; +var config = {}; +function noop() {} var on = noop; var addListener = noop; var once = noop; @@ -163,8 +158,7 @@ function chdir(dir) { function umask() { return 0; } -var performance = globalContext.performance || { -}; +var performance = globalContext.performance || {}; var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() { return new Date().getTime(); }; @@ -229,18 +223,15 @@ function getUserAgent() { } function lowercaseKeys(object) { if (!object) { - return { - }; + return {}; } return Object.keys(object).reduce((newObj, key)=>{ newObj[key.toLowerCase()] = object[key]; return newObj; - }, { - }); + }, {}); } function mergeDeep(defaults, options) { - const result = Object.assign({ - }, defaults); + const result = Object.assign({}, defaults); Object.keys(options).forEach((key)=>{ if (isPlainObject(options[key])) { if (!(key in defaults)) Object.assign(result, { @@ -273,14 +264,12 @@ function merge(defaults, route, options) { url: method }, options); } else { - options = Object.assign({ - }, route); + options = Object.assign({}, route); } options.headers = lowercaseKeys(options.headers); removeUndefinedProperties(options); removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || { - }, options); + const mergedOptions = mergeDeep(defaults || {}, options); if (defaults && defaults.mediaType.previews.length) { mergedOptions.mediaType.previews = defaults.mediaType.previews.filter((preview)=>!mergedOptions.mediaType.previews.includes(preview) ).concat(mergedOptions.mediaType.previews); @@ -319,8 +308,7 @@ function omit(object, keysToOmit) { ).reduce((obj, key)=>{ obj[key] = object[key]; return obj; - }, { - }); + }, {}); } function encodeReserved(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { @@ -451,8 +439,7 @@ function expand(template, context) { function parse(options) { let method = options.method.toUpperCase(); let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({ - }, options.headers); + let headers = Object.assign({}, options.headers); let body; let parameters = omit(options, [ "method", @@ -632,13 +619,10 @@ class RequestError extends Error { return statusCode; } }); - this.headers = options.headers || { - }; - const requestCopy = Object.assign({ - }, options.request); + this.headers = options.headers || {}; + const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({ - }, options.request.headers, { + requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") }); } @@ -671,8 +655,7 @@ function fetchWrapper(requestOptions) { if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); } - let headers = { - }; + let headers = {}; let status; let url; const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; @@ -716,8 +699,7 @@ function fetchWrapper(requestOptions) { Object.assign(error, responseBody); let errors = responseBody.errors; error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); - } catch (e) { - } + } catch (e) {} throw error; }); } diff --git a/crates/swc_bundler/tests/fixture/deno-8574/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-8574/output/entry.ts index c04218dde58..b404adbcd53 100644 --- a/crates/swc_bundler/tests/fixture/deno-8574/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-8574/output/entry.ts @@ -27,8 +27,7 @@ if (typeof window !== "undefined") { } else if (typeof self !== "undefined") { globalContext = self; } else { - globalContext = { - }; + globalContext = {}; } if (typeof globalContext.setTimeout === "function") { cachedSetTimeout = setTimeout; @@ -136,14 +135,10 @@ var platform = "browser"; var browser = true; var argv = []; var version = ""; -var versions = { -}; -var release = { -}; -var config = { -}; -function noop() { -} +var versions = {}; +var release = {}; +var config = {}; +function noop() {} var on = noop; var addListener = noop; var once = noop; @@ -163,8 +158,7 @@ function chdir(dir) { function umask() { return 0; } -var performance = globalContext.performance || { -}; +var performance = globalContext.performance || {}; var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() { return new Date().getTime(); }; @@ -229,18 +223,15 @@ function getUserAgent() { } function lowercaseKeys(object) { if (!object) { - return { - }; + return {}; } return Object.keys(object).reduce((newObj, key)=>{ newObj[key.toLowerCase()] = object[key]; return newObj; - }, { - }); + }, {}); } function mergeDeep(defaults, options) { - const result = Object.assign({ - }, defaults); + const result = Object.assign({}, defaults); Object.keys(options).forEach((key)=>{ if (isPlainObject(options[key])) { if (!(key in defaults)) Object.assign(result, { @@ -273,14 +264,12 @@ function merge(defaults, route, options) { url: method }, options); } else { - options = Object.assign({ - }, route); + options = Object.assign({}, route); } options.headers = lowercaseKeys(options.headers); removeUndefinedProperties(options); removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || { - }, options); + const mergedOptions = mergeDeep(defaults || {}, options); if (defaults && defaults.mediaType.previews.length) { mergedOptions.mediaType.previews = defaults.mediaType.previews.filter((preview)=>!mergedOptions.mediaType.previews.includes(preview) ).concat(mergedOptions.mediaType.previews); @@ -319,8 +308,7 @@ function omit(object, keysToOmit) { ).reduce((obj, key)=>{ obj[key] = object[key]; return obj; - }, { - }); + }, {}); } function encodeReserved(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { @@ -451,8 +439,7 @@ function expand(template, context) { function parse(options) { let method = options.method.toUpperCase(); let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({ - }, options.headers); + let headers = Object.assign({}, options.headers); let body; let parameters = omit(options, [ "method", @@ -632,13 +619,10 @@ class RequestError extends Error { return statusCode; } }); - this.headers = options.headers || { - }; - const requestCopy = Object.assign({ - }, options.request); + this.headers = options.headers || {}; + const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({ - }, options.request.headers, { + requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") }); } @@ -671,8 +655,7 @@ function fetchWrapper(requestOptions) { if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); } - let headers = { - }; + let headers = {}; let status; let url; const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; @@ -716,8 +699,7 @@ function fetchWrapper(requestOptions) { Object.assign(error, responseBody); let errors = responseBody.errors; error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); - } catch (e) { - } + } catch (e) {} throw error; }); } diff --git a/crates/swc_bundler/tests/fixture/deno-8584/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-8584/output/entry.inlined.ts index 63974ddf80b..2ab5b80e1a6 100644 --- a/crates/swc_bundler/tests/fixture/deno-8584/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-8584/output/entry.inlined.ts @@ -1,10 +1,8 @@ -async function setup() { -} +async function setup() {} await setup(); const mod = await async function() { return { setup: setup }; }(); -await mod.setup({ -}); +await mod.setup({}); diff --git a/crates/swc_bundler/tests/fixture/deno-8584/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-8584/output/entry.ts index 63974ddf80b..2ab5b80e1a6 100644 --- a/crates/swc_bundler/tests/fixture/deno-8584/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-8584/output/entry.ts @@ -1,10 +1,8 @@ -async function setup() { -} +async function setup() {} await setup(); const mod = await async function() { return { setup: setup }; }(); -await mod.setup({ -}); +await mod.setup({}); diff --git a/crates/swc_bundler/tests/fixture/deno-8734/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-8734/output/entry.inlined.ts index 9eea4fa45c8..bf90f5024b9 100644 --- a/crates/swc_bundler/tests/fixture/deno-8734/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-8734/output/entry.inlined.ts @@ -3,9 +3,7 @@ if (!m) { throw new Error('b'); } class Comparator { - constructor(comp, optionsOrLoose = { - }){ - } + constructor(comp, optionsOrLoose = {}){} parse(comp) { const m2 = "another"; if (!m2) { diff --git a/crates/swc_bundler/tests/fixture/deno-8734/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-8734/output/entry.ts index 9eea4fa45c8..bf90f5024b9 100644 --- a/crates/swc_bundler/tests/fixture/deno-8734/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-8734/output/entry.ts @@ -3,9 +3,7 @@ if (!m) { throw new Error('b'); } class Comparator { - constructor(comp, optionsOrLoose = { - }){ - } + constructor(comp, optionsOrLoose = {}){} parse(comp) { const m2 = "another"; if (!m2) { diff --git a/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.inlined.ts index 0f555507182..358e580a3ea 100644 --- a/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.inlined.ts @@ -1,3 +1,2 @@ -function foo() { -} +function foo() {} foo(); diff --git a/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.ts index 0f555507182..358e580a3ea 100644 --- a/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9200/case1/output/entry.ts @@ -1,3 +1,2 @@ -function foo() { -} +function foo() {} foo(); diff --git a/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.inlined.ts index 129aea82f00..814ab6a16f6 100644 --- a/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.inlined.ts @@ -1,5 +1,4 @@ -function foo() { -} +function foo() {} export { foo as foo }; const mod = { foo diff --git a/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.ts index 129aea82f00..814ab6a16f6 100644 --- a/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9200/case2/output/entry.ts @@ -1,5 +1,4 @@ -function foo() { -} +function foo() {} export { foo as foo }; const mod = { foo diff --git a/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.inlined.ts index f2e96b5765b..d5cde205d84 100644 --- a/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.inlined.ts @@ -4,8 +4,7 @@ var Z = (e)=>_(e, "__esModule", { }) ; var g = (e, r)=>()=>(r || (r = { - exports: { - } + exports: {} }, e(r.exports, r)), r.exports) ; var ee = (e, r, t)=>{ @@ -15,8 +14,7 @@ var ee = (e, r, t)=>{ enumerable: !(t = X(r, n)) || t.enumerable }); return e; -}, re = (e)=>e && e.__esModule ? e : ee(_(e != null ? G(J(e)) : { - }, "default", { +}, re = (e)=>e && e.__esModule ? e : ee(_(e != null ? G(J(e)) : {}, "default", { value: e, enumerable: !0 }), e) @@ -33,18 +31,15 @@ var P = g((Te, k)=>{ if (!Object.assign) return !1; var e = new String("abc"); if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1; - for(var r = { - }, t = 0; t < 10; t++)r["_" + String.fromCharCode(t)] = t; + for(var r = {}, t = 0; t < 10; t++)r["_" + String.fromCharCode(t)] = t; var n = Object.getOwnPropertyNames(r).map(function(i) { return r[i]; }); if (n.join("") !== "0123456789") return !1; - var o = { - }; + var o = {}; return "abcdefghijklmnopqrst".split("").forEach(function(i) { o[i] = i; - }), Object.keys(Object.assign({ - }, o)).join("") === "abcdefghijklmnopqrst"; + }), Object.keys(Object.assign({}, o)).join("") === "abcdefghijklmnopqrst"; } catch (i) { return !1; } @@ -83,19 +78,14 @@ var z = g((u)=>{ isMounted: function() { return !1; }, - enqueueForceUpdate: function() { - }, - enqueueReplaceState: function() { - }, - enqueueSetState: function() { - } - }, L = { - }; + enqueueForceUpdate: function() {}, + enqueueReplaceState: function() {}, + enqueueSetState: function() {} + }, L = {}; function d(e, r, t) { this.props = e, this.context = r, this.refs = L, this.updater = t || F; } - d.prototype.isReactComponent = { - }; + d.prototype.isReactComponent = {}; d.prototype.setState = function(e, r) { if (typeof e != "object" && typeof e != "function" && e != null) throw Error(v(85)); this.updater.enqueueSetState(this, e, r, "setState"); @@ -103,8 +93,7 @@ var z = g((u)=>{ d.prototype.forceUpdate = function(e) { this.updater.enqueueForceUpdate(this, e, "forceUpdate"); }; - function U() { - } + function U() {} U.prototype = d.prototype; function O(e, r, t) { this.props = e, this.context = r, this.refs = L, this.updater = t || F; @@ -122,8 +111,7 @@ var z = g((u)=>{ __source: !0 }; function T(e, r, t) { - var n, o = { - }, i = null, s = null; + var n, o = {}, i = null, s = null; if (r != null) for(n in r.ref !== void 0 && (s = r.ref), r.key !== void 0 && (i = "" + r.key), r)D.call(r, n) && !M.hasOwnProperty(n) && (o[n] = r[n]); var c = arguments.length - 2; if (c === 1) o.children = t; @@ -262,8 +250,7 @@ var z = g((u)=>{ u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = le; u.cloneElement = function(e, r, t) { if (e == null) throw Error(v(267, e)); - var n = E({ - }, e.props), o = e.key, i = e.ref, s = e._owner; + var n = E({}, e.props), o = e.key, i = e.ref, s = e._owner; if (r != null) { if (r.ref !== void 0 && (i = r.ref, s = S.current), r.key !== void 0 && (o = "" + r.key), e.type && e.type.defaultProps) var c = e.type.defaultProps; for(f in r)D.call(r, f) && !M.hasOwnProperty(f) && (n[f] = r[f] === void 0 && c !== void 0 ? c[f] : r[f]); @@ -338,8 +325,7 @@ var z = g((u)=>{ u.useContext = function(e, r) { return p().useContext(e, r); }; - u.useDebugValue = function() { - }; + u.useDebugValue = function() {}; u.useEffect = function(e, r) { return p().useEffect(e, r); }; @@ -374,8 +360,7 @@ var va = (e)=>Zr(e, "__esModule", { }) ; var Bn = (e, n)=>()=>(n || (n = { - exports: { - } + exports: {} }, e(n.exports, n)), n.exports) ; var ya = (e, n, t)=>{ @@ -385,8 +370,7 @@ var ya = (e, n, t)=>{ enumerable: !(t = ha(n, r)) || t.enumerable }); return e; -}, ga = (e)=>e && e.__esModule ? e : ya(Zr(e != null ? ca(da(e)) : { - }, "default", { +}, ga = (e)=>e && e.__esModule ? e : ya(Zr(e != null ? ca(da(e)) : {}, "default", { value: e, enumerable: !0 }), e) @@ -403,18 +387,15 @@ var ao = Bn((Rc, uo)=>{ if (!Object.assign) return !1; var e = new String("abc"); if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1; - for(var n = { - }, t = 0; t < 10; t++)n["_" + String.fromCharCode(t)] = t; + for(var n = {}, t = 0; t < 10; t++)n["_" + String.fromCharCode(t)] = t; var r = Object.getOwnPropertyNames(n).map(function(i) { return n[i]; }); if (r.join("") !== "0123456789") return !1; - var l = { - }; + var l = {}; return "abcdefghijklmnopqrst".split("").forEach(function(i) { l[i] = i; - }), Object.keys(Object.assign({ - }, l)).join("") === "abcdefghijklmnopqrst"; + }), Object.keys(Object.assign({}, l)).join("") === "abcdefghijklmnopqrst"; } catch (i) { return !1; } @@ -455,11 +436,9 @@ var vo = Bn((L)=>{ clearTimeout(br); }, L.unstable_shouldYield = function() { return !1; - }, Jr = L.unstable_forceFrameRate = function() { - }) : (po = window.setTimeout, mo = window.clearTimeout, typeof console != "undefined" && (ho = window.cancelAnimationFrame, typeof window.requestAnimationFrame != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof ho != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")), Hn = !1, An = null, Bt = -1, nl = 5, tl = 0, L.unstable_shouldYield = function() { + }, Jr = L.unstable_forceFrameRate = function() {}) : (po = window.setTimeout, mo = window.clearTimeout, typeof console != "undefined" && (ho = window.cancelAnimationFrame, typeof window.requestAnimationFrame != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof ho != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")), Hn = !1, An = null, Bt = -1, nl = 5, tl = 0, L.unstable_shouldYield = function() { return L.unstable_now() >= tl; - }, Jr = function() { - }, L.unstable_forceFrameRate = function(e) { + }, Jr = function() {}, L.unstable_forceFrameRate = function(e) { 0 > e || 125 < e ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : nl = 0 < e ? Math.floor(1000 / e) : 5; }, rl = new MessageChannel, Wt = rl.port2, rl.port1.onmessage = function() { if (An !== null) { @@ -590,8 +569,7 @@ var vo = Bn((L)=>{ A = t; } }; - L.unstable_pauseExecution = function() { - }; + L.unstable_pauseExecution = function() {}; L.unstable_requestPaint = _a; L.unstable_runWithPriority = function(e, n) { switch(e){ @@ -664,17 +642,14 @@ var ia = Bn((re1)=>{ return "Minified React error #" + e + "; visit " + n + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } if (!$t) throw Error(v(227)); - var wo = new Set, $n = { - }; + var wo = new Set, $n = {}; function Ke(e, n) { cn(e, n), cn(e + "Capture", n); } function cn(e, n) { for($n[e] = n, e = 0; e < n.length; e++)wo.add(n[e]); } - var we1 = !(typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined"), Ca = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ko = Object.prototype.hasOwnProperty, So = { - }, Eo = { - }; + var we1 = !(typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined"), Ca = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ko = Object.prototype.hasOwnProperty, So = {}, Eo = {}; function Na(e) { return ko.call(Eo, e) ? !0 : ko.call(So, e) ? !1 : Ca.test(e) ? Eo[e] = !0 : (So[e] = !0, !1); } @@ -708,8 +683,7 @@ var ia = Bn((re1)=>{ function K1(e, n, t, r, l, i, o) { this.acceptsBooleans = n === 2 || n === 3 || n === 4, this.attributeName = r, this.attributeNamespace = l, this.mustUseProperty = t, this.propertyName = e, this.type = n, this.sanitizeURL = i, this.removeEmptyString = o; } - var B = { - }; + var B = {}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e) { B[e] = new K1(e, 0, !1, e, null, !1, !1); }); @@ -948,8 +922,7 @@ var ia = Bn((re1)=>{ n = e._payload, e = e._init; try { return dn(e(n)); - } catch (t) { - } + } catch (t) {} } return null; } @@ -1016,8 +989,7 @@ var ia = Bn((re1)=>{ } function Sl(e, n) { var t = n.checked; - return R({ - }, n, { + return R({}, n, { defaultChecked: void 0, defaultValue: void 0, value: void 0, @@ -1069,8 +1041,7 @@ var ia = Bn((re1)=>{ } function pn(e, n, t, r) { if (e = e.options, n) { - n = { - }; + n = {}; for(var l = 0; l < t.length; l++)n["$" + t[l]] = !0; for(t = 0; t < e.length; t++)l = n.hasOwnProperty("$" + e[t].value), e[t].selected !== l && (e[t].selected = l), l && r && (e[t].defaultSelected = !0); } else { @@ -1086,8 +1057,7 @@ var ia = Bn((re1)=>{ } function Cl(e, n) { if (n.dangerouslySetInnerHTML != null) throw Error(v(91)); - return R({ - }, n, { + return R({}, n, { value: void 0, defaultValue: void 0, children: "" + e._wrapperState.initialValue @@ -1296,8 +1266,7 @@ var ia = Bn((re1)=>{ function Bo(e, n, t, r, l) { return e(n, t, r, l); } - function Rl() { - } + function Rl() {} var Wo = Ml, Je = !1, jl = !1; function Il() { (mn !== null || hn !== null) && (Rl(), Vo()); @@ -1340,8 +1309,7 @@ var ia = Bn((re1)=>{ } var Dl = !1; if (we1) try { - vn = { - }, Object.defineProperty(vn, "passive", { + vn = {}, Object.defineProperty(vn, "passive", { get: function() { Dl = !0; } @@ -1601,8 +1569,7 @@ var ia = Bn((re1)=>{ for(; 0 < lt.length && (t = lt[0], t.blockedOn === null);)Wa(t), t.blockedOn === null && lt.shift(); } function rr(e, n) { - var t = { - }; + var t = {}; return t[e.toLowerCase()] = n.toLowerCase(), t["Webkit" + e] = "webkit" + n, t["Moz" + e] = "moz" + n, t; } var yn = { @@ -1610,9 +1577,7 @@ var ia = Bn((re1)=>{ animationiteration: rr("Animation", "AnimationIteration"), animationstart: rr("Animation", "AnimationStart"), transitionend: rr("Transition", "TransitionEnd") - }, Hl = { - }, bo = { - }; + }, Hl = {}, bo = {}; we1 && (bo = document.createElement("div").style, "AnimationEvent" in window || (delete yn.animationend.animation, delete yn.animationiteration.animation, delete yn.animationstart.animation), "TransitionEvent" in window || delete yn.transitionend.transition); function lr(e) { if (Hl[e]) return Hl[e]; @@ -1874,8 +1839,7 @@ var ia = Bn((re1)=>{ var t = this.nativeEvent; t && (t.stopPropagation ? t.stopPropagation() : typeof t.cancelBubble != "unknown" && (t.cancelBubble = !0), this.isPropagationStopped = fr); }, - persist: function() { - }, + persist: function() {}, isPersistent: fr }), n; } @@ -1888,12 +1852,10 @@ var ia = Bn((re1)=>{ }, defaultPrevented: 0, isTrusted: 0 - }, Kl = ee1(kn), st = R({ - }, kn, { + }, Kl = ee1(kn), st = R({}, kn, { view: 0, detail: 0 - }), ef = ee1(st), Gl, Zl, at, cr = R({ - }, st, { + }), ef = ee1(st), Gl, Zl, at, cr = R({}, st, { screenX: 0, screenY: 0, clientX: 0, @@ -1916,24 +1878,19 @@ var ia = Bn((re1)=>{ movementY: function(e) { return "movementY" in e ? e.movementY : Zl; } - }), au = ee1(cr), nf = R({ - }, cr, { + }), au = ee1(cr), nf = R({}, cr, { dataTransfer: 0 - }), tf = ee1(nf), rf = R({ - }, st, { + }), tf = ee1(nf), rf = R({}, st, { relatedTarget: 0 - }), ql = ee1(rf), lf = R({ - }, kn, { + }), ql = ee1(rf), lf = R({}, kn, { animationName: 0, elapsedTime: 0, pseudoElement: 0 - }), of = ee1(lf), uf = R({ - }, kn, { + }), of = ee1(lf), uf = R({}, kn, { clipboardData: function(e) { return "clipboardData" in e ? e.clipboardData : window.clipboardData; } - }), sf = ee1(uf), af = R({ - }, kn, { + }), sf = ee1(uf), af = R({}, kn, { data: 0 }), fu = ee1(af), ff = { Esc: "Escape", @@ -1998,8 +1955,7 @@ var ia = Bn((re1)=>{ function Jl() { return pf; } - var mf = R({ - }, st, { + var mf = R({}, st, { key: function(e) { if (e.key) { var n = ff[e.key] || e.key; @@ -2025,8 +1981,7 @@ var ia = Bn((re1)=>{ which: function(e) { return e.type === "keypress" ? ar(e) : e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0; } - }), hf = ee1(mf), vf = R({ - }, cr, { + }), hf = ee1(mf), vf = R({}, cr, { pointerId: 0, width: 0, height: 0, @@ -2037,8 +1992,7 @@ var ia = Bn((re1)=>{ twist: 0, pointerType: 0, isPrimary: 0 - }), cu = ee1(vf), yf = R({ - }, st, { + }), cu = ee1(vf), yf = R({}, st, { touches: 0, targetTouches: 0, changedTouches: 0, @@ -2047,13 +2001,11 @@ var ia = Bn((re1)=>{ ctrlKey: 0, shiftKey: 0, getModifierState: Jl - }), gf = ee1(yf), wf = R({ - }, kn, { + }), gf = ee1(yf), wf = R({}, kn, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 - }), kf = ee1(wf), Sf = R({ - }, cr, { + }), kf = ee1(wf), Sf = R({}, cr, { deltaX: function(e) { return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0; }, @@ -2587,8 +2539,7 @@ var ia = Bn((re1)=>{ listeners: o }); } - function vr() { - } + function vr() {} var ii = null, oi = null; function Fu(e, n) { switch(e){ @@ -2678,15 +2629,13 @@ var ia = Bn((re1)=>{ function j(e, n) { Pn++, fi[Pn] = e.current, e.current = n; } - var De1 = { - }, Q1 = Ie1(De1), Z1 = Ie1(!1), en = De1; + var De1 = {}, Q1 = Ie1(De1), Z1 = Ie1(!1), en = De1; function Tn(e, n) { var t = e.type.contextTypes; if (!t) return De1; var r = e.stateNode; if (r && r.__reactInternalMemoizedUnmaskedChildContext === n) return r.__reactInternalMemoizedMaskedChildContext; - var l = { - }, i; + var l = {}, i; for(i in t)l[i] = n[i]; return r && (e = e.stateNode, e.__reactInternalMemoizedUnmaskedChildContext = n, e.__reactInternalMemoizedMaskedChildContext = l), l; } @@ -2705,8 +2654,7 @@ var ia = Bn((re1)=>{ if (e = n.childContextTypes, typeof r.getChildContext != "function") return t; r = r.getChildContext(); for(var l in r)if (!(l in e)) throw Error(v(108, dn(n) || "Unknown", l)); - return R({ - }, t, r); + return R({}, t, r); } function kr(e) { return e = (e = e.stateNode) && e.__reactInternalMemoizedMergedChildContext || De1, en = Q1.current, j(Q1, e), j(Z1, Z1.current), !0; @@ -2716,9 +2664,7 @@ var ia = Bn((re1)=>{ if (!r) throw Error(v(169)); t ? (e = Hu(e, n, en), r.__reactInternalMemoizedMergedChildContext = e, M(Z1), M(Q1), j(Q1, e)) : M(Z1), j(Z1, t); } - var ci = null, nn = null, Vf = V.unstable_runWithPriority, di = V.unstable_scheduleCallback, pi = V.unstable_cancelCallback, Bf = V.unstable_shouldYield, Qu = V.unstable_requestPaint, mi = V.unstable_now, Wf = V.unstable_getCurrentPriorityLevel, Sr = V.unstable_ImmediatePriority, $u = V.unstable_UserBlockingPriority, Yu = V.unstable_NormalPriority, Xu = V.unstable_LowPriority, Ku = V.unstable_IdlePriority, hi = { - }, Hf = Qu !== void 0 ? Qu : function() { - }, ke1 = null, Er = null, vi = !1, Gu = mi(), $ = 10000 > Gu ? mi : function() { + var ci = null, nn = null, Vf = V.unstable_runWithPriority, di = V.unstable_scheduleCallback, pi = V.unstable_cancelCallback, Bf = V.unstable_shouldYield, Qu = V.unstable_requestPaint, mi = V.unstable_now, Wf = V.unstable_getCurrentPriorityLevel, Sr = V.unstable_ImmediatePriority, $u = V.unstable_UserBlockingPriority, Yu = V.unstable_NormalPriority, Xu = V.unstable_LowPriority, Ku = V.unstable_IdlePriority, hi = {}, Hf = Qu !== void 0 ? Qu : function() {}, ke1 = null, Er = null, vi = !1, Gu = mi(), $ = 10000 > Gu ? mi : function() { return mi() - Gu; }; function Ln() { @@ -2789,8 +2735,7 @@ var ia = Bn((re1)=>{ var Af = Ge.ReactCurrentBatchConfig; function fe(e, n) { if (e && e.defaultProps) { - n = R({ - }, n), e = e.defaultProps; + n = R({}, n), e = e.defaultProps; for(var t in e)n[t] === void 0 && (n[t] = e[t]); return n; } @@ -2942,8 +2887,7 @@ var ia = Bn((re1)=>{ k.flags = k.flags & -4097 | 64; case 0: if (k = E.payload, u = typeof k == "function" ? k.call(h, _2, u) : k, u == null) break e; - _2 = R({ - }, _2, u); + _2 = R({}, _2, u); break e; case 2: Fe1 = !0; @@ -2979,8 +2923,7 @@ var ia = Bn((re1)=>{ } var ts = new $t.Component().refs; function Nr(e, n, t, r) { - n = e.memoizedState, t = t(r, n), t = t == null ? n : R({ - }, n, t), e.memoizedState = t, e.lanes === 0 && (e.updateQueue.baseState = t); + n = e.memoizedState, t = t(r, n), t = t == null ? n : R({}, n, t), e.memoizedState = t, e.lanes === 0 && (e.updateQueue.baseState = t); } var Pr = { isMounted: function(e) { @@ -3030,8 +2973,7 @@ var ia = Bn((re1)=>{ var l = "" + e; return n !== null && n.ref !== null && typeof n.ref == "function" && n.ref._stringRef === l ? n.ref : (n = function(i) { var o = r.refs; - o === ts && (o = r.refs = { - }), i === null ? delete o[l] : o[l] = i; + o === ts && (o = r.refs = {}), i === null ? delete o[l] : o[l] = i; }, n._stringRef = l, n); } if (typeof e != "string") throw Error(v(284)); @@ -3226,8 +3168,7 @@ var ia = Bn((re1)=>{ return t(c, a); }; } - var zr = os(!0), us = os(!1), St = { - }, he1 = Ie1(St), Et = Ie1(St), xt = Ie1(St); + var zr = os(!0), us = os(!1), St = {}, he1 = Ie1(St), Et = Ie1(St), xt = Ie1(St); function rn(e) { if (e === St) throw Error(v(174)); return e; @@ -3592,8 +3533,7 @@ var ia = Bn((re1)=>{ e ]) : null, Mi(4, 2, gs.bind(null, n, e), t); } - function Ri() { - } + function Ri() {} function ks(e, n) { var t = on(); n = n === void 0 ? null : n; @@ -3639,9 +3579,7 @@ var ia = Bn((re1)=>{ if (e.lanes === 0 && (o === null || o.lanes === 0) && (o = n.lastRenderedReducer, o !== null)) try { var u = n.lastRenderedState, s = o(u, t); if (i.eagerReducer = o, i.eagerState = s, le(s, u)) return; - } catch (d) { - } finally{ - } + } catch (d) {} finally{} We(e, l, r); } } @@ -4039,8 +3977,7 @@ var ia = Bn((re1)=>{ t.sibling.return = t.return, t = t.sibling; } }; - Bi = function() { - }; + Bi = function() {}; Is = function(e, n, t, r) { var l = e.memoizedProps; if (l !== r) { @@ -4054,11 +3991,9 @@ var ia = Bn((re1)=>{ l = _l(e, l), r = _l(e, r), i = []; break; case "select": - l = R({ - }, l, { + l = R({}, l, { value: void 0 - }), r = R({ - }, r, { + }), r = R({}, r, { value: void 0 }), i = []; break; @@ -4073,16 +4008,13 @@ var ia = Bn((re1)=>{ t = null; for(d in l)if (!r.hasOwnProperty(d) && l.hasOwnProperty(d) && l[d] != null) if (d === "style") { var u = l[d]; - for(o in u)u.hasOwnProperty(o) && (t || (t = { - }), t[o] = ""); + for(o in u)u.hasOwnProperty(o) && (t || (t = {}), t[o] = ""); } else d !== "dangerouslySetInnerHTML" && d !== "children" && d !== "suppressContentEditableWarning" && d !== "suppressHydrationWarning" && d !== "autoFocus" && ($n.hasOwnProperty(d) ? i || (i = []) : (i = i || []).push(d, null)); for(d in r){ var s = r[d]; if (u = l != null ? l[d] : void 0, r.hasOwnProperty(d) && s !== u && (s != null || u != null)) if (d === "style") if (u) { - for(o in u)!u.hasOwnProperty(o) || s && s.hasOwnProperty(o) || (t || (t = { - }), t[o] = ""); - for(o in s)s.hasOwnProperty(o) && u[o] !== s[o] && (t || (t = { - }), t[o] = s[o]); + for(o in u)!u.hasOwnProperty(o) || s && s.hasOwnProperty(o) || (t || (t = {}), t[o] = ""); + for(o in s)s.hasOwnProperty(o) && u[o] !== s[o] && (t || (t = {}), t[o] = s[o]); } else t || (i || (i = []), i.push(d, t)), t = s; else d === "dangerouslySetInnerHTML" ? (s = s ? s.__html : void 0, u = u ? u.__html : void 0, s != null && u !== s && (i = i || []).push(d, s)) : d === "children" ? typeof s != "string" && typeof s != "number" || (i = i || []).push(d, "" + s) : d !== "suppressContentEditableWarning" && d !== "suppressHydrationWarning" && ($n.hasOwnProperty(d) ? (s != null && d === "onScroll" && z1("scroll", e), i || u === s || (i = [])) : typeof s == "object" && s !== null && s.$$typeof === vl ? s.toString() : (i = i || []).push(d, s)); } @@ -4231,8 +4163,7 @@ var ia = Bn((re1)=>{ case "select": e._wrapperState = { wasMultiple: !!r.multiple - }, l = R({ - }, r, { + }, l = R({}, r, { value: void 0 }), z1("invalid", e); break; @@ -4516,8 +4447,7 @@ Error generating stack: ` + i.message + ` function As(e, n) { if (nn && typeof nn.onCommitFiberUnmount == "function") try { nn.onCommitFiberUnmount(ci, n); - } catch (i) { - } + } catch (i) {} switch(n.tag){ case 0: case 11: @@ -5233,8 +5163,7 @@ Add a component higher in the tree to provide a loading else for(g1 = r; g1 !== null;)n = g1.nextEffect, g1.nextEffect = null, g1.flags & 8 && (w = g1, w.sibling = null, w.stateNode = null), g1 = n; if (r = e.pendingLanes, r === 0 && (ge1 = null), r === 1 ? e === to ? Rt++ : (Rt = 0, to = e) : Rt = 0, t = t.stateNode, nn && typeof nn.onCommitFiberRoot == "function") try { nn.onCommitFiberRoot(ci, t, void 0, (t.current.flags & 64) == 64); - } catch (P) { - } + } catch (P) {} if (se(e, $()), Wr) throw Wr = !1, e = $i, $i = null, e; return (x & 8) != 0 || me1(), null; } @@ -5312,8 +5241,7 @@ Add a component higher in the tree to provide a loading if (Ve(t, l), l = ne(), t = Xr(t, 1), t !== null) or(t, 1, l), se(t, l); else if (typeof r.componentDidCatch == "function" && (ge1 === null || !ge1.has(r))) try { r.componentDidCatch(n, e); - } catch (i) { - } + } catch (i) {} break; } } @@ -5814,8 +5742,7 @@ Add a component higher in the tree to provide a loading }; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && (Ut = __REACT_DEVTOOLS_GLOBAL_HOOK__, !Ut.isDisabled && Ut.supportsFiber)) try { ci = Ut.inject(wc), nn = Ut; - } catch (e2) { - } + } catch (e2) {} var Ut; re1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = gc; re1.createPortal = la; diff --git a/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.ts index f2e96b5765b..d5cde205d84 100644 --- a/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9212/case1/output/entry.ts @@ -4,8 +4,7 @@ var Z = (e)=>_(e, "__esModule", { }) ; var g = (e, r)=>()=>(r || (r = { - exports: { - } + exports: {} }, e(r.exports, r)), r.exports) ; var ee = (e, r, t)=>{ @@ -15,8 +14,7 @@ var ee = (e, r, t)=>{ enumerable: !(t = X(r, n)) || t.enumerable }); return e; -}, re = (e)=>e && e.__esModule ? e : ee(_(e != null ? G(J(e)) : { - }, "default", { +}, re = (e)=>e && e.__esModule ? e : ee(_(e != null ? G(J(e)) : {}, "default", { value: e, enumerable: !0 }), e) @@ -33,18 +31,15 @@ var P = g((Te, k)=>{ if (!Object.assign) return !1; var e = new String("abc"); if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1; - for(var r = { - }, t = 0; t < 10; t++)r["_" + String.fromCharCode(t)] = t; + for(var r = {}, t = 0; t < 10; t++)r["_" + String.fromCharCode(t)] = t; var n = Object.getOwnPropertyNames(r).map(function(i) { return r[i]; }); if (n.join("") !== "0123456789") return !1; - var o = { - }; + var o = {}; return "abcdefghijklmnopqrst".split("").forEach(function(i) { o[i] = i; - }), Object.keys(Object.assign({ - }, o)).join("") === "abcdefghijklmnopqrst"; + }), Object.keys(Object.assign({}, o)).join("") === "abcdefghijklmnopqrst"; } catch (i) { return !1; } @@ -83,19 +78,14 @@ var z = g((u)=>{ isMounted: function() { return !1; }, - enqueueForceUpdate: function() { - }, - enqueueReplaceState: function() { - }, - enqueueSetState: function() { - } - }, L = { - }; + enqueueForceUpdate: function() {}, + enqueueReplaceState: function() {}, + enqueueSetState: function() {} + }, L = {}; function d(e, r, t) { this.props = e, this.context = r, this.refs = L, this.updater = t || F; } - d.prototype.isReactComponent = { - }; + d.prototype.isReactComponent = {}; d.prototype.setState = function(e, r) { if (typeof e != "object" && typeof e != "function" && e != null) throw Error(v(85)); this.updater.enqueueSetState(this, e, r, "setState"); @@ -103,8 +93,7 @@ var z = g((u)=>{ d.prototype.forceUpdate = function(e) { this.updater.enqueueForceUpdate(this, e, "forceUpdate"); }; - function U() { - } + function U() {} U.prototype = d.prototype; function O(e, r, t) { this.props = e, this.context = r, this.refs = L, this.updater = t || F; @@ -122,8 +111,7 @@ var z = g((u)=>{ __source: !0 }; function T(e, r, t) { - var n, o = { - }, i = null, s = null; + var n, o = {}, i = null, s = null; if (r != null) for(n in r.ref !== void 0 && (s = r.ref), r.key !== void 0 && (i = "" + r.key), r)D.call(r, n) && !M.hasOwnProperty(n) && (o[n] = r[n]); var c = arguments.length - 2; if (c === 1) o.children = t; @@ -262,8 +250,7 @@ var z = g((u)=>{ u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = le; u.cloneElement = function(e, r, t) { if (e == null) throw Error(v(267, e)); - var n = E({ - }, e.props), o = e.key, i = e.ref, s = e._owner; + var n = E({}, e.props), o = e.key, i = e.ref, s = e._owner; if (r != null) { if (r.ref !== void 0 && (i = r.ref, s = S.current), r.key !== void 0 && (o = "" + r.key), e.type && e.type.defaultProps) var c = e.type.defaultProps; for(f in r)D.call(r, f) && !M.hasOwnProperty(f) && (n[f] = r[f] === void 0 && c !== void 0 ? c[f] : r[f]); @@ -338,8 +325,7 @@ var z = g((u)=>{ u.useContext = function(e, r) { return p().useContext(e, r); }; - u.useDebugValue = function() { - }; + u.useDebugValue = function() {}; u.useEffect = function(e, r) { return p().useEffect(e, r); }; @@ -374,8 +360,7 @@ var va = (e)=>Zr(e, "__esModule", { }) ; var Bn = (e, n)=>()=>(n || (n = { - exports: { - } + exports: {} }, e(n.exports, n)), n.exports) ; var ya = (e, n, t)=>{ @@ -385,8 +370,7 @@ var ya = (e, n, t)=>{ enumerable: !(t = ha(n, r)) || t.enumerable }); return e; -}, ga = (e)=>e && e.__esModule ? e : ya(Zr(e != null ? ca(da(e)) : { - }, "default", { +}, ga = (e)=>e && e.__esModule ? e : ya(Zr(e != null ? ca(da(e)) : {}, "default", { value: e, enumerable: !0 }), e) @@ -403,18 +387,15 @@ var ao = Bn((Rc, uo)=>{ if (!Object.assign) return !1; var e = new String("abc"); if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1; - for(var n = { - }, t = 0; t < 10; t++)n["_" + String.fromCharCode(t)] = t; + for(var n = {}, t = 0; t < 10; t++)n["_" + String.fromCharCode(t)] = t; var r = Object.getOwnPropertyNames(n).map(function(i) { return n[i]; }); if (r.join("") !== "0123456789") return !1; - var l = { - }; + var l = {}; return "abcdefghijklmnopqrst".split("").forEach(function(i) { l[i] = i; - }), Object.keys(Object.assign({ - }, l)).join("") === "abcdefghijklmnopqrst"; + }), Object.keys(Object.assign({}, l)).join("") === "abcdefghijklmnopqrst"; } catch (i) { return !1; } @@ -455,11 +436,9 @@ var vo = Bn((L)=>{ clearTimeout(br); }, L.unstable_shouldYield = function() { return !1; - }, Jr = L.unstable_forceFrameRate = function() { - }) : (po = window.setTimeout, mo = window.clearTimeout, typeof console != "undefined" && (ho = window.cancelAnimationFrame, typeof window.requestAnimationFrame != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof ho != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")), Hn = !1, An = null, Bt = -1, nl = 5, tl = 0, L.unstable_shouldYield = function() { + }, Jr = L.unstable_forceFrameRate = function() {}) : (po = window.setTimeout, mo = window.clearTimeout, typeof console != "undefined" && (ho = window.cancelAnimationFrame, typeof window.requestAnimationFrame != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof ho != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")), Hn = !1, An = null, Bt = -1, nl = 5, tl = 0, L.unstable_shouldYield = function() { return L.unstable_now() >= tl; - }, Jr = function() { - }, L.unstable_forceFrameRate = function(e) { + }, Jr = function() {}, L.unstable_forceFrameRate = function(e) { 0 > e || 125 < e ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : nl = 0 < e ? Math.floor(1000 / e) : 5; }, rl = new MessageChannel, Wt = rl.port2, rl.port1.onmessage = function() { if (An !== null) { @@ -590,8 +569,7 @@ var vo = Bn((L)=>{ A = t; } }; - L.unstable_pauseExecution = function() { - }; + L.unstable_pauseExecution = function() {}; L.unstable_requestPaint = _a; L.unstable_runWithPriority = function(e, n) { switch(e){ @@ -664,17 +642,14 @@ var ia = Bn((re1)=>{ return "Minified React error #" + e + "; visit " + n + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } if (!$t) throw Error(v(227)); - var wo = new Set, $n = { - }; + var wo = new Set, $n = {}; function Ke(e, n) { cn(e, n), cn(e + "Capture", n); } function cn(e, n) { for($n[e] = n, e = 0; e < n.length; e++)wo.add(n[e]); } - var we1 = !(typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined"), Ca = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ko = Object.prototype.hasOwnProperty, So = { - }, Eo = { - }; + var we1 = !(typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined"), Ca = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ko = Object.prototype.hasOwnProperty, So = {}, Eo = {}; function Na(e) { return ko.call(Eo, e) ? !0 : ko.call(So, e) ? !1 : Ca.test(e) ? Eo[e] = !0 : (So[e] = !0, !1); } @@ -708,8 +683,7 @@ var ia = Bn((re1)=>{ function K1(e, n, t, r, l, i, o) { this.acceptsBooleans = n === 2 || n === 3 || n === 4, this.attributeName = r, this.attributeNamespace = l, this.mustUseProperty = t, this.propertyName = e, this.type = n, this.sanitizeURL = i, this.removeEmptyString = o; } - var B = { - }; + var B = {}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e) { B[e] = new K1(e, 0, !1, e, null, !1, !1); }); @@ -948,8 +922,7 @@ var ia = Bn((re1)=>{ n = e._payload, e = e._init; try { return dn(e(n)); - } catch (t) { - } + } catch (t) {} } return null; } @@ -1016,8 +989,7 @@ var ia = Bn((re1)=>{ } function Sl(e, n) { var t = n.checked; - return R({ - }, n, { + return R({}, n, { defaultChecked: void 0, defaultValue: void 0, value: void 0, @@ -1069,8 +1041,7 @@ var ia = Bn((re1)=>{ } function pn(e, n, t, r) { if (e = e.options, n) { - n = { - }; + n = {}; for(var l = 0; l < t.length; l++)n["$" + t[l]] = !0; for(t = 0; t < e.length; t++)l = n.hasOwnProperty("$" + e[t].value), e[t].selected !== l && (e[t].selected = l), l && r && (e[t].defaultSelected = !0); } else { @@ -1086,8 +1057,7 @@ var ia = Bn((re1)=>{ } function Cl(e, n) { if (n.dangerouslySetInnerHTML != null) throw Error(v(91)); - return R({ - }, n, { + return R({}, n, { value: void 0, defaultValue: void 0, children: "" + e._wrapperState.initialValue @@ -1296,8 +1266,7 @@ var ia = Bn((re1)=>{ function Bo(e, n, t, r, l) { return e(n, t, r, l); } - function Rl() { - } + function Rl() {} var Wo = Ml, Je = !1, jl = !1; function Il() { (mn !== null || hn !== null) && (Rl(), Vo()); @@ -1340,8 +1309,7 @@ var ia = Bn((re1)=>{ } var Dl = !1; if (we1) try { - vn = { - }, Object.defineProperty(vn, "passive", { + vn = {}, Object.defineProperty(vn, "passive", { get: function() { Dl = !0; } @@ -1601,8 +1569,7 @@ var ia = Bn((re1)=>{ for(; 0 < lt.length && (t = lt[0], t.blockedOn === null);)Wa(t), t.blockedOn === null && lt.shift(); } function rr(e, n) { - var t = { - }; + var t = {}; return t[e.toLowerCase()] = n.toLowerCase(), t["Webkit" + e] = "webkit" + n, t["Moz" + e] = "moz" + n, t; } var yn = { @@ -1610,9 +1577,7 @@ var ia = Bn((re1)=>{ animationiteration: rr("Animation", "AnimationIteration"), animationstart: rr("Animation", "AnimationStart"), transitionend: rr("Transition", "TransitionEnd") - }, Hl = { - }, bo = { - }; + }, Hl = {}, bo = {}; we1 && (bo = document.createElement("div").style, "AnimationEvent" in window || (delete yn.animationend.animation, delete yn.animationiteration.animation, delete yn.animationstart.animation), "TransitionEvent" in window || delete yn.transitionend.transition); function lr(e) { if (Hl[e]) return Hl[e]; @@ -1874,8 +1839,7 @@ var ia = Bn((re1)=>{ var t = this.nativeEvent; t && (t.stopPropagation ? t.stopPropagation() : typeof t.cancelBubble != "unknown" && (t.cancelBubble = !0), this.isPropagationStopped = fr); }, - persist: function() { - }, + persist: function() {}, isPersistent: fr }), n; } @@ -1888,12 +1852,10 @@ var ia = Bn((re1)=>{ }, defaultPrevented: 0, isTrusted: 0 - }, Kl = ee1(kn), st = R({ - }, kn, { + }, Kl = ee1(kn), st = R({}, kn, { view: 0, detail: 0 - }), ef = ee1(st), Gl, Zl, at, cr = R({ - }, st, { + }), ef = ee1(st), Gl, Zl, at, cr = R({}, st, { screenX: 0, screenY: 0, clientX: 0, @@ -1916,24 +1878,19 @@ var ia = Bn((re1)=>{ movementY: function(e) { return "movementY" in e ? e.movementY : Zl; } - }), au = ee1(cr), nf = R({ - }, cr, { + }), au = ee1(cr), nf = R({}, cr, { dataTransfer: 0 - }), tf = ee1(nf), rf = R({ - }, st, { + }), tf = ee1(nf), rf = R({}, st, { relatedTarget: 0 - }), ql = ee1(rf), lf = R({ - }, kn, { + }), ql = ee1(rf), lf = R({}, kn, { animationName: 0, elapsedTime: 0, pseudoElement: 0 - }), of = ee1(lf), uf = R({ - }, kn, { + }), of = ee1(lf), uf = R({}, kn, { clipboardData: function(e) { return "clipboardData" in e ? e.clipboardData : window.clipboardData; } - }), sf = ee1(uf), af = R({ - }, kn, { + }), sf = ee1(uf), af = R({}, kn, { data: 0 }), fu = ee1(af), ff = { Esc: "Escape", @@ -1998,8 +1955,7 @@ var ia = Bn((re1)=>{ function Jl() { return pf; } - var mf = R({ - }, st, { + var mf = R({}, st, { key: function(e) { if (e.key) { var n = ff[e.key] || e.key; @@ -2025,8 +1981,7 @@ var ia = Bn((re1)=>{ which: function(e) { return e.type === "keypress" ? ar(e) : e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0; } - }), hf = ee1(mf), vf = R({ - }, cr, { + }), hf = ee1(mf), vf = R({}, cr, { pointerId: 0, width: 0, height: 0, @@ -2037,8 +1992,7 @@ var ia = Bn((re1)=>{ twist: 0, pointerType: 0, isPrimary: 0 - }), cu = ee1(vf), yf = R({ - }, st, { + }), cu = ee1(vf), yf = R({}, st, { touches: 0, targetTouches: 0, changedTouches: 0, @@ -2047,13 +2001,11 @@ var ia = Bn((re1)=>{ ctrlKey: 0, shiftKey: 0, getModifierState: Jl - }), gf = ee1(yf), wf = R({ - }, kn, { + }), gf = ee1(yf), wf = R({}, kn, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 - }), kf = ee1(wf), Sf = R({ - }, cr, { + }), kf = ee1(wf), Sf = R({}, cr, { deltaX: function(e) { return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0; }, @@ -2587,8 +2539,7 @@ var ia = Bn((re1)=>{ listeners: o }); } - function vr() { - } + function vr() {} var ii = null, oi = null; function Fu(e, n) { switch(e){ @@ -2678,15 +2629,13 @@ var ia = Bn((re1)=>{ function j(e, n) { Pn++, fi[Pn] = e.current, e.current = n; } - var De1 = { - }, Q1 = Ie1(De1), Z1 = Ie1(!1), en = De1; + var De1 = {}, Q1 = Ie1(De1), Z1 = Ie1(!1), en = De1; function Tn(e, n) { var t = e.type.contextTypes; if (!t) return De1; var r = e.stateNode; if (r && r.__reactInternalMemoizedUnmaskedChildContext === n) return r.__reactInternalMemoizedMaskedChildContext; - var l = { - }, i; + var l = {}, i; for(i in t)l[i] = n[i]; return r && (e = e.stateNode, e.__reactInternalMemoizedUnmaskedChildContext = n, e.__reactInternalMemoizedMaskedChildContext = l), l; } @@ -2705,8 +2654,7 @@ var ia = Bn((re1)=>{ if (e = n.childContextTypes, typeof r.getChildContext != "function") return t; r = r.getChildContext(); for(var l in r)if (!(l in e)) throw Error(v(108, dn(n) || "Unknown", l)); - return R({ - }, t, r); + return R({}, t, r); } function kr(e) { return e = (e = e.stateNode) && e.__reactInternalMemoizedMergedChildContext || De1, en = Q1.current, j(Q1, e), j(Z1, Z1.current), !0; @@ -2716,9 +2664,7 @@ var ia = Bn((re1)=>{ if (!r) throw Error(v(169)); t ? (e = Hu(e, n, en), r.__reactInternalMemoizedMergedChildContext = e, M(Z1), M(Q1), j(Q1, e)) : M(Z1), j(Z1, t); } - var ci = null, nn = null, Vf = V.unstable_runWithPriority, di = V.unstable_scheduleCallback, pi = V.unstable_cancelCallback, Bf = V.unstable_shouldYield, Qu = V.unstable_requestPaint, mi = V.unstable_now, Wf = V.unstable_getCurrentPriorityLevel, Sr = V.unstable_ImmediatePriority, $u = V.unstable_UserBlockingPriority, Yu = V.unstable_NormalPriority, Xu = V.unstable_LowPriority, Ku = V.unstable_IdlePriority, hi = { - }, Hf = Qu !== void 0 ? Qu : function() { - }, ke1 = null, Er = null, vi = !1, Gu = mi(), $ = 10000 > Gu ? mi : function() { + var ci = null, nn = null, Vf = V.unstable_runWithPriority, di = V.unstable_scheduleCallback, pi = V.unstable_cancelCallback, Bf = V.unstable_shouldYield, Qu = V.unstable_requestPaint, mi = V.unstable_now, Wf = V.unstable_getCurrentPriorityLevel, Sr = V.unstable_ImmediatePriority, $u = V.unstable_UserBlockingPriority, Yu = V.unstable_NormalPriority, Xu = V.unstable_LowPriority, Ku = V.unstable_IdlePriority, hi = {}, Hf = Qu !== void 0 ? Qu : function() {}, ke1 = null, Er = null, vi = !1, Gu = mi(), $ = 10000 > Gu ? mi : function() { return mi() - Gu; }; function Ln() { @@ -2789,8 +2735,7 @@ var ia = Bn((re1)=>{ var Af = Ge.ReactCurrentBatchConfig; function fe(e, n) { if (e && e.defaultProps) { - n = R({ - }, n), e = e.defaultProps; + n = R({}, n), e = e.defaultProps; for(var t in e)n[t] === void 0 && (n[t] = e[t]); return n; } @@ -2942,8 +2887,7 @@ var ia = Bn((re1)=>{ k.flags = k.flags & -4097 | 64; case 0: if (k = E.payload, u = typeof k == "function" ? k.call(h, _2, u) : k, u == null) break e; - _2 = R({ - }, _2, u); + _2 = R({}, _2, u); break e; case 2: Fe1 = !0; @@ -2979,8 +2923,7 @@ var ia = Bn((re1)=>{ } var ts = new $t.Component().refs; function Nr(e, n, t, r) { - n = e.memoizedState, t = t(r, n), t = t == null ? n : R({ - }, n, t), e.memoizedState = t, e.lanes === 0 && (e.updateQueue.baseState = t); + n = e.memoizedState, t = t(r, n), t = t == null ? n : R({}, n, t), e.memoizedState = t, e.lanes === 0 && (e.updateQueue.baseState = t); } var Pr = { isMounted: function(e) { @@ -3030,8 +2973,7 @@ var ia = Bn((re1)=>{ var l = "" + e; return n !== null && n.ref !== null && typeof n.ref == "function" && n.ref._stringRef === l ? n.ref : (n = function(i) { var o = r.refs; - o === ts && (o = r.refs = { - }), i === null ? delete o[l] : o[l] = i; + o === ts && (o = r.refs = {}), i === null ? delete o[l] : o[l] = i; }, n._stringRef = l, n); } if (typeof e != "string") throw Error(v(284)); @@ -3226,8 +3168,7 @@ var ia = Bn((re1)=>{ return t(c, a); }; } - var zr = os(!0), us = os(!1), St = { - }, he1 = Ie1(St), Et = Ie1(St), xt = Ie1(St); + var zr = os(!0), us = os(!1), St = {}, he1 = Ie1(St), Et = Ie1(St), xt = Ie1(St); function rn(e) { if (e === St) throw Error(v(174)); return e; @@ -3592,8 +3533,7 @@ var ia = Bn((re1)=>{ e ]) : null, Mi(4, 2, gs.bind(null, n, e), t); } - function Ri() { - } + function Ri() {} function ks(e, n) { var t = on(); n = n === void 0 ? null : n; @@ -3639,9 +3579,7 @@ var ia = Bn((re1)=>{ if (e.lanes === 0 && (o === null || o.lanes === 0) && (o = n.lastRenderedReducer, o !== null)) try { var u = n.lastRenderedState, s = o(u, t); if (i.eagerReducer = o, i.eagerState = s, le(s, u)) return; - } catch (d) { - } finally{ - } + } catch (d) {} finally{} We(e, l, r); } } @@ -4039,8 +3977,7 @@ var ia = Bn((re1)=>{ t.sibling.return = t.return, t = t.sibling; } }; - Bi = function() { - }; + Bi = function() {}; Is = function(e, n, t, r) { var l = e.memoizedProps; if (l !== r) { @@ -4054,11 +3991,9 @@ var ia = Bn((re1)=>{ l = _l(e, l), r = _l(e, r), i = []; break; case "select": - l = R({ - }, l, { + l = R({}, l, { value: void 0 - }), r = R({ - }, r, { + }), r = R({}, r, { value: void 0 }), i = []; break; @@ -4073,16 +4008,13 @@ var ia = Bn((re1)=>{ t = null; for(d in l)if (!r.hasOwnProperty(d) && l.hasOwnProperty(d) && l[d] != null) if (d === "style") { var u = l[d]; - for(o in u)u.hasOwnProperty(o) && (t || (t = { - }), t[o] = ""); + for(o in u)u.hasOwnProperty(o) && (t || (t = {}), t[o] = ""); } else d !== "dangerouslySetInnerHTML" && d !== "children" && d !== "suppressContentEditableWarning" && d !== "suppressHydrationWarning" && d !== "autoFocus" && ($n.hasOwnProperty(d) ? i || (i = []) : (i = i || []).push(d, null)); for(d in r){ var s = r[d]; if (u = l != null ? l[d] : void 0, r.hasOwnProperty(d) && s !== u && (s != null || u != null)) if (d === "style") if (u) { - for(o in u)!u.hasOwnProperty(o) || s && s.hasOwnProperty(o) || (t || (t = { - }), t[o] = ""); - for(o in s)s.hasOwnProperty(o) && u[o] !== s[o] && (t || (t = { - }), t[o] = s[o]); + for(o in u)!u.hasOwnProperty(o) || s && s.hasOwnProperty(o) || (t || (t = {}), t[o] = ""); + for(o in s)s.hasOwnProperty(o) && u[o] !== s[o] && (t || (t = {}), t[o] = s[o]); } else t || (i || (i = []), i.push(d, t)), t = s; else d === "dangerouslySetInnerHTML" ? (s = s ? s.__html : void 0, u = u ? u.__html : void 0, s != null && u !== s && (i = i || []).push(d, s)) : d === "children" ? typeof s != "string" && typeof s != "number" || (i = i || []).push(d, "" + s) : d !== "suppressContentEditableWarning" && d !== "suppressHydrationWarning" && ($n.hasOwnProperty(d) ? (s != null && d === "onScroll" && z1("scroll", e), i || u === s || (i = [])) : typeof s == "object" && s !== null && s.$$typeof === vl ? s.toString() : (i = i || []).push(d, s)); } @@ -4231,8 +4163,7 @@ var ia = Bn((re1)=>{ case "select": e._wrapperState = { wasMultiple: !!r.multiple - }, l = R({ - }, r, { + }, l = R({}, r, { value: void 0 }), z1("invalid", e); break; @@ -4516,8 +4447,7 @@ Error generating stack: ` + i.message + ` function As(e, n) { if (nn && typeof nn.onCommitFiberUnmount == "function") try { nn.onCommitFiberUnmount(ci, n); - } catch (i) { - } + } catch (i) {} switch(n.tag){ case 0: case 11: @@ -5233,8 +5163,7 @@ Add a component higher in the tree to provide a loading else for(g1 = r; g1 !== null;)n = g1.nextEffect, g1.nextEffect = null, g1.flags & 8 && (w = g1, w.sibling = null, w.stateNode = null), g1 = n; if (r = e.pendingLanes, r === 0 && (ge1 = null), r === 1 ? e === to ? Rt++ : (Rt = 0, to = e) : Rt = 0, t = t.stateNode, nn && typeof nn.onCommitFiberRoot == "function") try { nn.onCommitFiberRoot(ci, t, void 0, (t.current.flags & 64) == 64); - } catch (P) { - } + } catch (P) {} if (se(e, $()), Wr) throw Wr = !1, e = $i, $i = null, e; return (x & 8) != 0 || me1(), null; } @@ -5312,8 +5241,7 @@ Add a component higher in the tree to provide a loading if (Ve(t, l), l = ne(), t = Xr(t, 1), t !== null) or(t, 1, l), se(t, l); else if (typeof r.componentDidCatch == "function" && (ge1 === null || !ge1.has(r))) try { r.componentDidCatch(n, e); - } catch (i) { - } + } catch (i) {} break; } } @@ -5814,8 +5742,7 @@ Add a component higher in the tree to provide a loading }; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && (Ut = __REACT_DEVTOOLS_GLOBAL_HOOK__, !Ut.isDisabled && Ut.supportsFiber)) try { ci = Ut.inject(wc), nn = Ut; - } catch (e2) { - } + } catch (e2) {} var Ut; re1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = gc; re1.createPortal = la; diff --git a/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.inlined.ts index 862153c20e6..123ec273cb5 100644 --- a/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.inlined.ts @@ -27,22 +27,16 @@ function isNumber(x) { function hasKey(obj, keys) { let o = obj; keys.slice(0, -1).forEach((key)=>{ - o = get(o, key) ?? { - }; + o = get(o, key) ?? {}; }); const key1 = keys[keys.length - 1]; return key1 in o; } -function parse(args1, { "--": doubleDash = false , alias: alias3 = { -} , boolean: __boolean = false , default: defaults = { -} , stopEarly =false , string =[] , unknown =(i)=>i - } = { -}) { +function parse(args1, { "--": doubleDash = false , alias: alias3 = {} , boolean: __boolean = false , default: defaults = {} , stopEarly =false , string =[] , unknown =(i)=>i + } = {}) { const flags = { - bools: { - }, - strings: { - }, + bools: {}, + strings: {}, unknownFn: unknown, allBools: false }; @@ -58,8 +52,7 @@ function parse(args1, { "--": doubleDash = false , alias: alias3 = { } } } - const aliases = { - }; + const aliases = {}; if (alias3 !== undefined) { for(const key in alias3){ const val = getForce(alias3, key); @@ -102,8 +95,7 @@ function parse(args1, { "--": doubleDash = false , alias: alias3 = { let o = obj; keys.slice(0, -1).forEach(function(key) { if (get(o, key) === undefined) { - o[key] = { - }; + o[key] = {}; } o = get(o, key); }); diff --git a/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.ts index 862153c20e6..123ec273cb5 100644 --- a/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9219/case1/output/entry.ts @@ -27,22 +27,16 @@ function isNumber(x) { function hasKey(obj, keys) { let o = obj; keys.slice(0, -1).forEach((key)=>{ - o = get(o, key) ?? { - }; + o = get(o, key) ?? {}; }); const key1 = keys[keys.length - 1]; return key1 in o; } -function parse(args1, { "--": doubleDash = false , alias: alias3 = { -} , boolean: __boolean = false , default: defaults = { -} , stopEarly =false , string =[] , unknown =(i)=>i - } = { -}) { +function parse(args1, { "--": doubleDash = false , alias: alias3 = {} , boolean: __boolean = false , default: defaults = {} , stopEarly =false , string =[] , unknown =(i)=>i + } = {}) { const flags = { - bools: { - }, - strings: { - }, + bools: {}, + strings: {}, unknownFn: unknown, allBools: false }; @@ -58,8 +52,7 @@ function parse(args1, { "--": doubleDash = false , alias: alias3 = { } } } - const aliases = { - }; + const aliases = {}; if (alias3 !== undefined) { for(const key in alias3){ const val = getForce(alias3, key); @@ -102,8 +95,7 @@ function parse(args1, { "--": doubleDash = false , alias: alias3 = { let o = obj; keys.slice(0, -1).forEach(function(key) { if (get(o, key) === undefined) { - o[key] = { - }; + o[key] = {}; } o = get(o, key); }); diff --git a/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.inlined.ts index f371a28054d..c3080e776a3 100644 --- a/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.inlined.ts @@ -93,8 +93,7 @@ const JpegImage = function jpegImage() { const dctSin6 = 3784; const dctSqrt2 = 5793; const dctSqrt1d2 = 2896; - function constructor() { - } + function constructor() {} function buildHuffmanTable(codeLengths, values) { let k = 0; const code = []; @@ -532,8 +531,7 @@ const JpegImage = function jpegImage() { return a < 0 ? 0 : a > 255 ? 255 : a; } constructor.prototype = { - load: function load(path) { - }, + load: function load(path) {}, parse: function parse(data) { let offset = 0; function readUint16() { @@ -674,15 +672,13 @@ const JpegImage = function jpegImage() { case 65473: case 65474: readUint16(); - frame1 = { - }; + frame1 = {}; frame1.extended = fileMarker === 65473; frame1.progressive = fileMarker === 65474; frame1.precision = data[offset++]; frame1.scanLines = readUint16(); frame1.samplesPerLine = readUint16(); - frame1.components = { - }; + frame1.components = {}; frame1.componentsOrder = []; let componentsCount = data[offset++], componentId; for(i = 0; i < componentsCount; i++){ diff --git a/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.ts index f371a28054d..c3080e776a3 100644 --- a/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9220/case1/output/entry.ts @@ -93,8 +93,7 @@ const JpegImage = function jpegImage() { const dctSin6 = 3784; const dctSqrt2 = 5793; const dctSqrt1d2 = 2896; - function constructor() { - } + function constructor() {} function buildHuffmanTable(codeLengths, values) { let k = 0; const code = []; @@ -532,8 +531,7 @@ const JpegImage = function jpegImage() { return a < 0 ? 0 : a > 255 ? 255 : a; } constructor.prototype = { - load: function load(path) { - }, + load: function load(path) {}, parse: function parse(data) { let offset = 0; function readUint16() { @@ -674,15 +672,13 @@ const JpegImage = function jpegImage() { case 65473: case 65474: readUint16(); - frame1 = { - }; + frame1 = {}; frame1.extended = fileMarker === 65473; frame1.progressive = fileMarker === 65474; frame1.precision = data[offset++]; frame1.scanLines = readUint16(); frame1.samplesPerLine = readUint16(); - frame1.components = { - }; + frame1.components = {}; frame1.componentsOrder = []; let componentsCount = data[offset++], componentId; for(i = 0; i < componentsCount; i++){ diff --git a/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.inlined.ts index f36e4968d63..93ffb17a009 100644 --- a/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.inlined.ts @@ -1,5 +1,4 @@ -const foo = { -}; +const foo = {}; bar(); function bar() { console.log(foo); diff --git a/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.ts index f36e4968d63..93ffb17a009 100644 --- a/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9250/case1/output/entry.ts @@ -1,5 +1,4 @@ -const foo = { -}; +const foo = {}; bar(); function bar() { console.log(foo); diff --git a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts index 3e20469ada2..4455c652d2b 100644 --- a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts @@ -27,22 +27,16 @@ function isNumber(x) { function hasKey(obj, keys) { let o = obj; keys.slice(0, -1).forEach((key)=>{ - o = get(o, key) ?? { - }; + o = get(o, key) ?? {}; }); const key1 = keys[keys.length - 1]; return key1 in o; } -function parse(args, { "--": doubleDash = false , alias: alias3 = { -} , boolean: __boolean = false , default: defaults = { -} , stopEarly =false , string =[] , unknown =(i1)=>i1 - } = { -}) { +function parse(args, { "--": doubleDash = false , alias: alias3 = {} , boolean: __boolean = false , default: defaults = {} , stopEarly =false , string =[] , unknown =(i1)=>i1 + } = {}) { const flags = { - bools: { - }, - strings: { - }, + bools: {}, + strings: {}, unknownFn: unknown, allBools: false }; @@ -58,8 +52,7 @@ function parse(args, { "--": doubleDash = false , alias: alias3 = { } } } - const aliases = { - }; + const aliases = {}; if (alias3 !== undefined) { for(const key in alias3){ const val = getForce(alias3, key); @@ -102,8 +95,7 @@ function parse(args, { "--": doubleDash = false , alias: alias3 = { let o = obj; keys.slice(0, -1).forEach(function(key) { if (get(o, key) === undefined) { - o[key] = { - }; + o[key] = {}; } o = get(o, key); }); @@ -284,8 +276,7 @@ function normalizeString(path2, allowAboveRoot, separator, isPathSeparator1) { else if (isPathSeparator1(code4)) break; else code4 = CHAR_FORWARD_SLASH; if (isPathSeparator1(code4)) { - if (lastSlash === i3 - 1 || dots === 1) { - } else if (lastSlash !== i3 - 1 && dots === 2) { + if (lastSlash === i3 - 1 || dots === 1) {} else if (lastSlash !== i3 - 1 && dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) { if (res.length > 2) { const lastSlashIndex = res.lastIndexOf(separator); @@ -1344,8 +1335,7 @@ const rangeEscapeChars = [ "\\", "]" ]; -function globToRegExp(glob, { extended =true , globstar: globstarOption = true , os =NATIVE_OS } = { -}) { +function globToRegExp(glob, { extended =true , globstar: globstarOption = true , os =NATIVE_OS } = {}) { if (glob == "") { return /(?!)/; } @@ -1568,8 +1558,7 @@ function isGlob(str) { } return false; } -function normalizeGlob(glob, { globstar =false } = { -}) { +function normalizeGlob(glob, { globstar =false } = {}) { if (glob.match(/\0/g)) { throw new Error(`Glob contains invalid characters: "${glob}"`); } @@ -1580,8 +1569,7 @@ function normalizeGlob(glob, { globstar =false } = { const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g"); return normalize2(glob.replace(badParentPattern, "\0")).replace(/\0/g, ".."); } -function joinGlobs(globs, { extended =false , globstar =false } = { -}) { +function joinGlobs(globs, { extended =false , globstar =false } = {}) { if (!globstar || globs.length == 0) { return join2(...globs); } @@ -1634,8 +1622,7 @@ var LogLevels; LogLevels1[LogLevels1["WARNING"] = 30] = "WARNING"; LogLevels1[LogLevels1["ERROR"] = 40] = "ERROR"; LogLevels1[LogLevels1["CRITICAL"] = 50] = "CRITICAL"; -})(LogLevels || (LogLevels = { -})); +})(LogLevels || (LogLevels = {})); Object.keys(LogLevels).filter((key)=>isNaN(Number(key)) ); const byLevel = { @@ -1697,8 +1684,7 @@ class Logger { #level; #handlers; #loggerName; - constructor(loggerName, levelName, options = { - }){ + constructor(loggerName, levelName, options = {}){ this.#loggerName = loggerName; this.#level = getLevelByName(levelName); this.#handlers = options.handlers || []; @@ -2195,8 +2181,7 @@ class BufWriterSync extends AbstractBufBase { } const DEFAULT_FORMATTER = "{levelName} {msg}"; class BaseHandler { - constructor(levelName, options = { - }){ + constructor(levelName, options = {}){ this.level = getLevelByName(levelName); this.levelName = levelName; this.formatter = options.formatter || DEFAULT_FORMATTER; @@ -2218,12 +2203,9 @@ class BaseHandler { return String(value); }); } - log(_msg) { - } - async setup() { - } - async destroy() { - } + log(_msg) {} + async setup() {} + async destroy() {} } class ConsoleHandler extends BaseHandler { format(logRecord) { @@ -2446,16 +2428,14 @@ async function setup(config) { handler.destroy(); }); state.handlers.clear(); - const handlers1 = state.config.handlers || { - }; + const handlers1 = state.config.handlers || {}; for(const handlerName1 in handlers1){ const handler = handlers1[handlerName1]; await handler.setup(); state.handlers.set(handlerName1, handler); } state.loggers.clear(); - const loggers = state.config.loggers || { - }; + const loggers = state.config.loggers || {}; for(const loggerName in loggers){ const loggerConfig = loggers[loggerName]; const handlerNames = loggerConfig.handlers || []; @@ -2714,8 +2694,7 @@ function include(path28, exts, match, skip) { } return true; } -async function* walk(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = { -}) { +async function* walk(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = {}) { if (maxDepth < 0) { return; } @@ -2755,8 +2734,7 @@ async function* walk(root, { maxDepth =Infinity , includeFiles =true , includeDi } } } -function* walkSync(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = { -}) { +function* walkSync(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = {}) { if (maxDepth < 0) { return; } @@ -2818,8 +2796,7 @@ function comparePath(a, b) { if (a.path > b.path) return 1; return 0; } -async function* expandGlob(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = { -}) { +async function* expandGlob(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = {}) { const globOptions = { extended, globstar @@ -2911,8 +2888,7 @@ async function* expandGlob(glob, { root =Deno.cwd() , exclude =[] , includeDirs } yield* currentMatches; } -function* expandGlobSync(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = { -}) { +function* expandGlobSync(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = {}) { const globOptions = { extended, globstar @@ -3004,8 +2980,7 @@ function* expandGlobSync(glob, { root =Deno.cwd() , exclude =[] , includeDirs =t } yield* currentMatches; } -async function move(src7, dest, { overwrite =false } = { -}) { +async function move(src7, dest, { overwrite =false } = {}) { const srcStat = await Deno.stat(src7); if (srcStat.isDirectory && isSubdir(src7, dest)) { throw new Error(`Cannot move '${src7}' to a subdirectory of itself, '${dest}'.`); @@ -3025,8 +3000,7 @@ async function move(src7, dest, { overwrite =false } = { } return; } -function moveSync(src8, dest, { overwrite =false } = { -}) { +function moveSync(src8, dest, { overwrite =false } = {}) { const srcStat = Deno.statSync(src8); if (srcStat.isDirectory && isSubdir(src8, dest)) { throw new Error(`Cannot move '${src8}' to a subdirectory of itself, '${dest}'.`); @@ -3185,8 +3159,7 @@ function copyDirSync(src16, dest, options) { } } } -async function copy(src17, dest, options = { -}) { +async function copy(src17, dest, options = {}) { src17 = resolve2(src17); dest = resolve2(dest); if (src17 === dest) { @@ -3204,8 +3177,7 @@ async function copy(src17, dest, options = { await copyFile(src17, dest, options); } } -function copySync(src18, dest, options = { -}) { +function copySync(src18, dest, options = {}) { src18 = resolve2(src18); dest = resolve2(dest); if (src18 === dest) { @@ -3227,8 +3199,7 @@ var EOL; (function(EOL1) { EOL1["LF"] = "\n"; EOL1["CRLF"] = "\r\n"; -})(EOL || (EOL = { -})); +})(EOL || (EOL = {})); const regDetect = /(?:\r?\n)/g; function detect(content) { const d = content.match(regDetect); @@ -3548,10 +3519,8 @@ async function init(input) { if (typeof input === 'undefined') { input = importMeta.url.replace(/\.js$/, '_bg.wasm'); } - const imports = { - }; - imports.wbg = { - }; + const imports = {}; + imports.wbg = {}; imports.wbg.__wbindgen_string_new = function(arg0, arg1) { var ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); @@ -4106,8 +4075,7 @@ function cmp(v1, operator, v2, optionsOrLoose) { throw new TypeError("Invalid operator: " + operator); } } -const ANY = { -}; +const ANY = {}; class Comparator { constructor(comp, optionsOrLoose){ if (!optionsOrLoose || typeof optionsOrLoose !== "object") { @@ -5209,8 +5177,7 @@ function stringMapJsonBinding(dresolver, texpr, boundTypeParams) { const elementBinding = once(()=>buildJsonBinding(dresolver, texpr, boundTypeParams) ); function toJson(v) { - const result = { - }; + const result = {}; for(let k in v){ result[k] = elementBinding().toJson(v[k]); } @@ -5221,8 +5188,7 @@ function stringMapJsonBinding(dresolver, texpr, boundTypeParams) { if (!jobj) { throw jsonParseException('expected an object'); } - let result = { - }; + let result = {}; for(let k in jobj){ try { result[k] = elementBinding().fromJson(jobj[k]); @@ -5282,8 +5248,7 @@ function structJsonBinding(dresolver, struct, params, boundTypeParams) { }); function toJson(v0) { const v = v0; - const json = { - }; + const json = {}; fieldDetails.forEach((fd)=>{ json[fd.field.serializedName] = fd.jsonBinding().toJson(v && v[fd.field.name]); }); @@ -5294,8 +5259,7 @@ function structJsonBinding(dresolver, struct, params, boundTypeParams) { if (!jobj) { throw jsonParseException("expected an object"); } - const v = { - }; + const v = {}; fieldDetails.forEach((fd)=>{ if (jobj[fd.field.serializedName] === undefined) { const defaultv = fd.buildDefault(); @@ -5324,8 +5288,7 @@ function structJsonBinding(dresolver, struct, params, boundTypeParams) { } function enumJsonBinding(_dresolver, union, _params, _boundTypeParams) { const fieldSerializedNames = []; - const fieldNumbers = { - }; + const fieldNumbers = {}; union.fields.forEach((field, i37)=>{ fieldSerializedNames.push(field.serializedName); fieldNumbers[field.serializedName] = i37; @@ -5350,10 +5313,8 @@ function enumJsonBinding(_dresolver, union, _params, _boundTypeParams) { } function unionJsonBinding(dresolver, union, params, boundTypeParams) { const newBoundTypeParams = createBoundTypeParams(dresolver, union.typeParams, params, boundTypeParams); - const detailsByName = { - }; - const detailsBySerializedName = { - }; + const detailsByName = {}; + const detailsBySerializedName = {}; union.fields.forEach((field)=>{ const details = { field: field, @@ -5370,8 +5331,7 @@ function unionJsonBinding(dresolver, union, params, boundTypeParams) { if (details.isVoid) { return details.field.serializedName; } else { - const result = { - }; + const result = {}; result[details.field.serializedName] = details.jsonBinding().toJson(v.value); return result; } @@ -5428,8 +5388,7 @@ function typedefJsonBinding(dresolver, typedef, params, boundTypeParams) { return buildJsonBinding(dresolver, typedef.typeExpr, newBoundTypeParams); } function createBoundTypeParams(dresolver, paramNames, paramTypes, boundTypeParams) { - let result = { - }; + let result = {}; paramNames.forEach((paramName, i)=>{ result[paramName] = buildJsonBinding(dresolver, paramTypes[i], boundTypeParams); }); @@ -5445,8 +5404,7 @@ function once(run1) { }; } function declResolver(...astMaps) { - const astMap = { - }; + const astMap = {}; for (let map of astMaps){ for(let scopedName in map){ astMap[scopedName] = map[scopedName]; diff --git a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts index bad3ae101d1..a679e548d1d 100644 --- a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts @@ -27,22 +27,16 @@ function isNumber(x) { function hasKey(obj, keys) { let o = obj; keys.slice(0, -1).forEach((key)=>{ - o = get(o, key) ?? { - }; + o = get(o, key) ?? {}; }); const key1 = keys[keys.length - 1]; return key1 in o; } -function parse(args, { "--": doubleDash = false , alias: alias3 = { -} , boolean: __boolean = false , default: defaults = { -} , stopEarly =false , string =[] , unknown =(i1)=>i1 - } = { -}) { +function parse(args, { "--": doubleDash = false , alias: alias3 = {} , boolean: __boolean = false , default: defaults = {} , stopEarly =false , string =[] , unknown =(i1)=>i1 + } = {}) { const flags = { - bools: { - }, - strings: { - }, + bools: {}, + strings: {}, unknownFn: unknown, allBools: false }; @@ -58,8 +52,7 @@ function parse(args, { "--": doubleDash = false , alias: alias3 = { } } } - const aliases = { - }; + const aliases = {}; if (alias3 !== undefined) { for(const key in alias3){ const val = getForce(alias3, key); @@ -102,8 +95,7 @@ function parse(args, { "--": doubleDash = false , alias: alias3 = { let o = obj; keys.slice(0, -1).forEach(function(key) { if (get(o, key) === undefined) { - o[key] = { - }; + o[key] = {}; } o = get(o, key); }); @@ -292,8 +284,7 @@ function normalizeString(path2, allowAboveRoot, separator, isPathSeparator1) { else if (isPathSeparator1(code4)) break; else code4 = CHAR_FORWARD_SLASH; if (isPathSeparator1(code4)) { - if (lastSlash === i3 - 1 || dots === 1) { - } else if (lastSlash !== i3 - 1 && dots === 2) { + if (lastSlash === i3 - 1 || dots === 1) {} else if (lastSlash !== i3 - 1 && dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { if (res.length > 2) { const lastSlashIndex = res.lastIndexOf(separator); @@ -1354,8 +1345,7 @@ const rangeEscapeChars = [ "\\", "]" ]; -function globToRegExp(glob, { extended =true , globstar: globstarOption = true , os =NATIVE_OS } = { -}) { +function globToRegExp(glob, { extended =true , globstar: globstarOption = true , os =NATIVE_OS } = {}) { if (glob == "") { return /(?!)/; } @@ -1578,8 +1568,7 @@ function isGlob(str) { } return false; } -function normalizeGlob(glob, { globstar =false } = { -}) { +function normalizeGlob(glob, { globstar =false } = {}) { if (glob.match(/\0/g)) { throw new Error(`Glob contains invalid characters: "${glob}"`); } @@ -1590,8 +1579,7 @@ function normalizeGlob(glob, { globstar =false } = { const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g"); return normalize2(glob.replace(badParentPattern, "\0")).replace(/\0/g, ".."); } -function joinGlobs(globs, { extended =false , globstar =false } = { -}) { +function joinGlobs(globs, { extended =false , globstar =false } = {}) { if (!globstar || globs.length == 0) { return join2(...globs); } @@ -1644,8 +1632,7 @@ var LogLevels; LogLevels1[LogLevels1["WARNING"] = 30] = "WARNING"; LogLevels1[LogLevels1["ERROR"] = 40] = "ERROR"; LogLevels1[LogLevels1["CRITICAL"] = 50] = "CRITICAL"; -})(LogLevels || (LogLevels = { -})); +})(LogLevels || (LogLevels = {})); Object.keys(LogLevels).filter((key)=>isNaN(Number(key)) ); const byLevel = { @@ -1707,8 +1694,7 @@ class Logger { #level; #handlers; #loggerName; - constructor(loggerName, levelName, options = { - }){ + constructor(loggerName, levelName, options = {}){ this.#loggerName = loggerName; this.#level = getLevelByName(levelName); this.#handlers = options.handlers || []; @@ -2206,8 +2192,7 @@ class BufWriterSync extends AbstractBufBase { } const DEFAULT_FORMATTER = "{levelName} {msg}"; class BaseHandler { - constructor(levelName, options = { - }){ + constructor(levelName, options = {}){ this.level = getLevelByName(levelName); this.levelName = levelName; this.formatter = options.formatter || DEFAULT_FORMATTER; @@ -2229,12 +2214,9 @@ class BaseHandler { return String(value); }); } - log(_msg) { - } - async setup() { - } - async destroy() { - } + log(_msg) {} + async setup() {} + async destroy() {} } class ConsoleHandler extends BaseHandler { format(logRecord) { @@ -2457,16 +2439,14 @@ async function setup(config) { handler.destroy(); }); state.handlers.clear(); - const handlers1 = state.config.handlers || { - }; + const handlers1 = state.config.handlers || {}; for(const handlerName1 in handlers1){ const handler = handlers1[handlerName1]; await handler.setup(); state.handlers.set(handlerName1, handler); } state.loggers.clear(); - const loggers = state.config.loggers || { - }; + const loggers = state.config.loggers || {}; for(const loggerName in loggers){ const loggerConfig = loggers[loggerName]; const handlerNames = loggerConfig.handlers || []; @@ -2725,8 +2705,7 @@ function include(path28, exts, match, skip) { } return true; } -async function* walk(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = { -}) { +async function* walk(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = {}) { if (maxDepth < 0) { return; } @@ -2766,8 +2745,7 @@ async function* walk(root, { maxDepth =Infinity , includeFiles =true , includeDi } } } -function* walkSync(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = { -}) { +function* walkSync(root, { maxDepth =Infinity , includeFiles =true , includeDirs =true , followSymlinks =false , exts =undefined , match =undefined , skip =undefined } = {}) { if (maxDepth < 0) { return; } @@ -2829,8 +2807,7 @@ function comparePath(a, b) { if (a.path > b.path) return 1; return 0; } -async function* expandGlob(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = { -}) { +async function* expandGlob(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = {}) { const globOptions = { extended, globstar @@ -2922,8 +2899,7 @@ async function* expandGlob(glob, { root =Deno.cwd() , exclude =[] , includeDirs } yield* currentMatches; } -function* expandGlobSync(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = { -}) { +function* expandGlobSync(glob, { root =Deno.cwd() , exclude =[] , includeDirs =true , extended =false , globstar =false } = {}) { const globOptions = { extended, globstar @@ -3015,8 +2991,7 @@ function* expandGlobSync(glob, { root =Deno.cwd() , exclude =[] , includeDirs =t } yield* currentMatches; } -async function move(src7, dest, { overwrite =false } = { -}) { +async function move(src7, dest, { overwrite =false } = {}) { const srcStat = await Deno.stat(src7); if (srcStat.isDirectory && isSubdir(src7, dest)) { throw new Error(`Cannot move '${src7}' to a subdirectory of itself, '${dest}'.`); @@ -3036,8 +3011,7 @@ async function move(src7, dest, { overwrite =false } = { } return; } -function moveSync(src8, dest, { overwrite =false } = { -}) { +function moveSync(src8, dest, { overwrite =false } = {}) { const srcStat = Deno.statSync(src8); if (srcStat.isDirectory && isSubdir(src8, dest)) { throw new Error(`Cannot move '${src8}' to a subdirectory of itself, '${dest}'.`); @@ -3196,8 +3170,7 @@ function copyDirSync(src16, dest, options) { } } } -async function copy(src17, dest, options = { -}) { +async function copy(src17, dest, options = {}) { src17 = resolve2(src17); dest = resolve2(dest); if (src17 === dest) { @@ -3215,8 +3188,7 @@ async function copy(src17, dest, options = { await copyFile(src17, dest, options); } } -function copySync(src18, dest, options = { -}) { +function copySync(src18, dest, options = {}) { src18 = resolve2(src18); dest = resolve2(dest); if (src18 === dest) { @@ -3238,8 +3210,7 @@ var EOL; (function(EOL1) { EOL1["LF"] = "\n"; EOL1["CRLF"] = "\r\n"; -})(EOL || (EOL = { -})); +})(EOL || (EOL = {})); const regDetect = /(?:\r?\n)/g; function detect(content) { const d = content.match(regDetect); @@ -3559,10 +3530,8 @@ async function init(input) { if (typeof input === 'undefined') { input = importMeta.url.replace(/\.js$/, '_bg.wasm'); } - const imports = { - }; - imports.wbg = { - }; + const imports = {}; + imports.wbg = {}; imports.wbg.__wbindgen_string_new = function(arg0, arg1) { var ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); @@ -4118,8 +4087,7 @@ function cmp(v1, operator, v2, optionsOrLoose) { throw new TypeError("Invalid operator: " + operator); } } -const ANY = { -}; +const ANY = {}; class Comparator { constructor(comp, optionsOrLoose){ if (!optionsOrLoose || typeof optionsOrLoose !== "object") { @@ -5221,8 +5189,7 @@ function stringMapJsonBinding(dresolver, texpr, boundTypeParams) { const elementBinding = once(()=>buildJsonBinding(dresolver, texpr, boundTypeParams) ); function toJson(v) { - const result = { - }; + const result = {}; for(let k in v){ result[k] = elementBinding().toJson(v[k]); } @@ -5233,8 +5200,7 @@ function stringMapJsonBinding(dresolver, texpr, boundTypeParams) { if (!jobj) { throw jsonParseException('expected an object'); } - let result = { - }; + let result = {}; for(let k in jobj){ try { result[k] = elementBinding().fromJson(jobj[k]); @@ -5294,8 +5260,7 @@ function structJsonBinding(dresolver, struct, params, boundTypeParams) { }); function toJson(v0) { const v = v0; - const json = { - }; + const json = {}; fieldDetails.forEach((fd)=>{ json[fd.field.serializedName] = fd.jsonBinding().toJson(v && v[fd.field.name]); }); @@ -5306,8 +5271,7 @@ function structJsonBinding(dresolver, struct, params, boundTypeParams) { if (!jobj) { throw jsonParseException("expected an object"); } - const v = { - }; + const v = {}; fieldDetails.forEach((fd)=>{ if (jobj[fd.field.serializedName] === undefined) { const defaultv = fd.buildDefault(); @@ -5336,8 +5300,7 @@ function structJsonBinding(dresolver, struct, params, boundTypeParams) { } function enumJsonBinding(_dresolver, union, _params, _boundTypeParams) { const fieldSerializedNames = []; - const fieldNumbers = { - }; + const fieldNumbers = {}; union.fields.forEach((field, i37)=>{ fieldSerializedNames.push(field.serializedName); fieldNumbers[field.serializedName] = i37; @@ -5362,10 +5325,8 @@ function enumJsonBinding(_dresolver, union, _params, _boundTypeParams) { } function unionJsonBinding(dresolver, union, params, boundTypeParams) { const newBoundTypeParams = createBoundTypeParams(dresolver, union.typeParams, params, boundTypeParams); - const detailsByName = { - }; - const detailsBySerializedName = { - }; + const detailsByName = {}; + const detailsBySerializedName = {}; union.fields.forEach((field)=>{ const details = { field: field, @@ -5382,8 +5343,7 @@ function unionJsonBinding(dresolver, union, params, boundTypeParams) { if (details.isVoid) { return details.field.serializedName; } else { - const result = { - }; + const result = {}; result[details.field.serializedName] = details.jsonBinding().toJson(v.value); return result; } @@ -5440,8 +5400,7 @@ function typedefJsonBinding(dresolver, typedef, params, boundTypeParams) { return buildJsonBinding(dresolver, typedef.typeExpr, newBoundTypeParams); } function createBoundTypeParams(dresolver, paramNames, paramTypes, boundTypeParams) { - let result = { - }; + let result = {}; paramNames.forEach((paramName, i)=>{ result[paramName] = buildJsonBinding(dresolver, paramTypes[i], boundTypeParams); }); @@ -5457,8 +5416,7 @@ function once(run1) { }; } function declResolver(...astMaps) { - const astMap = { - }; + const astMap = {}; for (let map of astMaps){ for(let scopedName in map){ astMap[scopedName] = map[scopedName]; diff --git a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts index b540d9ac718..fb8e1517e1e 100644 --- a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts @@ -179,8 +179,7 @@ function normalizeString(path2, allowAboveRoot, separator, isPathSeparator1) { else if (isPathSeparator1(code)) break; else code = CHAR_FORWARD_SLASH; if (isPathSeparator1(code)) { - if (lastSlash === i - 1 || dots === 1) { - } else if (lastSlash !== i - 1 && dots === 2) { + if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) { if (res.length > 2) { const lastSlashIndex = res.lastIndexOf(separator); @@ -1604,8 +1603,7 @@ class TextProtoReader { const value = str(kv.subarray(i)).replace(invalidHeaderCharRegex, encodeURI); try { m.append(key, value); - } catch { - } + } catch {} } } async readLineSlice() { @@ -1719,13 +1717,11 @@ class PartReader { this.total += nread; return nread; } - close() { - } + close() {} getContentDispositionParams() { if (this.contentDispositionParams) return this.contentDispositionParams; const cd = this.headers.get("content-disposition"); - const params = { - }; + const params = {}; assert(cd != null, "content-disposition must be set"); const comps = decodeURI(cd).split(";"); this.contentDisposition = comps[0]; diff --git a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts index e5217e65a10..8002f59aa4a 100644 --- a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts @@ -187,8 +187,7 @@ function normalizeString(path2, allowAboveRoot, separator, isPathSeparator1) { else if (isPathSeparator1(code)) break; else code = CHAR_FORWARD_SLASH; if (isPathSeparator1(code)) { - if (lastSlash === i - 1 || dots === 1) { - } else if (lastSlash !== i - 1 && dots === 2) { + if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { if (res.length > 2) { const lastSlashIndex = res.lastIndexOf(separator); @@ -1613,8 +1612,7 @@ class TextProtoReader { const value = str(kv.subarray(i)).replace(invalidHeaderCharRegex, encodeURI); try { m.append(key, value); - } catch { - } + } catch {} } } async readLineSlice() { @@ -1728,13 +1726,11 @@ class PartReader { this.total += nread; return nread; } - close() { - } + close() {} getContentDispositionParams() { if (this.contentDispositionParams) return this.contentDispositionParams; const cd = this.headers.get("content-disposition"); - const params = { - }; + const params = {}; assert(cd != null, "content-disposition must be set"); const comps = decodeURI(cd).split(";"); this.contentDisposition = comps[0]; diff --git a/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.inlined.ts index 8a149f06bac..47d4d904706 100644 --- a/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.inlined.ts @@ -6,14 +6,12 @@ var O; O1[O1["A"] = 0] = "A"; O1[O1["B"] = 1] = "B"; O1[O1["C"] = 2] = "C"; -})(O || (O = { -})); +})(O || (O = {})); export { O as O }; class A { #a; #c; - constructor(o = { - }){ + constructor(o = {}){ const { a: a2 = a , c , } = o; this.#a = a2; this.#c = c; diff --git a/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.ts b/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.ts index 8a149f06bac..47d4d904706 100644 --- a/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/issue-1150-2/output/entry.ts @@ -6,14 +6,12 @@ var O; O1[O1["A"] = 0] = "A"; O1[O1["B"] = 1] = "B"; O1[O1["C"] = 2] = "C"; -})(O || (O = { -})); +})(O || (O = {})); export { O as O }; class A { #a; #c; - constructor(o = { - }){ + constructor(o = {}){ const { a: a2 = a , c , } = o; this.#a = a2; this.#c = c; diff --git a/crates/swc_bundler/tests/fixture/issue-1150/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/issue-1150/output/entry.inlined.ts index 8a149f06bac..47d4d904706 100644 --- a/crates/swc_bundler/tests/fixture/issue-1150/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/issue-1150/output/entry.inlined.ts @@ -6,14 +6,12 @@ var O; O1[O1["A"] = 0] = "A"; O1[O1["B"] = 1] = "B"; O1[O1["C"] = 2] = "C"; -})(O || (O = { -})); +})(O || (O = {})); export { O as O }; class A { #a; #c; - constructor(o = { - }){ + constructor(o = {}){ const { a: a2 = a , c , } = o; this.#a = a2; this.#c = c; diff --git a/crates/swc_bundler/tests/fixture/issue-1150/output/entry.ts b/crates/swc_bundler/tests/fixture/issue-1150/output/entry.ts index 8a149f06bac..47d4d904706 100644 --- a/crates/swc_bundler/tests/fixture/issue-1150/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/issue-1150/output/entry.ts @@ -6,14 +6,12 @@ var O; O1[O1["A"] = 0] = "A"; O1[O1["B"] = 1] = "B"; O1[O1["C"] = 2] = "C"; -})(O || (O = { -})); +})(O || (O = {})); export { O as O }; class A { #a; #c; - constructor(o = { - }){ + constructor(o = {}){ const { a: a2 = a , c , } = o; this.#a = a2; this.#c = c; diff --git a/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts index dfdea7caa92..c3f6b779b2e 100644 --- a/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.inlined.ts @@ -3,13 +3,11 @@ function __swcpack_require__(mod) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { @@ -27,8 +25,7 @@ function __swcpack_require__(mod) { return cache; } var module = { - exports: { - } + exports: {} }; mod(module, module.exports); cache = interop(module.exports); diff --git a/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.ts b/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.ts index dfdea7caa92..c3f6b779b2e 100644 --- a/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/issue-2124/named-export/output/entry.ts @@ -3,13 +3,11 @@ function __swcpack_require__(mod) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { @@ -27,8 +25,7 @@ function __swcpack_require__(mod) { return cache; } var module = { - exports: { - } + exports: {} }; mod(module, module.exports); cache = interop(module.exports); diff --git a/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts index 22797e23d4d..14e9531f69a 100644 --- a/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.inlined.ts @@ -3,13 +3,11 @@ function __swcpack_require__(mod) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { @@ -27,8 +25,7 @@ function __swcpack_require__(mod) { return cache; } var module = { - exports: { - } + exports: {} }; mod(module, module.exports); cache = interop(module.exports); diff --git a/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts b/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts index 5273237e42f..a9ea1935637 100644 --- a/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/issue-2124/namespace-export/output/entry.ts @@ -3,13 +3,11 @@ function __swcpack_require__(mod) { if (obj && obj.__esModule) { return obj; } else { - var newObj = { - }; + var newObj = {}; if (obj != null) { for(var key in obj){ if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { @@ -27,8 +25,7 @@ function __swcpack_require__(mod) { return cache; } var module = { - exports: { - } + exports: {} }; mod(module, module.exports); cache = interop(module.exports); diff --git a/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.inlined.ts index 64a5e1b51ca..567db0d0bb0 100644 --- a/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.inlined.ts @@ -1,3 +1,2 @@ -function two() { -} +function two() {} two(); diff --git a/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.ts index 64a5e1b51ca..567db0d0bb0 100644 --- a/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/issue-3043/case1/output/entry.ts @@ -1,3 +1,2 @@ -function two() { -} +function two() {} two(); diff --git a/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.inlined.js b/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.inlined.js index 67a68c36b3a..3935731fdc4 100644 --- a/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.inlined.js +++ b/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.inlined.js @@ -1,6 +1,5 @@ const a = 1; -function foo() { -} +function foo() {} class Class { } export { a as a }; diff --git a/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.js b/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.js index 67a68c36b3a..3935731fdc4 100644 --- a/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.js +++ b/crates/swc_bundler/tests/fixture/reexport/nested/output/entry.js @@ -1,6 +1,5 @@ const a = 1; -function foo() { -} +function foo() {} class Class { } export { a as a }; diff --git a/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.inlined.ts index a9e55a5bbef..0774e15598c 100644 --- a/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.inlined.ts @@ -2,8 +2,7 @@ var A; (function(A1) { A1[A1["b"] = 5] = "b"; A1[A1["c"] = 28] = "c"; -})(A || (A = { -})); +})(A || (A = {})); function foo() { console.log(A); } diff --git a/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.ts b/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.ts index a9e55a5bbef..0774e15598c 100644 --- a/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/sort/enum-access/output/entry.ts @@ -2,8 +2,7 @@ var A; (function(A1) { A1[A1["b"] = 5] = "b"; A1[A1["c"] = 28] = "c"; -})(A || (A = { -})); +})(A || (A = {})); function foo() { console.log(A); } diff --git a/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.inlined.ts index da8efa42471..010d6182bfa 100644 --- a/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.inlined.ts @@ -1,6 +1,5 @@ var Status; (function(Status1) { Status1[Status1["Continue"] = 100] = "Continue"; -})(Status || (Status = { -})); +})(Status || (Status = {})); export { Status as Status }; diff --git a/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.ts b/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.ts index da8efa42471..010d6182bfa 100644 --- a/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/sort/enum-reexport/output/entry.ts @@ -1,6 +1,5 @@ var Status; (function(Status1) { Status1[Status1["Continue"] = 100] = "Continue"; -})(Status || (Status = { -})); +})(Status || (Status = {})); export { Status as Status }; diff --git a/crates/swc_ecma_codegen/src/lib.rs b/crates/swc_ecma_codegen/src/lib.rs index 1819c44e039..0d8aab5ef49 100644 --- a/crates/swc_ecma_codegen/src/lib.rs +++ b/crates/swc_ecma_codegen/src/lib.rs @@ -1594,17 +1594,27 @@ where }; punct!(span, "{"); } - if !self.cfg.minify { + + let emit_new_line = !self.cfg.minify + && !(node.props.len() == 0 && is_empty_comments(&node.span(), &self.comments)); + + if emit_new_line { self.wr.write_line()?; } - self.emit_list( - node.span(), - Some(&node.props), - ListFormat::ObjectLiteralExpressionProperties | ListFormat::CanSkipTrailingComma, - )?; - if !self.cfg.minify { + + let mut list_format = + ListFormat::ObjectLiteralExpressionProperties | ListFormat::CanSkipTrailingComma; + + if !emit_new_line { + list_format -= ListFormat::MultiLine | ListFormat::Indented; + } + + self.emit_list(node.span(), Some(&node.props), list_format)?; + + if emit_new_line { self.wr.write_line()?; } + { let span = if node.span.is_dummy() { DUMMY_SP @@ -1612,7 +1622,7 @@ where Span::new(node.span.hi - BytePos(1), node.span.hi, Default::default()) }; punct!(span, "}"); - } + }; } #[emitter] @@ -2273,11 +2283,17 @@ where }; punct!(span, "{"); } - self.emit_list( - node.span(), - Some(&node.stmts), - ListFormat::MultiLineBlockStatements, - )?; + + let emit_new_line = !self.cfg.minify + && !(node.stmts.len() == 0 && is_empty_comments(&node.span(), &self.comments)); + + let mut list_format = ListFormat::MultiLineBlockStatements; + + if !emit_new_line { + list_format -= ListFormat::MultiLine | ListFormat::Indented; + } + + self.emit_list(node.span(), Some(&node.stmts), list_format)?; self.emit_leading_comments_of_span(node.span(), true)?; @@ -3254,3 +3270,7 @@ fn is_space_require_before_rhs(rhs: &Expr) -> bool { _ => false, } } + +fn is_empty_comments(span: &Span, comments: &Option<&dyn Comments>) -> bool { + return span.is_dummy() || comments.map_or(true, |c| !c.has_leading(span.hi() - BytePos(1))); +} diff --git a/crates/swc_ecma_codegen/src/stmt.rs b/crates/swc_ecma_codegen/src/stmt.rs index 1fa0ef1ee67..6442de4a233 100644 --- a/crates/swc_ecma_codegen/src/stmt.rs +++ b/crates/swc_ecma_codegen/src/stmt.rs @@ -11,6 +11,22 @@ mod tests { assert_min("{foo;}", "{foo}"); } + #[test] + fn empty_block_statement() { + assert_pretty("{\n}", "{}"); + assert_pretty("{\n//todo\n}", "{\n//todo\n}"); + + assert_pretty( + "try {\n\n} catch {\n // Pass\n}\n", + "try {} catch {\n// Pass\n}", + ); + } + + #[test] + fn empty_object_lit() { + assert_pretty("Object.assign({\n}, a, b);", "Object.assign({}, a, b);"); + } + #[test] fn labeled_statement() { assert_min("foo: {}", "foo:{}"); @@ -78,14 +94,14 @@ mod tests { fn for_statement_pretty() { assert_pretty( "for (var i = 0; i < 10; i++) {}", - "for(var i = 0; i < 10; i++){\n}", + "for(var i = 0; i < 10; i++){}", ); - assert_pretty("for (i = 0; i < 10; i++) {}", "for(i = 0; i < 10; i++){\n}"); - assert_pretty("for (;;) {}", "for(;;){\n}"); - assert_pretty("for (foo in bar){}", "for(foo in bar){\n}"); - assert_pretty("for (let foo in bar){}", "for(let foo in bar){\n}"); - assert_pretty("for (foo of bar){}", "for (foo of bar){\n}"); - assert_pretty("for (let foo of bar){}", "for (let foo of bar){\n}"); + assert_pretty("for (i = 0; i < 10; i++) {}", "for(i = 0; i < 10; i++){}"); + assert_pretty("for (;;) {}", "for(;;){}"); + assert_pretty("for (foo in bar){}", "for(foo in bar){}"); + assert_pretty("for (let foo in bar){}", "for(let foo in bar){}"); + assert_pretty("for (foo of bar){}", "for (foo of bar){}"); + assert_pretty("for (let foo of bar){}", "for (let foo of bar){}"); } #[test] diff --git a/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-not-remove-extra-named-export-function-declarations/output.js b/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-not-remove-extra-named-export-function-declarations/output.js index 2c91fa8bdfd..e6cbbf9b6f5 100644 --- a/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-not-remove-extra-named-export-function-declarations/output.js +++ b/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-not-remove-extra-named-export-function-declarations/output.js @@ -1,6 +1,5 @@ export var __N_SSG = true; -export function Noop() { -} +export function Noop() {} export default function Test() { return __jsx('div', null); }; diff --git a/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-remove-re-exported-function-declarations-dependents-variables-functions-imports/output.js b/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-remove-re-exported-function-declarations-dependents-variables-functions-imports/output.js index 7d84af1e926..a6d6d2ab2a5 100644 --- a/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-remove-re-exported-function-declarations-dependents-variables-functions-imports/output.js +++ b/crates/swc_ecma_codegen/tests/fixture/next/ssg/getStaticProps/should-remove-re-exported-function-declarations-dependents-variables-functions-imports/output.js @@ -3,8 +3,7 @@ import { keep_me2 } from 'hello2'; import * as keep_me3 from 'hello3'; import { but_not_me } from 'bar'; var leave_me_alone = 1; -function dont_bug_me_either() { -} +function dont_bug_me_either() {} export var __N_SSG = true; export default function Test() { return __jsx('div', null); diff --git a/crates/swc_ecma_codegen/tests/fixture/semi/pending/001/output.js b/crates/swc_ecma_codegen/tests/fixture/semi/pending/001/output.js index 76e99966f8a..787c64aea01 100644 --- a/crates/swc_ecma_codegen/tests/fixture/semi/pending/001/output.js +++ b/crates/swc_ecma_codegen/tests/fixture/semi/pending/001/output.js @@ -1,3 +1,2 @@ foo; -if (foo) { -} +if (foo) {} diff --git a/crates/swc_ecma_codegen/tests/fixture/semi/pending/006/output.js b/crates/swc_ecma_codegen/tests/fixture/semi/pending/006/output.js index 1640d7cd889..73eaf5617c8 100644 --- a/crates/swc_ecma_codegen/tests/fixture/semi/pending/006/output.js +++ b/crates/swc_ecma_codegen/tests/fixture/semi/pending/006/output.js @@ -1,8 +1,6 @@ "use strict"; -const a = { -}; +const a = {}; for(let b in a)a[b] = a[b].trim(); [ "foo", -].forEach(()=>{ -}); +].forEach(()=>{}); diff --git a/crates/swc_ecma_codegen/tests/test262/006949a4f1471866.js b/crates/swc_ecma_codegen/tests/test262/006949a4f1471866.js index 1e58192f68c..9b22a0a9f26 100644 --- a/crates/swc_ecma_codegen/tests/test262/006949a4f1471866.js +++ b/crates/swc_ecma_codegen/tests/test262/006949a4f1471866.js @@ -1,2 +1 @@ -if (a) { -} +if (a) {} diff --git a/crates/swc_ecma_codegen/tests/test262/0228be549a7706e7.js b/crates/swc_ecma_codegen/tests/test262/0228be549a7706e7.js index 305ac2771b9..ad172c864ba 100644 --- a/crates/swc_ecma_codegen/tests/test262/0228be549a7706e7.js +++ b/crates/swc_ecma_codegen/tests/test262/0228be549a7706e7.js @@ -1,4 +1,3 @@ (class { - prototype() { - } + prototype() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/028846a58c67687f.js b/crates/swc_ecma_codegen/tests/test262/028846a58c67687f.js index cd51699e29d..3df8eb352c6 100644 --- a/crates/swc_ecma_codegen/tests/test262/028846a58c67687f.js +++ b/crates/swc_ecma_codegen/tests/test262/028846a58c67687f.js @@ -1,13 +1,10 @@ { ; }a(); +{}; { -}; -{ - { - } + {} ; }; b(); -{ -} +{} diff --git a/crates/swc_ecma_codegen/tests/test262/03608b6e222ae700.js b/crates/swc_ecma_codegen/tests/test262/03608b6e222ae700.js index 24066145449..bad258ac962 100644 --- a/crates/swc_ecma_codegen/tests/test262/03608b6e222ae700.js +++ b/crates/swc_ecma_codegen/tests/test262/03608b6e222ae700.js @@ -1,2 +1 @@ -a && (()=>{ -}); +a && (()=>{}); diff --git a/crates/swc_ecma_codegen/tests/test262/05089e6cc717523e.js b/crates/swc_ecma_codegen/tests/test262/05089e6cc717523e.js index 550cbed05ab..5c5a78c67e7 100644 --- a/crates/swc_ecma_codegen/tests/test262/05089e6cc717523e.js +++ b/crates/swc_ecma_codegen/tests/test262/05089e6cc717523e.js @@ -1,2 +1 @@ -(function() { -}(1, 2, 3)); +(function() {}(1, 2, 3)); diff --git a/crates/swc_ecma_codegen/tests/test262/05448bc107f9b759.js b/crates/swc_ecma_codegen/tests/test262/05448bc107f9b759.js index 434a4eca77a..ac7ba1832bc 100644 --- a/crates/swc_ecma_codegen/tests/test262/05448bc107f9b759.js +++ b/crates/swc_ecma_codegen/tests/test262/05448bc107f9b759.js @@ -1,8 +1,6 @@ class a { - b() { - } + b() {} ; - c() { - } + c() {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/05fcc31bfd8d3e60.js b/crates/swc_ecma_codegen/tests/test262/05fcc31bfd8d3e60.js index c9a950d5f16..092f0cd5d9c 100644 --- a/crates/swc_ecma_codegen/tests/test262/05fcc31bfd8d3e60.js +++ b/crates/swc_ecma_codegen/tests/test262/05fcc31bfd8d3e60.js @@ -1,2 +1 @@ -function a({ b , c }) { -} +function a({ b , c }) {} diff --git a/crates/swc_ecma_codegen/tests/test262/066b76285ce79182.js b/crates/swc_ecma_codegen/tests/test262/066b76285ce79182.js index 7189b18f317..12fb48921e2 100644 --- a/crates/swc_ecma_codegen/tests/test262/066b76285ce79182.js +++ b/crates/swc_ecma_codegen/tests/test262/066b76285ce79182.js @@ -1,6 +1,4 @@ class a { - set b(c) { - } - get b() { - } + set b(c) {} + get b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/075c7204d0b0af60.js b/crates/swc_ecma_codegen/tests/test262/075c7204d0b0af60.js index 962476ce565..d416f448f0c 100644 --- a/crates/swc_ecma_codegen/tests/test262/075c7204d0b0af60.js +++ b/crates/swc_ecma_codegen/tests/test262/075c7204d0b0af60.js @@ -1,4 +1,3 @@ ({ - get a () { - } + get a () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/0813adc754c82a98.js b/crates/swc_ecma_codegen/tests/test262/0813adc754c82a98.js index 2d88cb4feb4..3678f212c9b 100644 --- a/crates/swc_ecma_codegen/tests/test262/0813adc754c82a98.js +++ b/crates/swc_ecma_codegen/tests/test262/0813adc754c82a98.js @@ -1,4 +1,3 @@ class a { - constructor(){ - } + constructor(){} } diff --git a/crates/swc_ecma_codegen/tests/test262/0827a8316cca777a.js b/crates/swc_ecma_codegen/tests/test262/0827a8316cca777a.js index da8b3aea3a4..19b1612de5d 100644 --- a/crates/swc_ecma_codegen/tests/test262/0827a8316cca777a.js +++ b/crates/swc_ecma_codegen/tests/test262/0827a8316cca777a.js @@ -1,4 +1,3 @@ (class { - get a() { - } + get a() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/08c3105bb3f7ccb7.js b/crates/swc_ecma_codegen/tests/test262/08c3105bb3f7ccb7.js index a8a994ed27c..2aad015c97d 100644 --- a/crates/swc_ecma_codegen/tests/test262/08c3105bb3f7ccb7.js +++ b/crates/swc_ecma_codegen/tests/test262/08c3105bb3f7ccb7.js @@ -1,4 +1,3 @@ function* a() { - var b = function(yield) { - }; + var b = function(yield) {}; } diff --git a/crates/swc_ecma_codegen/tests/test262/09be3a3198b40536.js b/crates/swc_ecma_codegen/tests/test262/09be3a3198b40536.js index a028284b6ad..61b45b94bcd 100644 --- a/crates/swc_ecma_codegen/tests/test262/09be3a3198b40536.js +++ b/crates/swc_ecma_codegen/tests/test262/09be3a3198b40536.js @@ -1,2 +1 @@ -function a([]) { -} +function a([]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/09e84f25af85b836.js b/crates/swc_ecma_codegen/tests/test262/09e84f25af85b836.js index 497d7e2fe48..ecc76a9a98f 100644 --- a/crates/swc_ecma_codegen/tests/test262/09e84f25af85b836.js +++ b/crates/swc_ecma_codegen/tests/test262/09e84f25af85b836.js @@ -1,4 +1,3 @@ ({ - set a (yield){ - } + set a (yield){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/0b881b80b7220fad.js b/crates/swc_ecma_codegen/tests/test262/0b881b80b7220fad.js index b78a3a346c5..0eca65bb4c3 100644 --- a/crates/swc_ecma_codegen/tests/test262/0b881b80b7220fad.js +++ b/crates/swc_ecma_codegen/tests/test262/0b881b80b7220fad.js @@ -1,4 +1,3 @@ a = { - b (...c) { - } + b (...c) {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/0bbda5d7d8ae8990.js b/crates/swc_ecma_codegen/tests/test262/0bbda5d7d8ae8990.js index ca3a1d1f502..739a4522b42 100644 --- a/crates/swc_ecma_codegen/tests/test262/0bbda5d7d8ae8990.js +++ b/crates/swc_ecma_codegen/tests/test262/0bbda5d7d8ae8990.js @@ -1,5 +1,4 @@ function a() { - while(true){ - } /* bar */ + while(true){} /* bar */ var b; } diff --git a/crates/swc_ecma_codegen/tests/test262/0d7e3e1647af9ba6.js b/crates/swc_ecma_codegen/tests/test262/0d7e3e1647af9ba6.js index f66f4b3fa94..804406ac4df 100644 --- a/crates/swc_ecma_codegen/tests/test262/0d7e3e1647af9ba6.js +++ b/crates/swc_ecma_codegen/tests/test262/0d7e3e1647af9ba6.js @@ -1,2 +1 @@ -do { -}while (true) +do {}while (true) diff --git a/crates/swc_ecma_codegen/tests/test262/0da6496ed75822b1.module.js b/crates/swc_ecma_codegen/tests/test262/0da6496ed75822b1.module.js index 6155d658324..1dd3aefbc9e 100644 --- a/crates/swc_ecma_codegen/tests/test262/0da6496ed75822b1.module.js +++ b/crates/swc_ecma_codegen/tests/test262/0da6496ed75822b1.module.js @@ -1,3 +1,2 @@ -export function a() { -} +export function a() {} false; diff --git a/crates/swc_ecma_codegen/tests/test262/0de4ef1344cbb907.js b/crates/swc_ecma_codegen/tests/test262/0de4ef1344cbb907.js index 2de8934ec78..8d4d4a55fcc 100644 --- a/crates/swc_ecma_codegen/tests/test262/0de4ef1344cbb907.js +++ b/crates/swc_ecma_codegen/tests/test262/0de4ef1344cbb907.js @@ -1,4 +1,3 @@ function a() { - return { - } / 1; + return {} / 1; } diff --git a/crates/swc_ecma_codegen/tests/test262/0e22e969622bf137.js b/crates/swc_ecma_codegen/tests/test262/0e22e969622bf137.js index b9a7b746cc4..e4709fea3eb 100644 --- a/crates/swc_ecma_codegen/tests/test262/0e22e969622bf137.js +++ b/crates/swc_ecma_codegen/tests/test262/0e22e969622bf137.js @@ -1,4 +1,3 @@ ({ - *a () { - } + *a () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/10857a84ed2962f1.js b/crates/swc_ecma_codegen/tests/test262/10857a84ed2962f1.js index d5314072898..a6e58e058be 100644 --- a/crates/swc_ecma_codegen/tests/test262/10857a84ed2962f1.js +++ b/crates/swc_ecma_codegen/tests/test262/10857a84ed2962f1.js @@ -1,6 +1,4 @@ class a { - get b() { - } - set b(c) { - } + get b() {} + set b(c) {} } diff --git a/crates/swc_ecma_codegen/tests/test262/10d6486502949e74.js b/crates/swc_ecma_codegen/tests/test262/10d6486502949e74.js index ff32cf898ee..986892afb6b 100644 --- a/crates/swc_ecma_codegen/tests/test262/10d6486502949e74.js +++ b/crates/swc_ecma_codegen/tests/test262/10d6486502949e74.js @@ -1,5 +1,4 @@ ({ __proto__: null, - get __proto__ () { - } + get __proto__ () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/10f0ef998c05c611.js b/crates/swc_ecma_codegen/tests/test262/10f0ef998c05c611.js index ace0127b2d0..88ae25241cb 100644 --- a/crates/swc_ecma_codegen/tests/test262/10f0ef998c05c611.js +++ b/crates/swc_ecma_codegen/tests/test262/10f0ef998c05c611.js @@ -1,3 +1,2 @@ -do { -}while (false) +do {}while (false) a(); diff --git a/crates/swc_ecma_codegen/tests/test262/119e9dce4feae643.js b/crates/swc_ecma_codegen/tests/test262/119e9dce4feae643.js index a07831cd4cc..5143444d5c7 100644 --- a/crates/swc_ecma_codegen/tests/test262/119e9dce4feae643.js +++ b/crates/swc_ecma_codegen/tests/test262/119e9dce4feae643.js @@ -1,7 +1,6 @@ var a = { b: null, - set c (d){ - }, + set c (d){}, get c () { return this.b; } diff --git a/crates/swc_ecma_codegen/tests/test262/121491a690a13543.js b/crates/swc_ecma_codegen/tests/test262/121491a690a13543.js index 45579a17516..f36d146cc07 100644 --- a/crates/swc_ecma_codegen/tests/test262/121491a690a13543.js +++ b/crates/swc_ecma_codegen/tests/test262/121491a690a13543.js @@ -1,2 +1 @@ -a(()=>{ -}); +a(()=>{}); diff --git a/crates/swc_ecma_codegen/tests/test262/123bfcc3f6cf379f.js b/crates/swc_ecma_codegen/tests/test262/123bfcc3f6cf379f.js index 67970be5b61..8d8ea799966 100644 --- a/crates/swc_ecma_codegen/tests/test262/123bfcc3f6cf379f.js +++ b/crates/swc_ecma_codegen/tests/test262/123bfcc3f6cf379f.js @@ -1,2 +1 @@ -function a(b, ...c) { -} +function a(b, ...c) {} diff --git a/crates/swc_ecma_codegen/tests/test262/12556d5e39db1cea.js b/crates/swc_ecma_codegen/tests/test262/12556d5e39db1cea.js index 496b091189b..af2b0f0b709 100644 --- a/crates/swc_ecma_codegen/tests/test262/12556d5e39db1cea.js +++ b/crates/swc_ecma_codegen/tests/test262/12556d5e39db1cea.js @@ -1,2 +1 @@ -function* yield() { -} +function* yield() {} diff --git a/crates/swc_ecma_codegen/tests/test262/126a6455f0f721fe.js b/crates/swc_ecma_codegen/tests/test262/126a6455f0f721fe.js index d6baf4b0918..f63dbd8d2c6 100644 --- a/crates/swc_ecma_codegen/tests/test262/126a6455f0f721fe.js +++ b/crates/swc_ecma_codegen/tests/test262/126a6455f0f721fe.js @@ -1,4 +1,3 @@ ({ - a (b) { - } + a (b) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/12d5bedf1812952a.js b/crates/swc_ecma_codegen/tests/test262/12d5bedf1812952a.js index 00cbb6696d1..148e8dad0de 100644 --- a/crates/swc_ecma_codegen/tests/test262/12d5bedf1812952a.js +++ b/crates/swc_ecma_codegen/tests/test262/12d5bedf1812952a.js @@ -1,6 +1,4 @@ class a { - static get b() { - } - static get c() { - } + static get b() {} + static get c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/12ef713cb7737bdd.js b/crates/swc_ecma_codegen/tests/test262/12ef713cb7737bdd.js index 24a70b9dc05..061074e3cbe 100644 --- a/crates/swc_ecma_codegen/tests/test262/12ef713cb7737bdd.js +++ b/crates/swc_ecma_codegen/tests/test262/12ef713cb7737bdd.js @@ -1,7 +1,5 @@ class a { - b() { - } + b() {} ; - c() { - } + c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/13045bfdda0434e0.js b/crates/swc_ecma_codegen/tests/test262/13045bfdda0434e0.js index 0e518e7dfc5..208f9890314 100644 --- a/crates/swc_ecma_codegen/tests/test262/13045bfdda0434e0.js +++ b/crates/swc_ecma_codegen/tests/test262/13045bfdda0434e0.js @@ -1,4 +1,3 @@ ({ - set a (b){ - } + set a (b){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/1325417193f50cc3.js b/crates/swc_ecma_codegen/tests/test262/1325417193f50cc3.js index ca83068c2dd..5a4c3654a0f 100644 --- a/crates/swc_ecma_codegen/tests/test262/1325417193f50cc3.js +++ b/crates/swc_ecma_codegen/tests/test262/1325417193f50cc3.js @@ -1,4 +1,3 @@ -if (a) { -} else { +if (a) {} else { b(); } diff --git a/crates/swc_ecma_codegen/tests/test262/14360fa75e6ae228.js b/crates/swc_ecma_codegen/tests/test262/14360fa75e6ae228.js index 781bd7e85cd..b134bbefdac 100644 --- a/crates/swc_ecma_codegen/tests/test262/14360fa75e6ae228.js +++ b/crates/swc_ecma_codegen/tests/test262/14360fa75e6ae228.js @@ -1,4 +1,3 @@ function a({ b } = { b: 1 -}) { -} +}) {} diff --git a/crates/swc_ecma_codegen/tests/test262/14551b80fa8a0ce1.module.js b/crates/swc_ecma_codegen/tests/test262/14551b80fa8a0ce1.module.js index 7e588b65817..fa1736f9feb 100644 --- a/crates/swc_ecma_codegen/tests/test262/14551b80fa8a0ce1.module.js +++ b/crates/swc_ecma_codegen/tests/test262/14551b80fa8a0ce1.module.js @@ -1,2 +1 @@ -export function a() { -} +export function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/153bd6819f5fa69b.js b/crates/swc_ecma_codegen/tests/test262/153bd6819f5fa69b.js index 7ef3fe8422b..35731978637 100644 --- a/crates/swc_ecma_codegen/tests/test262/153bd6819f5fa69b.js +++ b/crates/swc_ecma_codegen/tests/test262/153bd6819f5fa69b.js @@ -1,4 +1,3 @@ ({ - yield () { - } + yield () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/16d0c12aad83f9b3.js b/crates/swc_ecma_codegen/tests/test262/16d0c12aad83f9b3.js index 696c639e6d6..11f90b2f96c 100644 --- a/crates/swc_ecma_codegen/tests/test262/16d0c12aad83f9b3.js +++ b/crates/swc_ecma_codegen/tests/test262/16d0c12aad83f9b3.js @@ -1,5 +1,4 @@ -function a() { -} +function a() {} function b() { return c; } diff --git a/crates/swc_ecma_codegen/tests/test262/18cc9a6b7038070f.js b/crates/swc_ecma_codegen/tests/test262/18cc9a6b7038070f.js index 2644ed02af7..7c30d647960 100644 --- a/crates/swc_ecma_codegen/tests/test262/18cc9a6b7038070f.js +++ b/crates/swc_ecma_codegen/tests/test262/18cc9a6b7038070f.js @@ -1,37 +1,20 @@ -(function(a) { -}); -(function([a]) { -}); -(function([a, b]) { -}); -(function([[a]]) { -}); -(function([[a, b]]) { -}); -(function([a, [b]]) { -}); -(function([[b], a]) { -}); -(function({ a }) { -}); -(function({ a , b }) { -}); -(function([{ a }]) { -}); -(function([{ a , b }]) { -}); -(function([a, { b }]) { -}); -(function([{ b }, a]) { -}); -([a])=>{ -}; -([a, b])=>{ -}; -({ a })=>{ -}; -({ a , b , c , d , e })=>{ -}; +(function(a) {}); +(function([a]) {}); +(function([a, b]) {}); +(function([[a]]) {}); +(function([[a, b]]) {}); +(function([a, [b]]) {}); +(function([[b], a]) {}); +(function({ a }) {}); +(function({ a , b }) {}); +(function([{ a }]) {}); +(function([{ a , b }]) {}); +(function([a, { b }]) {}); +(function([{ b }, a]) {}); +([a])=>{}; +([a, b])=>{}; +({ a })=>{}; +({ a , b , c , d , e })=>{}; ([a])=>b ; ([a, b])=>c diff --git a/crates/swc_ecma_codegen/tests/test262/1938db3bb862ded1.js b/crates/swc_ecma_codegen/tests/test262/1938db3bb862ded1.js index 156508c7508..05e6f4f935c 100644 --- a/crates/swc_ecma_codegen/tests/test262/1938db3bb862ded1.js +++ b/crates/swc_ecma_codegen/tests/test262/1938db3bb862ded1.js @@ -1,2 +1 @@ -function* a({ yield: b }) { -} +function* a({ yield: b }) {} diff --git a/crates/swc_ecma_codegen/tests/test262/194b702816a7e5e5.js b/crates/swc_ecma_codegen/tests/test262/194b702816a7e5e5.js index f2473e6c92d..c60efa824d1 100644 --- a/crates/swc_ecma_codegen/tests/test262/194b702816a7e5e5.js +++ b/crates/swc_ecma_codegen/tests/test262/194b702816a7e5e5.js @@ -1,2 +1 @@ -var yield = function yield() { -}; +var yield = function yield() {}; diff --git a/crates/swc_ecma_codegen/tests/test262/1a0dac12dbd33ef6.js b/crates/swc_ecma_codegen/tests/test262/1a0dac12dbd33ef6.js index fe27db609c5..948ec99cad9 100644 --- a/crates/swc_ecma_codegen/tests/test262/1a0dac12dbd33ef6.js +++ b/crates/swc_ecma_codegen/tests/test262/1a0dac12dbd33ef6.js @@ -1,2 +1 @@ -a = { -}; +a = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/1b6e33ab982844af.js b/crates/swc_ecma_codegen/tests/test262/1b6e33ab982844af.js index 39d9ec62aab..1a86eda4b5c 100644 --- a/crates/swc_ecma_codegen/tests/test262/1b6e33ab982844af.js +++ b/crates/swc_ecma_codegen/tests/test262/1b6e33ab982844af.js @@ -1,9 +1,7 @@ class a { ; - b() { - } + b() {} ; - c() { - } + c() {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/1b884461ff1acfc6.js b/crates/swc_ecma_codegen/tests/test262/1b884461ff1acfc6.js index 988dbdf2ed4..7985b735b74 100644 --- a/crates/swc_ecma_codegen/tests/test262/1b884461ff1acfc6.js +++ b/crates/swc_ecma_codegen/tests/test262/1b884461ff1acfc6.js @@ -1,2 +1 @@ -(function({ a }) { -}); +(function({ a }) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/1c6c67fcd71f2d08.js b/crates/swc_ecma_codegen/tests/test262/1c6c67fcd71f2d08.js index 60851c0acb2..dff43d04a1b 100644 --- a/crates/swc_ecma_codegen/tests/test262/1c6c67fcd71f2d08.js +++ b/crates/swc_ecma_codegen/tests/test262/1c6c67fcd71f2d08.js @@ -1,4 +1,3 @@ ({ - set a (b = 1){ - } + set a (b = 1){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/1db0d98ff1726af8.js b/crates/swc_ecma_codegen/tests/test262/1db0d98ff1726af8.js index f1193e4d45b..7e42fb08e9b 100644 --- a/crates/swc_ecma_codegen/tests/test262/1db0d98ff1726af8.js +++ b/crates/swc_ecma_codegen/tests/test262/1db0d98ff1726af8.js @@ -1,4 +1,3 @@ class a { - static ["prototype"]() { - } + static ["prototype"]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/1ea254c74f1071de.js b/crates/swc_ecma_codegen/tests/test262/1ea254c74f1071de.js index b9a7b746cc4..e4709fea3eb 100644 --- a/crates/swc_ecma_codegen/tests/test262/1ea254c74f1071de.js +++ b/crates/swc_ecma_codegen/tests/test262/1ea254c74f1071de.js @@ -1,4 +1,3 @@ ({ - *a () { - } + *a () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/1f039e0eeb1bc271.js b/crates/swc_ecma_codegen/tests/test262/1f039e0eeb1bc271.js index dc618e7b76f..890565d4d9e 100644 --- a/crates/swc_ecma_codegen/tests/test262/1f039e0eeb1bc271.js +++ b/crates/swc_ecma_codegen/tests/test262/1f039e0eeb1bc271.js @@ -1,4 +1,3 @@ a = { - get b () { - } + get b () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/20f9bec9f3215688.js b/crates/swc_ecma_codegen/tests/test262/20f9bec9f3215688.js index 9188b7c3bb7..d9b879f0294 100644 --- a/crates/swc_ecma_codegen/tests/test262/20f9bec9f3215688.js +++ b/crates/swc_ecma_codegen/tests/test262/20f9bec9f3215688.js @@ -1,4 +1,3 @@ /**/ function a() { - function b() { - } + function b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/212d2ca66d97a90f.js b/crates/swc_ecma_codegen/tests/test262/212d2ca66d97a90f.js index 4f9d573d634..01f26896d51 100644 --- a/crates/swc_ecma_codegen/tests/test262/212d2ca66d97a90f.js +++ b/crates/swc_ecma_codegen/tests/test262/212d2ca66d97a90f.js @@ -1,2 +1 @@ -const { a: b } = { -}; +const { a: b } = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js b/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js index 1517e05e617..9e43cc24e8f 100644 --- a/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js +++ b/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js @@ -5,6 +5,5 @@ if (a) { }()); try { b("d"); - } catch (e) { - } + } catch (e) {} } diff --git a/crates/swc_ecma_codegen/tests/test262/2207b24e625f30db.js b/crates/swc_ecma_codegen/tests/test262/2207b24e625f30db.js index 213adf769a4..872953ebe77 100644 --- a/crates/swc_ecma_codegen/tests/test262/2207b24e625f30db.js +++ b/crates/swc_ecma_codegen/tests/test262/2207b24e625f30db.js @@ -1,5 +1,4 @@ (function() { - var a = { - }; + var a = {}; a.b = (c(), 1); // ok }()); diff --git a/crates/swc_ecma_codegen/tests/test262/227118dffd2c9935.js b/crates/swc_ecma_codegen/tests/test262/227118dffd2c9935.js index 06211d94395..d48f1ba21ab 100644 --- a/crates/swc_ecma_codegen/tests/test262/227118dffd2c9935.js +++ b/crates/swc_ecma_codegen/tests/test262/227118dffd2c9935.js @@ -1,4 +1,3 @@ class a extends b { - static get c() { - } + static get c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/22dc0bb1d4e8d89f.js b/crates/swc_ecma_codegen/tests/test262/22dc0bb1d4e8d89f.js index 5dd809cc6c2..e7a29f2f3bb 100644 --- a/crates/swc_ecma_codegen/tests/test262/22dc0bb1d4e8d89f.js +++ b/crates/swc_ecma_codegen/tests/test262/22dc0bb1d4e8d89f.js @@ -1,2 +1 @@ -function a({ yield: b }) { -} +function a({ yield: b }) {} diff --git a/crates/swc_ecma_codegen/tests/test262/23869c020fc2cb0f.js b/crates/swc_ecma_codegen/tests/test262/23869c020fc2cb0f.js index 7b4c3c3b2b4..0f7f045986b 100644 --- a/crates/swc_ecma_codegen/tests/test262/23869c020fc2cb0f.js +++ b/crates/swc_ecma_codegen/tests/test262/23869c020fc2cb0f.js @@ -1,5 +1,4 @@ ({ "__proto__": null, - __proto__ () { - } + __proto__ () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js b/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js index 9cb2ada4d61..6fb3b6918ee 100644 --- a/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js +++ b/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js @@ -2,6 +2,4 @@ (function() { a('b'); }()); -try { -} catch (c) { -} +try {} catch (c) {} diff --git a/crates/swc_ecma_codegen/tests/test262/24fa28a37061a18f.js b/crates/swc_ecma_codegen/tests/test262/24fa28a37061a18f.js index 407a04fc500..c8ccf032699 100644 --- a/crates/swc_ecma_codegen/tests/test262/24fa28a37061a18f.js +++ b/crates/swc_ecma_codegen/tests/test262/24fa28a37061a18f.js @@ -1,5 +1,4 @@ "use strict"; ({ - yield () { - } + yield () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/252bb992a448270e.js b/crates/swc_ecma_codegen/tests/test262/252bb992a448270e.js index 0ad2fd297ed..4c9224222a7 100644 --- a/crates/swc_ecma_codegen/tests/test262/252bb992a448270e.js +++ b/crates/swc_ecma_codegen/tests/test262/252bb992a448270e.js @@ -1,4 +1,3 @@ ({ - get if () { - } + get if () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/26aa8b685715d445.module.js b/crates/swc_ecma_codegen/tests/test262/26aa8b685715d445.module.js index f86b7c6de32..1d0a68c04a0 100644 --- a/crates/swc_ecma_codegen/tests/test262/26aa8b685715d445.module.js +++ b/crates/swc_ecma_codegen/tests/test262/26aa8b685715d445.module.js @@ -1,2 +1 @@ -export const a = { -}; +export const a = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/27409f5b7b692b24.js b/crates/swc_ecma_codegen/tests/test262/27409f5b7b692b24.js index f46b9c1f5dd..2f6d5b006cb 100644 --- a/crates/swc_ecma_codegen/tests/test262/27409f5b7b692b24.js +++ b/crates/swc_ecma_codegen/tests/test262/27409f5b7b692b24.js @@ -1,2 +1 @@ -(function({ a =1 }) { -}); +(function({ a =1 }) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/290fdc5a2f826ead.js b/crates/swc_ecma_codegen/tests/test262/290fdc5a2f826ead.js index 1a4e64cdfff..f5aadb81f63 100644 --- a/crates/swc_ecma_codegen/tests/test262/290fdc5a2f826ead.js +++ b/crates/swc_ecma_codegen/tests/test262/290fdc5a2f826ead.js @@ -1,2 +1 @@ -(function a(b, c) { -}); +(function a(b, c) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/2976a1598d3a75e1.js b/crates/swc_ecma_codegen/tests/test262/2976a1598d3a75e1.js index 816b0ffeab6..f9ea23541f0 100644 --- a/crates/swc_ecma_codegen/tests/test262/2976a1598d3a75e1.js +++ b/crates/swc_ecma_codegen/tests/test262/2976a1598d3a75e1.js @@ -1,2 +1 @@ -let { a } = { -}; +let { a } = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/29ef8a7a1cbfda7f.js b/crates/swc_ecma_codegen/tests/test262/29ef8a7a1cbfda7f.js index a7d1e52634e..c75776c5217 100644 --- a/crates/swc_ecma_codegen/tests/test262/29ef8a7a1cbfda7f.js +++ b/crates/swc_ecma_codegen/tests/test262/29ef8a7a1cbfda7f.js @@ -1,3 +1,2 @@ a.in; -{ -}/foo/; +{}/foo/; diff --git a/crates/swc_ecma_codegen/tests/test262/2ab9ca1f6a30c203.js b/crates/swc_ecma_codegen/tests/test262/2ab9ca1f6a30c203.js index 349d538fc95..0ca91961d06 100644 --- a/crates/swc_ecma_codegen/tests/test262/2ab9ca1f6a30c203.js +++ b/crates/swc_ecma_codegen/tests/test262/2ab9ca1f6a30c203.js @@ -2,16 +2,14 @@ if (a) { { { - { - } + {} } } if (b) { c(); } { - { - } + {} } } else { d(); diff --git a/crates/swc_ecma_codegen/tests/test262/2b83dea123ed2e2e.js b/crates/swc_ecma_codegen/tests/test262/2b83dea123ed2e2e.js index 371055acc82..6681ef9c158 100644 --- a/crates/swc_ecma_codegen/tests/test262/2b83dea123ed2e2e.js +++ b/crates/swc_ecma_codegen/tests/test262/2b83dea123ed2e2e.js @@ -1,2 +1 @@ -({ a: [a, b] }, ...c)=>{ -}; +({ a: [a, b] }, ...c)=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/2c7e2fecbc1cb477.js b/crates/swc_ecma_codegen/tests/test262/2c7e2fecbc1cb477.js index d6c2ed595fa..e3013d0a8fc 100644 --- a/crates/swc_ecma_codegen/tests/test262/2c7e2fecbc1cb477.js +++ b/crates/swc_ecma_codegen/tests/test262/2c7e2fecbc1cb477.js @@ -1,4 +1,3 @@ (function() { - for(!!!a && a(); !!!b && a(); !!!b && a()){ - } + for(!!!a && a(); !!!b && a(); !!!b && a()){} }()); diff --git a/crates/swc_ecma_codegen/tests/test262/2d3273e0386e9cb8.js b/crates/swc_ecma_codegen/tests/test262/2d3273e0386e9cb8.js index f8e7f820d26..4df46943d26 100644 --- a/crates/swc_ecma_codegen/tests/test262/2d3273e0386e9cb8.js +++ b/crates/swc_ecma_codegen/tests/test262/2d3273e0386e9cb8.js @@ -1,2 +1 @@ -function* a() { -} +function* a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/2e7f443b2f555bc5.js b/crates/swc_ecma_codegen/tests/test262/2e7f443b2f555bc5.js index 9188b7c3bb7..d9b879f0294 100644 --- a/crates/swc_ecma_codegen/tests/test262/2e7f443b2f555bc5.js +++ b/crates/swc_ecma_codegen/tests/test262/2e7f443b2f555bc5.js @@ -1,4 +1,3 @@ /**/ function a() { - function b() { - } + function b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/2f6d8a2215407ae3.js b/crates/swc_ecma_codegen/tests/test262/2f6d8a2215407ae3.js index 55554923886..77ee01e9b84 100644 --- a/crates/swc_ecma_codegen/tests/test262/2f6d8a2215407ae3.js +++ b/crates/swc_ecma_codegen/tests/test262/2f6d8a2215407ae3.js @@ -1,4 +1,3 @@ function a() { - for(var b = 1, c = 2; b < 3; ++b){ - } + for(var b = 1, c = 2; b < 3; ++b){} } diff --git a/crates/swc_ecma_codegen/tests/test262/315692af7fe2aad3.js b/crates/swc_ecma_codegen/tests/test262/315692af7fe2aad3.js index fb903046a75..52f9afc19c6 100644 --- a/crates/swc_ecma_codegen/tests/test262/315692af7fe2aad3.js +++ b/crates/swc_ecma_codegen/tests/test262/315692af7fe2aad3.js @@ -1,5 +1,4 @@ -var a = { -}; +var a = {}; a.b = 1; a.c = 2; d.e(a.c); diff --git a/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js b/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js index 98fb880e334..04d124798dc 100644 --- a/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js +++ b/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js @@ -1,3 +1,2 @@ 'use strict'; -var a = function() { -}(b()); +var a = function() {}(b()); diff --git a/crates/swc_ecma_codegen/tests/test262/31cca30ad2bf696d.js b/crates/swc_ecma_codegen/tests/test262/31cca30ad2bf696d.js index df8cffc628d..d9039c886f7 100644 --- a/crates/swc_ecma_codegen/tests/test262/31cca30ad2bf696d.js +++ b/crates/swc_ecma_codegen/tests/test262/31cca30ad2bf696d.js @@ -1,4 +1,3 @@ (function() { - (function() { - }()); + (function() {}()); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/32efa0efd255748a.js b/crates/swc_ecma_codegen/tests/test262/32efa0efd255748a.js index 545f821525d..2b085be2d9d 100644 --- a/crates/swc_ecma_codegen/tests/test262/32efa0efd255748a.js +++ b/crates/swc_ecma_codegen/tests/test262/32efa0efd255748a.js @@ -1,4 +1,3 @@ class a { - static *[b]() { - } + static *[b]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/36224cf8215ad8e4.js b/crates/swc_ecma_codegen/tests/test262/36224cf8215ad8e4.js index 63ef65465e9..41ca4eb4aa6 100644 --- a/crates/swc_ecma_codegen/tests/test262/36224cf8215ad8e4.js +++ b/crates/swc_ecma_codegen/tests/test262/36224cf8215ad8e4.js @@ -1,4 +1,2 @@ -(function(a, ...b) { -}); -(function(...c) { -}); +(function(a, ...b) {}); +(function(...c) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/36fb3e9c8cedf764.js b/crates/swc_ecma_codegen/tests/test262/36fb3e9c8cedf764.js index 80b838030da..063d74d8438 100644 --- a/crates/swc_ecma_codegen/tests/test262/36fb3e9c8cedf764.js +++ b/crates/swc_ecma_codegen/tests/test262/36fb3e9c8cedf764.js @@ -1,5 +1,4 @@ class a { - set(b) { - } + set(b) {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/37e4a6eca1ece7e5.js b/crates/swc_ecma_codegen/tests/test262/37e4a6eca1ece7e5.js index 2d5ca5641ac..72e510f5dd2 100644 --- a/crates/swc_ecma_codegen/tests/test262/37e4a6eca1ece7e5.js +++ b/crates/swc_ecma_codegen/tests/test262/37e4a6eca1ece7e5.js @@ -1,2 +1 @@ -(function a([b, c]) { -}); +(function a([b, c]) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/380e999de8f31c7d.js b/crates/swc_ecma_codegen/tests/test262/380e999de8f31c7d.js index d37ec85eb70..0b8c72fe4c5 100644 --- a/crates/swc_ecma_codegen/tests/test262/380e999de8f31c7d.js +++ b/crates/swc_ecma_codegen/tests/test262/380e999de8f31c7d.js @@ -1,2 +1 @@ -function a([b, c]) { -} +function a([b, c]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/38284ea2d9914d86.js b/crates/swc_ecma_codegen/tests/test262/38284ea2d9914d86.js index 2bf60182576..cb703394a3a 100644 --- a/crates/swc_ecma_codegen/tests/test262/38284ea2d9914d86.js +++ b/crates/swc_ecma_codegen/tests/test262/38284ea2d9914d86.js @@ -1,6 +1,4 @@ ({ - get a () { - }, - get a () { - } + get a () {}, + get a () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/38befc89fcf92e25.js b/crates/swc_ecma_codegen/tests/test262/38befc89fcf92e25.js index f2d526c3400..106c4969b49 100644 --- a/crates/swc_ecma_codegen/tests/test262/38befc89fcf92e25.js +++ b/crates/swc_ecma_codegen/tests/test262/38befc89fcf92e25.js @@ -1,2 +1 @@ -+{ -} / 1; ++{} / 1; diff --git a/crates/swc_ecma_codegen/tests/test262/3a5a7699f0631c6f.js b/crates/swc_ecma_codegen/tests/test262/3a5a7699f0631c6f.js index 36c5e32c9d1..a22c55860d1 100644 --- a/crates/swc_ecma_codegen/tests/test262/3a5a7699f0631c6f.js +++ b/crates/swc_ecma_codegen/tests/test262/3a5a7699f0631c6f.js @@ -1,4 +1,2 @@ -with ({ -}){ -} +with ({}){} ; diff --git a/crates/swc_ecma_codegen/tests/test262/3aa600e48cbd8a5c.js b/crates/swc_ecma_codegen/tests/test262/3aa600e48cbd8a5c.js index 590d10a0e01..390a50d6dfc 100644 --- a/crates/swc_ecma_codegen/tests/test262/3aa600e48cbd8a5c.js +++ b/crates/swc_ecma_codegen/tests/test262/3aa600e48cbd8a5c.js @@ -1,5 +1,4 @@ class a { - static [b]() { - } + static [b]() {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/3bac973df7480fe9.js b/crates/swc_ecma_codegen/tests/test262/3bac973df7480fe9.js index 215a29b15c8..12f625758b4 100644 --- a/crates/swc_ecma_codegen/tests/test262/3bac973df7480fe9.js +++ b/crates/swc_ecma_codegen/tests/test262/3bac973df7480fe9.js @@ -1,4 +1,3 @@ (class { - 3() { - } + 3() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/3bbd75d597d54fe6.js b/crates/swc_ecma_codegen/tests/test262/3bbd75d597d54fe6.js index 10448264a04..6701dde8b91 100644 --- a/crates/swc_ecma_codegen/tests/test262/3bbd75d597d54fe6.js +++ b/crates/swc_ecma_codegen/tests/test262/3bbd75d597d54fe6.js @@ -1,2 +1 @@ -(function yield() { -}); +(function yield() {}); diff --git a/crates/swc_ecma_codegen/tests/test262/3e69c5cc1a7ac103.js b/crates/swc_ecma_codegen/tests/test262/3e69c5cc1a7ac103.js index 903c70f348a..344939ff12c 100644 --- a/crates/swc_ecma_codegen/tests/test262/3e69c5cc1a7ac103.js +++ b/crates/swc_ecma_codegen/tests/test262/3e69c5cc1a7ac103.js @@ -1,3 +1 @@ -try { -} catch ([a, ...b]) { -} +try {} catch ([a, ...b]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/3eac36e29398cdc5.js b/crates/swc_ecma_codegen/tests/test262/3eac36e29398cdc5.js index c704c063dcd..f64732e35c9 100644 --- a/crates/swc_ecma_codegen/tests/test262/3eac36e29398cdc5.js +++ b/crates/swc_ecma_codegen/tests/test262/3eac36e29398cdc5.js @@ -1,3 +1 @@ -try { -} catch ([a]) { -} +try {} catch ([a]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/3ff52d86c77678bd.js b/crates/swc_ecma_codegen/tests/test262/3ff52d86c77678bd.js index 6b80c63bbc5..9c9e12c7031 100644 --- a/crates/swc_ecma_codegen/tests/test262/3ff52d86c77678bd.js +++ b/crates/swc_ecma_codegen/tests/test262/3ff52d86c77678bd.js @@ -1,2 +1 @@ -(function(...a) { -}); +(function(...a) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/409f30dc7efe75d5.js b/crates/swc_ecma_codegen/tests/test262/409f30dc7efe75d5.js index 7ff619a9f9c..51cfdf5f8fe 100644 --- a/crates/swc_ecma_codegen/tests/test262/409f30dc7efe75d5.js +++ b/crates/swc_ecma_codegen/tests/test262/409f30dc7efe75d5.js @@ -1,6 +1,4 @@ ({ - get __proto__ () { - }, - set __proto__ (a){ - } + get __proto__ () {}, + set __proto__ (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/43023cd549deee77.js b/crates/swc_ecma_codegen/tests/test262/43023cd549deee77.js index a38eee76ccd..0f447adbd19 100644 --- a/crates/swc_ecma_codegen/tests/test262/43023cd549deee77.js +++ b/crates/swc_ecma_codegen/tests/test262/43023cd549deee77.js @@ -1,3 +1 @@ -try { -} catch (a) { -} +try {} catch (a) {} diff --git a/crates/swc_ecma_codegen/tests/test262/44136fa355b3678a.js b/crates/swc_ecma_codegen/tests/test262/44136fa355b3678a.js index 2c63c085104..0967ef424bc 100644 --- a/crates/swc_ecma_codegen/tests/test262/44136fa355b3678a.js +++ b/crates/swc_ecma_codegen/tests/test262/44136fa355b3678a.js @@ -1,2 +1 @@ -{ -} +{} diff --git a/crates/swc_ecma_codegen/tests/test262/444856ec05e8d330.js b/crates/swc_ecma_codegen/tests/test262/444856ec05e8d330.js index 1a84cb7d496..56ec0e102b6 100644 --- a/crates/swc_ecma_codegen/tests/test262/444856ec05e8d330.js +++ b/crates/swc_ecma_codegen/tests/test262/444856ec05e8d330.js @@ -1,2 +1 @@ -function a(b = new.target) { -} +function a(b = new.target) {} diff --git a/crates/swc_ecma_codegen/tests/test262/4694af065eecd95a.js b/crates/swc_ecma_codegen/tests/test262/4694af065eecd95a.js index e2d10f0234b..a4a4244ddd3 100644 --- a/crates/swc_ecma_codegen/tests/test262/4694af065eecd95a.js +++ b/crates/swc_ecma_codegen/tests/test262/4694af065eecd95a.js @@ -1,5 +1,4 @@ class a { - static b() { - } + static b() {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/47ddfd79dcd20fd5.js b/crates/swc_ecma_codegen/tests/test262/47ddfd79dcd20fd5.js index b0935fd4054..00bea9867c0 100644 --- a/crates/swc_ecma_codegen/tests/test262/47ddfd79dcd20fd5.js +++ b/crates/swc_ecma_codegen/tests/test262/47ddfd79dcd20fd5.js @@ -1,2 +1 @@ -a = function(b = 1) { -}; +a = function(b = 1) {}; diff --git a/crates/swc_ecma_codegen/tests/test262/4869454dd215468e.js b/crates/swc_ecma_codegen/tests/test262/4869454dd215468e.js index b698eba04b1..54d43022f8e 100644 --- a/crates/swc_ecma_codegen/tests/test262/4869454dd215468e.js +++ b/crates/swc_ecma_codegen/tests/test262/4869454dd215468e.js @@ -1,4 +1 @@ -try { -} catch (a) { -} finally{ -} +try {} catch (a) {} finally{} diff --git a/crates/swc_ecma_codegen/tests/test262/488cd27c94308caa.js b/crates/swc_ecma_codegen/tests/test262/488cd27c94308caa.js index bd8f4333661..c6761f9dde1 100644 --- a/crates/swc_ecma_codegen/tests/test262/488cd27c94308caa.js +++ b/crates/swc_ecma_codegen/tests/test262/488cd27c94308caa.js @@ -1,5 +1,4 @@ function a() { - var b = { - }; + var b = {}; b[void 1] = (c(), d); } diff --git a/crates/swc_ecma_codegen/tests/test262/48bb091783df3da9.js b/crates/swc_ecma_codegen/tests/test262/48bb091783df3da9.js index b20d16d07ca..c8633bbd1fe 100644 --- a/crates/swc_ecma_codegen/tests/test262/48bb091783df3da9.js +++ b/crates/swc_ecma_codegen/tests/test262/48bb091783df3da9.js @@ -1,5 +1,4 @@ -function a() { -} +function a() {} var b = "is a valid variable name"; b = { b: "is ok" diff --git a/crates/swc_ecma_codegen/tests/test262/48bb138a6b033a34.js b/crates/swc_ecma_codegen/tests/test262/48bb138a6b033a34.js index 01af879fbb4..c02558bf2aa 100644 --- a/crates/swc_ecma_codegen/tests/test262/48bb138a6b033a34.js +++ b/crates/swc_ecma_codegen/tests/test262/48bb138a6b033a34.js @@ -3,6 +3,5 @@ ; ; ; - a() { - } + a() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/4a56cf2dea99fcd6.js b/crates/swc_ecma_codegen/tests/test262/4a56cf2dea99fcd6.js index 83043ab88a0..9f118c50f0c 100644 --- a/crates/swc_ecma_codegen/tests/test262/4a56cf2dea99fcd6.js +++ b/crates/swc_ecma_codegen/tests/test262/4a56cf2dea99fcd6.js @@ -1,4 +1,3 @@ ({ - get "a" () { - } + get "a" () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/4b6559716b2f7b21.js b/crates/swc_ecma_codegen/tests/test262/4b6559716b2f7b21.js index e329d2be0e3..e759829a36b 100644 --- a/crates/swc_ecma_codegen/tests/test262/4b6559716b2f7b21.js +++ b/crates/swc_ecma_codegen/tests/test262/4b6559716b2f7b21.js @@ -1,3 +1,2 @@ a++; -{ -}/foo/; +{}/foo/; diff --git a/crates/swc_ecma_codegen/tests/test262/4bd3199f5a4d8e52.js b/crates/swc_ecma_codegen/tests/test262/4bd3199f5a4d8e52.js index ab74f96ff43..769029fd961 100644 --- a/crates/swc_ecma_codegen/tests/test262/4bd3199f5a4d8e52.js +++ b/crates/swc_ecma_codegen/tests/test262/4bd3199f5a4d8e52.js @@ -1,3 +1 @@ -try { -} catch ({ a }) { -} +try {} catch ({ a }) {} diff --git a/crates/swc_ecma_codegen/tests/test262/4beb0b6ae8b9801a.js b/crates/swc_ecma_codegen/tests/test262/4beb0b6ae8b9801a.js index 24ddba0aeb6..5b576774b52 100644 --- a/crates/swc_ecma_codegen/tests/test262/4beb0b6ae8b9801a.js +++ b/crates/swc_ecma_codegen/tests/test262/4beb0b6ae8b9801a.js @@ -1,2 +1 @@ -function a({}) { -} +function a({}) {} diff --git a/crates/swc_ecma_codegen/tests/test262/4c71e11fbbc56349.js b/crates/swc_ecma_codegen/tests/test262/4c71e11fbbc56349.js index 6e10dc15249..4aafede60a7 100644 --- a/crates/swc_ecma_codegen/tests/test262/4c71e11fbbc56349.js +++ b/crates/swc_ecma_codegen/tests/test262/4c71e11fbbc56349.js @@ -1,6 +1,4 @@ ({ - set a (b){ - }, - set a (b){ - } + set a (b){}, + set a (b){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/4d310ef039a7435c.js b/crates/swc_ecma_codegen/tests/test262/4d310ef039a7435c.js index 18717ac3e15..1462347f31d 100644 --- a/crates/swc_ecma_codegen/tests/test262/4d310ef039a7435c.js +++ b/crates/swc_ecma_codegen/tests/test262/4d310ef039a7435c.js @@ -1,4 +1,3 @@ ({ - a (b, c) { - } + a (b, c) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/4d88f169e3827587.js b/crates/swc_ecma_codegen/tests/test262/4d88f169e3827587.js index d31d7b2fac0..178e5c9360e 100644 --- a/crates/swc_ecma_codegen/tests/test262/4d88f169e3827587.js +++ b/crates/swc_ecma_codegen/tests/test262/4d88f169e3827587.js @@ -1,3 +1 @@ -try { -} catch ({ a =1 }) { -} +try {} catch ({ a =1 }) {} diff --git a/crates/swc_ecma_codegen/tests/test262/4e7c58761e24d77c.js b/crates/swc_ecma_codegen/tests/test262/4e7c58761e24d77c.js index 52f4c1209fd..3e57021642a 100644 --- a/crates/swc_ecma_codegen/tests/test262/4e7c58761e24d77c.js +++ b/crates/swc_ecma_codegen/tests/test262/4e7c58761e24d77c.js @@ -1,4 +1,3 @@ a = { - get null () { - } + get null () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/4e8e7d6fe1e67ce5.js b/crates/swc_ecma_codegen/tests/test262/4e8e7d6fe1e67ce5.js index 55c4f376a83..74dcf3050cf 100644 --- a/crates/swc_ecma_codegen/tests/test262/4e8e7d6fe1e67ce5.js +++ b/crates/swc_ecma_codegen/tests/test262/4e8e7d6fe1e67ce5.js @@ -1,4 +1,3 @@ ({ - 1: { - } / 1 + 1: {} / 1 }); diff --git a/crates/swc_ecma_codegen/tests/test262/4eafc760484cd72b.js b/crates/swc_ecma_codegen/tests/test262/4eafc760484cd72b.js index d33b4b0dd78..3a74448d2ec 100644 --- a/crates/swc_ecma_codegen/tests/test262/4eafc760484cd72b.js +++ b/crates/swc_ecma_codegen/tests/test262/4eafc760484cd72b.js @@ -1,8 +1,5 @@ function a() { - function b() { - } - function c() { - } - function d() { - } + function b() {} + function c() {} + function d() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/50ac15a08f7c812f.js b/crates/swc_ecma_codegen/tests/test262/50ac15a08f7c812f.js index ec3772b07b3..ff03194eb07 100644 --- a/crates/swc_ecma_codegen/tests/test262/50ac15a08f7c812f.js +++ b/crates/swc_ecma_codegen/tests/test262/50ac15a08f7c812f.js @@ -1,4 +1,3 @@ ({ - get __proto__ () { - } + get __proto__ () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js b/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js index 5c93ff6bc78..a358234170a 100644 --- a/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js +++ b/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js @@ -1,7 +1,5 @@ while(a){ - try { - } catch (b) { - } + try {} catch (b) {} // do not optimize it (function() { c('d'); diff --git a/crates/swc_ecma_codegen/tests/test262/51a3505b43223a9f.js b/crates/swc_ecma_codegen/tests/test262/51a3505b43223a9f.js index 824138f00f8..bf50bca4f57 100644 --- a/crates/swc_ecma_codegen/tests/test262/51a3505b43223a9f.js +++ b/crates/swc_ecma_codegen/tests/test262/51a3505b43223a9f.js @@ -1,3 +1 @@ -if (a) { -} else { -} +if (a) {} else {} diff --git a/crates/swc_ecma_codegen/tests/test262/51fd2b53ad7e1581.js b/crates/swc_ecma_codegen/tests/test262/51fd2b53ad7e1581.js index ee7cf1c83cf..baf79e46598 100644 --- a/crates/swc_ecma_codegen/tests/test262/51fd2b53ad7e1581.js +++ b/crates/swc_ecma_codegen/tests/test262/51fd2b53ad7e1581.js @@ -1,4 +1,3 @@ class a { - b() { - } + b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/521b6dfff0a28aa1.js b/crates/swc_ecma_codegen/tests/test262/521b6dfff0a28aa1.js index dba852b8924..1f46689eb31 100644 --- a/crates/swc_ecma_codegen/tests/test262/521b6dfff0a28aa1.js +++ b/crates/swc_ecma_codegen/tests/test262/521b6dfff0a28aa1.js @@ -1,2 +1 @@ -function a([a = 1]) { -} +function a([a = 1]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/52ce5853ea953f0f.js b/crates/swc_ecma_codegen/tests/test262/52ce5853ea953f0f.js index 0f2c5f85482..594cd8cf235 100644 --- a/crates/swc_ecma_codegen/tests/test262/52ce5853ea953f0f.js +++ b/crates/swc_ecma_codegen/tests/test262/52ce5853ea953f0f.js @@ -1,2 +1 @@ -+{ -}; ++{}; diff --git a/crates/swc_ecma_codegen/tests/test262/541ee533b54ae664.js b/crates/swc_ecma_codegen/tests/test262/541ee533b54ae664.js index 4e0d0f1b876..f22eab077b7 100644 --- a/crates/swc_ecma_codegen/tests/test262/541ee533b54ae664.js +++ b/crates/swc_ecma_codegen/tests/test262/541ee533b54ae664.js @@ -1,2 +1 @@ -function a(__proto__) { -} +function a(__proto__) {} diff --git a/crates/swc_ecma_codegen/tests/test262/5495e25325fdd364.js b/crates/swc_ecma_codegen/tests/test262/5495e25325fdd364.js index 3a00fd9a620..a9e93469160 100644 --- a/crates/swc_ecma_codegen/tests/test262/5495e25325fdd364.js +++ b/crates/swc_ecma_codegen/tests/test262/5495e25325fdd364.js @@ -1,2 +1 @@ -function a(b = c) { -} +function a(b = c) {} diff --git a/crates/swc_ecma_codegen/tests/test262/54e70df597a4f9a3.js b/crates/swc_ecma_codegen/tests/test262/54e70df597a4f9a3.js index bccd46de01a..831dfff43ea 100644 --- a/crates/swc_ecma_codegen/tests/test262/54e70df597a4f9a3.js +++ b/crates/swc_ecma_codegen/tests/test262/54e70df597a4f9a3.js @@ -1,3 +1 @@ -try { -} catch (eval) { -} +try {} catch (eval) {} diff --git a/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js b/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js index 09608868293..79a1c624605 100644 --- a/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js +++ b/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js @@ -1,8 +1,7 @@ (function() { try { throw 'a'; - } catch (b) { - } finally{ + } catch (b) {} finally{ return 1; } c(); // This should be removed. diff --git a/crates/swc_ecma_codegen/tests/test262/55b74de671f60184.js b/crates/swc_ecma_codegen/tests/test262/55b74de671f60184.js index b88891d384d..106316365c9 100644 --- a/crates/swc_ecma_codegen/tests/test262/55b74de671f60184.js +++ b/crates/swc_ecma_codegen/tests/test262/55b74de671f60184.js @@ -1,6 +1,4 @@ class a { - constructor(){ - } - ["constructor"]() { - } + constructor(){} + ["constructor"]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/55c27b3727ba1165.js b/crates/swc_ecma_codegen/tests/test262/55c27b3727ba1165.js index ad85ce32e75..310c866665b 100644 --- a/crates/swc_ecma_codegen/tests/test262/55c27b3727ba1165.js +++ b/crates/swc_ecma_codegen/tests/test262/55c27b3727ba1165.js @@ -1,2 +1 @@ -(a, ...b)=>{ -}; +(a, ...b)=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/5641ad33abcd1752.js b/crates/swc_ecma_codegen/tests/test262/5641ad33abcd1752.js index 79e3a1cde7a..6745c7fc060 100644 --- a/crates/swc_ecma_codegen/tests/test262/5641ad33abcd1752.js +++ b/crates/swc_ecma_codegen/tests/test262/5641ad33abcd1752.js @@ -1,4 +1,3 @@ a = { - get true () { - } + get true () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js b/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js index c18819d49ae..aeeea976170 100644 --- a/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js +++ b/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js @@ -1,15 +1,11 @@ if (a) { - try { - } catch (b) { - } + try {} catch (b) {} // do not optimize it (function() { c('d'); }()); } else { - try { - } catch (b) { - } + try {} catch (b) {} // do not optimize it (function() { c('d'); diff --git a/crates/swc_ecma_codegen/tests/test262/587400d1c019785a.js b/crates/swc_ecma_codegen/tests/test262/587400d1c019785a.js index 3e88dd10869..8c176c45d50 100644 --- a/crates/swc_ecma_codegen/tests/test262/587400d1c019785a.js +++ b/crates/swc_ecma_codegen/tests/test262/587400d1c019785a.js @@ -1,4 +1,3 @@ -try { -} finally{ +try {} finally{ a(b); } diff --git a/crates/swc_ecma_codegen/tests/test262/5a54ee2c0b326b18.js b/crates/swc_ecma_codegen/tests/test262/5a54ee2c0b326b18.js index 55429466040..83b155999a3 100644 --- a/crates/swc_ecma_codegen/tests/test262/5a54ee2c0b326b18.js +++ b/crates/swc_ecma_codegen/tests/test262/5a54ee2c0b326b18.js @@ -1,4 +1,3 @@ function a(b) { - for(var c = 1, d = b.e();; c++){ - } + for(var c = 1, d = b.e();; c++){} } diff --git a/crates/swc_ecma_codegen/tests/test262/5b39aca97d9006f4.js b/crates/swc_ecma_codegen/tests/test262/5b39aca97d9006f4.js index d9959cb9bff..29f5166a8e4 100644 --- a/crates/swc_ecma_codegen/tests/test262/5b39aca97d9006f4.js +++ b/crates/swc_ecma_codegen/tests/test262/5b39aca97d9006f4.js @@ -1,2 +1 @@ -a`token ${`nested ${`deeply` + { -}} blah`}`; +a`token ${`nested ${`deeply` + {}} blah`}`; diff --git a/crates/swc_ecma_codegen/tests/test262/5b8d2b991d2c1f5b.js b/crates/swc_ecma_codegen/tests/test262/5b8d2b991d2c1f5b.js index 30b42eafb22..b3bf1ddb086 100644 --- a/crates/swc_ecma_codegen/tests/test262/5b8d2b991d2c1f5b.js +++ b/crates/swc_ecma_codegen/tests/test262/5b8d2b991d2c1f5b.js @@ -1,2 +1 @@ -({ -}); +({}); diff --git a/crates/swc_ecma_codegen/tests/test262/5b9f113c3bdd0c49.js b/crates/swc_ecma_codegen/tests/test262/5b9f113c3bdd0c49.js index ce34b0af7bb..b481d5920a0 100644 --- a/crates/swc_ecma_codegen/tests/test262/5b9f113c3bdd0c49.js +++ b/crates/swc_ecma_codegen/tests/test262/5b9f113c3bdd0c49.js @@ -8,14 +8,12 @@ function a() { if (c) { e(); var c; - function b() { - } + function b() {} ; // but nested declarations should not be kept. (function() { var f; - function e() { - } + function e() {} ; })(); } diff --git a/crates/swc_ecma_codegen/tests/test262/5bae374be95382c6.js b/crates/swc_ecma_codegen/tests/test262/5bae374be95382c6.js index 06408fa8f29..1cdad10f5d3 100644 --- a/crates/swc_ecma_codegen/tests/test262/5bae374be95382c6.js +++ b/crates/swc_ecma_codegen/tests/test262/5bae374be95382c6.js @@ -1,6 +1,5 @@ function a() { return; - { - } + {} /foo/; } diff --git a/crates/swc_ecma_codegen/tests/test262/5c57eec29a019ebb.js b/crates/swc_ecma_codegen/tests/test262/5c57eec29a019ebb.js index ff3b6156087..34876fed883 100644 --- a/crates/swc_ecma_codegen/tests/test262/5c57eec29a019ebb.js +++ b/crates/swc_ecma_codegen/tests/test262/5c57eec29a019ebb.js @@ -1,7 +1,5 @@ class a { - static [b]() { - } + static [b]() {} ; - static [c]() { - } + static [c]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/5cf0dc4259e98c15.js b/crates/swc_ecma_codegen/tests/test262/5cf0dc4259e98c15.js index 28d0f49a816..7088f7bc6f3 100644 --- a/crates/swc_ecma_codegen/tests/test262/5cf0dc4259e98c15.js +++ b/crates/swc_ecma_codegen/tests/test262/5cf0dc4259e98c15.js @@ -1,5 +1,3 @@ var a, b; -a.c = (a = { -}, 1); -b = (b = { -}, 2); +a.c = (a = {}, 1); +b = (b = {}, 2); diff --git a/crates/swc_ecma_codegen/tests/test262/5e6d5c3edf519b99.js b/crates/swc_ecma_codegen/tests/test262/5e6d5c3edf519b99.js index 0e0bdd2371e..c0c4f4c7407 100644 --- a/crates/swc_ecma_codegen/tests/test262/5e6d5c3edf519b99.js +++ b/crates/swc_ecma_codegen/tests/test262/5e6d5c3edf519b99.js @@ -1,4 +1,3 @@ a = function({ b } = { b: 1 -}) { -}; +}) {}; diff --git a/crates/swc_ecma_codegen/tests/test262/5ecbbdc097bee212.js b/crates/swc_ecma_codegen/tests/test262/5ecbbdc097bee212.js index 68f92867738..69604bbedb5 100644 --- a/crates/swc_ecma_codegen/tests/test262/5ecbbdc097bee212.js +++ b/crates/swc_ecma_codegen/tests/test262/5ecbbdc097bee212.js @@ -1,2 +1 @@ -for(a in let){ -} +for(a in let){} diff --git a/crates/swc_ecma_codegen/tests/test262/5ed18bdbe48cc4c3.js b/crates/swc_ecma_codegen/tests/test262/5ed18bdbe48cc4c3.js index 1882a2fc3aa..9b33901335c 100644 --- a/crates/swc_ecma_codegen/tests/test262/5ed18bdbe48cc4c3.js +++ b/crates/swc_ecma_codegen/tests/test262/5ed18bdbe48cc4c3.js @@ -1,4 +1,3 @@ function* a() { - var b = function yield() { - }; + var b = function yield() {}; } diff --git a/crates/swc_ecma_codegen/tests/test262/5f730961df66e8e8.js b/crates/swc_ecma_codegen/tests/test262/5f730961df66e8e8.js index 140b8699d75..9e3f79db01f 100644 --- a/crates/swc_ecma_codegen/tests/test262/5f730961df66e8e8.js +++ b/crates/swc_ecma_codegen/tests/test262/5f730961df66e8e8.js @@ -1,4 +1,3 @@ a = { - get false () { - } + get false () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/5f85b0b6828b081b.js b/crates/swc_ecma_codegen/tests/test262/5f85b0b6828b081b.js index 520db067bbf..91b24380cf4 100644 --- a/crates/swc_ecma_codegen/tests/test262/5f85b0b6828b081b.js +++ b/crates/swc_ecma_codegen/tests/test262/5f85b0b6828b081b.js @@ -1,2 +1 @@ -(a, ...[b])=>{ -}; +(a, ...[b])=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/5fa8c711247d70f5.js b/crates/swc_ecma_codegen/tests/test262/5fa8c711247d70f5.js index 584d8a39f5b..019d2c7ee7d 100644 --- a/crates/swc_ecma_codegen/tests/test262/5fa8c711247d70f5.js +++ b/crates/swc_ecma_codegen/tests/test262/5fa8c711247d70f5.js @@ -1,2 +1 @@ -()=>{ -}; +()=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/60dcd48a3f6af44f.js b/crates/swc_ecma_codegen/tests/test262/60dcd48a3f6af44f.js index bfee60c8058..a57da52d176 100644 --- a/crates/swc_ecma_codegen/tests/test262/60dcd48a3f6af44f.js +++ b/crates/swc_ecma_codegen/tests/test262/60dcd48a3f6af44f.js @@ -1,4 +1,3 @@ -try { -} catch (a) { +try {} catch (a) { var a = 1; } diff --git a/crates/swc_ecma_codegen/tests/test262/61f55d9f22cc8426.js b/crates/swc_ecma_codegen/tests/test262/61f55d9f22cc8426.js index bb9e525e9ee..1714a21195a 100644 --- a/crates/swc_ecma_codegen/tests/test262/61f55d9f22cc8426.js +++ b/crates/swc_ecma_codegen/tests/test262/61f55d9f22cc8426.js @@ -1,5 +1,4 @@ class a { - static static() { - } + static static() {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/624bc7f99260037f.js b/crates/swc_ecma_codegen/tests/test262/624bc7f99260037f.js index 23d5aa6f60b..b94e031c5cc 100644 --- a/crates/swc_ecma_codegen/tests/test262/624bc7f99260037f.js +++ b/crates/swc_ecma_codegen/tests/test262/624bc7f99260037f.js @@ -1,2 +1 @@ -function a(b = 1) { -} +function a(b = 1) {} diff --git a/crates/swc_ecma_codegen/tests/test262/62ab44289ebbba49.js b/crates/swc_ecma_codegen/tests/test262/62ab44289ebbba49.js index 3ccd0e44f0a..1ebc4dab3f3 100644 --- a/crates/swc_ecma_codegen/tests/test262/62ab44289ebbba49.js +++ b/crates/swc_ecma_codegen/tests/test262/62ab44289ebbba49.js @@ -1,5 +1,4 @@ (function() { return 1; - function a() { - } + function a() {} }()); diff --git a/crates/swc_ecma_codegen/tests/test262/64cc57f82a54b7fb.js b/crates/swc_ecma_codegen/tests/test262/64cc57f82a54b7fb.js index 6ac1464974c..95a94d10cd9 100644 --- a/crates/swc_ecma_codegen/tests/test262/64cc57f82a54b7fb.js +++ b/crates/swc_ecma_codegen/tests/test262/64cc57f82a54b7fb.js @@ -1,4 +1,3 @@ ({ - get 10 () { - } + get 10 () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/64ff3b3ee7f636c5.js b/crates/swc_ecma_codegen/tests/test262/64ff3b3ee7f636c5.js index 1170790bf65..c0bc3e5a52c 100644 --- a/crates/swc_ecma_codegen/tests/test262/64ff3b3ee7f636c5.js +++ b/crates/swc_ecma_codegen/tests/test262/64ff3b3ee7f636c5.js @@ -1,2 +1 @@ -(function a({ b , c }) { -}); +(function a({ b , c }) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/655eab0815e0567e.js b/crates/swc_ecma_codegen/tests/test262/655eab0815e0567e.js index 927d11c8cfb..8d206aa5f46 100644 --- a/crates/swc_ecma_codegen/tests/test262/655eab0815e0567e.js +++ b/crates/swc_ecma_codegen/tests/test262/655eab0815e0567e.js @@ -1,2 +1 @@ -/**/ function a() { -} +/**/ function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/66bd9903ea05f8cc.js b/crates/swc_ecma_codegen/tests/test262/66bd9903ea05f8cc.js index ab8f423022f..1da27851527 100644 --- a/crates/swc_ecma_codegen/tests/test262/66bd9903ea05f8cc.js +++ b/crates/swc_ecma_codegen/tests/test262/66bd9903ea05f8cc.js @@ -1,4 +1,2 @@ -function a() { -} -function a() { -} +function a() {} +function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/6733f491913ccff2.js b/crates/swc_ecma_codegen/tests/test262/6733f491913ccff2.js index 2d88cb4feb4..3678f212c9b 100644 --- a/crates/swc_ecma_codegen/tests/test262/6733f491913ccff2.js +++ b/crates/swc_ecma_codegen/tests/test262/6733f491913ccff2.js @@ -1,4 +1,3 @@ class a { - constructor(){ - } + constructor(){} } diff --git a/crates/swc_ecma_codegen/tests/test262/673e6f2765ef3cb3.js b/crates/swc_ecma_codegen/tests/test262/673e6f2765ef3cb3.js index fe27db609c5..948ec99cad9 100644 --- a/crates/swc_ecma_codegen/tests/test262/673e6f2765ef3cb3.js +++ b/crates/swc_ecma_codegen/tests/test262/673e6f2765ef3cb3.js @@ -1,2 +1 @@ -a = { -}; +a = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/6776e2c88e03f1a2.js b/crates/swc_ecma_codegen/tests/test262/6776e2c88e03f1a2.js index 496b091189b..af2b0f0b709 100644 --- a/crates/swc_ecma_codegen/tests/test262/6776e2c88e03f1a2.js +++ b/crates/swc_ecma_codegen/tests/test262/6776e2c88e03f1a2.js @@ -1,2 +1 @@ -function* yield() { -} +function* yield() {} diff --git a/crates/swc_ecma_codegen/tests/test262/687b7b904904fcfd.js b/crates/swc_ecma_codegen/tests/test262/687b7b904904fcfd.js index aa8959022b3..23cc9c0ad28 100644 --- a/crates/swc_ecma_codegen/tests/test262/687b7b904904fcfd.js +++ b/crates/swc_ecma_codegen/tests/test262/687b7b904904fcfd.js @@ -1,4 +1,3 @@ class a { - prototype() { - } + prototype() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/698a8cfb0705c277.js b/crates/swc_ecma_codegen/tests/test262/698a8cfb0705c277.js index 79860bcf455..4ff5b17d256 100644 --- a/crates/swc_ecma_codegen/tests/test262/698a8cfb0705c277.js +++ b/crates/swc_ecma_codegen/tests/test262/698a8cfb0705c277.js @@ -1,5 +1,4 @@ ({ a: 1, - get a () { - } + get a () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/69bbdc7c34ed23cc.js b/crates/swc_ecma_codegen/tests/test262/69bbdc7c34ed23cc.js index 60983f6d1c5..e2480c16fd4 100644 --- a/crates/swc_ecma_codegen/tests/test262/69bbdc7c34ed23cc.js +++ b/crates/swc_ecma_codegen/tests/test262/69bbdc7c34ed23cc.js @@ -1,5 +1,4 @@ ({ - get a () { - }, + get a () {}, a: 1 }); diff --git a/crates/swc_ecma_codegen/tests/test262/6b68aefbfbf0beb9.js b/crates/swc_ecma_codegen/tests/test262/6b68aefbfbf0beb9.js index 09bbee2c02c..5e0c490c3bd 100644 --- a/crates/swc_ecma_codegen/tests/test262/6b68aefbfbf0beb9.js +++ b/crates/swc_ecma_codegen/tests/test262/6b68aefbfbf0beb9.js @@ -1,4 +1,3 @@ a = { - set () { - } + set () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/6b76b8761a049c19.js b/crates/swc_ecma_codegen/tests/test262/6b76b8761a049c19.js index 067912c30d8..572c6a44870 100644 --- a/crates/swc_ecma_codegen/tests/test262/6b76b8761a049c19.js +++ b/crates/swc_ecma_codegen/tests/test262/6b76b8761a049c19.js @@ -1,6 +1,5 @@ function* a() { ({ - set b (yield){ - } + set b (yield){} }); } diff --git a/crates/swc_ecma_codegen/tests/test262/6c27d048b07ca7e0.js b/crates/swc_ecma_codegen/tests/test262/6c27d048b07ca7e0.js index 39a5aa10091..60259a5e201 100644 --- a/crates/swc_ecma_codegen/tests/test262/6c27d048b07ca7e0.js +++ b/crates/swc_ecma_codegen/tests/test262/6c27d048b07ca7e0.js @@ -1,17 +1,13 @@ class a { - constructor(){ - } + constructor(){} ; - b() { - } + b() {} ; } ; class c { - constructor(...d){ - } - b() { - } + constructor(...d){} + b() {} } ; class e extends a { diff --git a/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js b/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js index 7caad5dd057..5a7a9ec3e28 100644 --- a/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js +++ b/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js @@ -1,6 +1,5 @@ (function() { 'use strict'; a = 1; - function b() { - } + function b() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/6f824ec22e22a198.js b/crates/swc_ecma_codegen/tests/test262/6f824ec22e22a198.js index 5b684d4a6aa..eee32b1f150 100644 --- a/crates/swc_ecma_codegen/tests/test262/6f824ec22e22a198.js +++ b/crates/swc_ecma_codegen/tests/test262/6f824ec22e22a198.js @@ -1,4 +1,3 @@ ({ - a (b, ...c) { - } + a (b, ...c) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/70bf2c409480ae10.js b/crates/swc_ecma_codegen/tests/test262/70bf2c409480ae10.js index 71a01ae963a..6eec2252c0f 100644 --- a/crates/swc_ecma_codegen/tests/test262/70bf2c409480ae10.js +++ b/crates/swc_ecma_codegen/tests/test262/70bf2c409480ae10.js @@ -1,4 +1,3 @@ ({ - get true () { - } + get true () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/73298cb8636154f2.js b/crates/swc_ecma_codegen/tests/test262/73298cb8636154f2.js index ff02590e19b..371c6df7d52 100644 --- a/crates/swc_ecma_codegen/tests/test262/73298cb8636154f2.js +++ b/crates/swc_ecma_codegen/tests/test262/73298cb8636154f2.js @@ -1,2 +1 @@ -var a = function eval() { -}; +var a = function eval() {}; diff --git a/crates/swc_ecma_codegen/tests/test262/75172741c27c7703.js b/crates/swc_ecma_codegen/tests/test262/75172741c27c7703.js index 1be76dd5d95..cd66260b1b5 100644 --- a/crates/swc_ecma_codegen/tests/test262/75172741c27c7703.js +++ b/crates/swc_ecma_codegen/tests/test262/75172741c27c7703.js @@ -1,2 +1 @@ -(function(yield) { -}); +(function(yield) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/753341b6f22ec11f.js b/crates/swc_ecma_codegen/tests/test262/753341b6f22ec11f.js index a4c487d8074..49637a3338e 100644 --- a/crates/swc_ecma_codegen/tests/test262/753341b6f22ec11f.js +++ b/crates/swc_ecma_codegen/tests/test262/753341b6f22ec11f.js @@ -1,4 +1,3 @@ function* a() { - (function yield() { - }); + (function yield() {}); } diff --git a/crates/swc_ecma_codegen/tests/test262/753a8b016a700975.js b/crates/swc_ecma_codegen/tests/test262/753a8b016a700975.js index 98c6f2e5ed2..95b41c84f4e 100644 --- a/crates/swc_ecma_codegen/tests/test262/753a8b016a700975.js +++ b/crates/swc_ecma_codegen/tests/test262/753a8b016a700975.js @@ -1,2 +1 @@ -(function(a = b) { -}); +(function(a = b) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/75bb6594d6ad253f.module.js b/crates/swc_ecma_codegen/tests/test262/75bb6594d6ad253f.module.js index 25dfc182169..a4a0cc8789e 100644 --- a/crates/swc_ecma_codegen/tests/test262/75bb6594d6ad253f.module.js +++ b/crates/swc_ecma_codegen/tests/test262/75bb6594d6ad253f.module.js @@ -1,2 +1 @@ -export let a = { -}; +export let a = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js b/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js index 5b50a9f9cdd..4c17c156b76 100644 --- a/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js +++ b/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js @@ -1,10 +1,8 @@ a = typeof 1; b = typeof 'c'; d = typeof []; -e = typeof { -}; +e = typeof {}; f = typeof /./; g = typeof false; -h = typeof function() { -}; +h = typeof function() {}; i = typeof j; diff --git a/crates/swc_ecma_codegen/tests/test262/784a059faa166072.js b/crates/swc_ecma_codegen/tests/test262/784a059faa166072.js index 239d7e4a970..46689501113 100644 --- a/crates/swc_ecma_codegen/tests/test262/784a059faa166072.js +++ b/crates/swc_ecma_codegen/tests/test262/784a059faa166072.js @@ -1,2 +1 @@ -(function a(b, b) { -}); +(function a(b, b) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/7855fbf5ea10e622.js b/crates/swc_ecma_codegen/tests/test262/7855fbf5ea10e622.js index ade67aeaf76..3716267abaf 100644 --- a/crates/swc_ecma_codegen/tests/test262/7855fbf5ea10e622.js +++ b/crates/swc_ecma_codegen/tests/test262/7855fbf5ea10e622.js @@ -1,2 +1 @@ -if (a) (function() { -}); +if (a) (function() {}); diff --git a/crates/swc_ecma_codegen/tests/test262/78ea6e4e98c18f91.js b/crates/swc_ecma_codegen/tests/test262/78ea6e4e98c18f91.js index ded05748abd..0e35c72647c 100644 --- a/crates/swc_ecma_codegen/tests/test262/78ea6e4e98c18f91.js +++ b/crates/swc_ecma_codegen/tests/test262/78ea6e4e98c18f91.js @@ -1,3 +1,2 @@ -function a() { -} +function a() {} / 1 /; diff --git a/crates/swc_ecma_codegen/tests/test262/78ecd285b8b44e99.js b/crates/swc_ecma_codegen/tests/test262/78ecd285b8b44e99.js index 54a610bf8a3..5bc181580cb 100644 --- a/crates/swc_ecma_codegen/tests/test262/78ecd285b8b44e99.js +++ b/crates/swc_ecma_codegen/tests/test262/78ecd285b8b44e99.js @@ -1,2 +1 @@ -var { a } = { -}; +var { a } = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/78fa04077cf1950c.js b/crates/swc_ecma_codegen/tests/test262/78fa04077cf1950c.js index 62419fd83d4..a71dd2bb346 100644 --- a/crates/swc_ecma_codegen/tests/test262/78fa04077cf1950c.js +++ b/crates/swc_ecma_codegen/tests/test262/78fa04077cf1950c.js @@ -1,4 +1,3 @@ ({ - set a ([{ b =1 }]){ - } + set a ([{ b =1 }]){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/790a34467d7d9d58.js b/crates/swc_ecma_codegen/tests/test262/790a34467d7d9d58.js index dc9ef6d7382..a0376a43f81 100644 --- a/crates/swc_ecma_codegen/tests/test262/790a34467d7d9d58.js +++ b/crates/swc_ecma_codegen/tests/test262/790a34467d7d9d58.js @@ -1,2 +1 @@ -function eval() { -} +function eval() {} diff --git a/crates/swc_ecma_codegen/tests/test262/791ee64772f0ea45.js b/crates/swc_ecma_codegen/tests/test262/791ee64772f0ea45.js index 13fc186074c..0d9488cb3bf 100644 --- a/crates/swc_ecma_codegen/tests/test262/791ee64772f0ea45.js +++ b/crates/swc_ecma_codegen/tests/test262/791ee64772f0ea45.js @@ -1,4 +1,3 @@ function a() { - var b = function c() { - }; + var b = function c() {}; } diff --git a/crates/swc_ecma_codegen/tests/test262/7bdcce70c382a9a4.js b/crates/swc_ecma_codegen/tests/test262/7bdcce70c382a9a4.js index 5d99c88e93c..427e76c1c4e 100644 --- a/crates/swc_ecma_codegen/tests/test262/7bdcce70c382a9a4.js +++ b/crates/swc_ecma_codegen/tests/test262/7bdcce70c382a9a4.js @@ -1,5 +1,4 @@ (function() { - var a = { - }; + var a = {}; a.b + (c(), d(), e()); // do not transform }()); diff --git a/crates/swc_ecma_codegen/tests/test262/7dea677261fc5dd8.module.js b/crates/swc_ecma_codegen/tests/test262/7dea677261fc5dd8.module.js index 4a60b72adbb..81cb254bf31 100644 --- a/crates/swc_ecma_codegen/tests/test262/7dea677261fc5dd8.module.js +++ b/crates/swc_ecma_codegen/tests/test262/7dea677261fc5dd8.module.js @@ -1,2 +1 @@ -export var a = function() { -}; +export var a = function() {}; diff --git a/crates/swc_ecma_codegen/tests/test262/7e99cc8b7ce365fb.js b/crates/swc_ecma_codegen/tests/test262/7e99cc8b7ce365fb.js index 23bf1012077..34bfc198c45 100644 --- a/crates/swc_ecma_codegen/tests/test262/7e99cc8b7ce365fb.js +++ b/crates/swc_ecma_codegen/tests/test262/7e99cc8b7ce365fb.js @@ -1,5 +1,4 @@ -var a = { -}; +var a = {}; a.b = 1; a.c = 2; d.e(a.b); diff --git a/crates/swc_ecma_codegen/tests/test262/7fbe94acda67721e.js b/crates/swc_ecma_codegen/tests/test262/7fbe94acda67721e.js index 4acd4a10318..a62cb96d570 100644 --- a/crates/swc_ecma_codegen/tests/test262/7fbe94acda67721e.js +++ b/crates/swc_ecma_codegen/tests/test262/7fbe94acda67721e.js @@ -1,4 +1,3 @@ ({ - *yield () { - } + *yield () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/80d2351a5ae68524.js b/crates/swc_ecma_codegen/tests/test262/80d2351a5ae68524.js index 737997f5de0..8aa0716bc95 100644 --- a/crates/swc_ecma_codegen/tests/test262/80d2351a5ae68524.js +++ b/crates/swc_ecma_codegen/tests/test262/80d2351a5ae68524.js @@ -1,4 +1,3 @@ a = { - set b (c){ - } + set b (c){} }; diff --git a/crates/swc_ecma_codegen/tests/test262/81be1572d1eebdf2.js b/crates/swc_ecma_codegen/tests/test262/81be1572d1eebdf2.js index b9fbc7d2091..e48e6f841a4 100644 --- a/crates/swc_ecma_codegen/tests/test262/81be1572d1eebdf2.js +++ b/crates/swc_ecma_codegen/tests/test262/81be1572d1eebdf2.js @@ -1,4 +1,3 @@ a = { - b (c = 1) { - } + b (c = 1) {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/820521ef532dce18.js b/crates/swc_ecma_codegen/tests/test262/820521ef532dce18.js index 57b54e041bb..3a509a3ce9a 100644 --- a/crates/swc_ecma_codegen/tests/test262/820521ef532dce18.js +++ b/crates/swc_ecma_codegen/tests/test262/820521ef532dce18.js @@ -1,4 +1,3 @@ function a([b] = [ 1 -]) { -} +]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/8286caaa8e0196bb.js b/crates/swc_ecma_codegen/tests/test262/8286caaa8e0196bb.js index 9cab4a23024..eea0076b3d5 100644 --- a/crates/swc_ecma_codegen/tests/test262/8286caaa8e0196bb.js +++ b/crates/swc_ecma_codegen/tests/test262/8286caaa8e0196bb.js @@ -1,4 +1,3 @@ { - function a() { - } + function a() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/8340cdb8653046bb.js b/crates/swc_ecma_codegen/tests/test262/8340cdb8653046bb.js index fe14b6531ad..98acceb5ea5 100644 --- a/crates/swc_ecma_codegen/tests/test262/8340cdb8653046bb.js +++ b/crates/swc_ecma_codegen/tests/test262/8340cdb8653046bb.js @@ -1,2 +1 @@ -for(var [a, b] in c){ -} +for(var [a, b] in c){} diff --git a/crates/swc_ecma_codegen/tests/test262/83fc5b5bbdb601ef.js b/crates/swc_ecma_codegen/tests/test262/83fc5b5bbdb601ef.js index 007afe378cf..cef523b9ec7 100644 --- a/crates/swc_ecma_codegen/tests/test262/83fc5b5bbdb601ef.js +++ b/crates/swc_ecma_codegen/tests/test262/83fc5b5bbdb601ef.js @@ -1,8 +1,5 @@ (function() { - function a() { - } - function b() { - } - function c() { - } + function a() {} + function b() {} + function c() {} }()); diff --git a/crates/swc_ecma_codegen/tests/test262/8411f3c15e3e8529.js b/crates/swc_ecma_codegen/tests/test262/8411f3c15e3e8529.js index 407a2ca78b1..01e89784d5f 100644 --- a/crates/swc_ecma_codegen/tests/test262/8411f3c15e3e8529.js +++ b/crates/swc_ecma_codegen/tests/test262/8411f3c15e3e8529.js @@ -1,5 +1,4 @@ { - { - } + {} /foo/; } diff --git a/crates/swc_ecma_codegen/tests/test262/845631d1a33b3409.js b/crates/swc_ecma_codegen/tests/test262/845631d1a33b3409.js index ace69ff691c..a98da644887 100644 --- a/crates/swc_ecma_codegen/tests/test262/845631d1a33b3409.js +++ b/crates/swc_ecma_codegen/tests/test262/845631d1a33b3409.js @@ -1,6 +1,4 @@ class a { - b() { - } - get b() { - } + b() {} + get b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js b/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js index dadcfcf8bfc..2c9840606a2 100644 --- a/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js +++ b/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js @@ -1,5 +1,4 @@ (function() { 'use strict'; - function a() { - } + function a() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/8628cd459b39ffe8.js b/crates/swc_ecma_codegen/tests/test262/8628cd459b39ffe8.js index d905ae37ce6..8db91f22960 100644 --- a/crates/swc_ecma_codegen/tests/test262/8628cd459b39ffe8.js +++ b/crates/swc_ecma_codegen/tests/test262/8628cd459b39ffe8.js @@ -1,3 +1 @@ -try { -} catch ([a = 1]) { -} +try {} catch ([a = 1]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/8664d1a4e7a73078.js b/crates/swc_ecma_codegen/tests/test262/8664d1a4e7a73078.js index 6bbe72be07b..74d0ae78e71 100644 --- a/crates/swc_ecma_codegen/tests/test262/8664d1a4e7a73078.js +++ b/crates/swc_ecma_codegen/tests/test262/8664d1a4e7a73078.js @@ -1,2 +1 @@ -function a({ [b]: c }) { -} +function a({ [b]: c }) {} diff --git a/crates/swc_ecma_codegen/tests/test262/86f68610fcefaeae.js b/crates/swc_ecma_codegen/tests/test262/86f68610fcefaeae.js index 299492ebe5f..578167ed55a 100644 --- a/crates/swc_ecma_codegen/tests/test262/86f68610fcefaeae.js +++ b/crates/swc_ecma_codegen/tests/test262/86f68610fcefaeae.js @@ -1,6 +1,4 @@ class a { - b() { - } - static c() { - } + b() {} + static c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/870a0b8d891753e9.js b/crates/swc_ecma_codegen/tests/test262/870a0b8d891753e9.js index ae0f608dc6f..f5912f76fb5 100644 --- a/crates/swc_ecma_codegen/tests/test262/870a0b8d891753e9.js +++ b/crates/swc_ecma_codegen/tests/test262/870a0b8d891753e9.js @@ -1,2 +1 @@ -(function(a, ...b) { -}); +(function(a, ...b) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/88d42455ac933ef5.js b/crates/swc_ecma_codegen/tests/test262/88d42455ac933ef5.js index 0c305c1fa72..20ab17675a7 100644 --- a/crates/swc_ecma_codegen/tests/test262/88d42455ac933ef5.js +++ b/crates/swc_ecma_codegen/tests/test262/88d42455ac933ef5.js @@ -1,6 +1,4 @@ class a { - constructor(){ - } - constructor(){ - } + constructor(){} + constructor(){} } diff --git a/crates/swc_ecma_codegen/tests/test262/88e99d6cd8e8d87f.js b/crates/swc_ecma_codegen/tests/test262/88e99d6cd8e8d87f.js index f8e7f820d26..4df46943d26 100644 --- a/crates/swc_ecma_codegen/tests/test262/88e99d6cd8e8d87f.js +++ b/crates/swc_ecma_codegen/tests/test262/88e99d6cd8e8d87f.js @@ -1,2 +1 @@ -function* a() { -} +function* a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/891fc3470b618587.js b/crates/swc_ecma_codegen/tests/test262/891fc3470b618587.js index 415da614e33..e16b456ec2e 100644 --- a/crates/swc_ecma_codegen/tests/test262/891fc3470b618587.js +++ b/crates/swc_ecma_codegen/tests/test262/891fc3470b618587.js @@ -1,2 +1 @@ -a((b, c)=>{ -}); +a((b, c)=>{}); diff --git a/crates/swc_ecma_codegen/tests/test262/8c5c46a300d5addb.module.js b/crates/swc_ecma_codegen/tests/test262/8c5c46a300d5addb.module.js index e015fdccd45..60dfa8b04ea 100644 --- a/crates/swc_ecma_codegen/tests/test262/8c5c46a300d5addb.module.js +++ b/crates/swc_ecma_codegen/tests/test262/8c5c46a300d5addb.module.js @@ -1,4 +1,3 @@ -export function a() { -} +export function a() {} ; 1; diff --git a/crates/swc_ecma_codegen/tests/test262/8d14286a8cc6ee9d.js b/crates/swc_ecma_codegen/tests/test262/8d14286a8cc6ee9d.js index 0695877ed44..846a383c19b 100644 --- a/crates/swc_ecma_codegen/tests/test262/8d14286a8cc6ee9d.js +++ b/crates/swc_ecma_codegen/tests/test262/8d14286a8cc6ee9d.js @@ -1,2 +1 @@ -(function*(...a) { -}); +(function*(...a) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/8d470354c5d2e216.js b/crates/swc_ecma_codegen/tests/test262/8d470354c5d2e216.js index 581bd33b1a0..73cef3d6c7e 100644 --- a/crates/swc_ecma_codegen/tests/test262/8d470354c5d2e216.js +++ b/crates/swc_ecma_codegen/tests/test262/8d470354c5d2e216.js @@ -1,3 +1,2 @@ ; -function a() { -} +function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/8d67ad04bfc356c9.js b/crates/swc_ecma_codegen/tests/test262/8d67ad04bfc356c9.js index 343afeec7ee..f785714102a 100644 --- a/crates/swc_ecma_codegen/tests/test262/8d67ad04bfc356c9.js +++ b/crates/swc_ecma_codegen/tests/test262/8d67ad04bfc356c9.js @@ -1,4 +1,3 @@ ({ - set __proto__ (a){ - } + set __proto__ (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/8d7d59e5d573ca84.js b/crates/swc_ecma_codegen/tests/test262/8d7d59e5d573ca84.js index 00002739f7c..a5bac944552 100644 --- a/crates/swc_ecma_codegen/tests/test262/8d7d59e5d573ca84.js +++ b/crates/swc_ecma_codegen/tests/test262/8d7d59e5d573ca84.js @@ -1,5 +1,4 @@ ({ "__proto__": null, - set __proto__ (a){ - } + set __proto__ (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/8dbf5f9322d8b5ac.js b/crates/swc_ecma_codegen/tests/test262/8dbf5f9322d8b5ac.js index f914f037bf2..51d6ac21e40 100644 --- a/crates/swc_ecma_codegen/tests/test262/8dbf5f9322d8b5ac.js +++ b/crates/swc_ecma_codegen/tests/test262/8dbf5f9322d8b5ac.js @@ -1,4 +1,3 @@ a = { - b (c) { - } + b (c) {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/8de47a8b53495792.js b/crates/swc_ecma_codegen/tests/test262/8de47a8b53495792.js index 15dcb6251ed..3b20fa87cbd 100644 --- a/crates/swc_ecma_codegen/tests/test262/8de47a8b53495792.js +++ b/crates/swc_ecma_codegen/tests/test262/8de47a8b53495792.js @@ -1,2 +1 @@ -function a(yield) { -} +function a(yield) {} diff --git a/crates/swc_ecma_codegen/tests/test262/8e6c915d1746636d.js b/crates/swc_ecma_codegen/tests/test262/8e6c915d1746636d.js index de42e6880cb..62ab698be9a 100644 --- a/crates/swc_ecma_codegen/tests/test262/8e6c915d1746636d.js +++ b/crates/swc_ecma_codegen/tests/test262/8e6c915d1746636d.js @@ -1,4 +1,3 @@ (({ a } = { a: 1 -})=>{ -}); +})=>{}); diff --git a/crates/swc_ecma_codegen/tests/test262/8ecaef2617d8c6a7.js b/crates/swc_ecma_codegen/tests/test262/8ecaef2617d8c6a7.js index a38eee76ccd..0f447adbd19 100644 --- a/crates/swc_ecma_codegen/tests/test262/8ecaef2617d8c6a7.js +++ b/crates/swc_ecma_codegen/tests/test262/8ecaef2617d8c6a7.js @@ -1,3 +1 @@ -try { -} catch (a) { -} +try {} catch (a) {} diff --git a/crates/swc_ecma_codegen/tests/test262/8f659ed872554f99.js b/crates/swc_ecma_codegen/tests/test262/8f659ed872554f99.js index 4440e57bb66..83a76883d26 100644 --- a/crates/swc_ecma_codegen/tests/test262/8f659ed872554f99.js +++ b/crates/swc_ecma_codegen/tests/test262/8f659ed872554f99.js @@ -1,4 +1,3 @@ class a { - static get() { - } + static get() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/8f9e8be5a6c50e77.js b/crates/swc_ecma_codegen/tests/test262/8f9e8be5a6c50e77.js index b7b3bd3136f..8c58a7b441b 100644 --- a/crates/swc_ecma_codegen/tests/test262/8f9e8be5a6c50e77.js +++ b/crates/swc_ecma_codegen/tests/test262/8f9e8be5a6c50e77.js @@ -1,4 +1,3 @@ function a() { - return function b(c) { - }; + return function b(c) {}; } diff --git a/crates/swc_ecma_codegen/tests/test262/901fca17189cd709.js b/crates/swc_ecma_codegen/tests/test262/901fca17189cd709.js index 65bfc377d2a..2e87523e977 100644 --- a/crates/swc_ecma_codegen/tests/test262/901fca17189cd709.js +++ b/crates/swc_ecma_codegen/tests/test262/901fca17189cd709.js @@ -1,7 +1,6 @@ function* a() { (class { - [yield]() { - } + [yield]() {} }); } ; diff --git a/crates/swc_ecma_codegen/tests/test262/90abe26c46af6975.js b/crates/swc_ecma_codegen/tests/test262/90abe26c46af6975.js index d9e0f43dd4c..612735e47c1 100644 --- a/crates/swc_ecma_codegen/tests/test262/90abe26c46af6975.js +++ b/crates/swc_ecma_codegen/tests/test262/90abe26c46af6975.js @@ -1,2 +1 @@ -function yield() { -} +function yield() {} diff --git a/crates/swc_ecma_codegen/tests/test262/914ae3168da48965.js b/crates/swc_ecma_codegen/tests/test262/914ae3168da48965.js index de44948dcc2..778886fcb90 100644 --- a/crates/swc_ecma_codegen/tests/test262/914ae3168da48965.js +++ b/crates/swc_ecma_codegen/tests/test262/914ae3168da48965.js @@ -1,2 +1 @@ -throw { -}; +throw {}; diff --git a/crates/swc_ecma_codegen/tests/test262/918e105a2ff6c64a.js b/crates/swc_ecma_codegen/tests/test262/918e105a2ff6c64a.js index be8f33fbe5a..346ffaf0683 100644 --- a/crates/swc_ecma_codegen/tests/test262/918e105a2ff6c64a.js +++ b/crates/swc_ecma_codegen/tests/test262/918e105a2ff6c64a.js @@ -1,4 +1,3 @@ class a extends b { - get c() { - } + get c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/92fd8e24864fde0a.js b/crates/swc_ecma_codegen/tests/test262/92fd8e24864fde0a.js index 6bbf4dc1253..aa5cbac4024 100644 --- a/crates/swc_ecma_codegen/tests/test262/92fd8e24864fde0a.js +++ b/crates/swc_ecma_codegen/tests/test262/92fd8e24864fde0a.js @@ -1,2 +1 @@ -(function eval() { -}); +(function eval() {}); diff --git a/crates/swc_ecma_codegen/tests/test262/939479d60d564ccd.js b/crates/swc_ecma_codegen/tests/test262/939479d60d564ccd.js index c36a58b45a1..9fb619eed68 100644 --- a/crates/swc_ecma_codegen/tests/test262/939479d60d564ccd.js +++ b/crates/swc_ecma_codegen/tests/test262/939479d60d564ccd.js @@ -1,4 +1,3 @@ ({ - *a (b, c, d) { - } + *a (b, c, d) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/93c75264893587a5.js b/crates/swc_ecma_codegen/tests/test262/93c75264893587a5.js index 4acd4a10318..a62cb96d570 100644 --- a/crates/swc_ecma_codegen/tests/test262/93c75264893587a5.js +++ b/crates/swc_ecma_codegen/tests/test262/93c75264893587a5.js @@ -1,4 +1,3 @@ ({ - *yield () { - } + *yield () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/9495a0dcecf5713c.js b/crates/swc_ecma_codegen/tests/test262/9495a0dcecf5713c.js index 7b2753aff74..ee873796f11 100644 --- a/crates/swc_ecma_codegen/tests/test262/9495a0dcecf5713c.js +++ b/crates/swc_ecma_codegen/tests/test262/9495a0dcecf5713c.js @@ -1,4 +1,3 @@ ({ - [a]: ()=>{ - } + [a]: ()=>{} }); diff --git a/crates/swc_ecma_codegen/tests/test262/94b8a654a87039b9.js b/crates/swc_ecma_codegen/tests/test262/94b8a654a87039b9.js index 69ba9092c1f..39d5e8180c7 100644 --- a/crates/swc_ecma_codegen/tests/test262/94b8a654a87039b9.js +++ b/crates/swc_ecma_codegen/tests/test262/94b8a654a87039b9.js @@ -1,2 +1 @@ -(function*(a, b, c) { -}); +(function*(a, b, c) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/94cb828d5dcfd136.js b/crates/swc_ecma_codegen/tests/test262/94cb828d5dcfd136.js index 56f4c18c869..c832bb8ed22 100644 --- a/crates/swc_ecma_codegen/tests/test262/94cb828d5dcfd136.js +++ b/crates/swc_ecma_codegen/tests/test262/94cb828d5dcfd136.js @@ -1,3 +1 @@ -try { -} catch (arguments) { -} +try {} catch (arguments) {} diff --git a/crates/swc_ecma_codegen/tests/test262/973cbc9ece13acbc.js b/crates/swc_ecma_codegen/tests/test262/973cbc9ece13acbc.js index 8a16eb28d4a..3b82a304575 100644 --- a/crates/swc_ecma_codegen/tests/test262/973cbc9ece13acbc.js +++ b/crates/swc_ecma_codegen/tests/test262/973cbc9ece13acbc.js @@ -1,4 +1,2 @@ -function* a() { -} -function a() { -} +function* a() {} +function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/976afd9ae5f5d71a.module.js b/crates/swc_ecma_codegen/tests/test262/976afd9ae5f5d71a.module.js index 266a17003b1..11080b753fc 100644 --- a/crates/swc_ecma_codegen/tests/test262/976afd9ae5f5d71a.module.js +++ b/crates/swc_ecma_codegen/tests/test262/976afd9ae5f5d71a.module.js @@ -1,3 +1,2 @@ -export function a() { -} +export function a() {} ; diff --git a/crates/swc_ecma_codegen/tests/test262/98df58b0c40fac90.js b/crates/swc_ecma_codegen/tests/test262/98df58b0c40fac90.js index 29cf4895513..7665d023b13 100644 --- a/crates/swc_ecma_codegen/tests/test262/98df58b0c40fac90.js +++ b/crates/swc_ecma_codegen/tests/test262/98df58b0c40fac90.js @@ -1,2 +1 @@ -a = function() { -}(b()); +a = function() {}(b()); diff --git a/crates/swc_ecma_codegen/tests/test262/99cdfc40e20af6f5.js b/crates/swc_ecma_codegen/tests/test262/99cdfc40e20af6f5.js index 161c38d45fe..223b5d362bb 100644 --- a/crates/swc_ecma_codegen/tests/test262/99cdfc40e20af6f5.js +++ b/crates/swc_ecma_codegen/tests/test262/99cdfc40e20af6f5.js @@ -1,2 +1 @@ -var a = function() { -}(b()); +var a = function() {}(b()); diff --git a/crates/swc_ecma_codegen/tests/test262/99fceed987b8ec3d.js b/crates/swc_ecma_codegen/tests/test262/99fceed987b8ec3d.js index 43c3f76f82f..82c781dd129 100644 --- a/crates/swc_ecma_codegen/tests/test262/99fceed987b8ec3d.js +++ b/crates/swc_ecma_codegen/tests/test262/99fceed987b8ec3d.js @@ -1,2 +1 @@ -function a(...[]) { -} +function a(...[]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/9aa93e1e417ce8e3.js b/crates/swc_ecma_codegen/tests/test262/9aa93e1e417ce8e3.js index c147906ee3d..e03c1f6f15d 100644 --- a/crates/swc_ecma_codegen/tests/test262/9aa93e1e417ce8e3.js +++ b/crates/swc_ecma_codegen/tests/test262/9aa93e1e417ce8e3.js @@ -1,2 +1 @@ -for(let in a){ -} +for(let in a){} diff --git a/crates/swc_ecma_codegen/tests/test262/9c30b0817f412a30.js b/crates/swc_ecma_codegen/tests/test262/9c30b0817f412a30.js index cc67abf49bd..38d601899bf 100644 --- a/crates/swc_ecma_codegen/tests/test262/9c30b0817f412a30.js +++ b/crates/swc_ecma_codegen/tests/test262/9c30b0817f412a30.js @@ -1,4 +1,3 @@ (function() { - return { - }; + return {}; })().a = 1; // should not transform this one diff --git a/crates/swc_ecma_codegen/tests/test262/9d3d960e32528788.js b/crates/swc_ecma_codegen/tests/test262/9d3d960e32528788.js index d78bbefb9cf..fd29eecef56 100644 --- a/crates/swc_ecma_codegen/tests/test262/9d3d960e32528788.js +++ b/crates/swc_ecma_codegen/tests/test262/9d3d960e32528788.js @@ -1,2 +1 @@ -(function() { -} / 1); +(function() {} / 1); diff --git a/crates/swc_ecma_codegen/tests/test262/9dc20e081005fba4.js b/crates/swc_ecma_codegen/tests/test262/9dc20e081005fba4.js index ace9c9f53d7..2bc30f54c9f 100644 --- a/crates/swc_ecma_codegen/tests/test262/9dc20e081005fba4.js +++ b/crates/swc_ecma_codegen/tests/test262/9dc20e081005fba4.js @@ -7,6 +7,5 @@ e = { b ([{ c }]) { return c; }, - f () { - } + f () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/9e3e46891aaf13de.js b/crates/swc_ecma_codegen/tests/test262/9e3e46891aaf13de.js index 92d32392e6e..89fb8265051 100644 --- a/crates/swc_ecma_codegen/tests/test262/9e3e46891aaf13de.js +++ b/crates/swc_ecma_codegen/tests/test262/9e3e46891aaf13de.js @@ -1,2 +1 @@ -let { a: b } = { -}; +let { a: b } = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/9fd584806e085e35.js b/crates/swc_ecma_codegen/tests/test262/9fd584806e085e35.js index 785e820770f..4e5915eb931 100644 --- a/crates/swc_ecma_codegen/tests/test262/9fd584806e085e35.js +++ b/crates/swc_ecma_codegen/tests/test262/9fd584806e085e35.js @@ -1,6 +1,4 @@ class a { - b() { - } - c() { - } + b() {} + c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/a08ed291f78352a0.js b/crates/swc_ecma_codegen/tests/test262/a08ed291f78352a0.js index 035a0b3e6f3..65527346b43 100644 --- a/crates/swc_ecma_codegen/tests/test262/a08ed291f78352a0.js +++ b/crates/swc_ecma_codegen/tests/test262/a08ed291f78352a0.js @@ -1,6 +1,5 @@ a(function() { - function b() { - } + function b() {} if (b()) { b(); return void 1; diff --git a/crates/swc_ecma_codegen/tests/test262/a1594a4d0c0ee99a.js b/crates/swc_ecma_codegen/tests/test262/a1594a4d0c0ee99a.js index 55fec75efe0..4b4c2401d30 100644 --- a/crates/swc_ecma_codegen/tests/test262/a1594a4d0c0ee99a.js +++ b/crates/swc_ecma_codegen/tests/test262/a1594a4d0c0ee99a.js @@ -1,2 +1 @@ -for(let a = let;;){ -} +for(let a = let;;){} diff --git a/crates/swc_ecma_codegen/tests/test262/a18a8865e65d4bdd.js b/crates/swc_ecma_codegen/tests/test262/a18a8865e65d4bdd.js index 969cde4fd12..4fbcab63cf2 100644 --- a/crates/swc_ecma_codegen/tests/test262/a18a8865e65d4bdd.js +++ b/crates/swc_ecma_codegen/tests/test262/a18a8865e65d4bdd.js @@ -1,4 +1,3 @@ ({ - [a] () { - } + [a] () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/a2798917405b080b.js b/crates/swc_ecma_codegen/tests/test262/a2798917405b080b.js index b3916a5ac76..828c2361bf6 100644 --- a/crates/swc_ecma_codegen/tests/test262/a2798917405b080b.js +++ b/crates/swc_ecma_codegen/tests/test262/a2798917405b080b.js @@ -1,3 +1 @@ -try { -} catch ({}) { -} +try {} catch ({}) {} diff --git a/crates/swc_ecma_codegen/tests/test262/a2cb5a14559c6a50.js b/crates/swc_ecma_codegen/tests/test262/a2cb5a14559c6a50.js index 85024faab24..42c9869dc16 100644 --- a/crates/swc_ecma_codegen/tests/test262/a2cb5a14559c6a50.js +++ b/crates/swc_ecma_codegen/tests/test262/a2cb5a14559c6a50.js @@ -1,3 +1 @@ -try { -} catch (yield) { -} +try {} catch (yield) {} diff --git a/crates/swc_ecma_codegen/tests/test262/a3b497c58f78b243.js b/crates/swc_ecma_codegen/tests/test262/a3b497c58f78b243.js index d3851a6dbd7..87344b431c1 100644 --- a/crates/swc_ecma_codegen/tests/test262/a3b497c58f78b243.js +++ b/crates/swc_ecma_codegen/tests/test262/a3b497c58f78b243.js @@ -1,4 +1,3 @@ (function() { - function a() { - } + function a() {} }()); diff --git a/crates/swc_ecma_codegen/tests/test262/a42a93f3af33bbc5.js b/crates/swc_ecma_codegen/tests/test262/a42a93f3af33bbc5.js index 92baf120bf7..1c7a06cc94b 100644 --- a/crates/swc_ecma_codegen/tests/test262/a42a93f3af33bbc5.js +++ b/crates/swc_ecma_codegen/tests/test262/a42a93f3af33bbc5.js @@ -8,5 +8,4 @@ a = 7; switch(b){ } a = 8; -with (g){ -} +with (g){} diff --git a/crates/swc_ecma_codegen/tests/test262/a454d2e2ab3484e6.js b/crates/swc_ecma_codegen/tests/test262/a454d2e2ab3484e6.js index 254cb5d37a7..2e175bf0f23 100644 --- a/crates/swc_ecma_codegen/tests/test262/a454d2e2ab3484e6.js +++ b/crates/swc_ecma_codegen/tests/test262/a454d2e2ab3484e6.js @@ -1,2 +1 @@ -(function*() { -}); +(function*() {}); diff --git a/crates/swc_ecma_codegen/tests/test262/a54cca69085ad35a.js b/crates/swc_ecma_codegen/tests/test262/a54cca69085ad35a.js index 926b584e588..2e16e29fbd8 100644 --- a/crates/swc_ecma_codegen/tests/test262/a54cca69085ad35a.js +++ b/crates/swc_ecma_codegen/tests/test262/a54cca69085ad35a.js @@ -1,4 +1,3 @@ class a { - static set b(c) { - } + static set b(c) {} } diff --git a/crates/swc_ecma_codegen/tests/test262/a8535eac4c7c9c3a.js b/crates/swc_ecma_codegen/tests/test262/a8535eac4c7c9c3a.js index 38bac06bf87..86e777a0a6e 100644 --- a/crates/swc_ecma_codegen/tests/test262/a8535eac4c7c9c3a.js +++ b/crates/swc_ecma_codegen/tests/test262/a8535eac4c7c9c3a.js @@ -1,4 +1,3 @@ class a { - static() { - } + static() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/a86a29773d1168d3.js b/crates/swc_ecma_codegen/tests/test262/a86a29773d1168d3.js index f8e030615fc..4d5aaa8c48f 100644 --- a/crates/swc_ecma_codegen/tests/test262/a86a29773d1168d3.js +++ b/crates/swc_ecma_codegen/tests/test262/a86a29773d1168d3.js @@ -1,3 +1 @@ -try { -} catch ([]) { -} +try {} catch ([]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/a9e4ff39f145a1fd.js b/crates/swc_ecma_codegen/tests/test262/a9e4ff39f145a1fd.js index a926568357d..4abfa9df528 100644 --- a/crates/swc_ecma_codegen/tests/test262/a9e4ff39f145a1fd.js +++ b/crates/swc_ecma_codegen/tests/test262/a9e4ff39f145a1fd.js @@ -1,6 +1,5 @@ ({ a ({ b } = { b: 1 - }) { - } + }) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/a9f99e657441a735.js b/crates/swc_ecma_codegen/tests/test262/a9f99e657441a735.js index 59433a1b783..440cdadba40 100644 --- a/crates/swc_ecma_codegen/tests/test262/a9f99e657441a735.js +++ b/crates/swc_ecma_codegen/tests/test262/a9f99e657441a735.js @@ -1,4 +1,3 @@ (class { - static() { - } + static() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/aaf1be6cd60a9ac9.js b/crates/swc_ecma_codegen/tests/test262/aaf1be6cd60a9ac9.js index 644af57515b..a8c496dabfc 100644 --- a/crates/swc_ecma_codegen/tests/test262/aaf1be6cd60a9ac9.js +++ b/crates/swc_ecma_codegen/tests/test262/aaf1be6cd60a9ac9.js @@ -1,4 +1,3 @@ ({ - "a" () { - } + "a" () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js b/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js index bd273680427..508b2f87fc6 100644 --- a/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js +++ b/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js @@ -1,8 +1,7 @@ if (a) { try { b('try'); - } catch (c) { - } + } catch (c) {} // do not optimize it (function() { b('d'); diff --git a/crates/swc_ecma_codegen/tests/test262/ac09566949f0db57.js b/crates/swc_ecma_codegen/tests/test262/ac09566949f0db57.js index 40cb8f5519c..ef87217eb02 100644 --- a/crates/swc_ecma_codegen/tests/test262/ac09566949f0db57.js +++ b/crates/swc_ecma_codegen/tests/test262/ac09566949f0db57.js @@ -1,5 +1,4 @@ { - do { - }while (false) + do {}while (false) false; } diff --git a/crates/swc_ecma_codegen/tests/test262/ad6bf12aa7eda975.js b/crates/swc_ecma_codegen/tests/test262/ad6bf12aa7eda975.js index 87a1991f13f..86ed489536c 100644 --- a/crates/swc_ecma_codegen/tests/test262/ad6bf12aa7eda975.js +++ b/crates/swc_ecma_codegen/tests/test262/ad6bf12aa7eda975.js @@ -1,2 +1 @@ -(function([a]) { -}); +(function([a]) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/ad7d61a732903cd8.js b/crates/swc_ecma_codegen/tests/test262/ad7d61a732903cd8.js index 18f47bd45b1..33874862130 100644 --- a/crates/swc_ecma_codegen/tests/test262/ad7d61a732903cd8.js +++ b/crates/swc_ecma_codegen/tests/test262/ad7d61a732903cd8.js @@ -1,4 +1,3 @@ ({ - a ([b, c]) { - } + a ([b, c]) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/ae89d08bdd65b56b.js b/crates/swc_ecma_codegen/tests/test262/ae89d08bdd65b56b.js index 785e820770f..4e5915eb931 100644 --- a/crates/swc_ecma_codegen/tests/test262/ae89d08bdd65b56b.js +++ b/crates/swc_ecma_codegen/tests/test262/ae89d08bdd65b56b.js @@ -1,6 +1,4 @@ class a { - b() { - } - c() { - } + b() {} + c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/af1d905ed056724f.js b/crates/swc_ecma_codegen/tests/test262/af1d905ed056724f.js index 03e1aaec4aa..8643e0f164e 100644 --- a/crates/swc_ecma_codegen/tests/test262/af1d905ed056724f.js +++ b/crates/swc_ecma_codegen/tests/test262/af1d905ed056724f.js @@ -1,2 +1 @@ -var a = function arguments() { -}; +var a = function arguments() {}; diff --git a/crates/swc_ecma_codegen/tests/test262/af4bbcea9802b120.js b/crates/swc_ecma_codegen/tests/test262/af4bbcea9802b120.js index bc3522409c5..2b19eb5cef7 100644 --- a/crates/swc_ecma_codegen/tests/test262/af4bbcea9802b120.js +++ b/crates/swc_ecma_codegen/tests/test262/af4bbcea9802b120.js @@ -1,4 +1,3 @@ (class { - a() { - } + a() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js b/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js index bfd852f82f5..2cb32e9ba9a 100644 --- a/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js +++ b/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js @@ -1,7 +1,5 @@ ({ a: 1, - get 'b' () { - }, - set 3 (c){ - } + get 'b' () {}, + set 3 (c){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/affd557fd820e1f2.js b/crates/swc_ecma_codegen/tests/test262/affd557fd820e1f2.js index 2b17d01b341..f517ec4a6df 100644 --- a/crates/swc_ecma_codegen/tests/test262/affd557fd820e1f2.js +++ b/crates/swc_ecma_codegen/tests/test262/affd557fd820e1f2.js @@ -1,6 +1,4 @@ ({ - get [a] () { - }, - set [a] (b){ - } + get [a] () {}, + set [a] (b){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/b030378ad6e36751.js b/crates/swc_ecma_codegen/tests/test262/b030378ad6e36751.js index 939df225b3a..b7c442e25bd 100644 --- a/crates/swc_ecma_codegen/tests/test262/b030378ad6e36751.js +++ b/crates/swc_ecma_codegen/tests/test262/b030378ad6e36751.js @@ -1,4 +1,3 @@ class a { - static [b]() { - } + static [b]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/b0659cf9cb6793a2.js b/crates/swc_ecma_codegen/tests/test262/b0659cf9cb6793a2.js index 75ef43185e5..4ee7152f0f3 100644 --- a/crates/swc_ecma_codegen/tests/test262/b0659cf9cb6793a2.js +++ b/crates/swc_ecma_codegen/tests/test262/b0659cf9cb6793a2.js @@ -1,4 +1,3 @@ class a extends b { - constructor(c = super()){ - } + constructor(c = super()){} } diff --git a/crates/swc_ecma_codegen/tests/test262/b0c6752e1db068ed.js b/crates/swc_ecma_codegen/tests/test262/b0c6752e1db068ed.js index 05c1f0b105b..b5e8b820ad2 100644 --- a/crates/swc_ecma_codegen/tests/test262/b0c6752e1db068ed.js +++ b/crates/swc_ecma_codegen/tests/test262/b0c6752e1db068ed.js @@ -1,2 +1 @@ -(a = yield)=>{ -}; +(a = yield)=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/b1c37dedeec0b867.js b/crates/swc_ecma_codegen/tests/test262/b1c37dedeec0b867.js index 6de4e8e9891..7b129501fdf 100644 --- a/crates/swc_ecma_codegen/tests/test262/b1c37dedeec0b867.js +++ b/crates/swc_ecma_codegen/tests/test262/b1c37dedeec0b867.js @@ -1,2 +1 @@ -function a(...b) { -} +function a(...b) {} diff --git a/crates/swc_ecma_codegen/tests/test262/b24fa2a1936d38d9.js b/crates/swc_ecma_codegen/tests/test262/b24fa2a1936d38d9.js index b87a6377c67..d6420c2fab3 100644 --- a/crates/swc_ecma_codegen/tests/test262/b24fa2a1936d38d9.js +++ b/crates/swc_ecma_codegen/tests/test262/b24fa2a1936d38d9.js @@ -1,4 +1,3 @@ ({ - 3 () { - } + 3 () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/b29070859dbeaf08.js b/crates/swc_ecma_codegen/tests/test262/b29070859dbeaf08.js index cafb64622f7..77536f20135 100644 --- a/crates/swc_ecma_codegen/tests/test262/b29070859dbeaf08.js +++ b/crates/swc_ecma_codegen/tests/test262/b29070859dbeaf08.js @@ -1,2 +1 @@ -[a, b = 1, [c, ...a[2]] = { -}] = 3; +[a, b = 1, [c, ...a[2]] = {}] = 3; diff --git a/crates/swc_ecma_codegen/tests/test262/b2e6c124e2822117.js b/crates/swc_ecma_codegen/tests/test262/b2e6c124e2822117.js index 7545507efea..c6b905ac90e 100644 --- a/crates/swc_ecma_codegen/tests/test262/b2e6c124e2822117.js +++ b/crates/swc_ecma_codegen/tests/test262/b2e6c124e2822117.js @@ -1,7 +1,5 @@ ({ "__proto__": null, - get __proto__ () { - }, - set __proto__ (a){ - } + get __proto__ () {}, + set __proto__ (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/b363a70923be42c8.js b/crates/swc_ecma_codegen/tests/test262/b363a70923be42c8.js index 36469c134f0..2454953cbe2 100644 --- a/crates/swc_ecma_codegen/tests/test262/b363a70923be42c8.js +++ b/crates/swc_ecma_codegen/tests/test262/b363a70923be42c8.js @@ -1,2 +1 @@ -for(;;){ -} +for(;;){} diff --git a/crates/swc_ecma_codegen/tests/test262/b42377ca7015e7d4.js b/crates/swc_ecma_codegen/tests/test262/b42377ca7015e7d4.js index 34bcf6f059a..1fce59af447 100644 --- a/crates/swc_ecma_codegen/tests/test262/b42377ca7015e7d4.js +++ b/crates/swc_ecma_codegen/tests/test262/b42377ca7015e7d4.js @@ -1,2 +1 @@ -const { a } = { -}; +const { a } = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/b433b0cfef2a3cd1.js b/crates/swc_ecma_codegen/tests/test262/b433b0cfef2a3cd1.js index 29ba4739476..86d7b67783b 100644 --- a/crates/swc_ecma_codegen/tests/test262/b433b0cfef2a3cd1.js +++ b/crates/swc_ecma_codegen/tests/test262/b433b0cfef2a3cd1.js @@ -1,4 +1,3 @@ ({ - [a]: function() { - } + [a]: function() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/b471292fedf2f813.js b/crates/swc_ecma_codegen/tests/test262/b471292fedf2f813.js index 7505520c663..17907deee2d 100644 --- a/crates/swc_ecma_codegen/tests/test262/b471292fedf2f813.js +++ b/crates/swc_ecma_codegen/tests/test262/b471292fedf2f813.js @@ -1,5 +1,4 @@ function a() { b(); - function c() { - } + function c() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/b549d045fc8e93bf.js b/crates/swc_ecma_codegen/tests/test262/b549d045fc8e93bf.js index ce939d6f610..e4119d4cf53 100644 --- a/crates/swc_ecma_codegen/tests/test262/b549d045fc8e93bf.js +++ b/crates/swc_ecma_codegen/tests/test262/b549d045fc8e93bf.js @@ -1,4 +1,2 @@ "use strict"; -try { -} catch (a) { -} +try {} catch (a) {} diff --git a/crates/swc_ecma_codegen/tests/test262/b5a1e1a3679f81ba.js b/crates/swc_ecma_codegen/tests/test262/b5a1e1a3679f81ba.js index 55b3f398cb6..aaaa7fc2a88 100644 --- a/crates/swc_ecma_codegen/tests/test262/b5a1e1a3679f81ba.js +++ b/crates/swc_ecma_codegen/tests/test262/b5a1e1a3679f81ba.js @@ -1,2 +1 @@ -({ a }, ...b)=>{ -}; +({ a }, ...b)=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/b77549e54bfef0f9.js b/crates/swc_ecma_codegen/tests/test262/b77549e54bfef0f9.js index 37212c70aa1..ad0d34e3c77 100644 --- a/crates/swc_ecma_codegen/tests/test262/b77549e54bfef0f9.js +++ b/crates/swc_ecma_codegen/tests/test262/b77549e54bfef0f9.js @@ -1,2 +1 @@ -var { a: b } = { -}; +var { a: b } = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/b7a6a807ae6db312.js b/crates/swc_ecma_codegen/tests/test262/b7a6a807ae6db312.js index fac87d895fc..08374f7187f 100644 --- a/crates/swc_ecma_codegen/tests/test262/b7a6a807ae6db312.js +++ b/crates/swc_ecma_codegen/tests/test262/b7a6a807ae6db312.js @@ -1,5 +1,4 @@ ({ - set a (b){ - }, + set a (b){}, a: 1 }); diff --git a/crates/swc_ecma_codegen/tests/test262/b7cd8df8dc875529.js b/crates/swc_ecma_codegen/tests/test262/b7cd8df8dc875529.js index 537d126386f..6629f7b8513 100644 --- a/crates/swc_ecma_codegen/tests/test262/b7cd8df8dc875529.js +++ b/crates/swc_ecma_codegen/tests/test262/b7cd8df8dc875529.js @@ -1,8 +1,7 @@ while(!((a && b) || (c + "0"))){ d.e("f"); var a; - function b() { - } + function b() {} } for(var c = 1, g; c && (g || c) && (!typeof c); ++c){ h(); diff --git a/crates/swc_ecma_codegen/tests/test262/b7d99c0034be0ce1.js b/crates/swc_ecma_codegen/tests/test262/b7d99c0034be0ce1.js index cc739a973fe..3f72a7cfaf8 100644 --- a/crates/swc_ecma_codegen/tests/test262/b7d99c0034be0ce1.js +++ b/crates/swc_ecma_codegen/tests/test262/b7d99c0034be0ce1.js @@ -1,2 +1 @@ -function a(b, b) { -} +function a(b, b) {} diff --git a/crates/swc_ecma_codegen/tests/test262/b86b0122e80c330e.js b/crates/swc_ecma_codegen/tests/test262/b86b0122e80c330e.js index 128a19fb7a4..53b87dfb93e 100644 --- a/crates/swc_ecma_codegen/tests/test262/b86b0122e80c330e.js +++ b/crates/swc_ecma_codegen/tests/test262/b86b0122e80c330e.js @@ -1,6 +1,5 @@ function* a() { ({ - *[yield] () { - } + *[yield] () {} }); } diff --git a/crates/swc_ecma_codegen/tests/test262/b8705496c9c1ff60.js b/crates/swc_ecma_codegen/tests/test262/b8705496c9c1ff60.js index c46bfa5bd68..754a178f61f 100644 --- a/crates/swc_ecma_codegen/tests/test262/b8705496c9c1ff60.js +++ b/crates/swc_ecma_codegen/tests/test262/b8705496c9c1ff60.js @@ -1,6 +1,5 @@ (function() { - var a = { - }; + var a = {}; with (a){ (1, b)(); // Don't transform it to test() } diff --git a/crates/swc_ecma_codegen/tests/test262/b93d116fd0409637.js b/crates/swc_ecma_codegen/tests/test262/b93d116fd0409637.js index f8bd49e4de4..b050ee3e64e 100644 --- a/crates/swc_ecma_codegen/tests/test262/b93d116fd0409637.js +++ b/crates/swc_ecma_codegen/tests/test262/b93d116fd0409637.js @@ -1,4 +1,3 @@ ({ - get false () { - } + get false () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/b96ba7cdf0b42ca9.js b/crates/swc_ecma_codegen/tests/test262/b96ba7cdf0b42ca9.js index d365aa9a74a..a5848845504 100644 --- a/crates/swc_ecma_codegen/tests/test262/b96ba7cdf0b42ca9.js +++ b/crates/swc_ecma_codegen/tests/test262/b96ba7cdf0b42ca9.js @@ -1,2 +1 @@ -(function(a) { -}(b())); +(function(a) {}(b())); diff --git a/crates/swc_ecma_codegen/tests/test262/ba21e63736d8fd46.js b/crates/swc_ecma_codegen/tests/test262/ba21e63736d8fd46.js index 8fda911b1ad..2629aabd8fd 100644 --- a/crates/swc_ecma_codegen/tests/test262/ba21e63736d8fd46.js +++ b/crates/swc_ecma_codegen/tests/test262/ba21e63736d8fd46.js @@ -1,2 +1 @@ -a: function a() { -} +a: function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/ba4cc699857f41f2.js b/crates/swc_ecma_codegen/tests/test262/ba4cc699857f41f2.js index 61fdeb560ad..d9a3c679029 100644 --- a/crates/swc_ecma_codegen/tests/test262/ba4cc699857f41f2.js +++ b/crates/swc_ecma_codegen/tests/test262/ba4cc699857f41f2.js @@ -1,6 +1,4 @@ function a() { - function* a() { - } - function a() { - } + function* a() {} + function a() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/ba9a047839eb4682.js b/crates/swc_ecma_codegen/tests/test262/ba9a047839eb4682.js index 4517355cbc7..ad2acb99e96 100644 --- a/crates/swc_ecma_codegen/tests/test262/ba9a047839eb4682.js +++ b/crates/swc_ecma_codegen/tests/test262/ba9a047839eb4682.js @@ -1,4 +1,3 @@ a = { - b () { - } + b () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/bb447d4ed988a1cb.js b/crates/swc_ecma_codegen/tests/test262/bb447d4ed988a1cb.js index 0f2c5f85482..594cd8cf235 100644 --- a/crates/swc_ecma_codegen/tests/test262/bb447d4ed988a1cb.js +++ b/crates/swc_ecma_codegen/tests/test262/bb447d4ed988a1cb.js @@ -1,2 +1 @@ -+{ -}; ++{}; diff --git a/crates/swc_ecma_codegen/tests/test262/bb7db120ad2fe995.js b/crates/swc_ecma_codegen/tests/test262/bb7db120ad2fe995.js index d020934de94..3ea97afe62a 100644 --- a/crates/swc_ecma_codegen/tests/test262/bb7db120ad2fe995.js +++ b/crates/swc_ecma_codegen/tests/test262/bb7db120ad2fe995.js @@ -1,6 +1,5 @@ ({ a: function({ b } = { b: 1 - }) { - } + }) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/bbff5671643cc2ea.js b/crates/swc_ecma_codegen/tests/test262/bbff5671643cc2ea.js index afc880c0f58..7395f3ff699 100644 --- a/crates/swc_ecma_codegen/tests/test262/bbff5671643cc2ea.js +++ b/crates/swc_ecma_codegen/tests/test262/bbff5671643cc2ea.js @@ -1,4 +1,3 @@ (class { - set a(b) { - } + set a(b) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/bbffb851469a3f0e.js b/crates/swc_ecma_codegen/tests/test262/bbffb851469a3f0e.js index 57e7745ed44..8fab52e8f74 100644 --- a/crates/swc_ecma_codegen/tests/test262/bbffb851469a3f0e.js +++ b/crates/swc_ecma_codegen/tests/test262/bbffb851469a3f0e.js @@ -1,4 +1,3 @@ -try { -} catch (a) { +try {} catch (a) { let b; } diff --git a/crates/swc_ecma_codegen/tests/test262/bc89b2b2f1e19f9e.js b/crates/swc_ecma_codegen/tests/test262/bc89b2b2f1e19f9e.js index 3b12aed0031..92ce65f470e 100644 --- a/crates/swc_ecma_codegen/tests/test262/bc89b2b2f1e19f9e.js +++ b/crates/swc_ecma_codegen/tests/test262/bc89b2b2f1e19f9e.js @@ -1,2 +1 @@ -{ -}/foo/; +{}/foo/; diff --git a/crates/swc_ecma_codegen/tests/test262/bd28a7d19ac0d50b.js b/crates/swc_ecma_codegen/tests/test262/bd28a7d19ac0d50b.js index 9f7db52c1cd..efa5d2ae1e0 100644 --- a/crates/swc_ecma_codegen/tests/test262/bd28a7d19ac0d50b.js +++ b/crates/swc_ecma_codegen/tests/test262/bd28a7d19ac0d50b.js @@ -1,6 +1,5 @@ "use strict"; var a = { b: 1, - get b () { - } + get b () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js b/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js index 4ba0b663878..45453a95702 100644 --- a/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js +++ b/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js @@ -1,7 +1,6 @@ (function() { try { throw 'a'; - } catch (b) { - } + } catch (b) {} c(); // This must not be removed. }()); diff --git a/crates/swc_ecma_codegen/tests/test262/bdc4accd07049034.js b/crates/swc_ecma_codegen/tests/test262/bdc4accd07049034.js index 83d24c61509..bdb4c16060c 100644 --- a/crates/swc_ecma_codegen/tests/test262/bdc4accd07049034.js +++ b/crates/swc_ecma_codegen/tests/test262/bdc4accd07049034.js @@ -3,8 +3,6 @@ ; ; ; - a() { - } - b() { - } + a() {} + b() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/bde1a5ea9aebf9d2.js b/crates/swc_ecma_codegen/tests/test262/bde1a5ea9aebf9d2.js index 12745b1eef1..ab32984f99f 100644 --- a/crates/swc_ecma_codegen/tests/test262/bde1a5ea9aebf9d2.js +++ b/crates/swc_ecma_codegen/tests/test262/bde1a5ea9aebf9d2.js @@ -1,2 +1 @@ -function arguments() { -} +function arguments() {} diff --git a/crates/swc_ecma_codegen/tests/test262/be9d538d5041fd5f.js b/crates/swc_ecma_codegen/tests/test262/be9d538d5041fd5f.js index f19075ebf6c..6cd4672180f 100644 --- a/crates/swc_ecma_codegen/tests/test262/be9d538d5041fd5f.js +++ b/crates/swc_ecma_codegen/tests/test262/be9d538d5041fd5f.js @@ -1,2 +1 @@ -(...[a, b])=>{ -}; +(...[a, b])=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/bf210a4f0cf9e352.js b/crates/swc_ecma_codegen/tests/test262/bf210a4f0cf9e352.js index 1ec5efffd2e..634e60a9415 100644 --- a/crates/swc_ecma_codegen/tests/test262/bf210a4f0cf9e352.js +++ b/crates/swc_ecma_codegen/tests/test262/bf210a4f0cf9e352.js @@ -1,6 +1,4 @@ class a { - static get b() { - } - get b() { - } + static get b() {} + get b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/bf8ffad512a5f568.js b/crates/swc_ecma_codegen/tests/test262/bf8ffad512a5f568.js index bdf0475100c..07e98e20115 100644 --- a/crates/swc_ecma_codegen/tests/test262/bf8ffad512a5f568.js +++ b/crates/swc_ecma_codegen/tests/test262/bf8ffad512a5f568.js @@ -1,10 +1,6 @@ class a { - static get b() { - } - static set b(c) { - } - get b() { - } - set b(c) { - } + static get b() {} + static set b(c) {} + get b() {} + set b(c) {} } diff --git a/crates/swc_ecma_codegen/tests/test262/c0f5f3f7db69c5a0.js b/crates/swc_ecma_codegen/tests/test262/c0f5f3f7db69c5a0.js index 407277665ed..0a0d963a6b2 100644 --- a/crates/swc_ecma_codegen/tests/test262/c0f5f3f7db69c5a0.js +++ b/crates/swc_ecma_codegen/tests/test262/c0f5f3f7db69c5a0.js @@ -1,4 +1,3 @@ a = { - get () { - } + get () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/c1c5c5d42a32aac1.js b/crates/swc_ecma_codegen/tests/test262/c1c5c5d42a32aac1.js index d0149ddeb83..19f7502dffb 100644 --- a/crates/swc_ecma_codegen/tests/test262/c1c5c5d42a32aac1.js +++ b/crates/swc_ecma_codegen/tests/test262/c1c5c5d42a32aac1.js @@ -1,6 +1,5 @@ (class { a({ b } = { b: 1 - }) { - } + }) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/c2558dc20a45b0a8.js b/crates/swc_ecma_codegen/tests/test262/c2558dc20a45b0a8.js index 841e01b18f5..db838767b44 100644 --- a/crates/swc_ecma_codegen/tests/test262/c2558dc20a45b0a8.js +++ b/crates/swc_ecma_codegen/tests/test262/c2558dc20a45b0a8.js @@ -1,4 +1,3 @@ ({ - [1 + 2] () { - } + [1 + 2] () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/c2f12d66ce17d5ab.js b/crates/swc_ecma_codegen/tests/test262/c2f12d66ce17d5ab.js index ccd181bc284..cae864dc8a5 100644 --- a/crates/swc_ecma_codegen/tests/test262/c2f12d66ce17d5ab.js +++ b/crates/swc_ecma_codegen/tests/test262/c2f12d66ce17d5ab.js @@ -1,4 +1,3 @@ ({ - get null () { - } + get null () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/c35dcf99291ec6be.js b/crates/swc_ecma_codegen/tests/test262/c35dcf99291ec6be.js index 6ea7022a714..678a6aa1575 100644 --- a/crates/swc_ecma_codegen/tests/test262/c35dcf99291ec6be.js +++ b/crates/swc_ecma_codegen/tests/test262/c35dcf99291ec6be.js @@ -1,5 +1,4 @@ ({ __proto__: null, - __proto__ () { - } + __proto__ () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/c4a57a72e25e042c.js b/crates/swc_ecma_codegen/tests/test262/c4a57a72e25e042c.js index cac0e07f51c..d73f9187d37 100644 --- a/crates/swc_ecma_codegen/tests/test262/c4a57a72e25e042c.js +++ b/crates/swc_ecma_codegen/tests/test262/c4a57a72e25e042c.js @@ -1,4 +1,3 @@ a = { - get "b" () { - } + get "b" () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/c5b2ea7da55d24c1.js b/crates/swc_ecma_codegen/tests/test262/c5b2ea7da55d24c1.js index b0fa260c76c..47d38812b26 100644 --- a/crates/swc_ecma_codegen/tests/test262/c5b2ea7da55d24c1.js +++ b/crates/swc_ecma_codegen/tests/test262/c5b2ea7da55d24c1.js @@ -1,6 +1,4 @@ function a() { - function a() { - } - function a() { - } + function a() {} + function a() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/c5bd72f618d7cade.js b/crates/swc_ecma_codegen/tests/test262/c5bd72f618d7cade.js index f8e7f820d26..4df46943d26 100644 --- a/crates/swc_ecma_codegen/tests/test262/c5bd72f618d7cade.js +++ b/crates/swc_ecma_codegen/tests/test262/c5bd72f618d7cade.js @@ -1,2 +1 @@ -function* a() { -} +function* a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/c756f39dca1f7423.js b/crates/swc_ecma_codegen/tests/test262/c756f39dca1f7423.js index 4b4b2695435..144d758b585 100644 --- a/crates/swc_ecma_codegen/tests/test262/c756f39dca1f7423.js +++ b/crates/swc_ecma_codegen/tests/test262/c756f39dca1f7423.js @@ -1,2 +1 @@ -a = function(b, ...c) { -}; +a = function(b, ...c) {}; diff --git a/crates/swc_ecma_codegen/tests/test262/c771490bbb3dd6e9.js b/crates/swc_ecma_codegen/tests/test262/c771490bbb3dd6e9.js index 9a7e1ec162a..d6c604dd2c1 100644 --- a/crates/swc_ecma_codegen/tests/test262/c771490bbb3dd6e9.js +++ b/crates/swc_ecma_codegen/tests/test262/c771490bbb3dd6e9.js @@ -1,4 +1,3 @@ class a { - *static() { - } + *static() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/c8513472857eae9c.js b/crates/swc_ecma_codegen/tests/test262/c8513472857eae9c.js index 027ad44eaa5..0110c4a035a 100644 --- a/crates/swc_ecma_codegen/tests/test262/c8513472857eae9c.js +++ b/crates/swc_ecma_codegen/tests/test262/c8513472857eae9c.js @@ -1,4 +1,3 @@ ({ - set a (b = new.target){ - } + set a (b = new.target){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/c8565124aee75c69.js b/crates/swc_ecma_codegen/tests/test262/c8565124aee75c69.js index 9855409b197..8cbd9737837 100644 --- a/crates/swc_ecma_codegen/tests/test262/c8565124aee75c69.js +++ b/crates/swc_ecma_codegen/tests/test262/c8565124aee75c69.js @@ -1,2 +1 @@ -for (a of let){ -} +for (a of let){} diff --git a/crates/swc_ecma_codegen/tests/test262/c8689b6da6fd227a.js b/crates/swc_ecma_codegen/tests/test262/c8689b6da6fd227a.js index dc618e7b76f..890565d4d9e 100644 --- a/crates/swc_ecma_codegen/tests/test262/c8689b6da6fd227a.js +++ b/crates/swc_ecma_codegen/tests/test262/c8689b6da6fd227a.js @@ -1,4 +1,3 @@ a = { - get b () { - } + get b () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/c87859666bd18c8c.js b/crates/swc_ecma_codegen/tests/test262/c87859666bd18c8c.js index 2730878a73b..7796eaacb75 100644 --- a/crates/swc_ecma_codegen/tests/test262/c87859666bd18c8c.js +++ b/crates/swc_ecma_codegen/tests/test262/c87859666bd18c8c.js @@ -1,3 +1,2 @@ -while(1){ -} +while(1){} /foo/; diff --git a/crates/swc_ecma_codegen/tests/test262/c92dc954a0ce196d.module.js b/crates/swc_ecma_codegen/tests/test262/c92dc954a0ce196d.module.js index da645135e4f..0032aae58e8 100644 --- a/crates/swc_ecma_codegen/tests/test262/c92dc954a0ce196d.module.js +++ b/crates/swc_ecma_codegen/tests/test262/c92dc954a0ce196d.module.js @@ -1,3 +1,2 @@ -export default function a() { -}; +export default function a() {}; false; diff --git a/crates/swc_ecma_codegen/tests/test262/c963ac653b30699b.js b/crates/swc_ecma_codegen/tests/test262/c963ac653b30699b.js index 21fa4f5ee6d..15744edfb17 100644 --- a/crates/swc_ecma_codegen/tests/test262/c963ac653b30699b.js +++ b/crates/swc_ecma_codegen/tests/test262/c963ac653b30699b.js @@ -1,4 +1,3 @@ a = { - 'b' () { - } + 'b' () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/c964ed7bc2373c54.js b/crates/swc_ecma_codegen/tests/test262/c964ed7bc2373c54.js index c20f7ca174e..46668eb4243 100644 --- a/crates/swc_ecma_codegen/tests/test262/c964ed7bc2373c54.js +++ b/crates/swc_ecma_codegen/tests/test262/c964ed7bc2373c54.js @@ -1,6 +1,4 @@ -function a({ a =(1) , b }) { -} -function b([b, c = (2)]) { -} +function a({ a =(1) , b }) {} +function b([b, c = (2)]) {} var { d =(3) , e } = d; var [d, e = (4)] = d; diff --git a/crates/swc_ecma_codegen/tests/test262/ca20c15b39c87033.js b/crates/swc_ecma_codegen/tests/test262/ca20c15b39c87033.js index 879f5c952ee..5c1aa21f3ac 100644 --- a/crates/swc_ecma_codegen/tests/test262/ca20c15b39c87033.js +++ b/crates/swc_ecma_codegen/tests/test262/ca20c15b39c87033.js @@ -1,5 +1,4 @@ class a { - static() { - } + static() {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/ca7a0ca0d22f30f8.js b/crates/swc_ecma_codegen/tests/test262/ca7a0ca0d22f30f8.js index ec6fbfd533f..934c6446907 100644 --- a/crates/swc_ecma_codegen/tests/test262/ca7a0ca0d22f30f8.js +++ b/crates/swc_ecma_codegen/tests/test262/ca7a0ca0d22f30f8.js @@ -1,4 +1,3 @@ (class { - [1 + 2]() { - } + [1 + 2]() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/cda499c521ff60c7.js b/crates/swc_ecma_codegen/tests/test262/cda499c521ff60c7.js index d5d2af5f38a..5a90f13152b 100644 --- a/crates/swc_ecma_codegen/tests/test262/cda499c521ff60c7.js +++ b/crates/swc_ecma_codegen/tests/test262/cda499c521ff60c7.js @@ -1,14 +1,8 @@ a = class { - static b() { - } - static get c() { - } - static set d(a) { - } - static() { - } - get() { - } - set() { - } + static b() {} + static get c() {} + static set d(a) {} + static() {} + get() {} + set() {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/cdca52810bbe4532.js b/crates/swc_ecma_codegen/tests/test262/cdca52810bbe4532.js index a0a8623568e..52316e01a33 100644 --- a/crates/swc_ecma_codegen/tests/test262/cdca52810bbe4532.js +++ b/crates/swc_ecma_codegen/tests/test262/cdca52810bbe4532.js @@ -2,7 +2,6 @@ function a() { b.c('d'); } a(); -{ -}function a() { +{}function a() { b.c('e'); } diff --git a/crates/swc_ecma_codegen/tests/test262/cdf411040ab4b29b.js b/crates/swc_ecma_codegen/tests/test262/cdf411040ab4b29b.js index 33f90d5f58f..ed3e30e4a20 100644 --- a/crates/swc_ecma_codegen/tests/test262/cdf411040ab4b29b.js +++ b/crates/swc_ecma_codegen/tests/test262/cdf411040ab4b29b.js @@ -1,2 +1 @@ -((()=>{ -}))(); +((()=>{}))(); diff --git a/crates/swc_ecma_codegen/tests/test262/ce0aaec02d5d4465.js b/crates/swc_ecma_codegen/tests/test262/ce0aaec02d5d4465.js index 5e6b851b9eb..363cf18ace0 100644 --- a/crates/swc_ecma_codegen/tests/test262/ce0aaec02d5d4465.js +++ b/crates/swc_ecma_codegen/tests/test262/ce0aaec02d5d4465.js @@ -1,4 +1,3 @@ class a { - static get [b]() { - } + static get [b]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/ce8c443eb361e1a2.js b/crates/swc_ecma_codegen/tests/test262/ce8c443eb361e1a2.js index 2bbda5d5b2c..4d44d2b6aa2 100644 --- a/crates/swc_ecma_codegen/tests/test262/ce8c443eb361e1a2.js +++ b/crates/swc_ecma_codegen/tests/test262/ce8c443eb361e1a2.js @@ -1,2 +1 @@ -(function([]) { -}); +(function([]) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/cec2d94dc09a6a71.js b/crates/swc_ecma_codegen/tests/test262/cec2d94dc09a6a71.js index 19d9a80d8b6..4376ef0a753 100644 --- a/crates/swc_ecma_codegen/tests/test262/cec2d94dc09a6a71.js +++ b/crates/swc_ecma_codegen/tests/test262/cec2d94dc09a6a71.js @@ -1,6 +1,4 @@ a = { - catch () { - }, - throw () { - } + catch () {}, + throw () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/d010d377bcfd5565.js b/crates/swc_ecma_codegen/tests/test262/d010d377bcfd5565.js index 1f311e07114..e17c04d8f61 100644 --- a/crates/swc_ecma_codegen/tests/test262/d010d377bcfd5565.js +++ b/crates/swc_ecma_codegen/tests/test262/d010d377bcfd5565.js @@ -1,7 +1,5 @@ ({ __proto__: null, - get __proto__ () { - }, - set __proto__ (a){ - } + get __proto__ () {}, + set __proto__ (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/d33efc20e46c3961.js b/crates/swc_ecma_codegen/tests/test262/d33efc20e46c3961.js index d5cc3d5888b..96152d7d26e 100644 --- a/crates/swc_ecma_codegen/tests/test262/d33efc20e46c3961.js +++ b/crates/swc_ecma_codegen/tests/test262/d33efc20e46c3961.js @@ -1,2 +1 @@ -(...a)=>{ -}; +(...a)=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/d37653c5aedf3d46.js b/crates/swc_ecma_codegen/tests/test262/d37653c5aedf3d46.js index 2ffe6bb9c34..9466e70a81e 100644 --- a/crates/swc_ecma_codegen/tests/test262/d37653c5aedf3d46.js +++ b/crates/swc_ecma_codegen/tests/test262/d37653c5aedf3d46.js @@ -1,4 +1,3 @@ ({ - "a" (b, c, d) { - } + "a" (b, c, d) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/d3c1ea553fea8944.js b/crates/swc_ecma_codegen/tests/test262/d3c1ea553fea8944.js index cea7f2374cf..5d02896db04 100644 --- a/crates/swc_ecma_codegen/tests/test262/d3c1ea553fea8944.js +++ b/crates/swc_ecma_codegen/tests/test262/d3c1ea553fea8944.js @@ -1,5 +1,4 @@ class a { - static set(b) { - } + static set(b) {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/d3d6ca7932414eed.js b/crates/swc_ecma_codegen/tests/test262/d3d6ca7932414eed.js index a9d9cd9d0d0..cec0cfb2d37 100644 --- a/crates/swc_ecma_codegen/tests/test262/d3d6ca7932414eed.js +++ b/crates/swc_ecma_codegen/tests/test262/d3d6ca7932414eed.js @@ -1,9 +1,5 @@ -function a(b = 1) { -} -function c(b = (2 + 3)) { -} -function d({ e } = { -}, [f] = [ +function a(b = 1) {} +function c(b = (2 + 3)) {} +function d({ e } = {}, [f] = [ 4 -]) { -} +]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/d4b898b45172a637.js b/crates/swc_ecma_codegen/tests/test262/d4b898b45172a637.js index e091e6464e2..bf32fb43919 100644 --- a/crates/swc_ecma_codegen/tests/test262/d4b898b45172a637.js +++ b/crates/swc_ecma_codegen/tests/test262/d4b898b45172a637.js @@ -1,7 +1,5 @@ "use strict"; var a = { - get b () { - }, - get b () { - } + get b () {}, + get b () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/d53aef16fe683218.js b/crates/swc_ecma_codegen/tests/test262/d53aef16fe683218.js index 696a7ee2790..be462dce231 100644 --- a/crates/swc_ecma_codegen/tests/test262/d53aef16fe683218.js +++ b/crates/swc_ecma_codegen/tests/test262/d53aef16fe683218.js @@ -1,6 +1,5 @@ switch(a){ case 1: - { - } + {} /foo/; } diff --git a/crates/swc_ecma_codegen/tests/test262/d767138e133ad239.js b/crates/swc_ecma_codegen/tests/test262/d767138e133ad239.js index 4aead1787b6..c7d2a62c644 100644 --- a/crates/swc_ecma_codegen/tests/test262/d767138e133ad239.js +++ b/crates/swc_ecma_codegen/tests/test262/d767138e133ad239.js @@ -1,5 +1,4 @@ ({ "__proto__": null, - get __proto__ () { - } + get __proto__ () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/d82ae3dbc61808f8.js b/crates/swc_ecma_codegen/tests/test262/d82ae3dbc61808f8.js index c34c2f7a789..6b3a35498c7 100644 --- a/crates/swc_ecma_codegen/tests/test262/d82ae3dbc61808f8.js +++ b/crates/swc_ecma_codegen/tests/test262/d82ae3dbc61808f8.js @@ -1,2 +1 @@ -function a(...yield) { -} +function a(...yield) {} diff --git a/crates/swc_ecma_codegen/tests/test262/da3756d1f8acb3c5.js b/crates/swc_ecma_codegen/tests/test262/da3756d1f8acb3c5.js index 4327c583e27..8a4ff34a8af 100644 --- a/crates/swc_ecma_codegen/tests/test262/da3756d1f8acb3c5.js +++ b/crates/swc_ecma_codegen/tests/test262/da3756d1f8acb3c5.js @@ -1,2 +1 @@ -({ a })=>{ -}; +({ a })=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/da671a25e498bcac.module.js b/crates/swc_ecma_codegen/tests/test262/da671a25e498bcac.module.js index eb0591cefe8..2dd8e728b38 100644 --- a/crates/swc_ecma_codegen/tests/test262/da671a25e498bcac.module.js +++ b/crates/swc_ecma_codegen/tests/test262/da671a25e498bcac.module.js @@ -1,2 +1 @@ -export default function a() { -}; +export default function a() {}; diff --git a/crates/swc_ecma_codegen/tests/test262/da9fdc3a2d7f9452.js b/crates/swc_ecma_codegen/tests/test262/da9fdc3a2d7f9452.js index 2315b62ea04..55050c1fe31 100644 --- a/crates/swc_ecma_codegen/tests/test262/da9fdc3a2d7f9452.js +++ b/crates/swc_ecma_codegen/tests/test262/da9fdc3a2d7f9452.js @@ -1,2 +1 @@ -function a(b, c = 1) { -} +function a(b, c = 1) {} diff --git a/crates/swc_ecma_codegen/tests/test262/dc1acc240053a397.js b/crates/swc_ecma_codegen/tests/test262/dc1acc240053a397.js index b4244743257..ba76cca61d6 100644 --- a/crates/swc_ecma_codegen/tests/test262/dc1acc240053a397.js +++ b/crates/swc_ecma_codegen/tests/test262/dc1acc240053a397.js @@ -1,4 +1,3 @@ ({ - a () { - } + a () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/dc2b756c7828d827.module.js b/crates/swc_ecma_codegen/tests/test262/dc2b756c7828d827.module.js index 7e588b65817..fa1736f9feb 100644 --- a/crates/swc_ecma_codegen/tests/test262/dc2b756c7828d827.module.js +++ b/crates/swc_ecma_codegen/tests/test262/dc2b756c7828d827.module.js @@ -1,2 +1 @@ -export function a() { -} +export function a() {} diff --git a/crates/swc_ecma_codegen/tests/test262/dcc5609dcc043200.js b/crates/swc_ecma_codegen/tests/test262/dcc5609dcc043200.js index eb577f3f354..e4eaaf977c7 100644 --- a/crates/swc_ecma_codegen/tests/test262/dcc5609dcc043200.js +++ b/crates/swc_ecma_codegen/tests/test262/dcc5609dcc043200.js @@ -1,4 +1,3 @@ (class { - constructor(){ - } + constructor(){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/dcc9c2ff46392f30.js b/crates/swc_ecma_codegen/tests/test262/dcc9c2ff46392f30.js index cd4bad62e13..922d92d4cf6 100644 --- a/crates/swc_ecma_codegen/tests/test262/dcc9c2ff46392f30.js +++ b/crates/swc_ecma_codegen/tests/test262/dcc9c2ff46392f30.js @@ -1,4 +1,3 @@ a = { - b: function(c = 1) { - } + b: function(c = 1) {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/dcfb11abc780d6d9.js b/crates/swc_ecma_codegen/tests/test262/dcfb11abc780d6d9.js index 40cb8f5519c..ef87217eb02 100644 --- a/crates/swc_ecma_codegen/tests/test262/dcfb11abc780d6d9.js +++ b/crates/swc_ecma_codegen/tests/test262/dcfb11abc780d6d9.js @@ -1,5 +1,4 @@ { - do { - }while (false) + do {}while (false) false; } diff --git a/crates/swc_ecma_codegen/tests/test262/de6dd6b2ec971861.js b/crates/swc_ecma_codegen/tests/test262/de6dd6b2ec971861.js index b4f25c207d1..f7d23c2b4cc 100644 --- a/crates/swc_ecma_codegen/tests/test262/de6dd6b2ec971861.js +++ b/crates/swc_ecma_codegen/tests/test262/de6dd6b2ec971861.js @@ -1,4 +1,3 @@ class a { - get() { - } + get() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/dec1ae80150e1664.js b/crates/swc_ecma_codegen/tests/test262/dec1ae80150e1664.js index f81e6a08953..7435ed94c4b 100644 --- a/crates/swc_ecma_codegen/tests/test262/dec1ae80150e1664.js +++ b/crates/swc_ecma_codegen/tests/test262/dec1ae80150e1664.js @@ -1,2 +1 @@ -{ -}/=/; +{}/=/; diff --git a/crates/swc_ecma_codegen/tests/test262/dfa22e3eac3cd26e.js b/crates/swc_ecma_codegen/tests/test262/dfa22e3eac3cd26e.js index b3420cee842..bec4a6b6242 100644 --- a/crates/swc_ecma_codegen/tests/test262/dfa22e3eac3cd26e.js +++ b/crates/swc_ecma_codegen/tests/test262/dfa22e3eac3cd26e.js @@ -1,4 +1,3 @@ class a { - static b() { - } + static b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/dfbd1b07bd57a08d.js b/crates/swc_ecma_codegen/tests/test262/dfbd1b07bd57a08d.js index 6de4e8e9891..7b129501fdf 100644 --- a/crates/swc_ecma_codegen/tests/test262/dfbd1b07bd57a08d.js +++ b/crates/swc_ecma_codegen/tests/test262/dfbd1b07bd57a08d.js @@ -1,2 +1 @@ -function a(...b) { -} +function a(...b) {} diff --git a/crates/swc_ecma_codegen/tests/test262/e01c7172cf204b92.js b/crates/swc_ecma_codegen/tests/test262/e01c7172cf204b92.js index 9fdab552e6e..d0f096858b3 100644 --- a/crates/swc_ecma_codegen/tests/test262/e01c7172cf204b92.js +++ b/crates/swc_ecma_codegen/tests/test262/e01c7172cf204b92.js @@ -1,2 +1 @@ -(function a(b = new.target) { -}); +(function a(b = new.target) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/e08e181172bad2b1.js b/crates/swc_ecma_codegen/tests/test262/e08e181172bad2b1.js index a9602342214..a81ab6b8f19 100644 --- a/crates/swc_ecma_codegen/tests/test262/e08e181172bad2b1.js +++ b/crates/swc_ecma_codegen/tests/test262/e08e181172bad2b1.js @@ -1,6 +1,4 @@ ({ - get [1 + 2] () { - }, - set [3 / 4] (a){ - } + get [1 + 2] () {}, + set [3 / 4] (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/e0c3f07a142a589d.js b/crates/swc_ecma_codegen/tests/test262/e0c3f07a142a589d.js index 7fc7642ca2f..5e6484207b3 100644 --- a/crates/swc_ecma_codegen/tests/test262/e0c3f07a142a589d.js +++ b/crates/swc_ecma_codegen/tests/test262/e0c3f07a142a589d.js @@ -1,6 +1,5 @@ function a() { - if (b) { - } else { + if (b) {} else { c(); } } diff --git a/crates/swc_ecma_codegen/tests/test262/e0fc2148b455a6be.js b/crates/swc_ecma_codegen/tests/test262/e0fc2148b455a6be.js index a6ebca5a878..ab16f462703 100644 --- a/crates/swc_ecma_codegen/tests/test262/e0fc2148b455a6be.js +++ b/crates/swc_ecma_codegen/tests/test262/e0fc2148b455a6be.js @@ -1,2 +1 @@ -(function({ a: b , a: c }) { -}); +(function({ a: b , a: c }) {}); diff --git a/crates/swc_ecma_codegen/tests/test262/e1d373aa5d926fde.module.js b/crates/swc_ecma_codegen/tests/test262/e1d373aa5d926fde.module.js index dd39cbb7b0c..b3c6b95ffa6 100644 --- a/crates/swc_ecma_codegen/tests/test262/e1d373aa5d926fde.module.js +++ b/crates/swc_ecma_codegen/tests/test262/e1d373aa5d926fde.module.js @@ -1,2 +1 @@ -export var a = { -}; +export var a = {}; diff --git a/crates/swc_ecma_codegen/tests/test262/e1dd1979a86a5f1d.js b/crates/swc_ecma_codegen/tests/test262/e1dd1979a86a5f1d.js index 18f01acffc1..9624c9b0926 100644 --- a/crates/swc_ecma_codegen/tests/test262/e1dd1979a86a5f1d.js +++ b/crates/swc_ecma_codegen/tests/test262/e1dd1979a86a5f1d.js @@ -1,3 +1 @@ -try { -} catch ([a, b, { c , d: e = 1 , [f]: g = 2 , h =i }]) { -} +try {} catch ([a, b, { c , d: e = 1 , [f]: g = 2 , h =i }]) {} diff --git a/crates/swc_ecma_codegen/tests/test262/e2470430b235b9bb.module.js b/crates/swc_ecma_codegen/tests/test262/e2470430b235b9bb.module.js index c991eb331a9..5f54bd930af 100644 --- a/crates/swc_ecma_codegen/tests/test262/e2470430b235b9bb.module.js +++ b/crates/swc_ecma_codegen/tests/test262/e2470430b235b9bb.module.js @@ -1,4 +1,3 @@ -export default function a() { -}; +export default function a() {}; let b; export { b as a }; diff --git a/crates/swc_ecma_codegen/tests/test262/e42f306327c0f578.js b/crates/swc_ecma_codegen/tests/test262/e42f306327c0f578.js index 35a8847e548..e7fb5d290ef 100644 --- a/crates/swc_ecma_codegen/tests/test262/e42f306327c0f578.js +++ b/crates/swc_ecma_codegen/tests/test262/e42f306327c0f578.js @@ -1,6 +1,5 @@ "use strict"; var a = { - set b (a){ - }, + set b (a){}, b: 1 }; diff --git a/crates/swc_ecma_codegen/tests/test262/e54c1a2fc15cd4b8.js b/crates/swc_ecma_codegen/tests/test262/e54c1a2fc15cd4b8.js index 4a954b6294a..0b39e4a082d 100644 --- a/crates/swc_ecma_codegen/tests/test262/e54c1a2fc15cd4b8.js +++ b/crates/swc_ecma_codegen/tests/test262/e54c1a2fc15cd4b8.js @@ -1,8 +1,5 @@ class a { - static b() { - } - static get b() { - } - static set b(c) { - } + static b() {} + static get b() {} + static set b(c) {} } diff --git a/crates/swc_ecma_codegen/tests/test262/e6b424d430520bf2.js b/crates/swc_ecma_codegen/tests/test262/e6b424d430520bf2.js index aec3edb0a32..5e953c6c22a 100644 --- a/crates/swc_ecma_codegen/tests/test262/e6b424d430520bf2.js +++ b/crates/swc_ecma_codegen/tests/test262/e6b424d430520bf2.js @@ -1,4 +1,3 @@ function a(b) { - if (c) for(var d = 1, e = b.f();; d++){ - } + if (c) for(var d = 1, e = b.f();; d++){} } diff --git a/crates/swc_ecma_codegen/tests/test262/e71a91c61343cdb1.js b/crates/swc_ecma_codegen/tests/test262/e71a91c61343cdb1.js index e9340dbf766..c62c70d33bf 100644 --- a/crates/swc_ecma_codegen/tests/test262/e71a91c61343cdb1.js +++ b/crates/swc_ecma_codegen/tests/test262/e71a91c61343cdb1.js @@ -1,4 +1,3 @@ a = { - get 10 () { - } + get 10 () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/e78c7b54fc87d08c.js b/crates/swc_ecma_codegen/tests/test262/e78c7b54fc87d08c.js index 0ce088edacd..45825ffb9d9 100644 --- a/crates/swc_ecma_codegen/tests/test262/e78c7b54fc87d08c.js +++ b/crates/swc_ecma_codegen/tests/test262/e78c7b54fc87d08c.js @@ -1,2 +1 @@ -function* a(b, c, d) { -} +function* a(b, c, d) {} diff --git a/crates/swc_ecma_codegen/tests/test262/e7fa87b10d5136a0.js b/crates/swc_ecma_codegen/tests/test262/e7fa87b10d5136a0.js index cdbffb7fa1b..78e435e3385 100644 --- a/crates/swc_ecma_codegen/tests/test262/e7fa87b10d5136a0.js +++ b/crates/swc_ecma_codegen/tests/test262/e7fa87b10d5136a0.js @@ -1,7 +1,5 @@ class a { - get b() { - } - set c(d) { - } + get b() {} + set c(d) {} ; } diff --git a/crates/swc_ecma_codegen/tests/test262/e9d44e4cbaf92011.js b/crates/swc_ecma_codegen/tests/test262/e9d44e4cbaf92011.js index 969cde4fd12..4fbcab63cf2 100644 --- a/crates/swc_ecma_codegen/tests/test262/e9d44e4cbaf92011.js +++ b/crates/swc_ecma_codegen/tests/test262/e9d44e4cbaf92011.js @@ -1,4 +1,3 @@ ({ - [a] () { - } + [a] () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/ec99a663d6f3983d.js b/crates/swc_ecma_codegen/tests/test262/ec99a663d6f3983d.js index 2cb236b4f40..3f14e5a76e7 100644 --- a/crates/swc_ecma_codegen/tests/test262/ec99a663d6f3983d.js +++ b/crates/swc_ecma_codegen/tests/test262/ec99a663d6f3983d.js @@ -1,6 +1,5 @@ function a() { ({ - *[yield] () { - } + *[yield] () {} }); } diff --git a/crates/swc_ecma_codegen/tests/test262/edd1f39f90576180.js b/crates/swc_ecma_codegen/tests/test262/edd1f39f90576180.js index 463e314ce26..b5741052986 100644 --- a/crates/swc_ecma_codegen/tests/test262/edd1f39f90576180.js +++ b/crates/swc_ecma_codegen/tests/test262/edd1f39f90576180.js @@ -1,4 +1,3 @@ -try { -} catch (a) { +try {} catch (a) { b(a); } diff --git a/crates/swc_ecma_codegen/tests/test262/ef086346e9707e91.js b/crates/swc_ecma_codegen/tests/test262/ef086346e9707e91.js index 4490ef06b15..b21261ce3e4 100644 --- a/crates/swc_ecma_codegen/tests/test262/ef086346e9707e91.js +++ b/crates/swc_ecma_codegen/tests/test262/ef086346e9707e91.js @@ -1,4 +1,3 @@ class a { - [b]() { - } + [b]() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/efef19e06f58fdd9.js b/crates/swc_ecma_codegen/tests/test262/efef19e06f58fdd9.js index 60243ffb902..46b325d0821 100644 --- a/crates/swc_ecma_codegen/tests/test262/efef19e06f58fdd9.js +++ b/crates/swc_ecma_codegen/tests/test262/efef19e06f58fdd9.js @@ -1,5 +1,4 @@ ({ __proto__: null, - set __proto__ (a){ - } + set __proto__ (a){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/f01d9f3c7b2b2717.js b/crates/swc_ecma_codegen/tests/test262/f01d9f3c7b2b2717.js index 9b40a3562e3..d1e5b7b21a8 100644 --- a/crates/swc_ecma_codegen/tests/test262/f01d9f3c7b2b2717.js +++ b/crates/swc_ecma_codegen/tests/test262/f01d9f3c7b2b2717.js @@ -1,4 +1,3 @@ a = { - get if () { - } + get if () {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/f13a130829aa77c5.js b/crates/swc_ecma_codegen/tests/test262/f13a130829aa77c5.js index 85992ee9228..1b6c0e55dd9 100644 --- a/crates/swc_ecma_codegen/tests/test262/f13a130829aa77c5.js +++ b/crates/swc_ecma_codegen/tests/test262/f13a130829aa77c5.js @@ -1,4 +1,3 @@ class a { - static *b() { - } + static *b() {} } diff --git a/crates/swc_ecma_codegen/tests/test262/f404f7ff29ba5d1a.module.js b/crates/swc_ecma_codegen/tests/test262/f404f7ff29ba5d1a.module.js index dbfeaef972f..93c04ca181e 100644 --- a/crates/swc_ecma_codegen/tests/test262/f404f7ff29ba5d1a.module.js +++ b/crates/swc_ecma_codegen/tests/test262/f404f7ff29ba5d1a.module.js @@ -1,2 +1 @@ -export default function() { -}; +export default function() {}; diff --git a/crates/swc_ecma_codegen/tests/test262/f597b0312e2b678c.js b/crates/swc_ecma_codegen/tests/test262/f597b0312e2b678c.js index f007b910af7..e34b8103e5d 100644 --- a/crates/swc_ecma_codegen/tests/test262/f597b0312e2b678c.js +++ b/crates/swc_ecma_codegen/tests/test262/f597b0312e2b678c.js @@ -1,4 +1,3 @@ if (a) { b(); -} else { -} +} else {} diff --git a/crates/swc_ecma_codegen/tests/test262/f658dbaa20c36388.js b/crates/swc_ecma_codegen/tests/test262/f658dbaa20c36388.js index 0b4f7a5574c..c5b0d2c276c 100644 --- a/crates/swc_ecma_codegen/tests/test262/f658dbaa20c36388.js +++ b/crates/swc_ecma_codegen/tests/test262/f658dbaa20c36388.js @@ -1,6 +1,5 @@ (function() { if (!!a && b()) { - with (b){ - } + with (b){} } }()); diff --git a/crates/swc_ecma_codegen/tests/test262/f7291c5ec70a4152.js b/crates/swc_ecma_codegen/tests/test262/f7291c5ec70a4152.js index 740f45b7008..ef419d48dd0 100644 --- a/crates/swc_ecma_codegen/tests/test262/f7291c5ec70a4152.js +++ b/crates/swc_ecma_codegen/tests/test262/f7291c5ec70a4152.js @@ -1,2 +1 @@ -({ a: b , c }, [d, e], ...f)=>{ -}; +({ a: b , c }, [d, e], ...f)=>{}; diff --git a/crates/swc_ecma_codegen/tests/test262/f8cf06a0d5699319.js b/crates/swc_ecma_codegen/tests/test262/f8cf06a0d5699319.js index 67970be5b61..8d8ea799966 100644 --- a/crates/swc_ecma_codegen/tests/test262/f8cf06a0d5699319.js +++ b/crates/swc_ecma_codegen/tests/test262/f8cf06a0d5699319.js @@ -1,2 +1 @@ -function a(b, ...c) { -} +function a(b, ...c) {} diff --git a/crates/swc_ecma_codegen/tests/test262/fa5b398eeef697a6.js b/crates/swc_ecma_codegen/tests/test262/fa5b398eeef697a6.js index d8c6a67c6ce..d3191bd5cf2 100644 --- a/crates/swc_ecma_codegen/tests/test262/fa5b398eeef697a6.js +++ b/crates/swc_ecma_codegen/tests/test262/fa5b398eeef697a6.js @@ -1,4 +1,3 @@ ({ - set a (eval){ - } + set a (eval){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/fa9eaf58f51d6926.js b/crates/swc_ecma_codegen/tests/test262/fa9eaf58f51d6926.js index a0d35d57f7a..212e98240bd 100644 --- a/crates/swc_ecma_codegen/tests/test262/fa9eaf58f51d6926.js +++ b/crates/swc_ecma_codegen/tests/test262/fa9eaf58f51d6926.js @@ -1,2 +1 @@ -(function() { -}); +(function() {}); diff --git a/crates/swc_ecma_codegen/tests/test262/faa4a026e1e86145.js b/crates/swc_ecma_codegen/tests/test262/faa4a026e1e86145.js index e45ffe53c28..8a04fd2e050 100644 --- a/crates/swc_ecma_codegen/tests/test262/faa4a026e1e86145.js +++ b/crates/swc_ecma_codegen/tests/test262/faa4a026e1e86145.js @@ -1,2 +1 @@ -(()=>{ -})(); +(()=>{})(); diff --git a/crates/swc_ecma_codegen/tests/test262/fada2c7bbfabe14a.js b/crates/swc_ecma_codegen/tests/test262/fada2c7bbfabe14a.js index 6c3223f8454..f7721b696ca 100644 --- a/crates/swc_ecma_codegen/tests/test262/fada2c7bbfabe14a.js +++ b/crates/swc_ecma_codegen/tests/test262/fada2c7bbfabe14a.js @@ -1,2 +1 @@ -(function arguments() { -}); +(function arguments() {}); diff --git a/crates/swc_ecma_codegen/tests/test262/fb8db7a71f3755fc.js b/crates/swc_ecma_codegen/tests/test262/fb8db7a71f3755fc.js index a496fb83e3a..0505485abc5 100644 --- a/crates/swc_ecma_codegen/tests/test262/fb8db7a71f3755fc.js +++ b/crates/swc_ecma_codegen/tests/test262/fb8db7a71f3755fc.js @@ -1,4 +1,3 @@ class a { - set b(c) { - } + set b(c) {} } diff --git a/crates/swc_ecma_codegen/tests/test262/fbde237f11796df9.js b/crates/swc_ecma_codegen/tests/test262/fbde237f11796df9.js index fb02ae968f1..49404798896 100644 --- a/crates/swc_ecma_codegen/tests/test262/fbde237f11796df9.js +++ b/crates/swc_ecma_codegen/tests/test262/fbde237f11796df9.js @@ -1,5 +1,4 @@ ({ a: 1, - set a (b){ - } + set a (b){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/fc035551a2a4c15c.js b/crates/swc_ecma_codegen/tests/test262/fc035551a2a4c15c.js index bc1e1004a8f..cd8fcc0a2be 100644 --- a/crates/swc_ecma_codegen/tests/test262/fc035551a2a4c15c.js +++ b/crates/swc_ecma_codegen/tests/test262/fc035551a2a4c15c.js @@ -1,2 +1 @@ -while(a-- > 1){ -} +while(a-- > 1){} diff --git a/crates/swc_ecma_codegen/tests/test262/fc063bfba795ad91.js b/crates/swc_ecma_codegen/tests/test262/fc063bfba795ad91.js index f0eb1ffda26..83b87ff9c36 100644 --- a/crates/swc_ecma_codegen/tests/test262/fc063bfba795ad91.js +++ b/crates/swc_ecma_codegen/tests/test262/fc063bfba795ad91.js @@ -1,4 +1,3 @@ ({ - a (b = new.target) { - } + a (b = new.target) {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/fc1ba7d289fb1af1.js b/crates/swc_ecma_codegen/tests/test262/fc1ba7d289fb1af1.js index 22a03286755..ad3c89f537c 100644 --- a/crates/swc_ecma_codegen/tests/test262/fc1ba7d289fb1af1.js +++ b/crates/swc_ecma_codegen/tests/test262/fc1ba7d289fb1af1.js @@ -1,4 +1,3 @@ a = { - b: function(c, ...d) { - } + b: function(c, ...d) {} }; diff --git a/crates/swc_ecma_codegen/tests/test262/fd167642d02f2c66.js b/crates/swc_ecma_codegen/tests/test262/fd167642d02f2c66.js index 4440a7c4fe8..ffb77d5ca00 100644 --- a/crates/swc_ecma_codegen/tests/test262/fd167642d02f2c66.js +++ b/crates/swc_ecma_codegen/tests/test262/fd167642d02f2c66.js @@ -1,4 +1,3 @@ ({ - *[yield] () { - } + *[yield] () {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/fdb05dfd469c46c4.js b/crates/swc_ecma_codegen/tests/test262/fdb05dfd469c46c4.js index 63fc157dec9..de7d1883fc5 100644 --- a/crates/swc_ecma_codegen/tests/test262/fdb05dfd469c46c4.js +++ b/crates/swc_ecma_codegen/tests/test262/fdb05dfd469c46c4.js @@ -1,5 +1,4 @@ -var a = { -}; +var a = {}; a.你好 = 1; var ↂωↂ = 2; var l০ = 3; // 2nd char is a unicode digit diff --git a/crates/swc_ecma_codegen/tests/test262/fe5f0dcb8e902857.js b/crates/swc_ecma_codegen/tests/test262/fe5f0dcb8e902857.js index 1a1ae108dc9..ec0e231c686 100644 --- a/crates/swc_ecma_codegen/tests/test262/fe5f0dcb8e902857.js +++ b/crates/swc_ecma_codegen/tests/test262/fe5f0dcb8e902857.js @@ -2,7 +2,6 @@ while(a)// optimize it (function() { b('c'); }()); -try { -} catch (d) { +try {} catch (d) { b('e'); } diff --git a/crates/swc_ecma_codegen/tests/test262/ffcf0064736d41e7.js b/crates/swc_ecma_codegen/tests/test262/ffcf0064736d41e7.js index 965f884ab16..d994f034226 100644 --- a/crates/swc_ecma_codegen/tests/test262/ffcf0064736d41e7.js +++ b/crates/swc_ecma_codegen/tests/test262/ffcf0064736d41e7.js @@ -1,4 +1,3 @@ (function*() { - (function yield() { - }); + (function yield() {}); }); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-1/output.js index 68a56872fd6..772a98ef2d2 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-1/output.js @@ -2,9 +2,7 @@ function createCommonjsModule(fn) { return fn(); } const isFile = (config)=>!0 -, pkgBrowserslist = { -}, config = { -}; +, pkgBrowserslist = {}, config = {}; createCommonjsModule(function(module, exports) { Object.defineProperty(exports, "__esModule", { value: !0 diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-10/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-10/output.js index 68a56872fd6..772a98ef2d2 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-10/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2044/pass-10/output.js @@ -2,9 +2,7 @@ function createCommonjsModule(fn) { return fn(); } const isFile = (config)=>!0 -, pkgBrowserslist = { -}, config = { -}; +, pkgBrowserslist = {}, config = {}; createCommonjsModule(function(module, exports) { Object.defineProperty(exports, "__esModule", { value: !0 diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2257/full/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2257/full/output.js index 58d38276b4a..80bd7780e9b 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2257/full/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2257/full/output.js @@ -36,10 +36,8 @@ 21617: function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -49,8 +47,7 @@ } }); }, - 53721: function() { - }, + 53721: function() {}, 89704: function(module) { module.exports = { container: "Guide--container--ZhpDRAI", @@ -127,8 +124,7 @@ var onError = this.props.onError; if ("function" == typeof onError) try { onError.call(this, error, info.componentStack); - } catch (ignoredError) { - } + } catch (ignoredError) {} this.setState({ error: error, info: info @@ -238,22 +234,18 @@ exports.useAuth = useAuth, exports.withAuth = function(Component) { return function(props) { var ref = useAuth(), auth = ref[0], setAuth = ref[1]; - return _jsxRuntime.jsx(Component, swcHelpers.objectSpread({ - }, props, { + return _jsxRuntime.jsx(Component, swcHelpers.objectSpread({}, props, { auth: auth, setAuth: setAuth })); }; }, exports.Provider = function(param1) { - var _value = param1.value, children = param1.children, ref = _react.useState(void 0 === _value ? { - } : _value), state = ref[0], setState = ref[1]; + var _value = param1.value, children = param1.children, ref = _react.useState(void 0 === _value ? {} : _value), state = ref[0], setState = ref[1]; return _jsxRuntime.jsx(Context.Provider, { value: [ state, function(param) { - setState(swcHelpers.objectSpread({ - }, state, void 0 === param ? { - } : param)); + setState(swcHelpers.objectSpread({}, state, void 0 === param ? {} : param)); } ], children: children @@ -267,10 +259,7 @@ }), exports.default = void 0; var swcHelpers = __webpack_require__(547), _jsxRuntime = __webpack_require__(37712), _auth = __webpack_require__(45440); exports.default = function(param2) { - var authConfig, context = param2.context, appConfig = param2.appConfig, addProvider = param2.addProvider, wrapperPageComponent = param2.wrapperPageComponent, initialData = context && context.initialData ? context.initialData : { - }, initialAuth = initialData.auth || { - }, authConfig1 = appConfig.auth || { - }; + var authConfig, context = param2.context, appConfig = param2.appConfig, addProvider = param2.addProvider, wrapperPageComponent = param2.wrapperPageComponent, initialData = context && context.initialData ? context.initialData : {}, initialAuth = initialData.auth || {}, authConfig1 = appConfig.auth || {}; addProvider(function(param) { var children = param.children; return _jsxRuntime.jsx(_auth.Provider, { @@ -278,8 +267,7 @@ children: children }); }), wrapperPageComponent((authConfig = authConfig1, function(PageComponent) { - var _pageConfig = PageComponent.pageConfig, pageConfig = void 0 === _pageConfig ? { - } : _pageConfig; + var _pageConfig = PageComponent.pageConfig, pageConfig = void 0 === _pageConfig ? {} : _pageConfig; return _auth.withAuth(function(props) { var auth = props.auth, setAuth = props.setAuth, rest = swcHelpers.objectWithoutProperties(props, [ "auth", @@ -288,9 +276,7 @@ if (pageConfigAuth && !Array.isArray(pageConfigAuth)) throw new Error("pageConfig.auth must be an array"); return Array.isArray(pageConfigAuth) && pageConfigAuth.length && !Object.keys(auth).filter(function(item) { return !!pageConfigAuth.includes(item) && auth[item]; - }).length ? authConfig.NoAuthFallback ? "function" == typeof authConfig.NoAuthFallback ? _jsxRuntime.jsx(authConfig.NoAuthFallback, { - }) : authConfig.NoAuthFallback : null : _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({ - }, rest)); + }).length ? authConfig.NoAuthFallback ? "function" == typeof authConfig.NoAuthFallback ? _jsxRuntime.jsx(authConfig.NoAuthFallback, {}) : authConfig.NoAuthFallback : null : _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({}, rest)); }); })); }; @@ -300,8 +286,7 @@ Object.defineProperty(exports, "__esModule", { value: !0 }), exports.default = void 0; - var _runtime = __webpack_require__(56128), DEFAULE_CONFIG = { - }, axiosInstance = { + var _runtime = __webpack_require__(56128), DEFAULE_CONFIG = {}, axiosInstance = { default: _runtime.axios.create(DEFAULE_CONFIG) }; exports.default = function(instanceName) { @@ -319,8 +304,7 @@ }), exports.default = void 0; var swcHelpers = __webpack_require__(547), _createAxiosInstance = swcHelpers.interopRequireDefault(__webpack_require__(1481)); function setAxiosInstance(requestConfig, axiosInstance) { - var _interceptors = requestConfig.interceptors, interceptors = void 0 === _interceptors ? { - } : _interceptors, requestOptions = swcHelpers.objectWithoutProperties(requestConfig, [ + var _interceptors = requestConfig.interceptors, interceptors = void 0 === _interceptors ? {} : _interceptors, requestOptions = swcHelpers.objectWithoutProperties(requestConfig, [ "interceptors" ]); Object.keys(requestOptions).forEach(function(key) { @@ -338,8 +322,7 @@ exports.default = function(param) { var appConfig = param.appConfig; if (appConfig.request) { - var tmp = appConfig.request, requestConfig = void 0 === tmp ? { - } : tmp; + var tmp = appConfig.request, requestConfig = void 0 === tmp ? {} : tmp; "[object Array]" === Object.prototype.toString.call(requestConfig) ? requestConfig.forEach(function(requestItem) { var instanceName = requestItem.instanceName ? requestItem.instanceName : "default"; instanceName && setAxiosInstance(requestItem, _createAxiosInstance.default(instanceName)[instanceName]); @@ -355,15 +338,11 @@ }), exports.default = void 0; var swcHelpers = __webpack_require__(547), _jsxRuntime = __webpack_require__(37712), _errorBoundary = swcHelpers.interopRequireDefault(__webpack_require__(11179)), _routes = swcHelpers.interopRequireDefault(__webpack_require__(72791)), _router = __webpack_require__(37447), _formatRoutes = swcHelpers.interopRequireWildcard(__webpack_require__(14710)); exports.default = function(param3) { - var setRenderApp = param3.setRenderApp, appConfig = param3.appConfig, modifyRoutes = param3.modifyRoutes, wrapperPageComponent = param3.wrapperPageComponent, modifyRoutesComponent = param3.modifyRoutesComponent, buildConfig = param3.buildConfig, context = param3.context, applyRuntimeAPI = param3.applyRuntimeAPI, tmp = appConfig.router, appConfigRouter = void 0 === tmp ? { - } : tmp, _app = appConfig.app, app = void 0 === _app ? { - } : _app, ErrorBoundaryFallback = app.ErrorBoundaryFallback, onErrorBoundaryHandler = app.onErrorBoundaryHandler, _parseSearchParams = app.parseSearchParams, parseSearchParams = void 0 === _parseSearchParams || _parseSearchParams; + var setRenderApp = param3.setRenderApp, appConfig = param3.appConfig, modifyRoutes = param3.modifyRoutes, wrapperPageComponent = param3.wrapperPageComponent, modifyRoutesComponent = param3.modifyRoutesComponent, buildConfig = param3.buildConfig, context = param3.context, applyRuntimeAPI = param3.applyRuntimeAPI, tmp = appConfig.router, appConfigRouter = void 0 === tmp ? {} : tmp, _app = appConfig.app, app = void 0 === _app ? {} : _app, ErrorBoundaryFallback = app.ErrorBoundaryFallback, onErrorBoundaryHandler = app.onErrorBoundaryHandler, _parseSearchParams = app.parseSearchParams, parseSearchParams = void 0 === _parseSearchParams || _parseSearchParams; wrapperPageComponent(function(PageComponent) { return function(props) { var searchParams = parseSearchParams && applyRuntimeAPI("getSearchParams"); - return _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({ - }, Object.assign({ - }, props, { + return _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({}, Object.assign({}, props, { searchParams: searchParams }))); }; @@ -374,35 +353,28 @@ }); var wrapperPageFn = process.env.__IS_SERVER__ ? _formatRoutes.wrapperPageWithSSR(context) : _formatRoutes.wrapperPageWithCSR(); wrapperPageComponent(wrapperPageFn), wrapperPageComponent(function(PageComponent) { - var _pageConfig = PageComponent.pageConfig, pageConfig = void 0 === _pageConfig ? { - } : _pageConfig; + var _pageConfig = PageComponent.pageConfig, pageConfig = void 0 === _pageConfig ? {} : _pageConfig; return function(props) { return pageConfig.errorBoundary ? _jsxRuntime.jsx(_errorBoundary.default, { Fallback: ErrorBoundaryFallback, onError: onErrorBoundaryHandler, - children: _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({ - }, props)) - }) : _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({ - }, props)); + children: _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({}, props)) + }) : _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({}, props)); }; }), appConfigRouter.modifyRoutes && modifyRoutes(appConfigRouter.modifyRoutes); var lazy = buildConfig && buildConfig.router && buildConfig.router.lazy; setRenderApp(function(routes, RoutesComponent, param) { - var customRouterProps = void 0 === param ? { - } : param; + var customRouterProps = void 0 === param ? {} : param; return function() { - var routerProps = swcHelpers.objectSpread({ - }, appConfigRouter, { + var routerProps = swcHelpers.objectSpread({}, appConfigRouter, { lazy: lazy }, customRouterProps); if (routerProps.history || (routerProps.history = applyRuntimeAPI("createHistory", { type: appConfigRouter.type, basename: appConfigRouter.basename })), process.env.__IS_SERVER__) { - var _initialContext = context.initialContext, initialContext = void 0 === _initialContext ? { - } : _initialContext; - routerProps = Object.assign({ - }, routerProps, { + var _initialContext = context.initialContext, initialContext = void 0 === _initialContext ? {} : _initialContext; + routerProps = Object.assign({}, routerProps, { location: initialContext.location, context: initialContext }); @@ -410,8 +382,7 @@ var fallback = routerProps.fallback, restRouterProps = swcHelpers.objectWithoutProperties(routerProps, [ "fallback" ]); - return _jsxRuntime.jsx(_router.IceRouter, swcHelpers.objectSpread({ - }, restRouterProps, { + return _jsxRuntime.jsx(_router.IceRouter, swcHelpers.objectSpread({}, restRouterProps, { children: RoutesComponent ? _jsxRuntime.jsx(RoutesComponent, { routes: _router.parseRoutes(routes, fallback), fallback: fallback @@ -438,11 +409,9 @@ fallback: props.fallback }); } - return "static" === type ? _jsxRuntime.jsx(_reactRouterDom.StaticRouter, swcHelpers.objectSpread({ - }, others, { + return "static" === type ? _jsxRuntime.jsx(_reactRouterDom.StaticRouter, swcHelpers.objectSpread({}, others, { children: renderChildren - })) : _jsxRuntime.jsx(_reactRouterDom.Router, swcHelpers.objectSpread({ - }, others, { + })) : _jsxRuntime.jsx(_reactRouterDom.Router, swcHelpers.objectSpread({}, others, { children: renderChildren })); }, exports.Routes = Routes; @@ -470,10 +439,8 @@ "wrappers" ]), mergedRouteWrappers = children ? [] : routeWrappers; wrappers && wrappers.length && (mergedRouteWrappers = mergedRouteWrappers.concat(wrappers)); - var parsedRoute = swcHelpers.objectSpread({ - }, others); - return component1 && (parsedRoute.component = (component = component1, routerWrappers = mergedRouteWrappers, route1 = route, fallback = fallback1, __LAZY__ = (ref = component || { - }).__LAZY__, dynamicImport = ref.dynamicImport, __LOADABLE__ = ref.__LOADABLE__, __LOADABLE__ ? _component.default(dynamicImport, { + var parsedRoute = swcHelpers.objectSpread({}, others); + return component1 && (parsedRoute.component = (component = component1, routerWrappers = mergedRouteWrappers, route1 = route, fallback = fallback1, __LAZY__ = (ref = component || {}).__LAZY__, dynamicImport = ref.dynamicImport, __LOADABLE__ = ref.__LOADABLE__, __LOADABLE__ ? _component.default(dynamicImport, { resolveComponent: function(mod) { var comp = mod.default; return setComponentAttr(comp, route1), wrapperRoute(comp, routerWrappers); @@ -483,8 +450,7 @@ return dynamicImport().then(function(mod) { if (routerWrappers && routerWrappers.length) { var comp = mod.default; - return setComponentAttr(comp, route1), swcHelpers.objectSpread({ - }, mod, { + return setComponentAttr(comp, route1), swcHelpers.objectSpread({}, mod, { default: wrapperRoute(comp, routerWrappers) }); } @@ -506,13 +472,11 @@ routes: children, fallback: fallback }), RenderComponent = function(props) { - return LayoutComponent ? _jsxRuntime.jsx(LayoutComponent, swcHelpers.objectSpread({ - }, props, { + return LayoutComponent ? _jsxRuntime.jsx(LayoutComponent, swcHelpers.objectSpread({}, props, { children: routesComponent })) : routesComponent; }; - return _jsxRuntime.jsx(_reactRouterDom.Route, swcHelpers.objectSpread({ - }, others, { + return _jsxRuntime.jsx(_reactRouterDom.Route, swcHelpers.objectSpread({}, others, { render: RenderComponent }), id); } @@ -530,19 +494,16 @@ ]); if (!RouteComponent) return console.error("[Router] component is required when config routes"), null; var RenderComponent = process.env.__IS_SERVER__ || window.__ICE_SSR_ENABLED__ ? function(props) { - return _jsxRuntime.jsx(RouteComponent, swcHelpers.objectSpread({ - }, props)); + return _jsxRuntime.jsx(RouteComponent, swcHelpers.objectSpread({}, props)); } : function(props) { return _jsxRuntime.jsx(_react.Suspense, { fallback: fallback || _jsxRuntime.jsx("div", { children: "loading" }), - children: _jsxRuntime.jsx(RouteComponent, swcHelpers.objectSpread({ - }, props)) + children: _jsxRuntime.jsx(RouteComponent, swcHelpers.objectSpread({}, props)) }); }; - return _jsxRuntime.jsx(_reactRouterDom.Route, swcHelpers.objectSpread({ - }, others, { + return _jsxRuntime.jsx(_reactRouterDom.Route, swcHelpers.objectSpread({}, others, { render: RenderComponent }), id); }) @@ -554,19 +515,15 @@ Object.defineProperty(exports, "__esModule", { value: !0 }), exports.default = formatRoutes, exports.wrapperPageWithSSR = function(context) { - var pageInitialProps = swcHelpers.objectSpread({ - }, context.pageInitialProps); + var pageInitialProps = swcHelpers.objectSpread({}, context.pageInitialProps); return function(PageComponent) { return function(props) { - return _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({ - }, Object.assign({ - }, props, pageInitialProps))); + return _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({}, Object.assign({}, props, pageInitialProps))); }; }; }, exports.wrapperPageWithCSR = function() { return function(PageComponent) { - var ref1 = PageComponent.pageConfig || { - }, title = ref1.title, scrollToTop = ref1.scrollToTop; + var ref1 = PageComponent.pageConfig || {}, title = ref1.title, scrollToTop = ref1.scrollToTop; return function(props) { var ref = _react.useState(window.__ICE_PAGE_PROPS__), data = ref[0], setData = ref[1]; return _react.useEffect(function() { @@ -589,9 +546,7 @@ } }, _callee); }))(); - }, []), _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({ - }, Object.assign({ - }, props, data))); + }, []), _jsxRuntime.jsx(PageComponent, swcHelpers.objectSpread({}, Object.assign({}, props, data))); }; }; }; @@ -605,8 +560,7 @@ if (item.children) item.children = formatRoutes(item.children, item.path); else if (item.component) { var itemComponent = item.component; - itemComponent.pageConfig = Object.assign({ - }, itemComponent.pageConfig, { + itemComponent.pageConfig = Object.assign({}, itemComponent.pageConfig, { componentName: itemComponent.name }); } @@ -680,8 +634,7 @@ }), exports.default = void 0; var swcHelpers = __webpack_require__(547), _jsxRuntime = __webpack_require__(37712), _guide = swcHelpers.interopRequireDefault(__webpack_require__(56905)); exports.default = function() { - return console.log(1), _jsxRuntime.jsx(_guide.default, { - }); + return console.log(1), _jsxRuntime.jsx(_guide.default, {}); }; }, 72791: function(__unused_webpack_module, exports, __webpack_require__) { @@ -724,11 +677,9 @@ } function merge() { for(var args = [], _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i]; - var result = { - }; + var result = {}; function assignValue(val, key) { - isPlainObject(result[key]) && isPlainObject(val) ? result[key] = merge(result[key], val) : isPlainObject(val) ? result[key] = merge({ - }, val) : isArray(val) ? result[key] = val.slice() : result[key] = val; + isPlainObject(result[key]) && isPlainObject(val) ? result[key] = merge(result[key], val) : isPlainObject(val) ? result[key] = merge({}, val) : isArray(val) ? result[key] = val.slice() : result[key] = val; } for(var i = 0, l = args.length; i < l; i++)forEach(args[i], assignValue); return result; @@ -775,8 +726,7 @@ invariant: invariant, Context: Context }), LOADABLE_SHARED = { - initialChunks: { - } + initialChunks: {} }, STATUS_PENDING = "PENDING", STATUS_REJECTED = "REJECTED", withChunkExtractor = function(Component) { var LoadableWithChunkExtractor = function(props) { return _react_17_0_2_react.createElement(Context.Consumer, null, function(extractor) { @@ -792,16 +742,12 @@ return v; } : _ref$defaultResolveCo, _render = _ref.render, onLoad = _ref.onLoad; function loadable(loadableConstructor, options) { - void 0 === options && (options = { - }); + void 0 === options && (options = {}); var ctor, ctor1 = "function" == typeof (ctor = loadableConstructor) ? { requireAsync: ctor, - resolve: function() { - }, - chunkName: function() { - } - } : ctor, cache = { - }; + resolve: function() {}, + chunkName: function() {} + } : ctor, cache = {}; function _getCacheKey(props) { return options.cacheKey ? options.cacheKey(props) : ctor1.resolve ? ctor1.resolve(props) : "static"; } @@ -829,8 +775,7 @@ } (0, inheritsLoose.Z)(InnerLoadable, _React$Component), InnerLoadable.getDerivedStateFromProps = function(props, state) { var cacheKey = _getCacheKey(props); - return (0, esm_extends.Z)({ - }, state, { + return (0, esm_extends.Z)({}, state, { cacheKey: cacheKey, loading: state.loading || state.cacheKey !== cacheKey }); @@ -913,8 +858,7 @@ fallback: fallback, result: result, options: options, - props: (0, esm_extends.Z)({ - }, props, { + props: (0, esm_extends.Z)({}, props, { ref: forwardedRef }) }); @@ -933,8 +877,7 @@ return { loadable: loadable, lazy: function(ctor, options) { - return loadable(ctor, (0, esm_extends.Z)({ - }, options, { + return loadable(ctor, (0, esm_extends.Z)({}, options, { suspense: !0 })); } @@ -958,10 +901,8 @@ } }), loadable$1 = _createLoadable$1.loadable, lazy$1 = _createLoadable$1.lazy, BROWSER = "undefined" != typeof window; function loadableReady(done, _temp) { - void 0 === done && (done = function() { - }); - var _ref = void 0 === _temp ? { - } : _temp, _ref$namespace = _ref.namespace, _ref$chunkLoadingGlob = _ref.chunkLoadingGlobal, chunkLoadingGlobal = void 0 === _ref$chunkLoadingGlob ? "__LOADABLE_LOADED_CHUNKS__" : _ref$chunkLoadingGlob; + void 0 === done && (done = function() {}); + var _ref = void 0 === _temp ? {} : _temp, _ref$namespace = _ref.namespace, _ref$chunkLoadingGlob = _ref.chunkLoadingGlobal, chunkLoadingGlobal = void 0 === _ref$chunkLoadingGlob ? "__LOADABLE_LOADED_CHUNKS__" : _ref$chunkLoadingGlob; if (!BROWSER) return warn("`loadableReady()` must be called in browser only"), done(), Promise.resolve(); var requiredChunks = null; if (BROWSER) { @@ -1002,8 +943,7 @@ "use strict"; var REACT_ELEMENT_TYPE; function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc1 = { - }; + var desc1 = {}; return Object.keys(descriptor).forEach(function(key) { desc1[key] = descriptor[key]; }), desc1.enumerable = !!desc1.enumerable, desc1.configurable = !!desc1.configurable, ("value" in desc1 || desc1.initializer) && (desc1.writable = !0), desc1 = decorators.slice().reverse().reduce(function(desc, decorator) { @@ -1078,8 +1018,7 @@ }, "function" != typeof gen.return && (this.return = void 0); } function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = { - }, waiting = !1; + var iter = {}, waiting = !1; function pump(key, value) { return waiting = !0, { done: !1, @@ -1176,8 +1115,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -1412,8 +1350,7 @@ kind: kind, key: key, placement: placement, - descriptor: Object.assign({ - }, descriptor) + descriptor: Object.assign({}, descriptor) }; return "field" !== kind ? _disallowProperty(elementObject, "initializer", "A method descriptor") : (_disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"), _disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"), _disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"), element.initializer = elementObject.initializer), element; } @@ -1567,12 +1504,10 @@ } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; - var newObj = { - }; + var newObj = {}; if (null != obj) { for(var key in obj)if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : { - }; + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; desc.get || desc.set ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key]; } } @@ -1606,8 +1541,7 @@ if (props || 0 === childrenLength || (props = { children: void 0 }), props && defaultProps) for(var propName in defaultProps)void 0 === props[propName] && (props[propName] = defaultProps[propName]); - else props || (props = defaultProps || { - }); + else props || (props = defaultProps || {}); if (1 === childrenLength) props.children = children; else if (childrenLength > 1) { for(var childArray = new Array(childrenLength), i = 0; i < childrenLength; i++)childArray[i] = arguments[i + 3]; @@ -1630,8 +1564,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -1641,16 +1574,13 @@ return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } function _objectWithoutProperties(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -2105,9 +2035,7 @@ }; } Axios.prototype.request = function(config) { - "string" == typeof config ? (config = arguments[1] || { - }, config.url = arguments[0]) : config = config || { - }, (config = mergeConfig(this.defaults, config)).method ? config.method = config.method.toLowerCase() : this.defaults.method ? config.method = this.defaults.method.toLowerCase() : config.method = "get"; + "string" == typeof config ? (config = arguments[1] || {}, config.url = arguments[0]) : config = config || {}, (config = mergeConfig(this.defaults, config)).method ? config.method = config.method.toLowerCase() : this.defaults.method ? config.method = this.defaults.method.toLowerCase() : config.method = "get"; var promise, transitional = config.transitional; void 0 !== transitional && validator.assertOptions(transitional, { silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"), @@ -2154,12 +2082,10 @@ "options" ], function(method) { Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || { - }, { + return this.request(mergeConfig(config || {}, { method: method, url: url, - data: (config || { - }).data + data: (config || {}).data })); }; }), utils.forEach([ @@ -2168,8 +2094,7 @@ "patch" ], function(method) { Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || { - }, { + return this.request(mergeConfig(config || {}, { method: method, url: url, data: data @@ -2219,10 +2144,7 @@ config.cancelToken && config.cancelToken.throwIfRequested(); } module.exports = function(config) { - return throwIfCancellationRequested(config), config.headers = config.headers || { - }, config.data = transformData.call(config, config.data, config.headers, config.transformRequest), config.headers = utils.merge(config.headers.common || { - }, config.headers[config.method] || { - }, config.headers), utils.forEach([ + return throwIfCancellationRequested(config), config.headers = config.headers || {}, config.data = transformData.call(config, config.data, config.headers, config.transformRequest), config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers), utils.forEach([ "delete", "get", "head", @@ -2262,10 +2184,8 @@ "use strict"; var utils = __webpack_require__(99677); module.exports = function(config1, config2) { - config2 = config2 || { - }; - var config = { - }, valueFromConfig2Keys = [ + config2 = config2 || {}; + var config = {}, valueFromConfig2Keys = [ "url", "method", "data" @@ -2302,8 +2222,7 @@ "validateStatus" ]; function getMergedValue(target, source) { - return utils.isPlainObject(target) && utils.isPlainObject(source) ? utils.merge(target, source) : utils.isPlainObject(source) ? utils.merge({ - }, source) : utils.isArray(source) ? source.slice() : source; + return utils.isPlainObject(target) && utils.isPlainObject(source) ? utils.merge(target, source) : utils.isPlainObject(source) ? utils.merge({}, source) : utils.isArray(source) ? source.slice() : source; } function mergeDeepProperties(prop) { utils.isUndefined(config2[prop]) ? utils.isUndefined(config1[prop]) || (config[prop] = getMergedValue(void 0, config1[prop])) : config[prop] = getMergedValue(config1[prop], config2[prop]); @@ -2398,8 +2317,7 @@ "get", "head" ], function(method) { - defaults.headers[method] = { - }; + defaults.headers[method] = {}; }), utils.forEach([ "post", "put", @@ -2466,13 +2384,11 @@ this.write(name, "", Date.now() - 86400000); } } : { - write: function() { - }, + write: function() {}, read: function() { return null; }, - remove: function() { - } + remove: function() {} }; }, 11511: function(module) { @@ -2544,8 +2460,7 @@ "user-agent" ]; module.exports = function(headers) { - var key, val, i, parsed = { - }; + var key, val, i, parsed = {}; return headers && utils.forEach(headers.split("\n"), function(line) { i = line.indexOf(":"), key = utils.trim(line.substr(0, i)).toLowerCase(), val = utils.trim(line.substr(i + 1)), key && (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0 || ("set-cookie" === key ? parsed[key] = (parsed[key] ? parsed[key] : []).concat([ val @@ -2563,8 +2478,7 @@ }, 69847: function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; - var pkg = __webpack_require__(84228), validators = { - }; + var pkg = __webpack_require__(84228), validators = {}; [ "object", "boolean", @@ -2577,8 +2491,7 @@ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; }; }); - var deprecatedWarnings = { - }, currentVerArr = pkg.version.split("."); + var deprecatedWarnings = {}, currentVerArr = pkg.version.split("."); function isOlderVersion(version, thanVersion) { for(var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr, destVer = version.split("."), i = 0; i < 3; i++){ if (pkgVersionArr[i] > destVer[i]) return !0; @@ -2639,11 +2552,9 @@ else for(var key in obj)Object.prototype.hasOwnProperty.call(obj, key) && fn.call(null, obj[key], key, obj); } function merge() { - var result = { - }; + var result = {}; function assignValue(val, key) { - isPlainObject(result[key]) && isPlainObject(val) ? result[key] = merge(result[key], val) : isPlainObject(val) ? result[key] = merge({ - }, val) : isArray(val) ? result[key] = val.slice() : result[key] = val; + isPlainObject(result[key]) && isPlainObject(val) ? result[key] = merge(result[key], val) : isPlainObject(val) ? result[key] = merge({}, val) : isArray(val) ? result[key] = val.slice() : result[key] = val; } for(var i = 0, l = arguments.length; i < l; i++)forEach(arguments[i], assignValue); return result; @@ -2811,8 +2722,7 @@ var TypedArrayConstructor = global[ARRAY]; if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) try { delete TypedArrayConstructor.prototype[KEY]; - } catch (error) { - } + } catch (error) {} } (!TypedArrayPrototype[KEY] || forced) && redefine(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property); } @@ -2824,14 +2734,12 @@ if (forced) { for(ARRAY in TypedArrayConstructorsList)if ((TypedArrayConstructor = global[ARRAY]) && has(TypedArrayConstructor, KEY)) try { delete TypedArrayConstructor[KEY]; - } catch (error) { - } + } catch (error) {} } if (TypedArray[KEY] && !forced) return; try { return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property); - } catch (error2) { - } + } catch (error2) {} } for(ARRAY in TypedArrayConstructorsList)(TypedArrayConstructor = global[ARRAY]) && (!TypedArrayConstructor[KEY] || forced) && redefine(TypedArrayConstructor, KEY, property); } @@ -3098,8 +3006,7 @@ module.exports = function(METHOD_NAME) { return V8_VERSION >= 51 || !fails(function() { var array = []; - return (array.constructor = { - })[SPECIES] = function() { + return (array.constructor = {})[SPECIES] = function() { return { foo: 1 }; @@ -3197,14 +3104,12 @@ }, Array.from(iteratorWithReturn, function() { throw 2; }); - } catch (error) { - } + } catch (error) {} module.exports = function(exec, SKIP_CLOSING) { if (!SKIP_CLOSING && !SAFE_CLOSING) return !1; var ITERATION_SUPPORT = !1; try { - var object = { - }; + var object = {}; object[ITERATOR] = function() { return { next: function() { @@ -3214,14 +3119,12 @@ } }; }, exec(object); - } catch (error) { - } + } catch (error) {} return ITERATION_SUPPORT; }; }, 82020: function(module) { - var toString = { - }.toString; + var toString = {}.toString; module.exports = function(it) { return toString.call(it).slice(8, -1); }; @@ -3232,8 +3135,7 @@ }()), tryGet = function(it, key) { try { return it[key]; - } catch (error) { - } + } catch (error) {} }; module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) { var O, tag, result; @@ -3423,8 +3325,7 @@ "use strict"; var $ = __webpack_require__(35437), global = __webpack_require__(19514), isForced = __webpack_require__(23736), redefine = __webpack_require__(78109), InternalMetadataModule = __webpack_require__(19322), iterate = __webpack_require__(7261), anInstance = __webpack_require__(51819), isCallable = __webpack_require__(67106), isObject = __webpack_require__(39817), fails = __webpack_require__(60232), checkCorrectnessOfIteration = __webpack_require__(34124), setToStringTag = __webpack_require__(77875), inheritIfRequired = __webpack_require__(45564); module.exports = function(CONSTRUCTOR_NAME, wrapper, common) { - var IS_MAP = -1 !== CONSTRUCTOR_NAME.indexOf("Map"), IS_WEAK = -1 !== CONSTRUCTOR_NAME.indexOf("Weak"), ADDER = IS_MAP ? "set" : "add", NativeConstructor = global[CONSTRUCTOR_NAME], NativePrototype = NativeConstructor && NativeConstructor.prototype, Constructor = NativeConstructor, exported = { - }, fixMethod = function(KEY) { + var IS_MAP = -1 !== CONSTRUCTOR_NAME.indexOf("Map"), IS_WEAK = -1 !== CONSTRUCTOR_NAME.indexOf("Weak"), ADDER = IS_MAP ? "set" : "add", NativeConstructor = global[CONSTRUCTOR_NAME], NativePrototype = NativeConstructor && NativeConstructor.prototype, Constructor = NativeConstructor, exported = {}, fixMethod = function(KEY) { var nativeMethod = NativePrototype[KEY]; redefine(NativePrototype, KEY, "add" == KEY ? function(value) { return nativeMethod.call(this, 0 === value ? 0 : value), this; @@ -3442,8 +3343,7 @@ new NativeConstructor().entries().next(); })))) Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER), InternalMetadataModule.enable(); else if (isForced(CONSTRUCTOR_NAME, !0)) { - var instance = new Constructor(), HASNT_CHAINING = instance[ADDER](IS_WEAK ? { - } : -0, 1) != instance, THROWS_ON_PRIMITIVES = fails(function() { + var instance = new Constructor(), HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance, THROWS_ON_PRIMITIVES = fails(function() { instance.has(1); }), ACCEPT_ITERABLES = checkCorrectnessOfIteration(function(iterable) { new NativeConstructor(iterable); @@ -3484,8 +3384,7 @@ } catch (error1) { try { return regexp[MATCH] = !1, "/./"[METHOD_NAME](regexp); - } catch (error2) { - } + } catch (error2) {} } return !1; }; @@ -3493,8 +3392,7 @@ 81577: function(module, __unused_webpack_exports, __webpack_require__) { var fails = __webpack_require__(60232); module.exports = !fails(function() { - function F() { - } + function F() {} return F.prototype.constructor = null, Object.getPrototypeOf(new F()) !== F.prototype; }); }, @@ -3613,8 +3511,7 @@ 71309: function(module, __unused_webpack_exports, __webpack_require__) { var path = __webpack_require__(79574), has = __webpack_require__(1521), wrappedWellKnownSymbolModule = __webpack_require__(52301), defineProperty = __webpack_require__(94770).f; module.exports = function(NAME) { - var Symbol = path.Symbol || (path.Symbol = { - }); + var Symbol = path.Symbol || (path.Symbol = {}); has(Symbol, NAME) || defineProperty(Symbol, NAME, { value: wrappedWellKnownSymbolModule.f(NAME) }); @@ -3623,8 +3520,7 @@ 87122: function(module, __unused_webpack_exports, __webpack_require__) { var fails = __webpack_require__(60232); module.exports = !fails(function() { - return 7 != Object.defineProperty({ - }, 1, { + return 7 != Object.defineProperty({}, 1, { get: function() { return 7; } @@ -3634,8 +3530,7 @@ 28554: function(module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(19514), isObject = __webpack_require__(39817), document = global.document, EXISTS = isObject(document) && isObject(document.createElement); module.exports = function(it) { - return EXISTS ? document.createElement(it) : { - }; + return EXISTS ? document.createElement(it) : {}; }; }, 69379: function(module) { @@ -3731,9 +3626,7 @@ var global = __webpack_require__(19514), getOwnPropertyDescriptor = __webpack_require__(24722).f, createNonEnumerableProperty = __webpack_require__(48181), redefine = __webpack_require__(78109), setGlobal = __webpack_require__(65933), copyConstructorProperties = __webpack_require__(18295), isForced = __webpack_require__(23736); module.exports = function(options, source) { var FORCED, target, key, targetProperty, sourceProperty, descriptor, TARGET = options.target, GLOBAL = options.global, STATIC = options.stat; - if (target = GLOBAL ? global : STATIC ? global[TARGET] || setGlobal(TARGET, { - }) : (global[TARGET] || { - }).prototype) for(key in source){ + if (target = GLOBAL ? global : STATIC ? global[TARGET] || setGlobal(TARGET, {}) : (global[TARGET] || {}).prototype) for(key in source){ if (sourceProperty = source[key], targetProperty = options.noTargetGet ? (descriptor = getOwnPropertyDescriptor(target, key)) && descriptor.value : target[key], FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced), !FORCED && void 0 !== targetProperty) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); @@ -3757,16 +3650,13 @@ var redefine = __webpack_require__(78109), regexpExec = __webpack_require__(72384), fails = __webpack_require__(60232), wellKnownSymbol = __webpack_require__(81019), createNonEnumerableProperty = __webpack_require__(48181), SPECIES = wellKnownSymbol("species"), RegExpPrototype = RegExp.prototype; module.exports = function(KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol(KEY), DELEGATES_TO_SYMBOL = !fails(function() { - var O = { - }; + var O = {}; return O[SYMBOL] = function() { return 7; }, 7 != ""[KEY](O); }), DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function() { var execCalled = !1, re = /a/; - return "split" === KEY && ((re = { - }).constructor = { - }, re.constructor[SPECIES] = function() { + return "split" === KEY && ((re = {}).constructor = {}, re.constructor[SPECIES] = function() { return re; }, re.flags = "", re[SYMBOL] = /./[SYMBOL]), re.exec = function() { return execCalled = !0, null; @@ -3811,8 +3701,7 @@ 85469: function(module, __unused_webpack_exports, __webpack_require__) { var fails = __webpack_require__(60232); module.exports = !fails(function() { - return Object.isExtensible(Object.preventExtensions({ - })); + return Object.isExtensible(Object.preventExtensions({})); }); }, 59561: function(module, __unused_webpack_exports, __webpack_require__) { @@ -3844,8 +3733,7 @@ }, 48644: function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; - var aCallable = __webpack_require__(74618), isObject = __webpack_require__(39817), slice = [].slice, factories = { - }, construct = function(C, argsLength, args) { + var aCallable = __webpack_require__(74618), isObject = __webpack_require__(39817), slice = [].slice, factories = {}, construct = function(C, argsLength, args) { if (!(argsLength in factories)) { for(var list = [], i = 0; i < argsLength; i++)list[i] = "a[" + i + "]"; factories[argsLength] = Function("C,a", "return new C(" + list.join(",") + ")"); @@ -3861,8 +3749,7 @@ }; }, 25160: function(module, __unused_webpack_exports, __webpack_require__) { - var DESCRIPTORS = __webpack_require__(87122), has = __webpack_require__(1521), FunctionPrototype = Function.prototype, getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor, EXISTS = has(FunctionPrototype, "name"), PROPER = EXISTS && "something" === (function() { - }).name, CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable); + var DESCRIPTORS = __webpack_require__(87122), has = __webpack_require__(1521), FunctionPrototype = Function.prototype, getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor, EXISTS = has(FunctionPrototype, "name"), PROPER = EXISTS && "something" === (function() {}).name, CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable); module.exports = { EXISTS: EXISTS, PROPER: PROPER, @@ -3937,15 +3824,13 @@ module.exports = check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) || check("object" == typeof self && self) || check("object" == typeof __webpack_require__.g && __webpack_require__.g) || this || Function("return this")(); }, 1521: function(module, __unused_webpack_exports, __webpack_require__) { - var toObject = __webpack_require__(89343), hasOwnProperty = { - }.hasOwnProperty; + var toObject = __webpack_require__(89343), hasOwnProperty = {}.hasOwnProperty; module.exports = Object.hasOwn || function(it, key) { return hasOwnProperty.call(toObject(it), key); }; }, 38276: function(module) { - module.exports = { - }; + module.exports = {}; }, 85033: function(module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(19514); @@ -4018,16 +3903,13 @@ defineProperty(it, METADATA, { value: { objectID: "O" + id++, - weakData: { - } + weakData: {} } }); }, meta = module.exports = { enable: function() { - meta.enable = function() { - }, REQUIRED = !0; - var getOwnPropertyNames = getOwnPropertyNamesModule.f, splice = [].splice, test = { - }; + meta.enable = function() {}, REQUIRED = !0; + var getOwnPropertyNames = getOwnPropertyNamesModule.f, splice = [].splice, test = {}; test[METADATA] = 1, getOwnPropertyNames(test).length && (getOwnPropertyNamesModule.f = function(it) { for(var result = getOwnPropertyNames(it), i = 0, length = result.length; i < length; i++)if (result[i] === METADATA) { splice.call(result, i, 1); @@ -4073,8 +3955,7 @@ if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); return metadata.facade = it, wmset.call(store, it, metadata), metadata; }, get = function(it) { - return wmget.call(store, it) || { - }; + return wmget.call(store, it) || {}; }, has = function(it) { return wmhas.call(store, it); }; @@ -4084,8 +3965,7 @@ if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); return metadata.facade = it, createNonEnumerableProperty(it, STATE, metadata), metadata; }, get = function(it) { - return objectHas(it, STATE) ? it[STATE] : { - }; + return objectHas(it, STATE) ? it[STATE] : {}; }, has = function(it) { return objectHas(it, STATE); }; @@ -4095,8 +3975,7 @@ get: get, has: has, enforce: function(it) { - return has(it) ? get(it) : set(it, { - }); + return has(it) ? get(it) : set(it, {}); }, getterFor: function(TYPE) { return function(it) { @@ -4125,8 +4004,7 @@ }; }, 17026: function(module, __unused_webpack_exports, __webpack_require__) { - var fails = __webpack_require__(60232), isCallable = __webpack_require__(67106), classof = __webpack_require__(85983), getBuiltIn = __webpack_require__(44990), inspectSource = __webpack_require__(71975), empty = [], construct = getBuiltIn("Reflect", "construct"), constructorRegExp = /^\s*(?:class|function)\b/, exec = constructorRegExp.exec, INCORRECT_TO_STRING = !constructorRegExp.exec(function() { - }), isConstructorModern = function(argument) { + var fails = __webpack_require__(60232), isCallable = __webpack_require__(67106), classof = __webpack_require__(85983), getBuiltIn = __webpack_require__(44990), inspectSource = __webpack_require__(71975), empty = [], construct = getBuiltIn("Reflect", "construct"), constructorRegExp = /^\s*(?:class|function)\b/, exec = constructorRegExp.exec, INCORRECT_TO_STRING = !constructorRegExp.exec(function() {}), isConstructorModern = function(argument) { if (!isCallable(argument)) return !1; try { return construct(Object, empty, argument), !0; @@ -4162,8 +4040,7 @@ return value == POLYFILL || value != NATIVE && (isCallable(detection) ? fails(detection) : !!detection); }, normalize = isForced.normalize = function(string) { return String(string).replace(replacement, ".").toLowerCase(); - }, data = isForced.data = { - }, NATIVE = isForced.NATIVE = "N", POLYFILL = isForced.POLYFILL = "P"; + }, data = isForced.data = {}, NATIVE = isForced.NATIVE = "N", POLYFILL = isForced.POLYFILL = "P"; module.exports = isForced; }, 73156: function(module, __unused_webpack_exports, __webpack_require__) { @@ -4251,12 +4128,10 @@ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator, fails = __webpack_require__(60232), isCallable = __webpack_require__(67106), create = __webpack_require__(18255), getPrototypeOf = __webpack_require__(39311), redefine = __webpack_require__(78109), wellKnownSymbol = __webpack_require__(81019), IS_PURE = __webpack_require__(80627), ITERATOR = wellKnownSymbol("iterator"), BUGGY_SAFARI_ITERATORS = !1; [].keys && ("next" in (arrayIterator = [].keys()) ? (PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator))) !== Object.prototype && (IteratorPrototype = PrototypeOfArrayIteratorPrototype) : BUGGY_SAFARI_ITERATORS = !0); var NEW_ITERATOR_PROTOTYPE = void 0 == IteratorPrototype || fails(function() { - var test = { - }; + var test = {}; return IteratorPrototype[ITERATOR].call(test) !== test; }); - NEW_ITERATOR_PROTOTYPE ? IteratorPrototype = { - } : IS_PURE && (IteratorPrototype = create(IteratorPrototype)), isCallable(IteratorPrototype[ITERATOR]) || redefine(IteratorPrototype, ITERATOR, function() { + NEW_ITERATOR_PROTOTYPE ? IteratorPrototype = {} : IS_PURE && (IteratorPrototype = create(IteratorPrototype)), isCallable(IteratorPrototype[ITERATOR]) || redefine(IteratorPrototype, ITERATOR, function() { return this; }), module.exports = { IteratorPrototype: IteratorPrototype, @@ -4264,8 +4139,7 @@ }; }, 25463: function(module) { - module.exports = { - }; + module.exports = {}; }, 87482: function(module) { var $expm1 = Math.expm1, exp = Math.exp; @@ -4396,8 +4270,7 @@ module.exports = !$assign || fails(function() { if (DESCRIPTORS && 1 !== $assign({ b: 1 - }, $assign(defineProperty({ - }, "a", { + }, $assign(defineProperty({}, "a", { enumerable: !0, get: function() { defineProperty(this, "b", { @@ -4408,22 +4281,17 @@ }), { b: 2 })).b) return !0; - var A = { - }, B = { - }, symbol = Symbol(), alphabet = "abcdefghijklmnopqrst"; + var A = {}, B = {}, symbol = Symbol(), alphabet = "abcdefghijklmnopqrst"; return A[symbol] = 7, alphabet.split("").forEach(function(chr) { B[chr] = chr; - }), 7 != $assign({ - }, A)[symbol] || objectKeys($assign({ - }, B)).join("") != alphabet; + }), 7 != $assign({}, A)[symbol] || objectKeys($assign({}, B)).join("") != alphabet; }) ? function(target, source) { for(var T = toObject(target), argumentsLength = arguments.length, index = 1, getOwnPropertySymbols = getOwnPropertySymbolsModule.f, propertyIsEnumerable = propertyIsEnumerableModule.f; argumentsLength > index;)for(var key, S = IndexedObject(arguments[index++]), keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S), length = keys.length, j = 0; length > j;)key = keys[j++], (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) && (T[key] = S[key]); return T; } : $assign; }, 18255: function(module, __unused_webpack_exports, __webpack_require__) { - var activeXDocument, anObject = __webpack_require__(83941), defineProperties = __webpack_require__(68381), enumBugKeys = __webpack_require__(91080), hiddenKeys = __webpack_require__(38276), html = __webpack_require__(40969), documentCreateElement = __webpack_require__(28554), sharedKey = __webpack_require__(16735), PROTOTYPE = "prototype", SCRIPT = "script", IE_PROTO = sharedKey("IE_PROTO"), EmptyConstructor = function() { - }, scriptTag = function(content) { + var activeXDocument, anObject = __webpack_require__(83941), defineProperties = __webpack_require__(68381), enumBugKeys = __webpack_require__(91080), hiddenKeys = __webpack_require__(38276), html = __webpack_require__(40969), documentCreateElement = __webpack_require__(28554), sharedKey = __webpack_require__(16735), PROTOTYPE = "prototype", SCRIPT = "script", IE_PROTO = sharedKey("IE_PROTO"), EmptyConstructor = function() {}, scriptTag = function(content) { return "<" + SCRIPT + ">" + content + ""; }, NullProtoObjectViaActiveX = function(activeXDocument) { return null.write(scriptTag("")), null.close(), null.parentWindow.Object; @@ -4433,8 +4301,7 @@ }, NullProtoObject = function() { try { activeXDocument = new ActiveXObject("htmlfile"); - } catch (error) { - } + } catch (error) {} NullProtoObject = "undefined" != typeof document ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); for(var length = enumBugKeys.length; length--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); @@ -4457,8 +4324,7 @@ exports.f = DESCRIPTORS ? $defineProperty : function(O, P, Attributes) { if (anObject(O), P = toPropertyKey(P), anObject(Attributes), IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); - } catch (error) { - } + } catch (error) {} if ("get" in Attributes || "set" in Attributes) throw TypeError("Accessors not supported"); return "value" in Attributes && (O[P] = Attributes.value), O; }; @@ -4468,14 +4334,12 @@ exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function(O, P) { if (O = toIndexedObject(O), P = toPropertyKey(P), IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); - } catch (error) { - } + } catch (error) {} if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; }, 33954: function(module, __unused_webpack_exports, __webpack_require__) { - var toIndexedObject = __webpack_require__(74981), $getOwnPropertyNames = __webpack_require__(13463).f, toString = { - }.toString, windowNames = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(it) { + var toIndexedObject = __webpack_require__(74981), $getOwnPropertyNames = __webpack_require__(13463).f, toString = {}.toString, windowNames = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(it) { try { return $getOwnPropertyNames(it); } catch (error) { @@ -4521,8 +4385,7 @@ }, 44096: function(__unused_webpack_module, exports) { "use strict"; - var $propertyIsEnumerable = { - }.propertyIsEnumerable, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ + var $propertyIsEnumerable = {}.propertyIsEnumerable, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); exports.f = NASHORN_BUG ? function(V) { @@ -4536,21 +4399,17 @@ module.exports = IS_PURE || !fails(function() { if (!WEBKIT || !(WEBKIT < 535)) { var key = Math.random(); - __defineSetter__.call(null, key, function() { - }), delete global[key]; + __defineSetter__.call(null, key, function() {}), delete global[key]; } }); }, 59057: function(module, __unused_webpack_exports, __webpack_require__) { var anObject = __webpack_require__(83941), aPossiblePrototype = __webpack_require__(47111); - module.exports = Object.setPrototypeOf || ("__proto__" in { - } ? (function() { - var setter, CORRECT_SETTER = !1, test = { - }; + module.exports = Object.setPrototypeOf || ("__proto__" in {} ? (function() { + var setter, CORRECT_SETTER = !1, test = {}; try { (setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(test, []), CORRECT_SETTER = test instanceof Array; - } catch (error) { - } + } catch (error) {} return function(O, proto) { return anObject(O), aPossiblePrototype(proto), CORRECT_SETTER ? setter.call(O, proto) : O.__proto__ = proto, O; }; @@ -4574,8 +4433,7 @@ 35253: function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var TO_STRING_TAG_SUPPORT = __webpack_require__(42716), classof = __webpack_require__(85983); - module.exports = TO_STRING_TAG_SUPPORT ? ({ - }).toString : function() { + module.exports = TO_STRING_TAG_SUPPORT ? ({}).toString : function() { return "[object " + classof(this) + "]"; }; }, @@ -4755,15 +4613,13 @@ }; }, 88986: function(module, __unused_webpack_exports, __webpack_require__) { - var global = __webpack_require__(19514), setGlobal = __webpack_require__(65933), SHARED = "__core-js_shared__", store = global[SHARED] || setGlobal(SHARED, { - }); + var global = __webpack_require__(19514), setGlobal = __webpack_require__(65933), SHARED = "__core-js_shared__", store = global[SHARED] || setGlobal(SHARED, {}); module.exports = store; }, 61011: function(module, __unused_webpack_exports, __webpack_require__) { var IS_PURE = __webpack_require__(80627), store = __webpack_require__(88986); (module.exports = function(key, value) { - return store[key] || (store[key] = void 0 !== value ? value : { - }); + return store[key] || (store[key] = void 0 !== value ? value : {}); })("versions", []).push({ version: "3.18.0", mode: IS_PURE ? "pure" : "global", @@ -4894,12 +4750,10 @@ }; }, 46660: function(module, __unused_webpack_exports, __webpack_require__) { - var location, defer, channel, port, global = __webpack_require__(19514), isCallable = __webpack_require__(67106), fails = __webpack_require__(60232), bind = __webpack_require__(59561), html = __webpack_require__(40969), createElement = __webpack_require__(28554), IS_IOS = __webpack_require__(80125), IS_NODE = __webpack_require__(96590), set = global.setImmediate, clear = global.clearImmediate, process = global.process, MessageChannel = global.MessageChannel, Dispatch = global.Dispatch, counter = 0, queue = { - }, ONREADYSTATECHANGE = "onreadystatechange"; + var location, defer, channel, port, global = __webpack_require__(19514), isCallable = __webpack_require__(67106), fails = __webpack_require__(60232), bind = __webpack_require__(59561), html = __webpack_require__(40969), createElement = __webpack_require__(28554), IS_IOS = __webpack_require__(80125), IS_NODE = __webpack_require__(96590), set = global.setImmediate, clear = global.clearImmediate, process = global.process, MessageChannel = global.MessageChannel, Dispatch = global.Dispatch, counter = 0, queue = {}, ONREADYSTATECHANGE = "onreadystatechange"; try { location = global.location; - } catch (error) { - } + } catch (error) {} var run = function(id) { if (queue.hasOwnProperty(id)) { var fn = queue[id]; @@ -5018,8 +4872,7 @@ }; }, 42716: function(module, __unused_webpack_exports, __webpack_require__) { - var TO_STRING_TAG = __webpack_require__(81019)("toStringTag"), test = { - }; + var TO_STRING_TAG = __webpack_require__(81019)("toStringTag"), test = {}; test[TO_STRING_TAG] = "z", module.exports = "[object z]" === String(test); }, 72729: function(module, __unused_webpack_exports, __webpack_require__) { @@ -5067,8 +4920,7 @@ getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, defineProperty: wrappedDefineProperty }), module.exports = function(TYPE, wrapper, CLAMPED) { - var BYTES = TYPE.match(/\d+$/)[0] / 8, CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array", GETTER = "get" + TYPE, SETTER = "set" + TYPE, NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME], TypedArrayConstructor = NativeTypedArrayConstructor, TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype, exported = { - }, getter = function(that, index) { + var BYTES = TYPE.match(/\d+$/)[0] / 8, CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array", GETTER = "get" + TYPE, SETTER = "set" + TYPE, NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME], TypedArrayConstructor = NativeTypedArrayConstructor, TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype, exported = {}, getter = function(that, index) { var data = getInternalState(that); return data.view[GETTER](index * BYTES + data.byteOffset, !0); }, setter = function(that, index, value) { @@ -5115,8 +4967,7 @@ forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported), BYTES_PER_ELEMENT in TypedArrayConstructor || createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES), BYTES_PER_ELEMENT in TypedArrayConstructorPrototype || createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES), setSpecies(CONSTRUCTOR_NAME); - }) : module.exports = function() { - }; + }) : module.exports = function() {}; }, 10158: function(module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(19514), fails = __webpack_require__(60232), checkCorrectnessOfIteration = __webpack_require__(34124), NATIVE_ARRAY_BUFFER_VIEWS = __webpack_require__(4351).NATIVE_ARRAY_BUFFER_VIEWS, ArrayBuffer = global.ArrayBuffer, Int8Array = global.Int8Array; @@ -5502,8 +5353,7 @@ 84279: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(35437), fails = __webpack_require__(60232), isConstructor = __webpack_require__(17026), createProperty = __webpack_require__(47267), ISNT_GENERIC = fails(function() { - function F() { - } + function F() {} return !(Array.of.call(F) instanceof F); }); $({ @@ -6198,8 +6048,7 @@ } return s; }, FORCED = !fails(function() { - nativeToFixed.call({ - }); + nativeToFixed.call({}); }); $({ target: "Number", @@ -6232,8 +6081,7 @@ var $ = __webpack_require__(35437), fails = __webpack_require__(60232), thisNumberValue = __webpack_require__(44378), nativeToPrecision = 1..toPrecision, FORCED = fails(function() { return "1" !== nativeToPrecision.call(1, void 0); }) || !fails(function() { - nativeToPrecision.call({ - }); + nativeToPrecision.call({}); }); $({ target: "Number", @@ -6354,8 +6202,7 @@ stat: !0 }, { fromEntries: function(iterable) { - var obj = { - }; + var obj = {}; return iterate(iterable, function(k, v) { createProperty(obj, k, v); }, { @@ -6387,8 +6234,7 @@ sham: !DESCRIPTORS }, { getOwnPropertyDescriptors: function(object) { - for(var key, descriptor, O = toIndexedObject(object), getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f, keys = ownKeys(O), result = { - }, index = 0; keys.length > index;)void 0 !== (descriptor = getOwnPropertyDescriptor(O, key = keys[index++])) && createProperty(result, key, descriptor); + for(var key, descriptor, O = toIndexedObject(object), getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f, keys = ownKeys(O), result = {}, index = 0; keys.length > index;)void 0 !== (descriptor = getOwnPropertyDescriptor(O, key = keys[index++])) && createProperty(result, key, descriptor); return result; } }); @@ -6654,10 +6500,8 @@ "use strict"; var $ = __webpack_require__(35437), IS_PURE = __webpack_require__(80627), NativePromise = __webpack_require__(91591), fails = __webpack_require__(60232), getBuiltIn = __webpack_require__(44990), isCallable = __webpack_require__(67106), speciesConstructor = __webpack_require__(94850), promiseResolve = __webpack_require__(56540), redefine = __webpack_require__(78109), NON_GENERIC = !!NativePromise && fails(function() { NativePromise.prototype.finally.call({ - then: function() { - } - }, function() { - }); + then: function() {} + }, function() {}); }); if ($({ target: "Promise", @@ -6694,16 +6538,11 @@ var promise = new PromiseConstructor(function(resolve) { resolve(1); }), FakePromise = function(exec) { - exec(function() { - }, function() { - }); + exec(function() {}, function() {}); }; - return (promise.constructor = { - })[SPECIES] = FakePromise, !(SUBCLASSING = promise.then(function() { - }) instanceof FakePromise) || !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT; + return (promise.constructor = {})[SPECIES] = FakePromise, !(SUBCLASSING = promise.then(function() {}) instanceof FakePromise) || !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT; }), INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function(iterable) { - PromiseConstructor.all(iterable).catch(function() { - }); + PromiseConstructor.all(iterable).catch(function() {}); }), isThenable = function(it) { var then; return !!(isObject(it) && isCallable(then = it.then)) && then; @@ -6817,8 +6656,7 @@ })); try { delete NativePromisePrototype.constructor; - } catch (error) { - } + } catch (error) {} setPrototypeOf && setPrototypeOf(NativePromisePrototype, PromiseConstructorPrototype); } $({ @@ -6874,8 +6712,7 @@ }, 40394: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var $ = __webpack_require__(35437), getBuiltIn = __webpack_require__(44990), aCallable = __webpack_require__(74618), anObject = __webpack_require__(83941), fails = __webpack_require__(60232), nativeApply = getBuiltIn("Reflect", "apply"), functionApply = Function.apply, OPTIONAL_ARGUMENTS_LIST = !fails(function() { - nativeApply(function() { - }); + nativeApply(function() {}); }); $({ target: "Reflect", @@ -6889,13 +6726,10 @@ }, 51908: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var $ = __webpack_require__(35437), getBuiltIn = __webpack_require__(44990), aConstructor = __webpack_require__(36381), anObject = __webpack_require__(83941), isObject = __webpack_require__(39817), create = __webpack_require__(18255), bind = __webpack_require__(48644), fails = __webpack_require__(60232), nativeConstruct = getBuiltIn("Reflect", "construct"), NEW_TARGET_BUG = fails(function() { - function F() { - } - return !(nativeConstruct(function() { - }, [], F) instanceof F); + function F() {} + return !(nativeConstruct(function() {}, [], F) instanceof F); }), ARGS_BUG = !fails(function() { - nativeConstruct(function() { - }); + nativeConstruct(function() {}); }), FORCED = NEW_TARGET_BUG || ARGS_BUG; $({ target: "Reflect", @@ -6932,8 +6766,7 @@ }, 60211: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var $ = __webpack_require__(35437), DESCRIPTORS = __webpack_require__(87122), anObject = __webpack_require__(83941), toPropertyKey = __webpack_require__(10482), definePropertyModule = __webpack_require__(94770), fails = __webpack_require__(60232), ERROR_INSTEAD_OF_FALSE = fails(function() { - Reflect.defineProperty(definePropertyModule.f({ - }, 1, { + Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 @@ -7094,8 +6927,7 @@ target: "Reflect", stat: !0, forced: fails(function() { - var Constructor = function() { - }, object = definePropertyModule.f(new Constructor(), "a", { + var Constructor = function() {}, object = definePropertyModule.f(new Constructor(), "a", { configurable: !0 }); return !1 !== Reflect.set(Constructor.prototype, "a", 1, object); @@ -7109,8 +6941,7 @@ $({ global: !0 }, { - Reflect: { - } + Reflect: {} }), setToStringTag(global.Reflect, "Reflect", !0); }, 24329: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { @@ -7126,8 +6957,7 @@ } return result; }, handleNCG = function(string) { - for(var chr, length = string.length, index = 0, result = "", named = [], names = { - }, brackets = !1, ncg = !1, groupid = 0, groupname = ""; index <= length; index++){ + for(var chr, length = string.length, index = 0, result = "", named = [], names = {}, brackets = !1, ncg = !1, groupid = 0, groupname = ""; index <= length; index++){ if ("\\" === (chr = string.charAt(index))) chr += string.charAt(++index); else if ("]" === chr) brackets = !1; else if (!brackets) switch(!0){ @@ -7158,8 +6988,7 @@ if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) return pattern; if ((patternIsRegExp || pattern instanceof RegExpWrapper) && (pattern = pattern.source, flagsAreUndefined && (flags = ("flags" in rawPattern) ? rawPattern.flags : getFlags.call(rawPattern))), pattern = void 0 === pattern ? "" : toString(pattern), flags = void 0 === flags ? "" : toString(flags), rawPattern = pattern, UNSUPPORTED_DOT_ALL && ("dotAll" in re1) && (dotAll = !!flags && flags.indexOf("s") > -1) && (flags = flags.replace(/s/g, "")), rawFlags = flags, UNSUPPORTED_Y && ("sticky" in re1) && (sticky = !!flags && flags.indexOf("y") > -1) && (flags = flags.replace(/y/g, "")), UNSUPPORTED_NCG && (pattern = (handled = handleNCG(pattern))[0], groups = handled[1]), result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper), (dotAll || sticky || groups.length) && (state = enforceInternalState(result), dotAll && (state.dotAll = !0, state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags)), sticky && (state.sticky = !0), groups.length && (state.groups = groups)), pattern !== rawPattern) try { createNonEnumerableProperty(result, "source", "" === rawPattern ? "(?:)" : rawPattern); - } catch (error) { - } + } catch (error) {} return result; }, proxy = function(key) { (key in RegExpWrapper) || defineProperty(RegExpWrapper, key, { @@ -7881,8 +7710,7 @@ "use strict"; var $ = __webpack_require__(35437), DESCRIPTORS = __webpack_require__(87122), global = __webpack_require__(19514), has = __webpack_require__(1521), isCallable = __webpack_require__(67106), isObject = __webpack_require__(39817), defineProperty = __webpack_require__(94770).f, copyConstructorProperties = __webpack_require__(18295), NativeSymbol = global.Symbol; if (DESCRIPTORS && isCallable(NativeSymbol) && (!("description" in NativeSymbol.prototype) || void 0 !== NativeSymbol().description)) { - var EmptyStringDescriptionStore = { - }, SymbolWrapper = function() { + var EmptyStringDescriptionStore = {}, SymbolWrapper = function() { var description = arguments.length < 1 || void 0 === arguments[0] ? void 0 : String(arguments[0]), result = this instanceof SymbolWrapper ? new NativeSymbol(description) : void 0 === description ? NativeSymbol() : NativeSymbol(description); return "" === description && (EmptyStringDescriptionStore[result] = !0), result; }; @@ -7918,8 +7746,7 @@ 83823: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(35437), global = __webpack_require__(19514), getBuiltIn = __webpack_require__(44990), IS_PURE = __webpack_require__(80627), DESCRIPTORS = __webpack_require__(87122), NATIVE_SYMBOL = __webpack_require__(11382), fails = __webpack_require__(60232), has = __webpack_require__(1521), isArray = __webpack_require__(63079), isCallable = __webpack_require__(67106), isObject = __webpack_require__(39817), isSymbol = __webpack_require__(17679), anObject = __webpack_require__(83941), toObject = __webpack_require__(89343), toIndexedObject = __webpack_require__(74981), toPropertyKey = __webpack_require__(10482), $toString = __webpack_require__(72729), createPropertyDescriptor = __webpack_require__(93608), nativeObjectCreate = __webpack_require__(18255), objectKeys = __webpack_require__(25732), getOwnPropertyNamesModule = __webpack_require__(13463), getOwnPropertyNamesExternal = __webpack_require__(33954), getOwnPropertySymbolsModule = __webpack_require__(19724), getOwnPropertyDescriptorModule = __webpack_require__(24722), definePropertyModule = __webpack_require__(94770), propertyIsEnumerableModule = __webpack_require__(44096), redefine = __webpack_require__(78109), shared = __webpack_require__(61011), sharedKey = __webpack_require__(16735), hiddenKeys = __webpack_require__(38276), uid = __webpack_require__(67045), wellKnownSymbol = __webpack_require__(81019), wrappedWellKnownSymbolModule = __webpack_require__(52301), defineWellKnownSymbol = __webpack_require__(71309), setToStringTag = __webpack_require__(77875), InternalStateModule = __webpack_require__(44670), $forEach = __webpack_require__(48499).forEach, HIDDEN = sharedKey("hidden"), SYMBOL = "Symbol", PROTOTYPE = "prototype", TO_PRIMITIVE = wellKnownSymbol("toPrimitive"), setInternalState = InternalStateModule.set, getInternalState = InternalStateModule.getterFor(SYMBOL), ObjectPrototype = Object[PROTOTYPE], $Symbol = global.Symbol, $stringify = getBuiltIn("JSON", "stringify"), nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f, nativeDefineProperty = definePropertyModule.f, nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f, nativePropertyIsEnumerable = propertyIsEnumerableModule.f, AllSymbols = shared("symbols"), ObjectPrototypeSymbols = shared("op-symbols"), StringToSymbolRegistry = shared("string-to-symbol-registry"), SymbolToStringRegistry = shared("symbol-to-string-registry"), WellKnownSymbolsStore = shared("wks"), QObject = global.QObject, USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDescriptor = DESCRIPTORS && fails(function() { - return 7 != nativeObjectCreate(nativeDefineProperty({ - }, "a", { + return 7 != nativeObjectCreate(nativeDefineProperty({}, "a", { get: function() { return nativeDefineProperty(this, "a", { value: 7 @@ -7941,8 +7768,7 @@ var key = toPropertyKey(P); return (anObject(Attributes), has(AllSymbols, key)) ? (Attributes.enumerable ? (has(O, HIDDEN) && O[HIDDEN][key] && (O[HIDDEN][key] = !1), Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, !1) - })) : (has(O, HIDDEN) || nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, { - })), O[HIDDEN][key] = !0), setSymbolDescriptor(O, key, Attributes)) : nativeDefineProperty(O, key, Attributes); + })) : (has(O, HIDDEN) || nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})), O[HIDDEN][key] = !0), setSymbolDescriptor(O, key, Attributes)) : nativeDefineProperty(O, key, Attributes); }, $defineProperties = function(O, Properties) { anObject(O); var properties = toIndexedObject(Properties); @@ -8290,8 +8116,7 @@ if (len + offset > length) throw RangeError("Wrong length"); for(; index < len;)this[offset + index] = src[index++]; }, fails(function() { - new Int8Array(1).set({ - }); + new Int8Array(1).set({}); })); }, 1987: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { @@ -8315,8 +8140,7 @@ "use strict"; var ArrayBufferViewCore = __webpack_require__(4351), global = __webpack_require__(19514), fails = __webpack_require__(60232), aCallable = __webpack_require__(74618), toLength = __webpack_require__(31998), internalSort = __webpack_require__(1978), FF = __webpack_require__(15546), IE_OR_EDGE = __webpack_require__(13497), V8 = __webpack_require__(50661), WEBKIT = __webpack_require__(34884), aTypedArray = ArrayBufferViewCore.aTypedArray, exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod, Uint16Array = global.Uint16Array, nativeSort = Uint16Array && Uint16Array.prototype.sort, ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !fails(function() { var array = new Uint16Array(2); - array.sort(null), array.sort({ - }); + array.sort(null), array.sort({}); }), STABLE_SORT = !!nativeSort && !fails(function() { if (V8) return V8 < 74; if (FF) return FF < 67; @@ -8372,11 +8196,9 @@ }, 37797: function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; - var exportTypedArrayMethod = __webpack_require__(4351).exportTypedArrayMethod, fails = __webpack_require__(60232), global = __webpack_require__(19514), Uint8Array = global.Uint8Array, Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || { - }, arrayToString = [].toString, arrayJoin = [].join; + var exportTypedArrayMethod = __webpack_require__(4351).exportTypedArrayMethod, fails = __webpack_require__(60232), global = __webpack_require__(19514), Uint8Array = global.Uint8Array, Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}, arrayToString = [].toString, arrayJoin = [].join; fails(function() { - arrayToString.call({ - }); + arrayToString.call({}); }) && (arrayToString = function() { return arrayJoin.call(this); }); @@ -8616,8 +8438,7 @@ if (setInternalState(this, { type: URL_SEARCH_PARAMS, entries: entries, - updateURL: function() { - }, + updateURL: function() {}, updateSearchParams: updateSearchParams }), void 0 !== init) if (isObject(init)) if (iteratorMethod = getIteratorMethod(init)) for(next = (iterator = getIterator(init, iteratorMethod)).next; !(step = next.call(iterator)).done;){ if ((first = (entryNext = (entryIterator = getIterator(anObject(step.value))).next).call(entryIterator)).done || (second = entryNext.call(entryIterator)).done || !entryNext.call(entryIterator).done) throw TypeError("Expected sequence with length 2"); @@ -8723,13 +8544,11 @@ forced: !0 }, { fetch: function(input) { - return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : { - }); + return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); } }), isCallable(NativeRequest)) { var RequestConstructor = function(input) { - return anInstance(this, RequestConstructor, "Request"), new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : { - }); + return anInstance(this, RequestConstructor, "Request"), new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); }; RequestPrototype.constructor = RequestConstructor, RequestConstructor.prototype = RequestPrototype, $({ global: !0, @@ -8849,22 +8668,18 @@ return "[" + result + "]"; } return host; - }, C0ControlPercentEncodeSet = { - }, fragmentPercentEncodeSet = assign({ - }, C0ControlPercentEncodeSet, { + }, C0ControlPercentEncodeSet = {}, fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { " ": 1, "\"": 1, "<": 1, ">": 1, "`": 1 - }), pathPercentEncodeSet = assign({ - }, fragmentPercentEncodeSet, { + }), pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { "#": 1, "?": 1, "{": 1, "}": 1 - }), userinfoPercentEncodeSet = assign({ - }, pathPercentEncodeSet, { + }), userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { "/": 1, ":": 1, ";": 1, @@ -8900,28 +8715,7 @@ }, shortenURLsPath = function(url) { var path = url.path, pathSize = path.length; pathSize && ("file" != url.scheme || 1 != pathSize || !isWindowsDriveLetter(path[0], !0)) && path.pop(); - }, SCHEME_START = { - }, SCHEME = { - }, NO_SCHEME = { - }, SPECIAL_RELATIVE_OR_AUTHORITY = { - }, PATH_OR_AUTHORITY = { - }, RELATIVE = { - }, RELATIVE_SLASH = { - }, SPECIAL_AUTHORITY_SLASHES = { - }, SPECIAL_AUTHORITY_IGNORE_SLASHES = { - }, AUTHORITY = { - }, HOST = { - }, HOSTNAME = { - }, PORT = { - }, FILE = { - }, FILE_SLASH = { - }, FILE_HOST = { - }, PATH_START = { - }, PATH = { - }, CANNOT_BE_A_BASE_URL_PATH = { - }, QUERY = { - }, FRAGMENT = { - }, parseURL = function(url, input, stateOverride, base) { + }, SCHEME_START = {}, SCHEME = {}, NO_SCHEME = {}, SPECIAL_RELATIVE_OR_AUTHORITY = {}, PATH_OR_AUTHORITY = {}, RELATIVE = {}, RELATIVE_SLASH = {}, SPECIAL_AUTHORITY_SLASHES = {}, SPECIAL_AUTHORITY_IGNORE_SLASHES = {}, AUTHORITY = {}, HOST = {}, HOSTNAME = {}, PORT = {}, FILE = {}, FILE_SLASH = {}, FILE_HOST = {}, PATH_START = {}, PATH = {}, CANNOT_BE_A_BASE_URL_PATH = {}, QUERY = {}, FRAGMENT = {}, parseURL = function(url, input, stateOverride, base) { var codePoints, chr, bufferCodePoints, failure, state = stateOverride || SCHEME_START, pointer = 0, buffer = "", seenAt = !1, seenBracket = !1, seenPasswordToken = !1; for(stateOverride || (url.scheme = "", url.username = "", url.password = "", url.host = null, url.port = null, url.path = [], url.query = null, url.fragment = null, url.cannotBeABaseURL = !1, input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, "")), codePoints = arrayFrom(input = input.replace(TAB_AND_NEW_LINE, "")); pointer <= codePoints.length;){ switch(chr = codePoints[pointer], state){ @@ -9117,8 +8911,7 @@ }); if (void 0 !== base) { if (base instanceof URLConstructor) baseState = getInternalURLState(base); - else if (failure = parseURL(baseState = { - }, $toString(base))) throw TypeError(failure); + else if (failure = parseURL(baseState = {}, $toString(base))) throw TypeError(failure); } if (failure = parseURL(state, urlString, null, baseState)) throw TypeError(failure); var searchParams = state.searchParams = new URLSearchParams(), searchParamsState = getInternalSearchParamsState(searchParams); @@ -9321,8 +9114,7 @@ } }); var _a1, SHOW = "show", HIDE = "hide", LAUNCH = "launch", ERROR = "error"; - (_a1 = { - })[SHOW] = "miniapp_pageshow", _a1[HIDE] = "miniapp_pagehide"; + (_a1 = {})[SHOW] = "miniapp_pageshow", _a1[HIDE] = "miniapp_pagehide"; var DEFAULT_APP_CONFIG = { app: { rootId: "root" @@ -9330,8 +9122,7 @@ router: { type: "hash" } - }, appCycles = { - }; + }, appCycles = {}; function emit(cycle, context) { for(var args = [], _i = 2; _i < arguments.length; _i++)args[_i - 2] = arguments[_i]; if (Object.prototype.hasOwnProperty.call(appCycles, cycle)) { @@ -9373,12 +9164,10 @@ this.constructor = d; } extendStatics(d, b), d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __()); - }), visibleListeners = { - }; + }), visibleListeners = {}; function addPageLifeCycle(cycle, callback) { var _a, pathname = lib_router.current.pathname; - visibleListeners[pathname] || (visibleListeners[pathname] = ((_a = { - })[SHOW] = [], _a[HIDE] = [], _a)), visibleListeners[pathname][cycle].push(callback); + visibleListeners[pathname] || (visibleListeners[pathname] = ((_a = {})[SHOW] = [], _a[HIDE] = [], _a)), visibleListeners[pathname][cycle].push(callback); } function pageLifeCycles_emit(cycle, pathname) { for(var _a, args = [], _i = 2; _i < arguments.length; _i++)args[_i - 2] = arguments[_i]; @@ -9442,8 +9231,7 @@ pathname: pathname, visibilityState: !0 }, emit(LAUNCH), emit(SHOW), history && history.listen && history.listen(function(location) { - location.pathname !== lib_router.current.pathname && (lib_router.prev = __assign({ - }, lib_router.current), lib_router.current = { + location.pathname !== lib_router.current.pathname && (lib_router.prev = __assign({}, lib_router.current), lib_router.current = { pathname: location.pathname, visibilityState: !0 }, lib_router.prev.visibiltyState = !1, pageLifeCycles_emit(HIDE, lib_router.prev.pathname), pageLifeCycles_emit(SHOW, lib_router.current.pathname)); @@ -9486,8 +9274,7 @@ } var _query_string_6_14_1_query_string = __webpack_require__(20386); function getSearchParams(history) { - return (void 0 === history && (history = getHistory()), !history && "undefined" != typeof window && window.history && (history = window.history), history && history.location && history.location.search) ? _query_string_6_14_1_query_string.parse(history.location.search) : { - }; + return (void 0 === history && (history = getHistory()), !history && "undefined" != typeof window && window.history && (history = window.history), history && history.location && history.location.search) ? _query_string_6_14_1_query_string.parse(history.location.search) : {}; } function collectAppLifeCycle(appConfig) { var _a = appConfig.app, onLaunch = _a.onLaunch, onShow = _a.onShow, onError = _a.onError, onHide = _a.onHide, onTabItemClick = _a.onTabItemClick; @@ -9499,8 +9286,7 @@ return t; }).apply(this, arguments); }, __rest = function(s, e) { - var t = { - }; + var t = {}; for(var p in s)Object.prototype.hasOwnProperty.call(s, p) && 0 > e.indexOf(p) && (t[p] = s[p]); if (null != s && "function" == typeof Object.getOwnPropertySymbols) for(var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)0 > e.indexOf(p[i]) && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]); return t; @@ -9541,8 +9327,7 @@ return _this.renderApp(_this.wrapperPageRegistration.reduce(function(acc, curr) { return curr(acc); }, _this.appConfig.renderComponent)); - }, this.AppProvider = [], this.appConfig = appConfig, this.buildConfig = buildConfig, this.context = context, this.staticConfig = staticConfig, this.modifyDOMRender = null, this.apiRegistration = { - }, this.renderApp = function(AppComponent) { + }, this.AppProvider = [], this.appConfig = appConfig, this.buildConfig = buildConfig, this.context = context, this.staticConfig = staticConfig, this.modifyDOMRender = null, this.apiRegistration = {}, this.renderApp = function(AppComponent) { return AppComponent; }, this.routesComponent = !1, this.modifyRoutesRegistration = [], this.wrapperPageRegistration = []; } @@ -9558,8 +9343,7 @@ setRenderApp: this.setRenderApp, staticConfig: this.staticConfig }; - enabledRouter && (runtimeAPI = runtimeModule_assign(runtimeModule_assign({ - }, runtimeAPI), { + enabledRouter && (runtimeAPI = runtimeModule_assign(runtimeModule_assign({}, runtimeAPI), { modifyRoutes: this.modifyRoutes, wrapperRouterRender: this.wrapperRouterRender, modifyRoutesComponent: this.modifyRoutesComponent @@ -9572,10 +9356,8 @@ return function(_a) { var children = _a.children, rest = __rest(_a, [ "children" - ]), element = CurrentProvider ? _this.context.createElement(CurrentProvider, runtimeModule_assign({ - }, rest), children) : children; - return _this.context.createElement(ProviderComponent, runtimeModule_assign({ - }, rest), element); + ]), element = CurrentProvider ? _this.context.createElement(CurrentProvider, runtimeModule_assign({}, rest), children) : children; + return _this.context.createElement(ProviderComponent, runtimeModule_assign({}, rest), element); }; }) : null; }, RuntimeModule; @@ -9586,8 +9368,7 @@ }), config; } var createBaseApp = function(_a) { - var loadRuntimeModules = _a.loadRuntimeModules, createElement = _a.createElement, _b = _a.runtimeAPI, runtimeAPI = void 0 === _b ? { - } : _b; + var loadRuntimeModules = _a.loadRuntimeModules, createElement = _a.createElement, _b = _a.runtimeAPI, runtimeAPI = void 0 === _b ? {} : _b; return function(appConfig, buildConfig, context, staticConfig) { appConfig = mergeDefaultConfig(DEFAULT_APP_CONFIG, appConfig), context.createElement = createElement; var runtime = new runtimeModule1(appConfig, buildConfig, context, staticConfig); @@ -9599,8 +9380,7 @@ }; }; }; - function registerNativeEventListeners(Klass, events) { - } + function registerNativeEventListeners(Klass, events) {} function addNativeEventListener(eventName, callback) { document.addEventListener(eventName, callback); } @@ -9614,8 +9394,7 @@ function decodeComponents(components, split) { try { return decodeURIComponent(components.join("")); - } catch (err) { - } + } catch (err) {} if (1 === components.length) return components; split = split || 1; var left = components.slice(0, split), right = components.slice(split); @@ -9660,8 +9439,7 @@ 47560: function(module) { "use strict"; module.exports = function(obj, predicate) { - for(var ret = { - }, keys = Object.keys(obj), isArr = Array.isArray(predicate), i = 0; i < keys.length; i++){ + for(var ret = {}, keys = Object.keys(obj), isArr = Array.isArray(predicate), i = 0; i < keys.length; i++){ var key = keys[i], val = obj[key]; (isArr ? -1 !== predicate.indexOf(key) : predicate(key, val, obj)) && (ret[key] = val); } @@ -9729,8 +9507,7 @@ }); if ("object" == typeof a || "object" == typeof b) { var aValue = value_equal_valueOf(a), bValue = value_equal_valueOf(b); - return aValue !== a || bValue !== b ? valueEqual(aValue, bValue) : Object.keys(Object.assign({ - }, a, b)).every(function(key) { + return aValue !== a || bValue !== b ? valueEqual(aValue, bValue) : Object.keys(Object.assign({}, a, b)).every(function(key) { return valueEqual(a[key], b[key]); }); } @@ -9766,8 +9543,7 @@ } function createLocation(path, state, key, currentLocation) { var location; - "string" == typeof path ? (location = parsePath(path)).state = state : (void 0 === (location = (0, esm_extends.Z)({ - }, path)).pathname && (location.pathname = ""), location.search ? "?" !== location.search.charAt(0) && (location.search = "?" + location.search) : location.search = "", location.hash ? "#" !== location.hash.charAt(0) && (location.hash = "#" + location.hash) : location.hash = "", void 0 !== state && void 0 === location.state && (location.state = state)); + "string" == typeof path ? (location = parsePath(path)).state = state : (void 0 === (location = (0, esm_extends.Z)({}, path)).pathname && (location.pathname = ""), location.search ? "?" !== location.search.charAt(0) && (location.search = "?" + location.search) : location.search = "", location.hash ? "#" !== location.hash.charAt(0) && (location.hash = "#" + location.hash) : location.hash = "", void 0 !== state && void 0 === location.state && (location.state = state)); try { location.pathname = decodeURI(location.pathname); } catch (e) { @@ -9819,20 +9595,16 @@ var PopStateEvent = "popstate", HashChangeEvent = "hashchange"; function getHistoryState() { try { - return window.history.state || { - }; + return window.history.state || {}; } catch (e) { - return { - }; + return {}; } } function createBrowserHistory(props) { - void 0 === props && (props = { - }), canUseDOM || (0, tiny_invariant_esm.default)(!1); + void 0 === props && (props = {}), canUseDOM || (0, tiny_invariant_esm.default)(!1); var ua, globalHistory = window.history, canUseHistory = (-1 === (ua = window.navigator.userAgent).indexOf("Android 2.") && -1 === ua.indexOf("Android 4.0") || -1 === ua.indexOf("Mobile Safari") || -1 !== ua.indexOf("Chrome") || -1 !== ua.indexOf("Windows Phone")) && window.history && "pushState" in window.history, needsHashChangeListener = -1 !== window.navigator.userAgent.indexOf("Trident"), _props = props, _props$forceRefresh = _props.forceRefresh, forceRefresh = void 0 !== _props$forceRefresh && _props$forceRefresh, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = void 0 === _props$getUserConfirm ? getConfirmation : _props$getUserConfirm, _props$keyLength = _props.keyLength, keyLength = void 0 === _props$keyLength ? 6 : _props$keyLength, basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ""; function getDOMLocation(historyState) { - var _ref = historyState || { - }, key = _ref.key, state = _ref.state, _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash, path = pathname + search + hash; + var _ref = historyState || {}, key = _ref.key, state = _ref.state, _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash, path = pathname + search + hash; return basename && (path = stripBasename(path, basename)), createLocation(path, state, key); } function createKey() { @@ -9980,8 +9752,7 @@ window.location.replace(stripHash(window.location.href) + "#" + path); } function createHashHistory(props) { - void 0 === props && (props = { - }), canUseDOM || (0, tiny_invariant_esm.default)(!1); + void 0 === props && (props = {}), canUseDOM || (0, tiny_invariant_esm.default)(!1); var globalHistory = window.history; -1 === window.navigator.userAgent.indexOf("Firefox"); var _props = props, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = void 0 === _props$getUserConfirm ? getConfirmation : _props$getUserConfirm, _props$hashType = _props.hashType, basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : "", _HashPathCoders$hashT = HashPathCoders[void 0 === _props$hashType ? "slash" : _props$hashType], encodePath = _HashPathCoders$hashT.encodePath, decodePath = _HashPathCoders$hashT.decodePath; @@ -10101,8 +9872,7 @@ return Math.min(Math.max(n, lowerBound), upperBound); } function createMemoryHistory(props) { - void 0 === props && (props = { - }); + void 0 === props && (props = {}); var _props = props, getUserConfirmation = _props.getUserConfirmation, _props$initialEntries = _props.initialEntries, initialEntries = void 0 === _props$initialEntries ? [ "/" ] : _props$initialEntries, _props$initialIndex = _props.initialIndex, _props$keyLength = _props.keyLength, keyLength = void 0 === _props$keyLength ? 6 : _props$keyLength, transitionManager = createTransitionManager(); @@ -10205,8 +9975,7 @@ displayName: !0, propTypes: !0, type: !0 - }, TYPE_STATICS = { - }; + }, TYPE_STATICS = {}; function getStatics(component) { return reactIs.isMemo(component) ? MEMO_STATICS : TYPE_STATICS[component.$$typeof] || REACT_STATICS; } @@ -10232,8 +10001,7 @@ var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { defineProperty(targetComponent, key, descriptor); - } catch (e) { - } + } catch (e) {} } } } @@ -10254,18 +10022,15 @@ if (!Object.assign) return !1; var test1 = new String("abc"); if (test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1; - for(var test2 = { - }, i = 0; i < 10; i++)test2["_" + String.fromCharCode(i)] = i; + for(var test2 = {}, i = 0; i < 10; i++)test2["_" + String.fromCharCode(i)] = i; var order2 = Object.getOwnPropertyNames(test2).map(function(n) { return test2[n]; }); if ("0123456789" !== order2.join("")) return !1; - var test3 = { - }; + var test3 = {}; if ("abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; - }), "abcdefghijklmnopqrst" !== Object.keys(Object.assign({ - }, test3)).join("")) return !1; + }), "abcdefghijklmnopqrst" !== Object.keys(Object.assign({}, test3)).join("")) return !1; return !0; } catch (err) { return !1; @@ -10326,9 +10091,7 @@ function tokensToFunction(tokens, options) { for(var matches = new Array(tokens.length), i1 = 0; i1 < tokens.length; i1++)"object" == typeof tokens[i1] && (matches[i1] = new RegExp("^(?:" + tokens[i1].pattern + ")$", flags(options))); return function(obj, opts) { - for(var path = "", data = obj || { - }, encode = (opts || { - }).pretty ? encodeURIComponentPretty : encodeURIComponent, i = 0; i < tokens.length; i++){ + for(var path = "", data = obj || {}, encode = (opts || {}).pretty ? encodeURIComponentPretty : encodeURIComponent, i = 0; i < tokens.length; i++){ var segment, token = tokens[i]; if ("string" == typeof token) { path += token; @@ -10374,8 +10137,7 @@ } function tokensToRegExp(tokens, keys, options) { isarray(keys) || (options = keys || options, keys = []); - for(var strict = (options = options || { - }).strict, end = !1 !== options.end, route = "", i = 0; i < tokens.length; i++){ + for(var strict = (options = options || {}).strict, end = !1 !== options.end, route = "", i = 0; i < tokens.length; i++){ var token = tokens[i]; if ("string" == typeof token) route += escapeString(token); else { @@ -10388,8 +10150,7 @@ } function pathToRegexp(path7, keys2, options2) { var path6, keys1, options1; - return (isarray(keys2) || (options2 = keys2 || options2, keys2 = []), options2 = options2 || { - }, path7 instanceof RegExp) ? (function(path, keys) { + return (isarray(keys2) || (options2 = keys2 || options2, keys2 = []), options2 = options2 || {}, path7 instanceof RegExp) ? (function(path, keys) { var groups = path.source.match(/\((?!\?)/g); if (groups) for(var i = 0; i < groups.length; i++)keys.push({ name: i, @@ -10409,8 +10170,7 @@ } }, 97671: function(module) { - var cachedSetTimeout, cachedClearTimeout, currentQueue, process = module.exports = { - }; + var cachedSetTimeout, cachedClearTimeout, currentQueue, process = module.exports = {}; function defaultSetTimout() { throw new Error("setTimeout has not been defined"); } @@ -10472,17 +10232,14 @@ function Item(fun, array) { this.fun = fun, this.array = array; } - function noop() { - } + function noop() {} process.nextTick = function(fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) for(var i = 1; i < arguments.length; i++)args[i - 1] = arguments[i]; queue.push(new Item(fun, args)), 1 !== queue.length || draining || runTimeout(drainQueue); }, Item.prototype.run = function() { this.fun.apply(null, this.array); - }, process.title = "browser", process.browser = !0, process.env = { - }, process.argv = [], process.version = "", process.versions = { - }, process.on = noop, process.addListener = noop, process.once = noop, process.off = noop, process.removeListener = noop, process.removeAllListeners = noop, process.emit = noop, process.prependListener = noop, process.prependOnceListener = noop, process.listeners = function(name) { + }, process.title = "browser", process.browser = !0, process.env = {}, process.argv = [], process.version = "", process.versions = {}, process.on = noop, process.addListener = noop, process.once = noop, process.off = noop, process.removeListener = noop, process.removeAllListeners = noop, process.emit = noop, process.prependListener = noop, process.prependOnceListener = noop, process.listeners = function(name) { return []; }, process.binding = function(name) { throw new Error("process.binding is not supported"); @@ -10497,10 +10254,8 @@ 46985: function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var ReactPropTypesSecret = __webpack_require__(16514); - function emptyFunction() { - } - function emptyFunctionWithReset() { - } + function emptyFunction() {} + function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction, module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret !== ReactPropTypesSecret) { @@ -10592,8 +10347,7 @@ accumulator[key] = value; return; } - void 0 === accumulator[key] && (accumulator[key] = { - }), accumulator[key][result[1]] = value; + void 0 === accumulator[key] && (accumulator[key] = {}), accumulator[key][result[1]] = value; }; case "bracket": return (key, value, accumulator)=>{ @@ -10726,8 +10480,7 @@ ] ; } - }(options4), objectCopy = { - }; + }(options4), objectCopy = {}; for (const key3 of Object.keys(object))shouldFilter(key3) || (objectCopy[key3] = object[key3]); const keys = Object.keys(objectCopy); return !1 !== options4.sort && keys.sort(options4.sort), keys.map((key)=>{ @@ -10745,8 +10498,7 @@ query: parse(extract(url), options) }, options && options.parseFragmentIdentifier && hash ? { fragmentIdentifier: decode(hash, options) - } : { - }); + } : {}); }, exports.stringifyUrl = (object, options)=>{ options = Object.assign({ encode: !0, @@ -10926,8 +10678,7 @@ var _a, _b, ErrorBoundary = options.ErrorBoundary, _c = options.appConfig, AppProvider = null === (_a = null == runtime ? void 0 : runtime.composeAppProvider) || void 0 === _a ? void 0 : _a.call(runtime), AppComponent = null === (_b = null == runtime ? void 0 : runtime.getAppComponent) || void 0 === _b ? void 0 : _b.call(runtime), rootApp = React.createElement(AppComponent, null); AppProvider && (rootApp = React.createElement(AppProvider, null, rootApp)); var _d = (void 0 === _c ? { - app: { - } + app: {} } : _c).app, ErrorBoundaryFallback = _d.ErrorBoundaryFallback, onErrorBoundaryHandler = _d.onErrorBoundaryHandler, errorBoundary = _d.errorBoundary, _e = _d.strict, strict = void 0 !== _e && _e; return function() { return errorBoundary && (rootApp = React.createElement(ErrorBoundary, { @@ -10945,9 +10696,7 @@ return __generator(this, function(_f) { switch(_f.label){ case 0: - if (appConfig = options5.appConfig, _b1 = options5.buildConfig, buildConfig = void 0 === _b1 ? { - } : _b1, createBaseApp = (appLifecycle = options5.appLifecycle).createBaseApp, emitLifeCycles = appLifecycle.emitLifeCycles, initAppLifeCycles = appLifecycle.initAppLifeCycles, context = { - }, !window.__ICE_APP_DATA__) return [ + if (appConfig = options5.appConfig, _b1 = options5.buildConfig, buildConfig = void 0 === _b1 ? {} : _b1, createBaseApp = (appLifecycle = options5.appLifecycle).createBaseApp, emitLifeCycles = appLifecycle.emitLifeCycles, initAppLifeCycles = appLifecycle.initAppLifeCycles, context = {}, !window.__ICE_APP_DATA__) return [ 3, 1 ]; @@ -10975,8 +10724,7 @@ return runtime1 = (_e = createBaseApp(appConfig, buildConfig, context)).runtime, modifiedAppConfig = _e.appConfig, initAppLifeCycles(), setInitialData(context.initialData), emitLifeCycles(), [ 2, function(runtime, options) { - var mountNode, rootId, _a, _b = options.appConfig, _c = (void 0 === _b ? { - } : _b).app, rootId1 = _c.rootId, mountNode1 = _c.mountNode, App = getRenderApp(runtime, options), appMountNode = (mountNode = mountNode1, rootId = rootId1, mountNode || document.getElementById(rootId) || document.getElementById("ice-container")); + var mountNode, rootId, _a, _b = options.appConfig, _c = (void 0 === _b ? {} : _b).app, rootId1 = _c.rootId, mountNode1 = _c.mountNode, App = getRenderApp(runtime, options), appMountNode = (mountNode = mountNode1, rootId = rootId1, mountNode || document.getElementById(rootId) || document.getElementById("ice-container")); if (null == runtime ? void 0 : runtime.modifyDOMRender) return null === (_a = null == runtime ? void 0 : runtime.modifyDOMRender) || void 0 === _a ? void 0 : _a.call(runtime, { App: App, appMountNode: appMountNode @@ -10984,8 +10732,7 @@ window.__ICE_SSR_ENABLED__ && process.env.SSR ? (0, component_1.loadableReady)(function() { ReactDOM.hydrate(React.createElement(App, null), appMountNode); }) : ReactDOM.render(React.createElement(App, null), appMountNode); - }(runtime1, __assign(__assign({ - }, options5), { + }(runtime1, __assign(__assign({}, options5), { appConfig: modifiedAppConfig })) ]; @@ -11002,22 +10749,18 @@ return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } if (!aa) throw Error(y(227)); - var ba = new Set, ca = { - }; + var ba = new Set, ca = {}; function da(a, b) { ea(a, b), ea(a + "Capture", b); } function ea(a, b) { for(ca[a] = b, a = 0; a < b.length; a++)ba.add(b[a]); } - var fa = !("undefined" == typeof window || void 0 === window.document || void 0 === window.document.createElement), ha = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ia = Object.prototype.hasOwnProperty, ja = { - }, ka = { - }; + var fa = !("undefined" == typeof window || void 0 === window.document || void 0 === window.document.createElement), ha = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ia = Object.prototype.hasOwnProperty, ja = {}, ka = {}; function B(a, b, c, d, e, f, g) { this.acceptsBooleans = 2 === b || 3 === b || 4 === b, this.attributeName = d, this.attributeNamespace = e, this.mustUseProperty = c, this.propertyName = a, this.type = b, this.sanitizeURL = f, this.removeEmptyString = g; } - var D = { - }; + var D = {}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { D[a] = new B(a, 0, !1, a, null, !1, !1); }), [ @@ -11268,8 +11011,7 @@ b = a._payload, a = a._init; try { return Ra(a(b)); - } catch (c) { - } + } catch (c) {} } return null; } @@ -11335,8 +11077,7 @@ } function Ya(a, b) { var c = b.checked; - return m({ - }, b, { + return m({}, b, { defaultChecked: void 0, defaultValue: void 0, value: void 0, @@ -11385,8 +11126,7 @@ } function fb(a, b, c, d) { if (a = a.options, b) { - b = { - }; + b = {}; for(var e = 0; e < c.length; e++)b["$" + c[e]] = !0; for(c = 0; c < a.length; c++)e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = !0); } else { @@ -11402,8 +11142,7 @@ } function gb(a, b) { if (null != b.dangerouslySetInnerHTML) throw Error(y(91)); - return m({ - }, b, { + return m({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue @@ -11611,8 +11350,7 @@ function Hb(a, b, c, d, e) { return a(b, c, d, e); } - function Ib() { - } + function Ib() {} var Jb = Gb, Kb = !1, Lb = !1; function Mb() { (null !== zb || null !== Ab) && (Ib(), Fb()); @@ -11646,8 +11384,7 @@ } var Pb = !1; if (fa) try { - var Qb = { - }; + var Qb = {}; Object.defineProperty(Qb, "passive", { get: function() { Pb = !0; @@ -11881,8 +11618,7 @@ for(; 0 < pc.length && null === (c = pc[0]).blockedOn;)vc(c), null === c.blockedOn && pc.shift(); } function Dc(a, b) { - var c = { - }; + var c = {}; return c[a.toLowerCase()] = b.toLowerCase(), c["Webkit" + a] = "webkit" + b, c["Moz" + a] = "moz" + b, c; } var Ec = { @@ -11890,9 +11626,7 @@ animationiteration: Dc("Animation", "AnimationIteration"), animationstart: Dc("Animation", "AnimationStart"), transitionend: Dc("Transition", "TransitionEnd") - }, Fc = { - }, Gc = { - }; + }, Fc = {}, Gc = {}; function Hc(a) { if (Fc[a]) return Fc[a]; if (!Ec[a]) return a; @@ -12072,8 +11806,7 @@ var a = this.nativeEvent; a && (a.stopPropagation ? a.stopPropagation() : "unknown" != typeof a.cancelBubble && (a.cancelBubble = !0), this.isPropagationStopped = pd); }, - persist: function() { - }, + persist: function() {}, isPersistent: pd }), b8; } @@ -12086,12 +11819,10 @@ }, defaultPrevented: 0, isTrusted: 0 - }, td = rd(sd), ud = m({ - }, sd, { + }, td = rd(sd), ud = m({}, sd, { view: 0, detail: 0 - }), vd = rd(ud), Ad = m({ - }, ud, { + }), vd = rd(ud), Ad = m({}, ud, { screenX: 0, screenY: 0, clientX: 0, @@ -12114,24 +11845,19 @@ movementY: function(a) { return "movementY" in a ? a.movementY : xd; } - }), Bd = rd(Ad), Dd = rd(m({ - }, Ad, { + }), Bd = rd(Ad), Dd = rd(m({}, Ad, { dataTransfer: 0 - })), Fd = rd(m({ - }, ud, { + })), Fd = rd(m({}, ud, { relatedTarget: 0 - })), Hd = rd(m({ - }, sd, { + })), Hd = rd(m({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 - })), Jd = rd(m({ - }, sd, { + })), Jd = rd(m({}, sd, { clipboardData: function(a) { return "clipboardData" in a ? a.clipboardData : window.clipboardData; } - })), Ld = rd(m({ - }, sd, { + })), Ld = rd(m({}, sd, { data: 0 })), Md = { Esc: "Escape", @@ -12196,8 +11922,7 @@ function zd() { return Pd; } - var Rd = rd(m({ - }, ud, { + var Rd = rd(m({}, ud, { key: function(a) { if (a.key) { var b = Md[a.key] || a.key; @@ -12223,8 +11948,7 @@ which: function(a) { return "keypress" === a.type ? od(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; } - })), Td = rd(m({ - }, Ad, { + })), Td = rd(m({}, Ad, { pointerId: 0, width: 0, height: 0, @@ -12235,8 +11959,7 @@ twist: 0, pointerType: 0, isPrimary: 0 - })), Vd = rd(m({ - }, ud, { + })), Vd = rd(m({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, @@ -12245,13 +11968,11 @@ ctrlKey: 0, shiftKey: 0, getModifierState: zd - })), Xd = rd(m({ - }, sd, { + })), Xd = rd(m({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 - })), Zd = rd(m({ - }, Ad, { + })), Zd = rd(m({}, Ad, { deltaX: function(a) { return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0; }, @@ -12843,8 +12564,7 @@ listeners: g }); } - function jf() { - } + function jf() {} var kf = null, lf = null; function mf(a, b) { switch(a){ @@ -12926,15 +12646,13 @@ function I(a, b) { Af++, zf[Af] = a.current, a.current = b; } - var Cf = { - }, M = Bf(Cf), N = Bf(!1), Df = Cf; + var Cf = {}, M = Bf(Cf), N = Bf(!1), Df = Cf; function Ef(a, b) { var c = a.type.contextTypes; if (!c) return Cf; var d = a.stateNode; if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext; - var f, e = { - }; + var f, e = {}; for(f in c)e[f] = b[f]; return d && ((a = a.stateNode).__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e), e; } @@ -12952,8 +12670,7 @@ var d = a.stateNode; if (a = b.childContextTypes, "function" != typeof d.getChildContext) return c; for(var e in d = d.getChildContext())if (!(e in a)) throw Error(y(108, Ra(b) || "Unknown", e)); - return m({ - }, c, d); + return m({}, c, d); } function Jf(a) { return a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Cf, Df = M.current, I(M, a), I(N, N.current), !0; @@ -12963,9 +12680,7 @@ if (!d) throw Error(y(169)); c ? (a = If(a, b, Df), d.__reactInternalMemoizedMergedChildContext = a, H(N), H(M), I(M, a)) : H(N), I(N, c); } - var Lf = null, Mf = null, Nf = r.unstable_runWithPriority, Of = r.unstable_scheduleCallback, Pf = r.unstable_cancelCallback, Qf = r.unstable_shouldYield, Rf = r.unstable_requestPaint, Sf = r.unstable_now, Tf = r.unstable_getCurrentPriorityLevel, Uf = r.unstable_ImmediatePriority, Vf = r.unstable_UserBlockingPriority, Wf = r.unstable_NormalPriority, Xf = r.unstable_LowPriority, Yf = r.unstable_IdlePriority, Zf = { - }, $f = void 0 !== Rf ? Rf : function() { - }, ag = null, bg = null, cg = !1, dg = Sf(), O = 10000 > dg ? Sf : function() { + var Lf = null, Mf = null, Nf = r.unstable_runWithPriority, Of = r.unstable_scheduleCallback, Pf = r.unstable_cancelCallback, Qf = r.unstable_shouldYield, Rf = r.unstable_requestPaint, Sf = r.unstable_now, Tf = r.unstable_getCurrentPriorityLevel, Uf = r.unstable_ImmediatePriority, Vf = r.unstable_UserBlockingPriority, Wf = r.unstable_NormalPriority, Xf = r.unstable_LowPriority, Yf = r.unstable_IdlePriority, Zf = {}, $f = void 0 !== Rf ? Rf : function() {}, ag = null, bg = null, cg = !1, dg = Sf(), O = 10000 > dg ? Sf : function() { return Sf() - dg; }; function eg() { @@ -13036,8 +12751,7 @@ var kg = ra.ReactCurrentBatchConfig; function lg(a, b) { if (a && a.defaultProps) { - for(var c in b = m({ - }, b), a = a.defaultProps)void 0 === b[c] && (b[c] = a[c]); + for(var c in b = m({}, b), a = a.defaultProps)void 0 === b[c] && (b[c] = a[c]); return b; } return b; @@ -13184,8 +12898,7 @@ C.flags = -4097 & C.flags | 64; case 0: if (null == (h = "function" == typeof (C = x.payload) ? C.call(p, A, h) : C)) break a; - A = m({ - }, A, h); + A = m({}, A, h); break a; case 2: wg = !0; @@ -13219,8 +12932,7 @@ } var Fg = (new aa.Component).refs; function Gg(a, b, c, d) { - c = null == (c = c(d, b = a.memoizedState)) ? b : m({ - }, b, c), a.memoizedState = c, 0 === a.lanes && (a.updateQueue.baseState = c); + c = null == (c = c(d, b = a.memoizedState)) ? b : m({}, b, c), a.memoizedState = c, 0 === a.lanes && (a.updateQueue.baseState = c); } var Kg = { isMounted: function(a) { @@ -13270,8 +12982,7 @@ var e = "" + a13; return null !== b10 && null !== b10.ref && "function" == typeof b10.ref && b10.ref._stringRef === e ? b10.ref : ((b10 = function(a) { var b = d.refs; - b === Fg && (b = d.refs = { - }), null === a ? delete b[e] : b[e] = a; + b === Fg && (b = d.refs = {}), null === a ? delete b[e] : b[e] = a; })._stringRef = e, b10); } if ("string" != typeof a13) throw Error(y(284)); @@ -13463,8 +13174,7 @@ return c5(a15, d); }; } - var Yg = Sg(!0), Zg = Sg(!1), $g = { - }, ah = Bf($g), bh = Bf($g), ch = Bf($g); + var Yg = Sg(!0), Zg = Sg(!1), $g = {}, ah = Bf($g), bh = Bf($g), ch = Bf($g); function dh(a) { if (a === $g) throw Error(y(174)); return a; @@ -13826,8 +13536,7 @@ a ]) : null, Vh(4, 2, Zh.bind(null, b, a), c); } - function ai() { - } + function ai() {} function bi(a, b) { var c = Ih(); b = void 0 === b ? null : b; @@ -13873,9 +13582,7 @@ if (0 === a.lanes && (null === g || 0 === g.lanes) && null !== (g = b.lastRenderedReducer)) try { var h = b.lastRenderedState, k = g(h, c); if (f.eagerReducer = g, f.eagerState = k, He(k, h)) return; - } catch (l) { - } finally{ - } + } catch (l) {} finally{} Jg(a, e, d); } } @@ -14397,8 +14104,7 @@ case "select": a._wrapperState = { wasMultiple: !!d.multiple - }, e = m({ - }, d, { + }, e = m({}, d, { value: void 0 }), G("invalid", a); break; @@ -14544,8 +14250,7 @@ } c.sibling.return = c.return, c = c.sibling; } - }, Ci = function() { - }, Di = function(a, b, c, d) { + }, Ci = function() {}, Di = function(a, b, c, d) { var e = a.memoizedProps; if (e !== d) { a = b.stateNode, dh(ah.current); @@ -14558,11 +14263,9 @@ e = eb(a, e), d = eb(a, d), f = []; break; case "select": - e = m({ - }, e, { + e = m({}, e, { value: void 0 - }), d = m({ - }, d, { + }), d = m({}, d, { value: void 0 }), f = []; break; @@ -14574,16 +14277,13 @@ } for(l in vb(c, d), c = null, e)if (!d.hasOwnProperty(l) && e.hasOwnProperty(l) && null != e[l]) if ("style" === l) { var h = e[l]; - for(g in h)h.hasOwnProperty(g) && (c || (c = { - }), c[g] = ""); + for(g in h)h.hasOwnProperty(g) && (c || (c = {}), c[g] = ""); } else "dangerouslySetInnerHTML" !== l && "children" !== l && "suppressContentEditableWarning" !== l && "suppressHydrationWarning" !== l && "autoFocus" !== l && (ca.hasOwnProperty(l) ? f || (f = []) : (f = f || []).push(l, null)); for(l in d){ var k = d[l]; if (h = null != e ? e[l] : void 0, d.hasOwnProperty(l) && k !== h && (null != k || null != h)) if ("style" === l) if (h) { - for(g in h)!h.hasOwnProperty(g) || k && k.hasOwnProperty(g) || (c || (c = { - }), c[g] = ""); - for(g in k)k.hasOwnProperty(g) && h[g] !== k[g] && (c || (c = { - }), c[g] = k[g]); + for(g in h)!h.hasOwnProperty(g) || k && k.hasOwnProperty(g) || (c || (c = {}), c[g] = ""); + for(g in k)k.hasOwnProperty(g) && h[g] !== k[g] && (c || (c = {}), c[g] = k[g]); } else c || (f || (f = []), f.push(l, c)), c = k; else "dangerouslySetInnerHTML" === l ? (k = k ? k.__html : void 0, h = h ? h.__html : void 0, null != k && h !== k && (f = f || []).push(l, k)) : "children" === l ? "string" != typeof k && "number" != typeof k || (f = f || []).push(l, "" + k) : "suppressContentEditableWarning" !== l && "suppressHydrationWarning" !== l && (ca.hasOwnProperty(l) ? (null != k && "onScroll" === l && G("scroll", a), f || h === k || (f = [])) : "object" == typeof k && null !== k && k.$$typeof === Ga ? k.toString() : (f = f || []).push(l, k)); } @@ -14745,8 +14445,7 @@ function bj(a, b) { if (Mf && "function" == typeof Mf.onCommitFiberUnmount) try { Mf.onCommitFiberUnmount(Lf, b); - } catch (f) { - } + } catch (f) {} switch(b.tag){ case 0: case 11: @@ -15490,8 +15189,7 @@ else for(Z = d; null !== Z;)b = Z.nextEffect, Z.nextEffect = null, 8 & Z.flags && ((K = Z).sibling = null, K.stateNode = null), Z = b; if (0 === (d = a.pendingLanes) && (Ti = null), 1 === d ? a === Ej ? Dj++ : (Dj = 0, Ej = a) : Dj = 0, c = c.stateNode, Mf && "function" == typeof Mf.onCommitFiberRoot) try { Mf.onCommitFiberRoot(Lf, c, void 0, 64 == (64 & c.current.flags)); - } catch (va) { - } + } catch (va) {} if (Mj(a, O()), Qi) throw Qi = !1, a = Ri, Ri = null, a; return 0 != (8 & X) || ig(), null; } @@ -15569,8 +15267,7 @@ if (Ag(c, e), e = Hg(), null !== (c = Kj(c, 1))) $c(c, 1, e), Mj(c, e); else if ("function" == typeof d.componentDidCatch && (null === Ti || !Ti.has(d))) try { d.componentDidCatch(b, a); - } catch (f) { - } + } catch (f) {} break; } } @@ -16049,8 +15746,7 @@ var yk = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (!yk.isDisabled && yk.supportsFiber) try { Lf = yk.inject(xk), Mf = yk; - } catch (a) { - } + } catch (a) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { Events: [ @@ -16211,10 +15907,8 @@ })(e6, t1); } function _objectWithoutPropertiesLoose(e, t) { - if (null == e) return { - }; - var r, o, n = { - }, a = Object.keys(e); + if (null == e) return {}; + var r, o, n = {}, a = Object.keys(e); for(o = 0; o < a.length; o++)r = a[o], 0 <= t.indexOf(r) || (n[r] = e[r]); return n; } @@ -16257,8 +15951,7 @@ "innerRef", "navigate", "onClick" - ]), i = a.target, c = _extends({ - }, a, { + ]), i = a.target, c = _extends({}, a, { onClick: function(t) { var e; try { @@ -16279,8 +15972,7 @@ ]); return React.createElement(reactRouter.__RouterContext.Consumer, null, function(r) { r || invariant(!1); - var o = r.history, e12 = normalizeToLocation(resolveToLocation(u, r.location), r.location), n = _extends({ - }, s, { + var o = r.history, e12 = normalizeToLocation(resolveToLocation(u, r.location), r.location), n = _extends({}, s, { href: e12 ? o.createHref(e12) : "", navigate: function() { var e = resolveToLocation(u, r.location), t = history.createPath(r.location) === history.createPath(normalizeToLocation(e)); @@ -16321,8 +16013,7 @@ return t.filter(function(e) { return e; }).join(" "); - })(c, p), u = _extends({ - }, u, R)); + })(c, p), u = _extends({}, u, R)); var f = _extends({ "aria-current": i && l || null, className: c, @@ -16460,8 +16151,7 @@ return withRouter; } }); - var inheritsLoose = __webpack_require__(48861), _react_17_0_2_react = __webpack_require__(59301), _prop_types_15_7_2_prop_types = __webpack_require__(68712), _prop_types_15_7_2_prop_types_default = __webpack_require__.n(_prop_types_15_7_2_prop_types), esm_history = __webpack_require__(91520), commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== __webpack_require__.g ? __webpack_require__.g : { - }, esm = _react_17_0_2_react.createContext || function(defaultValue, calculateChangedBits) { + var inheritsLoose = __webpack_require__(48861), _react_17_0_2_react = __webpack_require__(59301), _prop_types_15_7_2_prop_types = __webpack_require__(68712), _prop_types_15_7_2_prop_types_default = __webpack_require__.n(_prop_types_15_7_2_prop_types), esm_history = __webpack_require__(91520), commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== __webpack_require__.g ? __webpack_require__.g : {}, esm = _react_17_0_2_react.createContext || function(defaultValue, calculateChangedBits) { var _Provider$childContex, _Consumer$contextType, key, contextProp = "__create-react-context-" + (commonjsGlobal[key = "__global_unique_id__"] = (commonjsGlobal[key] || 0) + 1) + "__", Provider1 = function(_Component) { function Provider() { var _this, value, handlers; @@ -16488,8 +16178,7 @@ var _proto = Provider.prototype; return _proto.getChildContext = function() { var _ref; - return (_ref = { - })[contextProp] = this.emitter, _ref; + return (_ref = {})[contextProp] = this.emitter, _ref; }, _proto.componentWillReceiveProps = function(nextProps) { if (this.props.value !== nextProps.value) { var changedBits, x, y, oldValue = this.props.value, newValue = nextProps.value; @@ -16499,8 +16188,7 @@ return this.props.children; }, Provider; }(_react_17_0_2_react.Component); - (_Provider$childContex = { - })[contextProp] = _prop_types_15_7_2_prop_types_default().object.isRequired, Provider1.childContextTypes = _Provider$childContex; + (_Provider$childContex = {})[contextProp] = _prop_types_15_7_2_prop_types_default().object.isRequired, Provider1.childContextTypes = _Provider$childContex; var Consumer1 = function(_Component2) { function Consumer() { var _this2; @@ -16530,8 +16218,7 @@ return (children = this.props.children, Array.isArray(children) ? children[0] : children)(this.state.value); }, Consumer; }(_react_17_0_2_react.Component); - return (_Consumer$contextType = { - })[contextProp] = _prop_types_15_7_2_prop_types_default().object, Consumer1.contextTypes = _Consumer$contextType, { + return (_Consumer$contextType = {})[contextProp] = _prop_types_15_7_2_prop_types_default().object, Consumer1.contextTypes = _Consumer$contextType, { Provider: Provider1, Consumer: Consumer1 }; @@ -16555,8 +16242,7 @@ return { path: "/", url: "/", - params: { - }, + params: {}, isExact: "/" === pathname }; }; @@ -16628,11 +16314,9 @@ }); }); } - var cache = { - }, cacheCount = 0; + var cache = {}, cacheCount = 0; function generatePath(path8, params) { - return void 0 === path8 && (path8 = "/"), void 0 === params && (params = { - }), "/" === path8 ? path8 : (function(path) { + return void 0 === path8 && (path8 = "/"), void 0 === params && (params = {}), "/" === path8 ? path8 : (function(path) { if (cache[path]) return cache[path]; var generator = _path_to_regexp_1_8_0_path_to_regexp_default().compile(path); return cacheCount < 10000 && (cache[path] = generator, cacheCount++), generator; @@ -16644,8 +16328,7 @@ var computedMatch = _ref.computedMatch, to = _ref.to, _ref$push = _ref.push, push = void 0 !== _ref$push && _ref$push; return _react_17_0_2_react.createElement(context1.Consumer, null, function(context) { context || (0, tiny_invariant_esm.default)(!1); - var history = context.history, staticContext = context.staticContext, method = push ? history.push : history.replace, location = (0, esm_history.createLocation)(computedMatch ? "string" == typeof to ? generatePath(to, computedMatch.params) : (0, esm_extends.Z)({ - }, to, { + var history = context.history, staticContext = context.staticContext, method = push ? history.push : history.replace, location = (0, esm_history.createLocation)(computedMatch ? "string" == typeof to ? generatePath(to, computedMatch.params) : (0, esm_extends.Z)({}, to, { pathname: generatePath(to.pathname, computedMatch.params) }) : to); return staticContext ? (method(location), null) : _react_17_0_2_react.createElement(Lifecycle1, { @@ -16654,8 +16337,7 @@ }, onUpdate: function(self, prevProps) { var prevLocation = (0, esm_history.createLocation)(prevProps.to); - (0, esm_history.locationsAreEqual)(prevLocation, (0, esm_extends.Z)({ - }, location, { + (0, esm_history.locationsAreEqual)(prevLocation, (0, esm_extends.Z)({}, location, { key: prevLocation.key })) || method(location); }, @@ -16663,11 +16345,9 @@ }); }); } - var cache$1 = { - }, cacheCount$1 = 0; + var cache$1 = {}, cacheCount$1 = 0; function matchPath(pathname, options6) { - void 0 === options6 && (options6 = { - }), ("string" == typeof options6 || Array.isArray(options6)) && (options6 = { + void 0 === options6 && (options6 = {}), ("string" == typeof options6 || Array.isArray(options6)) && (options6 = { path: options6 }); var _options = options6, path9 = _options.path, _options$exact = _options.exact, exact = void 0 !== _options$exact && _options$exact, _options$strict = _options.strict, strict = void 0 !== _options$strict && _options$strict, _options$sensitive = _options.sensitive, sensitive = void 0 !== _options$sensitive && _options$sensitive, paths = [].concat(path9); @@ -16675,8 +16355,7 @@ if (!path10 && "" !== path10) return null; if (matched) return matched; var _compilePath = function(path, options) { - var cacheKey = "" + options.end + options.strict + options.sensitive, pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = { - }); + var cacheKey = "" + options.end + options.strict + options.sensitive, pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {}); if (pathCache[path]) return pathCache[path]; var keys = [], result = { regexp: _path_to_regexp_1_8_0_path_to_regexp_default()(path, keys, options), @@ -16696,8 +16375,7 @@ isExact: isExact, params: keys3.reduce(function(memo, key, index) { return memo[key.name] = values[index], memo; - }, { - }) + }, {}) }; }, null); } @@ -16709,8 +16387,7 @@ var _this = this; return _react_17_0_2_react.createElement(context1.Consumer, null, function(context$1) { context$1 || (0, tiny_invariant_esm.default)(!1); - var children, location = _this.props.location || context$1.location, match = _this.props.computedMatch ? _this.props.computedMatch : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match, props = (0, esm_extends.Z)({ - }, context$1, { + var children, location = _this.props.location || context$1.location, match = _this.props.computedMatch ? _this.props.computedMatch : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match, props = (0, esm_extends.Z)({}, context$1, { location: location, match: match }), _this$props = _this.props, children1 = _this$props.children, component = _this$props.component, render = _this$props.render; @@ -16731,8 +16408,7 @@ (0, tiny_invariant_esm.default)(!1); }; } - function noop() { - } + function noop() {} var StaticRouter1 = function(_React$Component) { function StaticRouter() { for(var _this, _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key]; @@ -16751,10 +16427,8 @@ (0, inheritsLoose.Z)(StaticRouter, _React$Component); var _proto = StaticRouter.prototype; return _proto.navigateTo = function(location, action) { - var basename, location1, _this$props = this.props, _this$props$basename = _this$props.basename, _this$props$context = _this$props.context, context = void 0 === _this$props$context ? { - } : _this$props$context; - context.action = action, basename = void 0 === _this$props$basename ? "" : _this$props$basename, location1 = (0, esm_history.createLocation)(location), context.location = basename ? (0, esm_extends.Z)({ - }, location1, { + var basename, location1, _this$props = this.props, _this$props$basename = _this$props.basename, _this$props$context = _this$props.context, context = void 0 === _this$props$context ? {} : _this$props$context; + context.action = action, basename = void 0 === _this$props$basename ? "" : _this$props$basename, location1 = (0, esm_history.createLocation)(location), context.location = basename ? (0, esm_extends.Z)({}, location1, { pathname: addLeadingSlash(basename) + location1.pathname }) : location1, context.url = createURL(context.location); }, _proto.render = function() { @@ -16770,8 +16444,7 @@ location: function(basename, location) { if (!basename) return location; var base = addLeadingSlash(basename); - return 0 !== location.pathname.indexOf(base) ? location : (0, esm_extends.Z)({ - }, location, { + return 0 !== location.pathname.indexOf(base) ? location : (0, esm_extends.Z)({}, location, { pathname: location.pathname.substr(base.length) }); }(basename1, (0, esm_history.createLocation)(void 0 === _this$props2$location ? "/" : _this$props2$location)), @@ -16783,11 +16456,9 @@ listen: this.handleListen, block: this.handleBlock }; - return _react_17_0_2_react.createElement(Router1, (0, esm_extends.Z)({ - }, rest, { + return _react_17_0_2_react.createElement(Router1, (0, esm_extends.Z)({}, rest, { history: history, - staticContext: void 0 === _this$props2$context ? { - } : _this$props2$context + staticContext: void 0 === _this$props2$context ? {} : _this$props2$context })); }, StaticRouter; }(_react_17_0_2_react.Component), Switch1 = function(_React$Component) { @@ -16803,8 +16474,7 @@ if (null == match && _react_17_0_2_react.isValidElement(child)) { element = child; var path = child.props.path || child.props.from; - match = path ? matchPath(location.pathname, (0, esm_extends.Z)({ - }, child.props, { + match = path ? matchPath(location.pathname, (0, esm_extends.Z)({}, child.props, { path: path })) : context.match; } @@ -16821,8 +16491,7 @@ "wrappedComponentRef" ]); return _react_17_0_2_react.createElement(context1.Consumer, null, function(context) { - return context || (0, tiny_invariant_esm.default)(!1), _react_17_0_2_react.createElement(Component, (0, esm_extends.Z)({ - }, remainingProps, context, { + return context || (0, tiny_invariant_esm.default)(!1), _react_17_0_2_react.createElement(Component, (0, esm_extends.Z)({}, remainingProps, context, { ref: wrappedComponentRef })); }); @@ -16838,8 +16507,7 @@ } function useParams() { var match = useContext(context1).match; - return match ? match.params : { - }; + return match ? match.params : {}; } function useRouteMatch(path) { var location = useLocation(), match = useContext(context1).match; @@ -16861,8 +16529,7 @@ __source: !0 }; function q(c, a, k) { - var b, d = { - }, e = null, l = null; + var b, d = {}, e = null, l = null; for(b in void 0 !== k && (e = "" + k), void 0 !== a.key && (e = "" + a.key), void 0 !== a.ref && (l = a.ref), a)n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); if (c && c.defaultProps) for(b in a = c.defaultProps)void 0 === d[b] && (d[b] = a[b]); return { @@ -16896,24 +16563,18 @@ isMounted: function() { return !1; }, - enqueueForceUpdate: function() { - }, - enqueueReplaceState: function() { - }, - enqueueSetState: function() { - } - }, B = { - }; + enqueueForceUpdate: function() {}, + enqueueReplaceState: function() {}, + enqueueSetState: function() {} + }, B = {}; function C(a, b, c) { this.props = a, this.context = b, this.refs = B, this.updater = c || A; } - function D() { - } + function D() {} function E(a, b, c) { this.props = a, this.context = b, this.refs = B, this.updater = c || A; } - C.prototype.isReactComponent = { - }, C.prototype.setState = function(a, b) { + C.prototype.isReactComponent = {}, C.prototype.setState = function(a, b) { if ("object" != typeof a && "function" != typeof a && null != a) throw Error(z(85)); this.updater.enqueueSetState(this, a, b, "setState"); }, C.prototype.forceUpdate = function(a) { @@ -16930,8 +16591,7 @@ __source: !0 }; function J(a, b, c) { - var e, d = { - }, k = null, h = null; + var e, d = {}, k = null, h = null; if (null != b) for(e in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b)H.call(b, e) && !I.hasOwnProperty(e) && (d[e] = b[e]); var g = arguments.length - 2; if (1 === g) d.children = c; @@ -17058,8 +16718,7 @@ assign: l }, exports.cloneElement = function(a, b, c) { if (null == a) throw Error(z(267, a)); - var e = l({ - }, a.props), d = a.key, k = a.ref, h = a._owner; + var e = l({}, a.props), d = a.key, k = a.ref, h = a._owner; if (null != b) { if (void 0 !== b.ref && (k = b.ref, h = G.current), void 0 !== b.key && (d = "" + b.key), a.type && a.type.defaultProps) var g = a.type.defaultProps; for(f in b)H.call(b, f) && !I.hasOwnProperty(f) && (e[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]); @@ -17123,8 +16782,7 @@ return S().useCallback(a, b); }, exports.useContext = function(a, b) { return S().useContext(a, b); - }, exports.useDebugValue = function() { - }, exports.useEffect = function(a, b) { + }, exports.useDebugValue = function() {}, exports.useEffect = function(a, b) { return S().useEffect(a, b); }, exports.useImperativeHandle = function(a, b, c) { return S().useImperativeHandle(a, b, c); @@ -17151,8 +16809,7 @@ 10405: function(module) { var runtime = function(exports) { "use strict"; - var undefined, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : { - }, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + var undefined, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, @@ -17162,8 +16819,7 @@ }), obj[key]; } try { - define({ - }, ""); + define({}, ""); } catch (err1) { define = function(obj, key, value) { return obj[key] = value; @@ -17187,16 +16843,11 @@ } } exports.wrap = wrap; - var GenStateSuspendedStart = "suspendedStart", GenStateExecuting = "executing", GenStateCompleted = "completed", ContinueSentinel = { - }; - function Generator() { - } - function GeneratorFunction() { - } - function GeneratorFunctionPrototype() { - } - var IteratorPrototype = { - }; + var GenStateSuspendedStart = "suspendedStart", GenStateExecuting = "executing", GenStateCompleted = "completed", ContinueSentinel = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function() { return this; }); @@ -17297,8 +16948,7 @@ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { - var record = entry.completion || { - }; + var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { @@ -17404,8 +17054,7 @@ } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); - var record = finallyEntry ? finallyEntry.completion : { - }; + var record = finallyEntry ? finallyEntry.completion : {}; return (record.type = type, record.arg = arg, finallyEntry) ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function(record, afterLoc) { @@ -17477,8 +17126,7 @@ clearTimeout(u); }, exports.unstable_shouldYield = function() { return !1; - }, k = exports.unstable_forceFrameRate = function() { - }; + }, k = exports.unstable_forceFrameRate = function() {}; } else { var x = window.setTimeout, y = window.clearTimeout; if ("undefined" != typeof console) { @@ -17488,8 +17136,7 @@ var A = !1, B = null, C = -1, D = 5, E = 0; exports.unstable_shouldYield = function() { return exports.unstable_now() >= E; - }, k = function() { - }, exports.unstable_forceFrameRate = function(a) { + }, k = function() {}, exports.unstable_forceFrameRate = function(a) { 0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : D = 0 < a ? Math.floor(1000 / a) : 5; }; var F = new MessageChannel, G = F.port2; @@ -17609,8 +17256,7 @@ } finally{ P = c; } - }, exports.unstable_pauseExecution = function() { - }, exports.unstable_requestPaint = k, exports.unstable_runWithPriority = function(a, b) { + }, exports.unstable_pauseExecution = function() {}, exports.unstable_requestPaint = k, exports.unstable_runWithPriority = function(a, b) { switch(3){ case 1: case 2: @@ -17705,8 +17351,7 @@ }, 98009: function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; - __webpack_require__.r(__webpack_exports__), __webpack_exports__.default = function(condition, message) { - }; + __webpack_require__.r(__webpack_exports__), __webpack_exports__.default = function(condition, message) {}; }, 6470: function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -17716,14 +17361,12 @@ "default" !== key && "__esModule" !== key && (key in exports && exports[key] === _env[key] || (exports[key] = _env[key])); }); } - }, __webpack_module_cache__ = { - }; + }, __webpack_module_cache__ = {}; function __webpack_require__1(moduleId) { var cachedModule = __webpack_module_cache__[moduleId]; if (void 0 !== cachedModule) return cachedModule.exports; var module = __webpack_module_cache__[moduleId] = { - exports: { - } + exports: {} }; return __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__1), module.exports; } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2558/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2558/1/output.js index 2f16952c265..4a10bbb41ce 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2558/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2558/1/output.js @@ -3,8 +3,7 @@ var ampersandTest, propValue, nativeURLSearchParams = function() { try { if (self.URLSearchParams && "bar" === new self.URLSearchParams("foo=bar").get("foo")) return self.URLSearchParams; - } catch (e) { - } + } catch (e) {} return null; }(), isSupportObjectConstructor = nativeURLSearchParams && "a=1" === new nativeURLSearchParams({ a: 1 @@ -110,8 +109,7 @@ }), iterator; } function parseToDict(search) { - var dict = { - }; + var dict = {}; if ("object" == typeof search) if (isArray(search)) for(var i = 0; i < search.length; i++){ var item = search[i]; if (isArray(item) && 2 === item.length) appendTo(dict, item[0], item[1]); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2807/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2807/1/output.js index dc6fa4d0bad..30b36901005 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2807/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2807/1/output.js @@ -1,2 +1 @@ -export default function A() { -}; +export default function A() {}; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/d3-time-format/3/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/d3-time-format/3/output.js index 488b89d1a84..f49f0caae4b 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/d3-time-format/3/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/d3-time-format/3/output.js @@ -47,8 +47,7 @@ }) : interval : null; }), interval; } - var millisecond = newInterval(function() { - }, function(date, step) { + var millisecond = newInterval(function() {}, function(date, step) { date.setTime(+date + step); }, function(start, end) { return end - start; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/emotion/react/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/emotion/react/1/output.js index 521ef1ec63a..6c21275f7fc 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/emotion/react/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/emotion/react/1/output.js @@ -34,8 +34,7 @@ }(tag1); try { sheet.insertRule(rule, sheet.cssRules.length); - } catch (e) { - } + } catch (e) {} } else tag1.appendChild(document.createTextNode(rule)); this.ctr++; }, _proto.flush = function() { @@ -627,8 +626,7 @@ -1 !== node.getAttribute("data-emotion").indexOf(" ") && (document.head.appendChild(node), node.setAttribute("data-s", "")); }); } - var stylisPlugins = options.stylisPlugins || defaultStylisPlugins, inserted = { - }, nodesToHydrate = []; + var stylisPlugins = options.stylisPlugins || defaultStylisPlugins, inserted = {}, nodesToHydrate = []; container = options.container || document.head, Array.prototype.forEach.call(document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function(node) { for(var attrib = node.getAttribute("data-emotion").split(" "), i = 1; i < attrib.length; i++)inserted[attrib[i]] = !0; nodesToHydrate.push(node); @@ -670,8 +668,7 @@ }), nonce: options.nonce, inserted: inserted, - registered: { - }, + registered: {}, insert: _insert }; return cache.sheet.hydrate(nodesToHydrate), cache; @@ -679,8 +676,7 @@ key: "css" }) : null); EmotionCacheContext.Provider; - var emotion_element_99289b21_browser_esm_ThemeContext = (0, react.createContext)({ - }); + var emotion_element_99289b21_browser_esm_ThemeContext = (0, react.createContext)({}); __webpack_require__(8679); var emotion_utils_browser_esm_insertStyles = function(cache, serialized, isStringTag) { var className = cache.key + "-" + serialized.name; @@ -760,8 +756,7 @@ displayName: !0, propTypes: !0, type: !0 - }, TYPE_STATICS = { - }; + }, TYPE_STATICS = {}; function getStatics(component) { return reactIs.isMemo(component) ? MEMO_STATICS : TYPE_STATICS[component.$$typeof] || REACT_STATICS; } @@ -787,8 +782,7 @@ var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { defineProperty(targetComponent, key, descriptor); - } catch (e) { - } + } catch (e) {} } } } @@ -822,12 +816,10 @@ exports.default = void 0; var obj, _react = (obj = __webpack_require__(7294)) && obj.__esModule ? obj : { default: obj - }, _router = __webpack_require__(6273), _router1 = __webpack_require__(387), _useIntersection = __webpack_require__(7190), prefetched = { - }; + }, _router = __webpack_require__(6273), _router1 = __webpack_require__(387), _useIntersection = __webpack_require__(7190), prefetched = {}; function prefetch(router, href, as, options) { if (router && _router.isLocalURL(href)) { - router.prefetch(href, as, options).catch(function(err) { - }); + router.prefetch(href, as, options).catch(function(err) {}); var curLocale = options && void 0 !== options.locale ? options.locale : router && router.locale; prefetched[href + "%" + as + (curLocale ? "%" + curLocale : "")] = !0; } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-core/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-core/1/output.js index cb308cf1904..fb3ac20bf6b 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-core/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-core/1/output.js @@ -12,8 +12,7 @@ const dateValue = source; return new Date(dateValue.getTime()); case Object: - void 0 === target && (target = { - }); + void 0 === target && (target = {}); break; case Array: target = []; @@ -86,8 +85,7 @@ this.service = service, this.serviceName = serviceName, this.errors = errors; } create(code, ...data) { - const customData = data[0] || { - }, fullCode = `${this.service}/${code}`, template = this.errors[code], message = template ? replaceTemplate(template, customData) : "Error", fullMessage = `${this.serviceName}: ${message} (${fullCode}).`, error = new FirebaseError(fullCode, fullMessage, customData); + const customData = data[0] || {}, fullCode = `${this.service}/${code}`, template = this.errors[code], message = template ? replaceTemplate(template, customData) : "Error", fullMessage = `${this.serviceName}: ${message} (${fullCode}).`, error = new FirebaseError(fullCode, fullMessage, customData); return error; } } @@ -149,12 +147,8 @@ return getStatEventTarget; } }); - var a2, x, Na, Ab, cc, k, commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== __webpack_require__.g ? __webpack_require__.g : "undefined" != typeof self ? self : { - }, esm = { - }, goog = goog || { - }, l = commonjsGlobal || self; - function aa() { - } + var a2, x, Na, Ab, cc, k, commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== __webpack_require__.g ? __webpack_require__.g : "undefined" != typeof self ? self : {}, esm = {}, goog = goog || {}, l = commonjsGlobal || self; + function aa() {} function ba(a) { var b = typeof a; return "array" == (b = "object" != b ? b : a ? Array.isArray(a) ? "array" : b : "null") || "object" == b && "number" == typeof a.length; @@ -190,8 +184,7 @@ }; } function t(a, b) { - function c() { - } + function c() {} c.prototype = b.prototype, a.Z = b.prototype, a.prototype = new c, a.prototype.constructor = a, a.Vb = function(d, e, f) { for(var h = Array(arguments.length - 2), n = 2; n < arguments.length; n++)h[n - 2] = arguments[n]; return b.prototype[e].apply(d, h); @@ -258,8 +251,7 @@ for(const d in a)b.call(c, a[d], d, a); } function ya(a) { - const b = { - }; + const b = {}; for(const c in a)b[c] = a[c]; return b; } @@ -291,19 +283,16 @@ } Na = Oa; } - var Ga = { - }, Ua = l.document && y ? Ma() || parseInt(Na, 10) || void 0 : void 0, Va = function() { + var Ga = {}, Ua = l.document && y ? Ma() || parseInt(Na, 10) || void 0 : void 0, Va = function() { if (!l.addEventListener || !Object.defineProperty) return !1; - var a = !1, b = Object.defineProperty({ - }, "passive", { + var a = !1, b = Object.defineProperty({}, "passive", { get: function() { a = !0; } }); try { l.addEventListener("test", aa, b), l.removeEventListener("test", aa, b); - } catch (c) { - } + } catch (c) {} return a; }(); function z(a, b) { @@ -319,8 +308,7 @@ Ca(b.nodeName); var e = !0; break a; - } catch (f) { - } + } catch (f) {} e = !1; } e || (b = null); @@ -350,8 +338,7 @@ a.ca = !0, a.listener = null, a.proxy = null, a.src = null, a.ia = null; } function $a(a) { - this.src = a, this.g = { - }, this.h = 0; + this.src = a, this.g = {}, this.h = 0; } function bb(a, b) { var c = b.type; @@ -373,8 +360,7 @@ var h = ab(a, b, d, e); return -1 < h ? (b = a[h], c || (b.fa = !1)) : ((b = new Ya(b, this.src, f, !!d, e)).fa = c, a.push(b)), b; }; - var cb = "closure_lm_" + (1000000 * Math.random() | 0), db = { - }; + var cb = "closure_lm_" + (1000000 * Math.random() | 0), db = {}; function fb(a, b, c, d, e) { if (d && d.once) return gb(a, b, c, d, e); if (Array.isArray(b)) { @@ -592,8 +578,7 @@ } } function E(a) { - v.call(this), this.h = a, this.g = { - }; + v.call(this), this.h = a, this.g = {}; } t(E, v); var Jb = []; @@ -608,8 +593,7 @@ function Lb(a) { xa(a.g, function(b, c) { this.g.hasOwnProperty(c) && ob(b); - }, a), a.g = { - }; + }, a), a.g = {}; } function Mb() { this.g = !0; @@ -647,10 +631,8 @@ throw Error("EventHandler.handleEvent not implemented"); }, Mb.prototype.Aa = function() { this.g = !1; - }, Mb.prototype.info = function() { - }; - var H = { - }, Rb = null; + }, Mb.prototype.info = function() {}; + var H = {}, Rb = null; function Sb() { return Rb = Rb || new C; } @@ -702,13 +684,11 @@ tb: "downloadprogress", Ub: "uploadprogress" }; - function Yb() { - } + function Yb() {} function Zb(a) { return a.h || (a.h = a.i()); } - function $b() { - } + function $b() {} Yb.prototype.h = null; var L = { OPEN: "a", @@ -722,8 +702,7 @@ function bc() { z.call(this, "c"); } - function dc() { - } + function dc() {} function M(a, b, c, d) { this.l = a, this.j = b, this.m = c, this.X = d || 1, this.V = new E(this), this.P = ec, a = Ja ? 125 : void 0, this.W = new Eb(a), this.H = null, this.i = !1, this.s = this.A = this.v = this.K = this.F = this.Y = this.B = null, this.D = [], this.g = null, this.C = 0, this.o = this.u = null, this.N = -1, this.I = !1, this.O = 0, this.L = null, this.aa = this.J = this.$ = this.U = !1, this.h = new fc; } @@ -733,12 +712,9 @@ t(ac, z), t(bc, z), t(dc, Yb), dc.prototype.g = function() { return new XMLHttpRequest; }, dc.prototype.i = function() { - return { - }; + return {}; }, cc = new dc; - var ec = 45000, gc = { - }, hc = { - }; + var ec = 45000, gc = {}, hc = {}; function ic(a, b, c) { a.K = 1, a.v = jc(N(b)), a.s = c, a.U = !0, kc(a, null); } @@ -747,8 +723,7 @@ var c1 = a3.A, d1 = a3.X; Array.isArray(d1) || (d1 = [ String(d1) - ]), mc(c1.h, "t", d1), a3.C = 0, c1 = a3.l.H, a3.h = new fc, a3.g = nc(a3.l, c1 ? b1 : null, !a3.s), 0 < a3.O && (a3.L = new Ib(q(a3.Ia, a3, a3.g), a3.O)), Kb(a3.V, a3.g, "readystatechange", a3.gb), b1 = a3.H ? ya(a3.H) : { - }, a3.s ? (a3.u || (a3.u = "POST"), b1["Content-Type"] = "application/x-www-form-urlencoded", a3.g.ea(a3.A, a3.u, a3.s, b1)) : (a3.u = "GET", a3.g.ea(a3.A, a3.u, null, b1)), I(1), (function(a, b, c, d, e, f) { + ]), mc(c1.h, "t", d1), a3.C = 0, c1 = a3.l.H, a3.h = new fc, a3.g = nc(a3.l, c1 ? b1 : null, !a3.s), 0 < a3.O && (a3.L = new Ib(q(a3.Ia, a3, a3.g), a3.O)), Kb(a3.V, a3.g, "readystatechange", a3.gb), b1 = a3.H ? ya(a3.H) : {}, a3.s ? (a3.u || (a3.u = "POST"), b1["Content-Type"] = "application/x-www-form-urlencoded", a3.g.ea(a3.A, a3.u, a3.s, b1)) : (a3.u = "GET", a3.g.ea(a3.A, a3.u, null, b1)), I(1), (function(a, b, c, d, e, f) { a.info(function() { if (a.g) if (f) for(var h = "", n = f.split("&"), u = 0; u < n.length; u++){ var m = n[u].split("="); @@ -823,8 +798,7 @@ if (1 >= Cc(c.i) && c.ka) { try { c.ka(); - } catch (m) { - } + } catch (m) {} c.ka = void 0; } } else Q(c, 11); @@ -863,8 +837,7 @@ } } I(4); - } catch (m) { - } + } catch (m) {} } function Kc(a4, b2) { if (a4.forEach && "function" == typeof a4.forEach) a4.forEach(b2, void 0); @@ -890,8 +863,7 @@ } } function S(a, b) { - this.h = { - }, this.g = [], this.i = 0; + this.h = {}, this.g = [], this.i = 0; var c = arguments.length; if (1 < c) { if (c % 2) throw Error("Uneven number of arguments"); @@ -908,8 +880,7 @@ a.g.length = c; } if (a.i != a.g.length) { - var e = { - }; + var e = {}; for(c = b = 0; b < a.g.length;)T(e, d = a.g[b]) || (a.g[c++] = d, e[d] = 1), b++; a.g.length = c; } @@ -976,9 +947,7 @@ } else 400 == c4 && 0 < h.indexOf("Unknown SID") ? (this.o = 3, J(12)) : (this.o = 0, J(13)), P(this), rc(this); } } - } catch (r) { - } finally{ - } + } catch (r) {} finally{} }, k.fb = function() { if (this.g) { var a = O(this.g), b = this.g.ga(); @@ -1171,8 +1140,7 @@ } return ra(a.i); } - function kd() { - } + function kd() {} function ld() { this.g = new kd; } @@ -1190,8 +1158,7 @@ function od(a, b, c, d, e) { try { b.onload = null, b.onerror = null, b.onabort = null, b.ontimeout = null, e(d); - } catch (f) { - } + } catch (f) {} } function pd(a) { this.l = a.$b || null, this.j = a.ib || !1; @@ -1211,8 +1178,7 @@ return l.JSON.parse(a, void 0); }, t(pd, Yb), pd.prototype.g = function() { return new qd(this.l, this.j); - }, a2 = { - }, pd.prototype.i = function() { + }, a2 = {}, pd.prototype.i = function() { return a2; }, t(qd, C); var rd = 0; @@ -1355,8 +1321,7 @@ a.g = null, a.C = null, b || D(a, "ready"); try { c.onreadystatechange = d; - } catch (e) { - } + } catch (e) {} } } function Ad(a) { @@ -1426,8 +1391,7 @@ R(d, "SID", a.J), R(d, "RID", c), R(d, "AID", a.U), Kd(a, d), a.o && a.s && Gd(d, a.o, a.s), c = new M(a, a.h, c, a.C + 1), null === a.o && (c.H = a.s), b && (a.l = b.D.concat(a.l)), b = Pd(a, c, 1000), c.setTimeout(Math.round(0.5 * a.ra) + Math.round(0.5 * a.ra * Math.random())), Dc(a.i, c), ic(c, d, b); } function Kd(a, b) { - a.j && Kc({ - }, function(c, d) { + a.j && Kc({}, function(c, d) { R(b, d, c); }); } @@ -1552,8 +1516,7 @@ ib: !0 }) : a.qa)).L = a.H, b; } - function Sd() { - } + function Sd() {} function Td() { if (y && !(10 <= Number(Ua))) throw Error("Environmental error: no available transport."); } @@ -1677,8 +1640,7 @@ }, (k = Id.prototype).ma = 8, k.G = 1, k.hb = function(a) { try { this.h.info("Origin Trials invoked: " + a); - } catch (b) { - } + } catch (b) {} }, k.Ha = function(a) { if (this.m) if (this.m = null, 1 == this.G) { if (!a) { @@ -1722,27 +1684,19 @@ null != this.v && (this.v = null, Ac(this), Bc(this), J(19)); }, k.jb = function(a) { a ? (this.h.info("Successfully pinged google.com"), J(2)) : (this.h.info("Failed to ping google.com"), J(1)); - }, (k = Sd.prototype).xa = function() { - }, k.wa = function() { - }, k.va = function() { - }, k.ua = function() { - }, k.Oa = function() { - }, Td.prototype.g = function(a, b) { + }, (k = Sd.prototype).xa = function() {}, k.wa = function() {}, k.va = function() {}, k.ua = function() {}, k.Oa = function() {}, Td.prototype.g = function(a, b) { return new Y(a, b); }, t(Y, C), Y.prototype.m = function() { this.g.j = this.j, this.A && (this.g.H = !0); var a = this.g, b = this.l, c = this.h || void 0; - a.Wa && (a.h.info("Origin Trials enabled."), zb(q(a.hb, a, b))), J(0), a.W = b, a.aa = c || { - }, a.N = a.X, a.F = Ec(a, null, a.W), Hc(a); + a.Wa && (a.h.info("Origin Trials enabled."), zb(q(a.hb, a, b))), J(0), a.W = b, a.aa = c || {}, a.N = a.X, a.F = Ec(a, null, a.W), Hc(a); }, Y.prototype.close = function() { Ic(this.g); }, Y.prototype.u = function(a) { if ("string" == typeof a) { - var b = { - }; + var b = {}; b.__data__ = a, Md(this.g, b); - } else this.v ? ((b = { - }).__data__ = rb(a), Md(this.g, b)) : Md(this.g, a); + } else this.v ? ((b = {}).__data__ = rb(a), Md(this.g, b)) : Md(this.g, a); }, Y.prototype.M = function() { this.g.j = null, delete this.j, Ic(this.g), delete this.g, Y.Z.M.call(this); }, t(Ud, ac), t(Vd, bc), t(Z, Sd), Z.prototype.xa = function() { @@ -1810,8 +1764,7 @@ } exports.default = function(_param) { var sizerSvg, src2 = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyBoundary = _param.lazyBoundary, lazyBoundary = void 0 === _lazyBoundary ? "200px" : _lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete1 = _param.onLoadingComplete, _loader = _param.loader, loader = void 0 === _loader ? defaultImageLoader : _loader, _placeholder = _param.placeholder, placeholder1 = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -1912,8 +1865,7 @@ backgroundSize: objectFit || "cover", backgroundImage: "url(\"".concat(blurDataURL, "\")"), backgroundPosition: objectPosition || "0% 0%" - } : { - }; + } : {}; if ("fill" === layout) wrapperStyle.display = "block", wrapperStyle.position = "absolute", wrapperStyle.top = 0, wrapperStyle.left = 0, wrapperStyle.bottom = 0, wrapperStyle.right = 0; else if (void 0 !== widthInt && void 0 !== heightInt) { var quotient = heightInt / widthInt, paddingTop = isNaN(quotient) ? "100%" : "".concat(100 * quotient, "%"); @@ -1953,8 +1905,7 @@ alt: "", "aria-hidden": !0, src: "data:image/svg+xml;base64,".concat(_toBase64.toBase64(sizerSvg)) - }) : null) : null, _react.default.createElement("img", Object.assign({ - }, rest, imgAttributes, { + }) : null) : null, _react.default.createElement("img", Object.assign({}, rest, imgAttributes, { decoding: "async", "data-nimg": layout, className: className, @@ -1962,8 +1913,7 @@ setRef(img1), (function(img, src, layout, placeholder, onLoadingComplete) { if (img) { var handleLoad = function() { - img.src !== emptyDataURL && ("decode" in img ? img.decode() : Promise.resolve()).catch(function() { - }).then(function() { + img.src !== emptyDataURL && ("decode" in img ? img.decode() : Promise.resolve()).catch(function() {}).then(function() { if ("blur" === placeholder && (img.style.filter = "none", img.style.backgroundSize = "none", img.style.backgroundImage = "none"), loadedImageURLs.add(src), onLoadingComplete) { var naturalWidth = img.naturalWidth, naturalHeight = img.naturalHeight; onLoadingComplete({ @@ -1977,10 +1927,8 @@ } })(img1, srcString, layout, placeholder1, onLoadingComplete1); }, - style: _objectSpread({ - }, imgStyle, blurStyle) - })), _react.default.createElement("noscript", null, _react.default.createElement("img", Object.assign({ - }, rest, generateImgAttrs({ + style: _objectSpread({}, imgStyle, blurStyle) + })), _react.default.createElement("noscript", null, _react.default.createElement("img", Object.assign({}, rest, generateImgAttrs({ src: src2, unoptimized: unoptimized, layout: layout, @@ -2011,8 +1959,7 @@ } function _objectSpread(target) { for(var _arguments = arguments, i = 1; i < arguments.length; i++)!function(i) { - var source = null != _arguments[i] ? _arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != _arguments[i] ? _arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -2028,10 +1975,8 @@ return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -2425,8 +2370,7 @@ }), __webpack_require__(4444); class Component { constructor(name, instanceFactory, type){ - this.name = name, this.instanceFactory = instanceFactory, this.type = type, this.multipleInstances = !1, this.serviceProps = { - }, this.instantiationMode = "LAZY", this.onInstanceCreated = null; + this.name = name, this.instanceFactory = instanceFactory, this.type = type, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY", this.onInstanceCreated = null; } setInstantiationMode(mode) { return this.instantiationMode = mode, this; @@ -2452,8 +2396,7 @@ Yd: function() { return Logger; } - }), (LogLevel1 = LogLevel || (LogLevel = { - }))[LogLevel1.DEBUG = 0] = "DEBUG", LogLevel1[LogLevel1.VERBOSE = 1] = "VERBOSE", LogLevel1[LogLevel1.INFO = 2] = "INFO", LogLevel1[LogLevel1.WARN = 3] = "WARN", LogLevel1[LogLevel1.ERROR = 4] = "ERROR", LogLevel1[LogLevel1.SILENT = 5] = "SILENT"; + }), (LogLevel1 = LogLevel || (LogLevel = {}))[LogLevel1.DEBUG = 0] = "DEBUG", LogLevel1[LogLevel1.VERBOSE = 1] = "VERBOSE", LogLevel1[LogLevel1.INFO = 2] = "INFO", LogLevel1[LogLevel1.WARN = 3] = "WARN", LogLevel1[LogLevel1.ERROR = 4] = "ERROR", LogLevel1[LogLevel1.SILENT = 5] = "SILENT"; const levelStringToEnum = { debug: LogLevel.DEBUG, verbose: LogLevel.VERBOSE, diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-firestore/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-firestore/1/output.js index d036cb5e582..953e4c36e0f 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-firestore/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase-firestore/1/output.js @@ -106,22 +106,19 @@ } class W { constructor(t, e){ - this.user = e, this.type = "OAuth", this.authHeaders = { - }, this.authHeaders.Authorization = `Bearer ${t}`; + this.user = e, this.type = "OAuth", this.authHeaders = {}, this.authHeaders.Authorization = `Bearer ${t}`; } } class G { getToken() { return Promise.resolve(null); } - invalidateToken() { - } + invalidateToken() {} start(t, e) { t.enqueueRetryable(()=>e(D.UNAUTHENTICATED) ); } - shutdown() { - } + shutdown() {} } class H { constructor(t){ @@ -192,10 +189,8 @@ t.enqueueRetryable(()=>e(D.FIRST_PARTY) ); } - shutdown() { - } - invalidateToken() { - } + shutdown() {} + invalidateToken() {} } class X { constructor(t2, e){ @@ -517,8 +512,7 @@ } function Tt(t) { var e, n; - return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || { - }).__type__) || void 0 === n ? void 0 : n.stringValue); + return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue); } function Et(t) { const e = t.mapValue.fields.__previous_value__; @@ -607,9 +601,7 @@ return nt(t10.arrayValue.values || [], e8.arrayValue.values || [], Vt); case 10: return (function(t, e) { - const n = t.mapValue.fields || { - }, s = e.mapValue.fields || { - }; + const n = t.mapValue.fields || {}, s = e.mapValue.fields || {}; if (ot(n) !== ot(s)) return !1; for(const t11 in n)if (n.hasOwnProperty(t11) && (void 0 === s[t11] || !Vt(n[t11], s[t11]))) return !1; return !0; @@ -671,9 +663,7 @@ })(t13.arrayValue, e9.arrayValue); case 10: return (function(t, e) { - const n = t.fields || { - }, s = Object.keys(n), i = e.fields || { - }, r = Object.keys(i); + const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i); s.sort(), r.sort(); for(let t16 = 0; t16 < s.length && t16 < r.length; ++t16){ const e = et(s[t16], r[t16]); @@ -705,8 +695,7 @@ for (const s of t.values || [])n ? n = !1 : e += ",", e += xt(s); return e + "]"; })(t17.arrayValue) : "mapValue" in t17 ? (function(t) { - const e = Object.keys(t.fields || { - }).sort(); + const e = Object.keys(t.fields || {}).sort(); let n = "{", s = !0; for (const i of e)s ? s = !1 : n += ",", n += `${i}:${xt(t.fields[i])}`; return n + "}"; @@ -729,18 +718,15 @@ } function Bt(t) { if (t.geoPointValue) return { - geoPointValue: Object.assign({ - }, t.geoPointValue) + geoPointValue: Object.assign({}, t.geoPointValue) }; if (t.timestampValue && "object" == typeof t.timestampValue) return { - timestampValue: Object.assign({ - }, t.timestampValue) + timestampValue: Object.assign({}, t.timestampValue) }; if (t.mapValue) { const e = { mapValue: { - fields: { - } + fields: {} } }; return ct(t.mapValue.fields, (t, n)=>e.mapValue.fields[t] = Bt(n) @@ -755,8 +741,7 @@ for(let n = 0; n < (t.arrayValue.values || []).length; ++n)e.arrayValue.values[n] = Bt(t.arrayValue.values[n]); return e; } - return Object.assign({ - }, t); + return Object.assign({}, t); } class Ut { constructor(t){ @@ -764,31 +749,26 @@ } static empty() { return new Ut({ - mapValue: { - } + mapValue: {} }); } field(t) { if (t.isEmpty()) return this.value; { let e = this.value; - for(let n = 0; n < t.length - 1; ++n)if (!Lt(e = (e.mapValue.fields || { - })[t.get(n)])) return null; - return (e = (e.mapValue.fields || { - })[t.lastSegment()]) || null; + for(let n = 0; n < t.length - 1; ++n)if (!Lt(e = (e.mapValue.fields || {})[t.get(n)])) return null; + return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null; } } set(t, e) { this.getFieldsMap(t.popLast())[t.lastSegment()] = Bt(e); } setAll(t18) { - let e = ft.emptyPath(), n = { - }, s = []; + let e = ft.emptyPath(), n = {}, s = []; t18.forEach((t, i)=>{ if (!e.isImmediateParentOf(i)) { const t = this.getFieldsMap(e); - this.applyChanges(t, n, s), n = { - }, s = [], e = i.popLast(); + this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast(); } t ? n[i.lastSegment()] = Bt(t) : s.push(i.lastSegment()); }); @@ -805,15 +785,13 @@ getFieldsMap(t) { let e = this.value; e.mapValue.fields || (e.mapValue = { - fields: { - } + fields: {} }); for(let n = 0; n < t.length; ++n){ let s = e.mapValue.fields[t.get(n)]; Lt(s) && s.mapValue.fields || (s = { mapValue: { - fields: { - } + fields: {} } }, e.mapValue.fields[t.get(n)] = s), e = s; } @@ -1440,8 +1418,7 @@ return L(); } } - (ln = hn || (hn = { - }))[ln.OK = 0] = "OK", ln[ln.CANCELLED = 1] = "CANCELLED", ln[ln.UNKNOWN = 2] = "UNKNOWN", ln[ln.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", ln[ln.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ln[ln.NOT_FOUND = 5] = "NOT_FOUND", ln[ln.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ln[ln.PERMISSION_DENIED = 7] = "PERMISSION_DENIED", ln[ln.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", ln[ln.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED", ln[ln.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", ln[ln.ABORTED = 10] = "ABORTED", ln[ln.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", ln[ln.UNIMPLEMENTED = 12] = "UNIMPLEMENTED", ln[ln.INTERNAL = 13] = "INTERNAL", ln[ln.UNAVAILABLE = 14] = "UNAVAILABLE", ln[ln.DATA_LOSS = 15] = "DATA_LOSS"; + (ln = hn || (hn = {}))[ln.OK = 0] = "OK", ln[ln.CANCELLED = 1] = "CANCELLED", ln[ln.UNKNOWN = 2] = "UNKNOWN", ln[ln.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", ln[ln.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ln[ln.NOT_FOUND = 5] = "NOT_FOUND", ln[ln.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ln[ln.PERMISSION_DENIED = 7] = "PERMISSION_DENIED", ln[ln.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", ln[ln.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED", ln[ln.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", ln[ln.ABORTED = 10] = "ABORTED", ln[ln.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", ln[ln.UNIMPLEMENTED = 12] = "UNIMPLEMENTED", ln[ln.INTERNAL = 13] = "INTERNAL", ln[ln.UNAVAILABLE = 14] = "UNAVAILABLE", ln[ln.DATA_LOSS = 15] = "DATA_LOSS"; class wn { constructor(t, e){ this.comparator = t, this.root = e || mn.EMPTY; @@ -2349,8 +2326,7 @@ "batchId" ]; class Ss { - constructor(){ - } + constructor(){} static prefixForUser(t) { return [ t @@ -2618,8 +2594,7 @@ this.db = await this.Dt(t70); const e = Qs.open(this.db, t70, i ? "readonly" : "readwrite", n), r = s(e).catch((t)=>(e.abort(t), js.reject(t)) ).toPromise(); - return r.catch(()=>{ - }), await e.It, r; + return r.catch(()=>{}), await e.It, r; } catch (t) { const e = "FirebaseError" !== t.name && r < 3; if ($("SimpleDb", "Transaction failed with error:", t.message, "Retrying:", e), this.close(), !e) return Promise.reject(t); @@ -2699,14 +2674,12 @@ } Kt(t, e) { let n; - e ? n = t : (n = { - }, e = t); + e ? n = t : (n = {}, e = t); const s = this.cursor(n); return this.Bt(s, e); } jt(t71) { - const e39 = this.cursor({ - }); + const e39 = this.cursor({}); return new js((n, s6)=>{ e39.onerror = (t)=>{ const e = Zs(t.target.error); @@ -2865,8 +2838,7 @@ Ri.DEFAULT_COLLECTION_PERCENTILE = 10, Ri.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1000, Ri.DEFAULT = new Ri(41943040, Ri.DEFAULT_COLLECTION_PERCENTILE, Ri.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), Ri.DISABLED = new Ri(-1, 0, 0); class vi { constructor(t, e, n, s){ - this.userId = t, this.N = e, this.Ht = n, this.referenceDelegate = s, this.Jt = { - }; + this.userId = t, this.N = e, this.Ht = n, this.referenceDelegate = s, this.Jt = {}; } static Yt(t, e, n, s) { B("" !== t.uid); @@ -2892,8 +2864,7 @@ } addMutationBatch(t78, e44, n17, s7) { const i3 = Di(t78), r = Si(t78); - return r.add({ - }).next((o)=>{ + return r.add({}).next((o)=>{ B("number" == typeof o); const c = new ni(o, e44, n17, s7), a = function(t, e45, n) { const s = n.baseMutations.map((e)=>ss(t.Wt, e) @@ -3110,8 +3081,7 @@ } class ji { constructor(t, e){ - this.mapKeyFn = t, this.equalsFn = e, this.inner = { - }; + this.mapKeyFn = t, this.equalsFn = e, this.inner = {}; } get(t) { const e = this.mapKeyFn(t), n = this.inner[e]; @@ -3188,8 +3158,7 @@ apply(t) { return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t); } - assertNotApplied() { - } + assertNotApplied() {} } class rr { constructor(t, e, n){ @@ -3525,8 +3494,7 @@ this.ds = n; }); } - te(t) { - } + te(t) {} containsKey(t, e) { const n = new Pr(e, 0), s = this.ds.firstAfterOrEqual(n); return js.resolve(e.isEqual(s && s.key)); @@ -3612,8 +3580,7 @@ } class Cr { constructor(t130, e73){ - this.bs = { - }, this.Le = new X(0), this.Be = !1, this.Be = !0, this.referenceDelegate = t130(this), this.ze = new class { + this.bs = {}, this.Le = new X(0), this.Be = !1, this.Be = !0, this.referenceDelegate = t130(this), this.ze = new class { constructor(t131){ this.persistence = t131, this.Es = new ji((t)=>Wt(t) , zt), this.lastRemoteSnapshotVersion = rt.min(), this.highestTargetId = 0, this.Is = 0, this.As = new br, this.targetCount = 0, this.Rs = Ni.se(); @@ -3687,8 +3654,7 @@ constructor(){ this.Gt = new class { constructor(){ - this.index = { - }; + this.index = {}; } add(t) { const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new gn(ht.comparator), i = !s.has(n); @@ -3795,10 +3761,8 @@ get started() { return this.Be; } - setDatabaseDeletedListener() { - } - setNetworkEnabled() { - } + setDatabaseDeletedListener() {} + setNetworkEnabled() {} getIndexManager() { return this.Ht; } @@ -3986,13 +3950,10 @@ } class Kr { constructor(){ - this.yi = new Ur, this.pi = { - }, this.onlineStateHandler = null, this.sequenceNumberHandler = null; - } - addPendingMutation(t) { - } - updateMutationState(t, e, n) { + this.yi = new Ur, this.pi = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null; } + addPendingMutation(t) {} + updateMutationState(t, e, n) {} addLocalQueryTarget(t) { return this.yi.Fs(t), this.pi[t] || "not-current"; } @@ -4017,22 +3978,15 @@ start() { return this.yi = new Ur, Promise.resolve(); } - handleUserChange(t, e, n) { - } - setOnlineState(t) { - } - shutdown() { - } - writeSequenceNumber(t) { - } - notifyBundleLoaded() { - } + handleUserChange(t, e, n) {} + setOnlineState(t) {} + shutdown() {} + writeSequenceNumber(t) {} + notifyBundleLoaded() {} } class jr { - Ti(t) { - } - shutdown() { - } + Ti(t) {} + shutdown() {} } class Qr { constructor(){ @@ -4102,8 +4056,7 @@ Li(t154, e90, n, s) { const i = this.Bi(t154, e90); $("RestConnection", "Sending: ", i, n); - const r = { - }; + const r = {}; return this.Ui(r, s), this.qi(t154, i, r, n).then((t)=>($("RestConnection", "Received: ", t), t) , (e)=>{ throw F("RestConnection", `${t154} failed with error: `, e, "url: ", i, "request:", n), e; @@ -4170,8 +4123,7 @@ "/channel" ], s13 = (0, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.UE)(), i9 = (0, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FJ)(), r = { httpSessionIdParam: "gsessionid", - initMessageHeaders: { - }, + initMessageHeaders: {}, messageUrlParams: { database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}` }, @@ -4183,8 +4135,7 @@ forceLongPolling: this.forceLongPolling, detectBufferingProxy: this.autoDetectLongPolling }; - this.useFetchStreams && (r.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.zI({ - })), this.Ui(r.initMessageHeaders, e86), (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.uI)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.b$)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.d)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.w1)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.Mn)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.ru)() || (r.httpHeadersOverwriteParam = "$httpHeaders"); + this.useFetchStreams && (r.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.zI({})), this.Ui(r.initMessageHeaders, e86), (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.uI)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.b$)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.d)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.w1)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.Mn)() || (0, _firebase_util__WEBPACK_IMPORTED_MODULE_3__.ru)() || (r.httpHeadersOverwriteParam = "$httpHeaders"); const o = n26.join(""); $("Connection", "Creating WebChannel: " + o, r); const c = s13.createWebChannel(o, r); @@ -4304,8 +4255,7 @@ async close(t, e) { this.gr(), this.yr(), this.ar.cancel(), this.ir++, 4 !== t ? this.ar.reset() : e && e.code === K.RESOURCE_EXHAUSTED ? (O(e.toString()), O("Using maximum backoff delay to prevent overloading the backend."), this.ar.Yi()) : e && e.code === K.UNAUTHENTICATED && 3 !== this.state && this.credentialsProvider.invalidateToken(), null !== this.stream && (this.pr(), this.stream.close(), this.stream = null), this.state = t, await this.listener.Ci(e); } - pr() { - } + pr() {} auth() { this.state = 1; const t155 = this.Tr(this.ir), e91 = this.ir; @@ -4407,8 +4357,7 @@ return this.listener.Rr(e93, n27); } br(t161) { - const e95 = { - }; + const e95 = {}; e95.database = Yn(this.N), e95.addTarget = (function(t163, e97) { let n29; const s14 = e97.target; @@ -4422,8 +4371,7 @@ query: (function(t164, e98) { var t162, e96; const n = { - structuredQuery: { - } + structuredQuery: {} }, s = e98.path; null !== e98.collectionGroup ? (n.parent = Hn(t164, s), n.structuredQuery.from = [ { @@ -4520,8 +4468,7 @@ n28 && (e95.labels = n28), this.mr(e95); } Pr(t) { - const e = { - }; + const e = {}; e.database = Yn(this.N), e.removeTarget = t, this.mr(e); } } @@ -4555,8 +4502,7 @@ return B(!t171.writeResults || 0 === t171.writeResults.length), this.vr = !0, this.listener.Cr(); } Nr() { - const t = { - }; + const t = {}; t.database = Yn(this.N), this.mr(t); } Sr(t172) { @@ -4594,8 +4540,7 @@ } class io { constructor(t175, e103, n, s, i){ - this.localStore = t175, this.datastore = e103, this.asyncQueue = n, this.remoteSyncer = { - }, this.jr = [], this.Qr = new Map, this.Wr = new Set, this.Gr = [], this.zr = i, this.zr.Ti((t176)=>{ + this.localStore = t175, this.datastore = e103, this.asyncQueue = n, this.remoteSyncer = {}, this.jr = [], this.Qr = new Map, this.Wr = new Set, this.Gr = [], this.zr = i, this.zr.Ti((t176)=>{ n.enqueueAndForget(async ()=>{ wo(this) && ($("RemoteStore", "Restarting streams for network reachability change."), await async function(t) { const e = q(t); @@ -4820,8 +4765,7 @@ } class xo { constructor(t, e, n, s, i){ - this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, this.deferred = new Q, this.then = this.deferred.promise.then.bind(this.deferred.promise), this.deferred.promise.catch((t)=>{ - }); + this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, this.deferred = new Q, this.then = this.deferred.promise.then.bind(this.deferred.promise), this.deferred.promise.catch((t)=>{}); } static createAndSchedule(t, e, n, s, i) { const r = Date.now() + n, o = new xo(t, e, r, s, i); @@ -5024,8 +4968,7 @@ } class Qo { constructor(t, e, n){ - this.query = t, this.oo = e, this.co = !1, this.ao = null, this.onlineState = "Unknown", this.options = n || { - }; + this.query = t, this.oo = e, this.co = !1, this.ao = null, this.onlineState = "Unknown", this.options = n || {}; } ro(t) { if (!this.options.includeMetadataChanges) { @@ -5156,8 +5099,7 @@ } Vo(t194) { t194 && (t194.addedDocuments.forEach((t)=>this.po = this.po.add(t) - ), t194.modifiedDocuments.forEach((t)=>{ - }), t194.removedDocuments.forEach((t)=>this.po = this.po.delete(t) + ), t194.modifiedDocuments.forEach((t)=>{}), t194.removedDocuments.forEach((t)=>this.po = this.po.delete(t) ), this.current = t194.current); } So() { @@ -5194,10 +5136,8 @@ } class ec { constructor(t196, e, n, s, i, r){ - this.localStore = t196, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.$o = { - }, this.Oo = new ji((t)=>Re(t) - , Ae), this.Fo = new Map, this.Mo = new Set, this.Lo = new wn(Pt.comparator), this.Bo = new Map, this.Uo = new br, this.qo = { - }, this.Ko = new Map, this.jo = Ni.ie(), this.onlineState = "Unknown", this.Qo = void 0; + this.localStore = t196, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.$o = {}, this.Oo = new ji((t)=>Re(t) + , Ae), this.Fo = new Map, this.Mo = new Set, this.Lo = new wn(Pt.comparator), this.Bo = new Map, this.Uo = new br, this.qo = {}, this.Ko = new Map, this.jo = Ni.ie(), this.onlineState = "Unknown", this.Qo = void 0; } get isPrimaryClient() { return !0 === this.Qo; @@ -5646,8 +5586,7 @@ } class Ta { constructor(t229, e){ - this._credentials = e, this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new pa({ - }), this._settingsFrozen = !1, t229 instanceof ha ? this._databaseId = t229 : (this._app = t229, this._databaseId = (function(t) { + this._credentials = e, this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new pa({}), this._settingsFrozen = !1, t229 instanceof ha ? this._databaseId = t229 : (this._app = t229, this._databaseId = (function(t) { if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new j(K.INVALID_ARGUMENT, "\"projectId\" not provided in firebase.initializeApp."); @@ -5789,8 +5728,7 @@ } } enqueue(t) { - if (this.bc(), this.gc) return new Promise(()=>{ - }); + if (this.bc(), this.gc) return new Promise(()=>{}); const e = new Q; return this.Pc(()=>this.gc && this.Ic ? Promise.resolve() : (t().then(e.resolve, e.reject), e.promise) ).then(()=>e.promise @@ -5833,8 +5771,7 @@ bc() { this.Tc && L(); } - verifyOperationInProgress() { - } + verifyOperationInProgress() {} async Sc() { let t; do await (t = this._c); @@ -5960,8 +5897,7 @@ return this.settings.kc; } $c(t) { - return new ru(Object.assign(Object.assign({ - }, this.settings), t), this.databaseId, this.N, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask); + return new ru(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.N, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask); } Oc(t) { var e; @@ -6089,8 +6025,7 @@ })(t239, e136); } function pu(t241, e) { - const n = { - }; + const n = {}; return at(t241) ? e.path && e.path.length > 0 && e.fieldMask.push(e.path) : ct(t241, (t, s)=>{ const i = yu(s, e.Oc(t)); null != i && (n[t] = i); @@ -6177,8 +6112,7 @@ exists() { return super.exists(); } - data(t = { - }) { + data(t = {}) { if (this._document) { if (this._converter) { const e = new Nu(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, null); @@ -6187,8 +6121,7 @@ return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps); } } - get(t, e = { - }) { + get(t, e = {}) { if (this._document) { const n = this._document.data.field(Su("DocumentSnapshot.get", t)); if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps); @@ -6196,8 +6129,7 @@ } } class Nu extends Cu { - data(t = { - }) { + data(t = {}) { return super.data(t); } } @@ -6221,8 +6153,7 @@ t.call(e, new Nu(this._firestore, this._userDataWriter, n.key, n, new Du(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter)); }); } - docChanges(t244 = { - }) { + docChanges(t244 = {}) { const e139 = !!t244.includeMetadataChanges; if (e139 && this._snapshot.excludesMetadataChanges) throw new j(K.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot()."); return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e139 || (this._cachedChanges = (function(t245, e140) { @@ -6296,8 +6227,7 @@ } } convertObject(t, e) { - const n = { - }; + const n = {}; return ct(t.fields, (t, s)=>{ n[t] = this.convertValue(s, e); }), n; @@ -6349,8 +6279,7 @@ const e141 = ga(t248.firestore, ka), n51 = ((t247 = e141)._firestoreClient || Ma(t247), t247._firestoreClient.verifyNotTerminated(), t247._firestoreClient), s24 = new ah(e141); return (function(t) { if (me(t) && 0 === t.explicitOrderBy.length) throw new j(K.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause"); - })(t248._query), (function(t249, e142, n52 = { - }) { + })(t248._query), (function(t249, e142, n52 = {}) { const s25 = new Q; return t249.asyncQueue.enqueueAndForget(async ()=>(function(t250, e, n53, s, i) { const r = new Lc({ diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/2/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/2/output.js index 1d0a156540e..e38d9f60ff0 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/2/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/2/output.js @@ -2,8 +2,7 @@ export function treeSubTree(tree, pathObj) { let path = pathObj instanceof Path ? pathObj : new Path(pathObj), child = tree, next = pathGetFront(path); for(; null !== next;){ const childNode = safeGet(child.node.children, next) || { - children: { - }, + children: {}, childCount: 0 }; child = new Tree(next, child, childNode), next = pathGetFront(path = pathPopFront(path)); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/dist/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/dist/1/output.js index 9f929ce6784..98ffcd3ca3a 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/dist/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/firebase/dist/1/output.js @@ -68,16 +68,13 @@ var _a, util = require("@firebase/util"), tslib = require("tslib"), component = options: this.options }; }, FirebaseAppImpl1; -}(), ERRORS = ((_a = { -})["no-app"] = "No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()", _a["invalid-app-argument"] = "firebase.{$appName}() takes either no argument or a Firebase App instance.", _a), ERROR_FACTORY = new util.ErrorFactory("app-compat", "Firebase", ERRORS); +}(), ERRORS = ((_a = {})["no-app"] = "No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()", _a["invalid-app-argument"] = "firebase.{$appName}() takes either no argument or a Firebase App instance.", _a), ERROR_FACTORY = new util.ErrorFactory("app-compat", "Firebase", ERRORS); function createFirebaseNamespace() { var namespace1 = function(firebaseAppImpl) { - var apps = { - }, namespace = { + var apps = {}, namespace = { __esModule: !0, initializeApp: function(options, rawConfig) { - void 0 === rawConfig && (rawConfig = { - }); + void 0 === rawConfig && (rawConfig = {}); var app = modularAPIs__namespace.initializeApp(options, rawConfig); if (util.contains(apps, app.name)) return apps[app.name]; var appCompat = new firebaseAppImpl(app, namespace); @@ -129,8 +126,7 @@ function createFirebaseNamespace() { } }), app1.App = firebaseAppImpl, namespace; }(FirebaseAppImpl); - return namespace1.INTERNAL = tslib.__assign(tslib.__assign({ - }, namespace1.INTERNAL), { + return namespace1.INTERNAL = tslib.__assign(tslib.__assign({}, namespace1.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace, extendNamespace: function(props) { util.deepExtend(namespace1, props); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/issue-2604/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/issue-2604/1/output.js index 11871f29c08..fce247ca033 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/issue-2604/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/issue-2604/1/output.js @@ -4,8 +4,7 @@ push({ function za() { try { return eval(a); - } catch (b) { - } + } catch (b) {} } function Rb(a) { return p() ? JSON : za(); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/moment/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/moment/1/output.js index 1e4217bdd91..d33f653433c 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/moment/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/moment/1/output.js @@ -112,8 +112,7 @@ return fn.apply(this, arguments); }, fn); } - var deprecations = { - }; + var deprecations = {}; function deprecateSimple(name, msg) { null != hooks.deprecationHandler && hooks.deprecationHandler(name, msg), deprecations[name] || (warn(msg), deprecations[name] = !0); } @@ -121,12 +120,9 @@ return "undefined" != typeof Function && input instanceof Function || "[object Function]" === Object.prototype.toString.call(input); } function mergeConfigs(parentConfig, childConfig) { - var prop, res = extend({ - }, parentConfig); - for(prop in childConfig)hasOwnProp(childConfig, prop) && (isObject(parentConfig[prop]) && isObject(childConfig[prop]) ? (res[prop] = { - }, extend(res[prop], parentConfig[prop]), extend(res[prop], childConfig[prop])) : null != childConfig[prop] ? res[prop] = childConfig[prop] : delete res[prop]); - for(prop in parentConfig)hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) && (res[prop] = extend({ - }, res[prop])); + var prop, res = extend({}, parentConfig); + for(prop in childConfig)hasOwnProp(childConfig, prop) && (isObject(parentConfig[prop]) && isObject(childConfig[prop]) ? (res[prop] = {}, extend(res[prop], parentConfig[prop]), extend(res[prop], childConfig[prop])) : null != childConfig[prop] ? res[prop] = childConfig[prop] : delete res[prop]); + for(prop in parentConfig)hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) && (res[prop] = extend({}, res[prop])); return res; } function Locale(config) { @@ -141,9 +137,7 @@ for(i in obj)hasOwnProp(obj, i) && res.push(i); return res; }; - var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = { - }, formatTokenFunctions = { - }; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; function addFormatToken(token, padded, ordinal, callback) { var func = callback; "string" == typeof callback && (func = function() { @@ -176,8 +170,7 @@ for(localFormattingTokens.lastIndex = 0; i >= 0 && localFormattingTokens.test(format);)format = format.replace(localFormattingTokens, replaceLongDateFormatTokens), localFormattingTokens.lastIndex = 0, i -= 1; return format; } - var aliases = { - }; + var aliases = {}; function addUnitAlias(unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit; @@ -186,13 +179,11 @@ return "string" == typeof units ? aliases[units] || aliases[units.toLowerCase()] : void 0; } function normalizeObjectUnits(inputObject) { - var normalizedProp, prop, normalizedInput = { - }; + var normalizedProp, prop, normalizedInput = {}; for(prop in inputObject)hasOwnProp(inputObject, prop) && (normalizedProp = normalizeUnits(prop)) && (normalizedInput[normalizedProp] = inputObject[prop]); return normalizedInput; } - var priorities = { - }; + var priorities = {}; function addUnitPriority(unit, priority) { priorities[unit] = priority; } @@ -234,10 +225,8 @@ function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); } - regexes = { - }; - var tokens1 = { - }; + regexes = {}; + var tokens1 = {}; function addParseToken(token, callback) { var i, func = callback; for("string" == typeof token && (token = [ @@ -248,8 +237,7 @@ } function addWeekParseToken(token2, callback) { addParseToken(token2, function(input, array, config, token) { - config._w = config._w || { - }, callback(input, config._w, config, token); + config._w = config._w || {}, callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { @@ -559,9 +547,7 @@ weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: /[ap]\.?m?\.?/i - }, locales = { - }, localeFamilies = { - }; + }, locales = {}, localeFamilies = {}; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for(i = 0; i < minl; i += 1)if (arr1[i] !== arr2[i]) return i; @@ -833,8 +819,7 @@ getParsingFlags(config).invalidFormat = !0, config._d = new Date(NaN); return; } - for(i = 0; i < config._f.length; i++)currentScore = 0, validFormatFound = !1, tempConfig = copyConfig({ - }, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), isValid(tempConfig) && (validFormatFound = !0), currentScore += getParsingFlags(tempConfig).charsLeftOver, currentScore += 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, bestFormatIsValid ? currentScore < scoreToBeat && (scoreToBeat = currentScore, bestMoment = tempConfig) : (null == scoreToBeat || currentScore < scoreToBeat || validFormatFound) && (scoreToBeat = currentScore, bestMoment = tempConfig, validFormatFound && (bestFormatIsValid = !0)); + for(i = 0; i < config._f.length; i++)currentScore = 0, validFormatFound = !1, tempConfig = copyConfig({}, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), isValid(tempConfig) && (validFormatFound = !0), currentScore += getParsingFlags(tempConfig).charsLeftOver, currentScore += 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, bestFormatIsValid ? currentScore < scoreToBeat && (scoreToBeat = currentScore, bestMoment = tempConfig) : (null == scoreToBeat || currentScore < scoreToBeat || validFormatFound) && (scoreToBeat = currentScore, bestMoment = tempConfig, validFormatFound && (bestFormatIsValid = !0)); extend(config, bestMoment || tempConfig); })(config3) : format ? configFromStringAndFormat(config3) : configFromInput(config3), isValid(config3) || (config3._d = null), config3); } @@ -867,8 +852,7 @@ })(config4) : isNumber(input) ? config4._d = new Date(input) : hooks.createFromInputFallback(config4); } function createLocalOrUTC(input, format, locale, strict, isUTC) { - var config, res, c = { - }; + var config, res, c = {}; return (!0 === format || !1 === format) && (strict = format, format = void 0), (!0 === locale || !1 === locale) && (strict = locale, locale = void 0), (isObject(input) && isObjectEmpty(input) || isArray(input) && 0 === input.length) && (input = void 0), c._isAMomentObject = !0, c._useUTC = c._isUTC = isUTC, c._l = locale, c._i = input, c._f = format, c._strict = strict, config = c, (res = new Moment(checkOverflow(prepareConfig(config))))._nextDay && (res.add(1, "d"), res._nextDay = void 0), res; } function createLocal(input, format, locale, strict) { @@ -876,9 +860,7 @@ } hooks.createFromInputFallback = deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function(config) { config._d = new Date(config._i + (config._useUTC ? " UTC" : "")); - }), hooks.ISO_8601 = function() { - }, hooks.RFC_2822 = function() { - }; + }), hooks.ISO_8601 = function() {}, hooks.RFC_2822 = function() {}; var prototypeMin = deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function() { var other = createLocal.apply(null, arguments); return this.isValid() && other.isValid() ? other < this ? this : other : createInvalid(); @@ -913,8 +895,7 @@ parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]]) && (unitHasDecimal = !0); } return !0; - })(normalizedInput), this._milliseconds = +milliseconds + 1000 * seconds + 60000 * minutes + 3600000 * hours, this._days = +days + 7 * weeks, this._months = +months + 3 * quarters + 12 * years, this._data = { - }, this._locale = getLocale(), this._bubble(); + })(normalizedInput), this._milliseconds = +milliseconds + 1000 * seconds + 60000 * minutes + 3600000 * hours, this._days = +days + 7 * weeks, this._months = +months + 3 * quarters + 12 * years, this._data = {}, this._locale = getLocale(), this._bubble(); } function isDuration(obj) { return obj instanceof Duration; @@ -953,8 +934,7 @@ function isUtc() { return !!this.isValid() && this._isUTC && 0 === this._offset; } - hooks.updateOffset = function() { - }; + hooks.updateOffset = function() {}; var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var sign, ret, diffRes, duration = input, match = null; @@ -962,8 +942,7 @@ ms: input._milliseconds, d: input._days, M: input._months - } : isNumber(input) || !isNaN(+input) ? (duration = { - }, key ? duration[key] = +input : duration.milliseconds = +input) : (match = aspNetRegex.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, duration = { + } : isNumber(input) || !isNaN(+input) ? (duration = {}, key ? duration[key] = +input : duration.milliseconds = +input) : (match = aspNetRegex.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, duration = { y: 0, d: toInt(match[2]) * sign, h: toInt(match[3]) * sign, @@ -978,17 +957,14 @@ h: parseIso(match[6], sign), m: parseIso(match[7], sign), s: parseIso(match[8], sign) - }) : null == duration ? duration = { - } : "object" == typeof duration && ("from" in duration || "to" in duration) && (diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)), (duration = { - }).ms = diffRes.milliseconds, duration.M = diffRes.months), ret = new Duration(duration), isDuration(input) && hasOwnProp(input, "_locale") && (ret._locale = input._locale), isDuration(input) && hasOwnProp(input, "_isValid") && (ret._isValid = input._isValid), ret; + }) : null == duration ? duration = {} : "object" == typeof duration && ("from" in duration || "to" in duration) && (diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)), (duration = {}).ms = diffRes.milliseconds, duration.M = diffRes.months), ret = new Duration(duration), isDuration(input) && hasOwnProp(input, "_locale") && (ret._locale = input._locale), isDuration(input) && hasOwnProp(input, "_isValid") && (ret._isValid = input._isValid), ret; } function parseIso(inp, sign) { var res = inp && parseFloat(inp.replace(",", ".")); return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { - var res = { - }; + var res = {}; return res.months = other.month() - base.month() + (other.year() - base.year()) * 12, base.clone().add(res.months, "M").isAfter(other) && --res.months, res.milliseconds = +other - +base.clone().add(res.months, "M"), res; } function momentsDifference(base, other) { @@ -1368,8 +1344,7 @@ }, proto.isValid = function() { return isValid(this); }, proto.lang = lang, proto.locale = locale1, proto.localeData = localeData, proto.max = prototypeMax, proto.min = prototypeMin, proto.parsingFlags = function() { - return extend({ - }, getParsingFlags(this)); + return extend({}, getParsingFlags(this)); }, proto.set = function(units1, value) { if ("object" == typeof units1) { var i, prioritized = function(unitsObj) { @@ -1569,8 +1544,7 @@ return null != input ? ("string" != typeof input && (input = -input), this.utcOffset(input, keepLocalTime), this) : -this.utcOffset(); }), proto.isDSTShifted = deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function() { if (!isUndefined(this._isDSTShifted)) return this._isDSTShifted; - var other, c = { - }; + var other, c = {}; return copyConfig(c, this), (c = prepareConfig(c))._a ? (other = c._isUTC ? createUTC(c._a) : createLocal(c._a), this._isDSTShifted = this.isValid() && (function(array1, array2, dontConvert) { var i, len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0; for(i = 0; i < len; i++)(dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) && diffs++; @@ -1840,8 +1814,7 @@ }, proto$2.months = months1, proto$2.years = years1, proto$2.humanize = function(argWithSuffix, argThresholds) { if (!this.isValid()) return this.localeData().invalidDate(); var locale, output, posNegDuration, withoutSuffix, thresholds1, locale3, duration, seconds, minutes, hours, days, months, weeks, years, a, withSuffix = !1, th = thresholds; - return "object" == typeof argWithSuffix && (argThresholds = argWithSuffix, argWithSuffix = !1), "boolean" == typeof argWithSuffix && (withSuffix = argWithSuffix), "object" == typeof argThresholds && (th = Object.assign({ - }, thresholds, argThresholds), null != argThresholds.s && null == argThresholds.ss && (th.ss = argThresholds.s - 1)), locale = this.localeData(), posNegDuration = this, withoutSuffix = !withSuffix, thresholds1 = th, locale3 = locale, seconds = round((duration = createDuration(posNegDuration).abs()).as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), weeks = round(duration.as("w")), years = round(duration.as("y")), a = seconds <= thresholds1.ss && [ + return "object" == typeof argWithSuffix && (argThresholds = argWithSuffix, argWithSuffix = !1), "boolean" == typeof argWithSuffix && (withSuffix = argWithSuffix), "object" == typeof argThresholds && (th = Object.assign({}, thresholds, argThresholds), null != argThresholds.s && null == argThresholds.ss && (th.ss = argThresholds.s - 1)), locale = this.localeData(), posNegDuration = this, withoutSuffix = !withSuffix, thresholds1 = th, locale3 = locale, seconds = round((duration = createDuration(posNegDuration).abs()).as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), weeks = round(duration.as("w")), years = round(duration.as("y")), a = seconds <= thresholds1.ss && [ "s", seconds ] || seconds < thresholds1.s && [ diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/quagga2/1.4.2/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/quagga2/1.4.2/1/output.js index 2f2a8fb5188..da1df3d8e45 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/quagga2/1.4.2/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/quagga2/1.4.2/1/output.js @@ -2,15 +2,13 @@ "object" == typeof exports && "object" == typeof module ? module.exports = factory() : "function" == typeof define && define.amd ? define([], factory) : "object" == typeof exports ? exports.Quagga = factory() : root.Quagga = factory(); }(window, function() { return (function(modules) { - var installedModules = { - }; + var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { i: moduleId, l: !1, - exports: { - } + exports: {} }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.l = !0, module.exports; } @@ -190,8 +188,7 @@ 0, 0 ]) - }, pointMap = { - }; + }, pointMap = {}; function _add(pointToAdd) { pointMap[pointToAdd.id] = pointToAdd, points.push(pointToAdd); } @@ -383,8 +380,7 @@ unit: (value.indexOf("%") === value.length - 1, "%") }, calculated = _dimensionsConverters[key](parsed, context); return result[key] = calculated, result; - }, { - }); + }, {}); return { sx: parsedArea.left, sy: parsedArea.top, @@ -1119,8 +1115,7 @@ }, function(module1, exports) { module1.exports = function(module) { - return module.webpackPolyfill || (module.deprecate = function() { - }, module.paths = [], module.children || (module.children = []), Object.defineProperty(module, "loaded", { + return module.webpackPolyfill || (module.deprecate = function() {}, module.paths = [], module.children || (module.children = []), Object.defineProperty(module, "loaded", { enumerable: !0, get: function() { return module.l; @@ -1207,11 +1202,8 @@ var getNative = __webpack_require__(35), defineProperty = function() { try { var func = getNative(Object, "defineProperty"); - return func({ - }, "", { - }), func; - } catch (e) { - } + return func({}, "", {}), func; + } catch (e) {} }(); module.exports = defineProperty; }, @@ -1462,8 +1454,7 @@ }, function(module, exports, __webpack_require__) { var basePick = __webpack_require__(229), pick = __webpack_require__(243)(function(object, paths) { - return null == object ? { - } : basePick(object, paths); + return null == object ? {} : basePick(object, paths); }); module.exports = pick; }, @@ -1726,8 +1717,7 @@ try { value[symToStringTag] = void 0; var unmasked = !0; - } catch (e) { - } + } catch (e) {} var result = nativeObjectToString.call(value); return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result; }; @@ -1754,12 +1744,10 @@ if (null != func) { try { return funcToString.call(func); - } catch (e) { - } + } catch (e) {} try { return func + ""; - } catch (e1) { - } + } catch (e1) {} } return ""; }; @@ -1793,8 +1781,7 @@ function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(28); module.exports = function() { - this.__data__ = nativeCreate ? nativeCreate(null) : { - }, this.size = 0; + this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0; }; }, function(module, exports) { @@ -1929,17 +1916,14 @@ function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(130), getPrototype = __webpack_require__(50), isPrototype = __webpack_require__(51); module.exports = function(object) { - return "function" != typeof object.constructor || isPrototype(object) ? { - } : baseCreate(getPrototype(object)); + return "function" != typeof object.constructor || isPrototype(object) ? {} : baseCreate(getPrototype(object)); }; }, function(module, exports, __webpack_require__) { var isObject = __webpack_require__(14), objectCreate = Object.create, baseCreate = function() { - function object() { - } + function object() {} return function(proto) { - if (!isObject(proto)) return { - }; + if (!isObject(proto)) return {}; if (objectCreate) return objectCreate(proto); object.prototype = proto; var result = new object(); @@ -1983,8 +1967,7 @@ }; }, function(module, exports, __webpack_require__) { - var baseGetTag = __webpack_require__(22), isLength = __webpack_require__(40), isObjectLike = __webpack_require__(18), typedArrayTags = { - }; + var baseGetTag = __webpack_require__(22), isLength = __webpack_require__(40), isObjectLike = __webpack_require__(18), typedArrayTags = {}; typedArrayTags["[object Float32Array]"] = typedArrayTags["[object Float64Array]"] = typedArrayTags["[object Int8Array]"] = typedArrayTags["[object Int16Array]"] = typedArrayTags["[object Int32Array]"] = typedArrayTags["[object Uint8Array]"] = typedArrayTags["[object Uint8ClampedArray]"] = typedArrayTags["[object Uint16Array]"] = typedArrayTags["[object Uint32Array]"] = !0, typedArrayTags["[object Arguments]"] = typedArrayTags["[object Array]"] = typedArrayTags["[object ArrayBuffer]"] = typedArrayTags["[object Boolean]"] = typedArrayTags["[object DataView]"] = typedArrayTags["[object Date]"] = typedArrayTags["[object Error]"] = typedArrayTags["[object Function]"] = typedArrayTags["[object Map]"] = typedArrayTags["[object Number]"] = typedArrayTags["[object Object]"] = typedArrayTags["[object RegExp]"] = typedArrayTags["[object Set]"] = typedArrayTags["[object String]"] = typedArrayTags["[object WeakMap]"] = !1, module.exports = function(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; }; @@ -2003,8 +1986,7 @@ var types = freeModule && freeModule.require && freeModule.require("util").types; if (types) return types; return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e) { - } + } catch (e) {} }(); module.exports = nodeUtil; }).call(this, __webpack_require__(38)(module4)); @@ -2019,8 +2001,7 @@ var assignValue = __webpack_require__(55), baseAssignValue = __webpack_require__(37); module.exports = function(source, props, object, customizer) { var isNew = !object; - object || (object = { - }); + object || (object = {}); for(var index = -1, length = props.length; ++index < length;){ var key = props[index], newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; void 0 === newValue && (newValue = source[key]), isNew ? baseAssignValue(object, key, newValue) : assignValue(object, key, newValue); @@ -2557,8 +2538,7 @@ function(module, exports1, __webpack_require__) { var runtime = function(exports) { "use strict"; - var undefined, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : { - }, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + var undefined, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = makeInvokeMethod(innerFn, self, context), generator; @@ -2577,16 +2557,11 @@ } } exports.wrap = wrap; - var GenStateSuspendedStart = "suspendedStart", GenStateExecuting = "executing", GenStateCompleted = "completed", ContinueSentinel = { - }; - function Generator() { - } - function GeneratorFunction() { - } - function GeneratorFunctionPrototype() { - } - var IteratorPrototype = { - }; + var GenStateSuspendedStart = "suspendedStart", GenStateExecuting = "executing", GenStateCompleted = "completed", ContinueSentinel = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function() { return this; }; @@ -2687,8 +2662,7 @@ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { - var record = entry.completion || { - }; + var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { @@ -2794,8 +2768,7 @@ } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); - var record = finallyEntry ? finallyEntry.completion : { - }; + var record = finallyEntry ? finallyEntry.completion : {}; return (record.type = type, record.arg = arg, finallyEntry) ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function(record, afterLoc) { @@ -2848,8 +2821,7 @@ function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(231), baseSet = __webpack_require__(239), castPath = __webpack_require__(32); module.exports = function(object, paths, predicate) { - for(var index = -1, length = paths.length, result = { - }; ++index < length;){ + for(var index = -1, length = paths.length, result = {}; ++index < length;){ var path = paths[index], value = baseGet(object, path); predicate(value, path) && baseSet(result, castPath(path, object), value); } @@ -2937,8 +2909,7 @@ if ("__proto__" === key || "constructor" === key || "prototype" === key) return object; if (index != lastIndex) { var objValue = nested[key]; - void 0 === (newValue = customizer ? customizer(objValue, key, nested) : void 0) && (newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : { - }); + void 0 === (newValue = customizer ? customizer(objValue, key, nested) : void 0) && (newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}); } assignValue(nested, key, newValue), nested = nested[key]; } @@ -3029,8 +3000,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -3125,8 +3095,7 @@ }), __webpack_require__.d(__webpack_exports__, "ResultCollector", function() { return result_collector; }); - var BarcodeDirection, streamRef, reader_namespaceObject = { - }; + var BarcodeDirection, streamRef, reader_namespaceObject = {}; __webpack_require__.r(reader_namespaceObject), __webpack_require__.d(reader_namespaceObject, "BarcodeReader", function() { return barcode_reader; }), __webpack_require__.d(reader_namespaceObject, "TwoOfFiveReader", function() { @@ -3160,8 +3129,7 @@ }); var helpers_typeof = __webpack_require__(19), typeof_default = __webpack_require__.n(helpers_typeof), merge = __webpack_require__(16), merge_default = __webpack_require__.n(merge); __webpack_require__(152); - var image_wrapper = __webpack_require__(11), Bresenham = { - }, Slope = { + var image_wrapper = __webpack_require__(11), Bresenham = {}, Slope = { DIR: { UP: 1, DOWN: -1 @@ -3212,14 +3180,10 @@ } }; var BarcodeDirection1, bresenham = Bresenham, image_debug = __webpack_require__(9), classCallCheck = __webpack_require__(3), classCallCheck_default = __webpack_require__.n(classCallCheck), createClass = __webpack_require__(4), createClass_default = __webpack_require__.n(createClass), assertThisInitialized = __webpack_require__(1), assertThisInitialized_default = __webpack_require__.n(assertThisInitialized), inherits = __webpack_require__(6), inherits_default = __webpack_require__.n(inherits), possibleConstructorReturn = __webpack_require__(5), possibleConstructorReturn_default = __webpack_require__.n(possibleConstructorReturn), getPrototypeOf = __webpack_require__(2), getPrototypeOf_default = __webpack_require__.n(getPrototypeOf), defineProperty = __webpack_require__(0), defineProperty_default = __webpack_require__.n(defineProperty), array_helper = __webpack_require__(10); - (BarcodeDirection1 = BarcodeDirection || (BarcodeDirection = { - }))[BarcodeDirection1.Forward = 1] = "Forward", BarcodeDirection1[BarcodeDirection1.Reverse = -1] = "Reverse"; + (BarcodeDirection1 = BarcodeDirection || (BarcodeDirection = {}))[BarcodeDirection1.Forward = 1] = "Forward", BarcodeDirection1[BarcodeDirection1.Reverse = -1] = "Reverse"; var barcode_reader_BarcodeReader = function() { function BarcodeReader(config, supplements) { - return classCallCheck_default()(this, BarcodeReader), defineProperty_default()(this, "_row", []), defineProperty_default()(this, "config", { - }), defineProperty_default()(this, "supplements", []), defineProperty_default()(this, "SINGLE_CODE_ERROR", 0), defineProperty_default()(this, "FORMAT", "unknown"), defineProperty_default()(this, "CONFIG_KEYS", { - }), this._row = [], this.config = config || { - }, supplements && (this.supplements = supplements), this; + return classCallCheck_default()(this, BarcodeReader), defineProperty_default()(this, "_row", []), defineProperty_default()(this, "config", {}), defineProperty_default()(this, "supplements", []), defineProperty_default()(this, "SINGLE_CODE_ERROR", 0), defineProperty_default()(this, "FORMAT", "unknown"), defineProperty_default()(this, "CONFIG_KEYS", {}), this._row = [], this.config = config || {}, supplements && (this.supplements = supplements), this; } return createClass_default()(BarcodeReader, [ { @@ -3315,8 +3279,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -4407,8 +4370,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -4571,8 +4533,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -4675,8 +4636,7 @@ { key: "_decodePayload", value: function(inCode, result, decodedCodes) { - for(var outCode = _objectSpread({ - }, inCode), codeFrequency = 0, i = 0; i < 6; i++){ + for(var outCode = _objectSpread({}, inCode), codeFrequency = 0, i = 0; i < 6; i++){ if (!(outCode = this._decodeCode(outCode.end))) return null; outCode.code >= 10 ? (outCode.code -= 10, codeFrequency |= 1 << 5 - i) : codeFrequency |= 0 << 5 - i, result.push(outCode.code), decodedCodes.push(outCode); } @@ -4740,8 +4700,7 @@ { key: "decode", value: function(row, start) { - var result = new Array(), decodedCodes = new Array(), resultInfo = { - }, startInfo = this._findStart(); + var result = new Array(), decodedCodes = new Array(), resultInfo = {}, startInfo = this._findStart(); if (!startInfo) return null; var code = { start: startInfo.start, @@ -4770,8 +4729,7 @@ end: code.end, startInfo: startInfo, decodedCodes: decodedCodes - }, resultInfo), { - }, { + }, resultInfo), {}, { format: this.FORMAT }); } @@ -4832,8 +4790,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -4968,8 +4925,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5063,8 +5019,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5258,8 +5213,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5298,8 +5252,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5347,8 +5300,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5413,8 +5365,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5487,8 +5438,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5548,8 +5498,7 @@ value: function(inCode, result, decodedCodes) { for(var outCode = function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? upc_e_reader_ownKeys(Object(source), !0).forEach(function(key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : upc_e_reader_ownKeys(Object(source)).forEach(function(key) { @@ -5557,8 +5506,7 @@ }); } return target; - }({ - }, inCode), codeFrequency = 0, i2 = 0; i2 < 6; i2++){ + }({}, inCode), codeFrequency = 0, i2 = 0; i2 < 6; i2++){ if (!(outCode = this._decodeCode(outCode.end))) return null; outCode.code >= 10 && (outCode.code = outCode.code - 10, codeFrequency |= 1 << 5 - i2), result.push(outCode.code), decodedCodes.push(outCode); } @@ -5634,8 +5582,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -5984,8 +5931,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -6185,8 +6131,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -6364,8 +6309,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -6450,8 +6394,7 @@ }, _barcodeReaders = []; function initReaders() { config.readers.forEach(function(readerConfig) { - var reader, configuration = { - }, supplements = []; + var reader, configuration = {}, supplements = []; "object" === typeof_default()(readerConfig) ? (reader = readerConfig.format, configuration = readerConfig.config) : "string" == typeof readerConfig && (reader = readerConfig), console.log("Before registering reader: ", reader), configuration.supplements && (supplements = configuration.supplements.map(function(supplement) { return new READERS[supplement](); })); @@ -6559,8 +6502,7 @@ var i, result, barcodes = [], multiple = config.multiple; for(i = 0; i < boxes.length; i++){ var box = boxes[i]; - if ((result = _decodeFromBoundingBox(box) || { - }).box = box, multiple) barcodes.push(result); + if ((result = _decodeFromBoundingBox(box) || {}).box = box, multiple) barcodes.push(result); else if (result.codeResult) return result; } if (multiple) return { @@ -6583,8 +6525,7 @@ }; } }, events1 = function() { - var events = { - }; + var events = {}; function getEvent(eventName) { return events[eventName] || (events[eventName] = { subscribers: [] @@ -6634,8 +6575,7 @@ _event && callback ? _event.subscribers = _event.subscribers.filter(function(subscriber) { return subscriber.callback !== callback; }) : _event.subscribers = []; - } else events = { - }; + } else events = {}; } }; }(), asyncToGenerator = __webpack_require__(20), asyncToGenerator_default = __webpack_require__.n(asyncToGenerator), regenerator = __webpack_require__(12), regenerator_default = __webpack_require__.n(regenerator), pick = __webpack_require__(85), pick_default = __webpack_require__.n(pick), wrapNativeSuper = __webpack_require__(86), wrapNativeSuper_default = __webpack_require__.n(wrapNativeSuper), Exception_Exception = function(_Error) { @@ -6646,8 +6586,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })), !0; + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0; } catch (e) { return !1; } @@ -6720,8 +6659,7 @@ }))).apply(this, arguments); } function pickConstraints() { - var videoConstraints, normalized, videoConstraints1 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { - }, video = (videoConstraints = videoConstraints1, normalized = pick_default()(videoConstraints, [ + var videoConstraints, normalized, videoConstraints1 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, video = (videoConstraints = videoConstraints1, normalized = pick_default()(videoConstraints, [ "width", "height", "facingMode", @@ -6795,8 +6733,7 @@ var _config$capacity, canvas = document.createElement("canvas"), ctx = canvas.getContext("2d"), results = [], capacity = null !== (_config$capacity = config.capacity) && void 0 !== _config$capacity ? _config$capacity : 20, capture = !0 === config.capture; return { addResult: function(data, imageSize, codeResult) { - var codeResult1, codeResult2, list, codeResult3, filter, result = { - }; + var codeResult1, codeResult2, list, codeResult3, filter, result = {}; codeResult1 = codeResult, !!capacity && codeResult1 && (codeResult2 = codeResult1, !((list = config.blacklist) && list.some(function(item) { return Object.keys(item).every(function(key) { return item[key] === codeResult2[key]; @@ -6899,8 +6836,7 @@ return !(firstIFDOffset < 8) && readTags(file, tiffOffset, tiffOffset + firstIFDOffset, exifTags, bigEnd); } function readTags(file, tiffStart, dirStart, strings, bigEnd) { - for(var entries = file.getUint16(dirStart, !bigEnd), tags = { - }, i = 0; i < entries; i++){ + for(var entries = file.getUint16(dirStart, !bigEnd), tags = {}, i = 0; i < entries; i++){ var entryOffset = dirStart + 12 * i + 2, tag = strings[file.getUint16(entryOffset, !bigEnd)]; tag && (tags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd)); } @@ -6918,8 +6854,7 @@ for(var outstr = "", n = start; n < start + length; n++)outstr += String.fromCharCode(buffer.getUint8(n)); return outstr; } - var ImageLoader = { - }; + var ImageLoader = {}; function addOnloadHandler(img, htmlImagesArray) { img.onload = function() { htmlImagesArray.loaded(this); @@ -6959,8 +6894,7 @@ return ExifTags[tag] === selectedTag; })[0]; return exifTag && (result[exifTag] = selectedTag), result; - }, { - }), offset = 2; + }, {}), offset = 2; if (255 !== dataView.getUint8(0) || 216 !== dataView.getUint8(1)) return !1; for(; offset < length;){ if (255 !== dataView.getUint8(offset)) return !1; @@ -6984,8 +6918,7 @@ var _calculatedWidth, _calculatedHeight, _config = null, _eventNames = [ "canrecord", "ended" - ], _eventHandlers = { - }, _topRight = { + ], _eventHandlers = {}, _topRight = { x: 0, y: 0, type: "Point" @@ -7078,8 +7011,7 @@ var calculatedWidth, calculatedHeight, _config = null, width = 0, height = 0, frameIdx = 0, paused = !0, loaded = !1, imgArray = null, size = 0, baseUrl = null, _ended = !1, _eventNames = [ "canrecord", "ended" - ], _eventHandlers = { - }, _topRight = { + ], _eventHandlers = {}, _topRight = { x: 0, y: 0, type: "Point" @@ -7133,8 +7065,7 @@ ended: function() { return _ended; }, - setAttribute: function() { - }, + setAttribute: function() {}, getConfig: function() { return _config; }, @@ -7176,11 +7107,9 @@ }; return inputStream; } - }, input_stream_browser = inputStreamFactory, cv_utils = __webpack_require__(8), TO_RADIANS = Math.PI / 180, FrameGrabber = { - }; + }, input_stream_browser = inputStreamFactory, cv_utils = __webpack_require__(8), TO_RADIANS = Math.PI / 180, FrameGrabber = {}; FrameGrabber.create = function(inputStream, canvas2) { - var _canvas, _that = { - }, _streamConfig = inputStream.getConfig(), _videoSize = Object(cv_utils.h)(inputStream.getRealWidth(), inputStream.getRealHeight()), _canvasSize = inputStream.getCanvasSize(), _size = Object(cv_utils.h)(inputStream.getWidth(), inputStream.getHeight()), topRight = inputStream.getTopRight(), _sx = topRight.x, _sy = topRight.y, _ctx = null, _data = null; + var _canvas, _that = {}, _streamConfig = inputStream.getConfig(), _videoSize = Object(cv_utils.h)(inputStream.getRealWidth(), inputStream.getRealHeight()), _canvasSize = inputStream.getCanvasSize(), _size = Object(cv_utils.h)(inputStream.getWidth(), inputStream.getHeight()), topRight = inputStream.getTopRight(), _sx = topRight.x, _sy = topRight.y, _ctx = null, _data = null; return (_canvas = canvas2 || document.createElement("canvas")).width = _canvasSize.x, _canvas.height = _canvasSize.y, _ctx = _canvas.getContext("2d"), _data = new Uint8Array(_size.x * _size.y), console.log("FrameGrabber", JSON.stringify({ size: _size, topRight: topRight, @@ -7221,8 +7150,7 @@ } function qworker_objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? qworker_ownKeys(Object(source), !0).forEach(function(key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : qworker_ownKeys(Object(source)).forEach(function(key) { @@ -7289,12 +7217,8 @@ y: inputStream.getHeight() }, imageData: workerThread.imageData, - config: qworker_objectSpread(qworker_objectSpread({ - }, config1 = config), { - }, { - inputStream: qworker_objectSpread(qworker_objectSpread({ - }, config1.inputStream), { - }, { + config: qworker_objectSpread(qworker_objectSpread({}, config1 = config), {}, { + inputStream: qworker_objectSpread(qworker_objectSpread({}, config1.inputStream), {}, { target: null }) }) @@ -7526,8 +7450,7 @@ value: function() { var boxes = this.getBoundingBoxes(); if (boxes) { - var decodeResult = this.context.decoder.decodeFromBoundingBoxes(boxes) || { - }; + var decodeResult = this.context.decoder.decodeFromBoundingBoxes(boxes) || {}; decodeResult.boxes = boxes, this.publishResult(decodeResult, null === (_this$context$inputIm3 = this.context.inputImageWrapper) || void 0 === _this$context$inputIm3 ? void 0 : _this$context$inputIm3.data); } else { var _this$context$inputIm3, _this$context$inputIm4, imageResult = this.context.decoder.decodeFromImage(this.context.inputImageWrapper); @@ -7612,8 +7535,7 @@ cb = function(err) { err ? reject(err) : resolve(); }; - })), quaggaInstance.context.config = merge_default()({ - }, config_config, config), quaggaInstance.context.config.numOfWorkers > 0 && (quaggaInstance.context.config.numOfWorkers = 0), imageWrapper ? (quaggaInstance.context.onUIThread = !1, quaggaInstance.initializeData(imageWrapper), cb && cb()) : quaggaInstance.initInputStream(cb), promise; + })), quaggaInstance.context.config = merge_default()({}, config_config, config), quaggaInstance.context.config.numOfWorkers > 0 && (quaggaInstance.context.config.numOfWorkers = 0), imageWrapper ? (quaggaInstance.context.onUIThread = !1, quaggaInstance.initializeData(imageWrapper), cb && cb()) : quaggaInstance.initInputStream(cb), promise; }, start: function() { return instance.start(); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autosuggest/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autosuggest/1/output.js index e0f3ab81a0f..b5eb731efaa 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autosuggest/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autosuggest/1/output.js @@ -9,8 +9,7 @@ var _react = function(obj) { }; var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - }, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + var newObj = {}, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for(var key in obj)if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key]; @@ -102,8 +101,7 @@ var ItemsList = function(_Component) { if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } @@ -147,8 +145,7 @@ var ItemsList = function(_Component) { itemIndex: itemIndex }) : itemProps, allItemProps = function(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -159,10 +156,8 @@ var ItemsList = function(_Component) { }({ id: getItemId(sectionIndex, itemIndex), "aria-selected": isHighlighted - }, theme(itemKey, "item", 0 === itemIndex && "itemFirst", isHighlighted && "itemHighlighted"), { - }, itemPropsObj); - return isHighlighted && (allItemProps.ref = _this2.storeHighlightedItemReference), _react.default.createElement(_Item.default, _extends({ - }, allItemProps, { + }, theme(itemKey, "item", 0 === itemIndex && "itemFirst", isHighlighted && "itemHighlighted"), {}, itemPropsObj); + return isHighlighted && (allItemProps.ref = _this2.storeHighlightedItemReference), _react.default.createElement(_Item.default, _extends({}, allItemProps, { sectionIndex: sectionIndex, isHighlighted: isHighlighted, itemIndex: itemIndex, diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autowhatever/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autowhatever/1/output.js index 7673dadf156..9b3f88bf4d2 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autowhatever/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-autowhatever/1/output.js @@ -24,8 +24,7 @@ function _getPrototypeOf(o1) { } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -86,8 +85,7 @@ var ItemsList = function(Component1) { id: getItemId(sectionIndex, itemIndex), "aria-selected": isHighlighted }, theme(itemKey, "item", 0 === itemIndex && "itemFirst", isHighlighted && "itemHighlighted"), itemPropsObj); - return isHighlighted && (allItemProps.ref = _this.storeHighlightedItemReference), _jsx(Item, _objectSpread({ - }, allItemProps, { + return isHighlighted && (allItemProps.ref = _this.storeHighlightedItemReference), _jsx(Item, _objectSpread({}, allItemProps, { sectionIndex: sectionIndex, isHighlighted: isHighlighted, itemIndex: itemIndex, diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-countup/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-countup/1/output.js index 97274455251..94f877c12d4 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-countup/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-countup/1/output.js @@ -50,8 +50,7 @@ })), (t < 0 ? "-" : "") + s1.options.prefix + a + n + s1.options.suffix; }, this.easeOutExpo = function(t, i, a, s) { return a * (1 - Math.pow(2, -10 * t / s)) * 1024 / 1023 + i; - }, this.options = __assign(__assign({ - }, this.defaults), a1), this.formattingFn = this.options.formattingFn ? this.options.formattingFn : this.formatNumber, this.easingFn = this.options.easingFn ? this.options.easingFn : this.easeOutExpo, this.startVal = this.validateValue(this.options.startVal), this.frameVal = this.startVal, this.endVal = this.validateValue(i1), this.options.decimalPlaces = Math.max(this.options.decimalPlaces), this.resetDuration(), this.options.separator = String(this.options.separator), this.useEasing = this.options.useEasing, "" === this.options.separator && (this.options.useGrouping = !1), this.el = "string" == typeof t2 ? document.getElementById(t2) : t2, this.el ? this.printValue(this.startVal) : this.error = "[CountUp] target is null or undefined"; + }, this.options = __assign(__assign({}, this.defaults), a1), this.formattingFn = this.options.formattingFn ? this.options.formattingFn : this.formatNumber, this.easingFn = this.options.easingFn ? this.options.easingFn : this.easeOutExpo, this.startVal = this.validateValue(this.options.startVal), this.frameVal = this.startVal, this.endVal = this.validateValue(i1), this.options.decimalPlaces = Math.max(this.options.decimalPlaces), this.resetDuration(), this.options.separator = String(this.options.separator), this.useEasing = this.options.useEasing, "" === this.options.separator && (this.options.useGrouping = !1), this.el = "string" == typeof t2 ? document.getElementById(t2) : t2, this.el ? this.printValue(this.startVal) : this.error = "[CountUp] target is null or undefined"; } return t1.prototype.determineDirectionAndSmartEasing = function() { var t = this.finalEndVal ? this.finalEndVal : this.endVal; @@ -98,8 +97,7 @@ } exports.default = function(_param) { var sizerSvg, src2 = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyBoundary = _param.lazyBoundary, lazyBoundary = void 0 === _lazyBoundary ? "200px" : _lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete1 = _param.onLoadingComplete, _loader = _param.loader, loader = void 0 === _loader ? defaultImageLoader : _loader, _placeholder = _param.placeholder, placeholder1 = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = function(source, excluded) { - if (null == source) return { - }; + if (null == source) return {}; var key, i, target = _objectWithoutPropertiesLoose(source, excluded); if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -200,8 +198,7 @@ backgroundSize: objectFit || "cover", backgroundImage: "url(\"".concat(blurDataURL, "\")"), backgroundPosition: objectPosition || "0% 0%" - } : { - }; + } : {}; if ("fill" === layout) wrapperStyle.display = "block", wrapperStyle.position = "absolute", wrapperStyle.top = 0, wrapperStyle.left = 0, wrapperStyle.bottom = 0, wrapperStyle.right = 0; else if (void 0 !== widthInt && void 0 !== heightInt) { var quotient = heightInt / widthInt, paddingTop = isNaN(quotient) ? "100%" : "".concat(100 * quotient, "%"); @@ -241,8 +238,7 @@ alt: "", "aria-hidden": !0, src: "data:image/svg+xml;base64,".concat(_toBase64.toBase64(sizerSvg)) - }) : null) : null, _react.default.createElement("img", Object.assign({ - }, rest, imgAttributes, { + }) : null) : null, _react.default.createElement("img", Object.assign({}, rest, imgAttributes, { decoding: "async", "data-nimg": layout, className: className, @@ -250,8 +246,7 @@ setRef(img1), (function(img, src, layout, placeholder, onLoadingComplete) { if (img) { var handleLoad = function() { - img.src !== emptyDataURL && ("decode" in img ? img.decode() : Promise.resolve()).catch(function() { - }).then(function() { + img.src !== emptyDataURL && ("decode" in img ? img.decode() : Promise.resolve()).catch(function() {}).then(function() { if ("blur" === placeholder && (img.style.filter = "none", img.style.backgroundSize = "none", img.style.backgroundImage = "none"), loadedImageURLs.add(src), onLoadingComplete) { var naturalWidth = img.naturalWidth, naturalHeight = img.naturalHeight; onLoadingComplete({ @@ -265,10 +260,8 @@ } })(img1, srcString, layout, placeholder1, onLoadingComplete1); }, - style: _objectSpread({ - }, imgStyle, blurStyle) - })), _react.default.createElement("noscript", null, _react.default.createElement("img", Object.assign({ - }, rest, generateImgAttrs({ + style: _objectSpread({}, imgStyle, blurStyle) + })), _react.default.createElement("noscript", null, _react.default.createElement("img", Object.assign({}, rest, generateImgAttrs({ src: src2, unoptimized: unoptimized, layout: layout, @@ -299,8 +292,7 @@ } function _objectSpread(target) { for(var _arguments = arguments, i = 1; i < arguments.length; i++)!function(i) { - var source = null != _arguments[i] ? _arguments[i] : { - }, ownKeys = Object.keys(source); + var source = null != _arguments[i] ? _arguments[i] : {}, ownKeys = Object.keys(source); "function" == typeof Object.getOwnPropertySymbols && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; }))), ownKeys.forEach(function(key) { @@ -316,10 +308,8 @@ return target; } function _objectWithoutPropertiesLoose(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; } @@ -616,8 +606,7 @@ } function _objectSpread2(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -644,13 +633,10 @@ }).apply(this, arguments); } function _objectWithoutProperties(source1, excluded1) { - if (null == source1) return { - }; + if (null == source1) return {}; var key2, i2, target1 = function(source, excluded) { - if (null == source) return { - }; - var key, i, target = { - }, sourceKeys = Object.keys(source); + if (null == source) return {}; + var key, i, target = {}, sourceKeys = Object.keys(source); for(i = 0; i < sourceKeys.length; i++)key = sourceKeys[i], excluded.indexOf(key) >= 0 || (target[key] = source[key]); return target; }(source1, excluded1); @@ -706,8 +692,7 @@ enableReinitialize: !0 }, useCountUp = function(props) { var _useMemo = React.useMemo(function() { - return _objectSpread2(_objectSpread2({ - }, DEFAULTS), props); + return _objectSpread2(_objectSpread2({}, DEFAULTS), props); }, [ props ]), ref = _useMemo.ref, startOnMount = _useMemo.startOnMount, enableReinitialize = _useMemo.enableReinitialize, delay = _useMemo.delay, onEnd = _useMemo.onEnd, onStart = _useMemo.onStart, onPauseResume = _useMemo.onPauseResume, onReset = _useMemo.onReset, onUpdate = _useMemo.onUpdate, instanceProps = _objectWithoutProperties(_useMemo, _excluded$1), countUpRef = React.useRef(), timerRef = React.useRef(), isInitializedRef = React.useRef(!1), createInstance = useEventCallback(function() { @@ -792,9 +777,7 @@ "style" ]; exports.ZP = function(props) { - var className = props.className, redraw = props.redraw, containerProps = props.containerProps, children = props.children, style = props.style, useCountUpProps = _objectWithoutProperties(props, _excluded), containerRef = React__default.default.useRef(null), isInitializedRef = React__default.default.useRef(!1), _useCountUp = useCountUp(_objectSpread2(_objectSpread2({ - }, useCountUpProps), { - }, { + var className = props.className, redraw = props.redraw, containerProps = props.containerProps, children = props.children, style = props.style, useCountUpProps = _objectWithoutProperties(props, _excluded), containerRef = React__default.default.useRef(null), isInitializedRef = React__default.default.useRef(!1), _useCountUp = useCountUp(_objectSpread2(_objectSpread2({}, useCountUpProps), {}, { ref: containerRef, startOnMount: "function" != typeof children || 0 === props.delay, enableReinitialize: !1 diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/002/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/002/output.js index 6fe59c34480..fe5f43f1a81 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/002/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/002/output.js @@ -19,8 +19,7 @@ const isMultiIndexContext = (widget)=>hasMultipleIndices({ const isFirstWidgetIndex = isIndexWidget(firstWidget), isSecondWidgetIndex = isIndexWidget(secondWidget); return isFirstWidgetIndex && !isSecondWidgetIndex ? -1 : !isFirstWidgetIndex && isSecondWidgetIndex ? 1 : 0; }; -export default function createInstantSearchManager({ indexName , initialState ={ -} , searchClient , resultsState , stalledSearchDelay , }) { +export default function createInstantSearchManager({ indexName , initialState ={} , searchClient , resultsState , stalledSearchDelay , }) { var results1; const helper = algoliasearchHelper(searchClient, indexName, { ...HIGHLIGHT_TAGS @@ -89,8 +88,7 @@ export default function createInstantSearchManager({ indexName , initialState ={ ...acc, [result._internalIndexId]: new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults) }) - , { - }) : new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results1.state), results1.rawResults) : null, + , {}) : new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results1.state), results1.rawResults) : null, error: null, searching: !1, isSearchStalled: !0, @@ -120,8 +118,7 @@ export default function createInstantSearchManager({ indexName , initialState ={ ...indices, [indexId]: widgets.concat(widget) }; - }, { - }), derivedParameters = Object.keys(derivedIndices).map((indexId)=>({ + }, {}), derivedParameters = Object.keys(derivedIndices).map((indexId)=>({ parameters: derivedIndices[indexId].reduce((res, widget)=>widget.getSearchParameters(res) , sharedParameters), indexId @@ -149,10 +146,8 @@ export default function createInstantSearchManager({ indexName , initialState ={ function handleSearchSuccess({ indexId }) { return (event)=>{ const state = store.getState(), isDerivedHelpersEmpty = !helper.derivedHelpers.length; - let results = state.results ? state.results : { - }; - results = !isDerivedHelpersEmpty && results.getFacetByName ? { - } : results, results = isDerivedHelpersEmpty ? event.results : { + let results = state.results ? state.results : {}; + results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results, results = isDerivedHelpersEmpty ? event.results : { ...results, [indexId]: event.results }; @@ -311,18 +306,15 @@ export default function createInstantSearchManager({ indexName , initialState ={ }; function hydrateMetadata(resultsState) { return resultsState ? resultsState.metadata.map((datum)=>({ - value: ()=>({ - }) + value: ()=>({}) , ...datum, items: datum.items && datum.items.map((item)=>({ - value: ()=>({ - }) + value: ()=>({}) , ...item, items: item.items && item.items.map((nestedItem)=>({ - value: ()=>({ - }) + value: ()=>({}) , ...nestedItem }) diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/003/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/003/output.js index f95b3def27d..86fcafb9d76 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/003/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/003/output.js @@ -19,8 +19,7 @@ const isMultiIndexContext = (widget)=>hasMultipleIndices({ const isFirstWidgetIndex = isIndexWidget(firstWidget), isSecondWidgetIndex = isIndexWidget(secondWidget); return isFirstWidgetIndex && !isSecondWidgetIndex ? -1 : !isFirstWidgetIndex && isSecondWidgetIndex ? 1 : 0; }; -export default function createInstantSearchManager({ indexName , initialState ={ -} , searchClient , resultsState , stalledSearchDelay , }) { +export default function createInstantSearchManager({ indexName , initialState ={} , searchClient , resultsState , stalledSearchDelay , }) { var results1; const helper = algoliasearchHelper(searchClient, indexName, { ...HIGHLIGHT_TAGS @@ -108,8 +107,7 @@ export default function createInstantSearchManager({ indexName , initialState ={ ...acc, [result._internalIndexId]: new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults) }) - , { - }) : new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results1.state), results1.rawResults) : null, + , {}) : new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results1.state), results1.rawResults) : null, error: null, searching: !1, isSearchStalled: !0, @@ -139,8 +137,7 @@ export default function createInstantSearchManager({ indexName , initialState ={ ...indices, [indexId]: widgets.concat(widget) }; - }, { - }), derivedParameters = Object.keys(derivedIndices).map((indexId)=>({ + }, {}), derivedParameters = Object.keys(derivedIndices).map((indexId)=>({ parameters: derivedIndices[indexId].reduce((res, widget)=>widget.getSearchParameters(res) , sharedParameters), indexId @@ -168,10 +165,8 @@ export default function createInstantSearchManager({ indexName , initialState ={ function handleSearchSuccess({ indexId }) { return (event)=>{ const state = store.getState(), isDerivedHelpersEmpty = !helper.derivedHelpers.length; - let results = state.results ? state.results : { - }; - results = !isDerivedHelpersEmpty && results.getFacetByName ? { - } : results, results = isDerivedHelpersEmpty ? event.results : { + let results = state.results ? state.results : {}; + results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results, results = isDerivedHelpersEmpty ? event.results : { ...results, [indexId]: event.results }; @@ -330,18 +325,15 @@ export default function createInstantSearchManager({ indexName , initialState ={ }; function hydrateMetadata(resultsState) { return resultsState ? resultsState.metadata.map((datum)=>({ - value: ()=>({ - }) + value: ()=>({}) , ...datum, items: datum.items && datum.items.map((item)=>({ - value: ()=>({ - }) + value: ()=>({}) , ...item, items: item.items && item.items.map((nestedItem)=>({ - value: ()=>({ - }) + value: ()=>({}) , ...nestedItem }) diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/004/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/004/output.js index d491c76fb48..c5206cb6fd9 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/004/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react-instancesearch/004/output.js @@ -51,11 +51,8 @@ export default function createInstantSearchManager(param1) { return targetedIndexNotEqualMainIndex || subIndexNotEqualMainIndex; }).sort(sortIndexWidgetsFirst).reduce(function(indices, widget) { var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId, widgets = indices[indexId] || []; - return swcHelpers.objectSpread({ - }, indices, swcHelpers.defineProperty({ - }, indexId, widgets.concat(widget))); - }, { - }), derivedParameters = Object.keys(derivedIndices).map(function(indexId) { + return swcHelpers.objectSpread({}, indices, swcHelpers.defineProperty({}, indexId, widgets.concat(widget))); + }, {}), derivedParameters = Object.keys(derivedIndices).map(function(indexId) { return { parameters: derivedIndices[indexId].reduce(function(res, widget) { return widget.getSearchParameters(res); @@ -84,19 +81,14 @@ export default function createInstantSearchManager(param1) { }, handleSearchSuccess = function(param) { var indexId = param.indexId; return function(event) { - var state = store.getState(), isDerivedHelpersEmpty = !helper.derivedHelpers.length, results = state.results ? state.results : { - }; - results = !isDerivedHelpersEmpty && results.getFacetByName ? { - } : results, results = isDerivedHelpersEmpty ? event.results : swcHelpers.objectSpread({ - }, results, swcHelpers.defineProperty({ - }, indexId, event.results)); + var state = store.getState(), isDerivedHelpersEmpty = !helper.derivedHelpers.length, results = state.results ? state.results : {}; + results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results, results = isDerivedHelpersEmpty ? event.results : swcHelpers.objectSpread({}, results, swcHelpers.defineProperty({}, indexId, event.results)); var currentState = store.getState(), nextIsSearchStalled = currentState.isSearchStalled; helper.hasPendingRequests() || (clearTimeout(stalledSearchTimer), stalledSearchTimer = null, nextIsSearchStalled = !1), currentState.resultsFacetValues; var partialState = swcHelpers.objectWithoutProperties(currentState, [ "resultsFacetValues" ]); - store.setState(swcHelpers.objectSpread({ - }, partialState, { + store.setState(swcHelpers.objectSpread({}, partialState, { results: results, isSearchStalled: nextIsSearchStalled, searching: !1, @@ -109,8 +101,7 @@ export default function createInstantSearchManager(param1) { var partialState = swcHelpers.objectWithoutProperties(currentState, [ "resultsFacetValues" ]); - store.setState(swcHelpers.objectSpread({ - }, partialState, { + store.setState(swcHelpers.objectSpread({}, partialState, { isSearchStalled: nextIsSearchStalled, error: error, searching: !1 @@ -146,9 +137,7 @@ export default function createInstantSearchManager(param1) { })); }, []) })); - client.cache = swcHelpers.objectSpread({ - }, client.cache, swcHelpers.defineProperty({ - }, key, JSON.stringify({ + client.cache = swcHelpers.objectSpread({}, client.cache, swcHelpers.defineProperty({}, key, JSON.stringify({ results: results.reduce(function(acc, result) { return acc.concat(result.rawResults); }, []) @@ -178,20 +167,16 @@ export default function createInstantSearchManager(param1) { }; }) })); - client.cache = swcHelpers.objectSpread({ - }, client.cache, swcHelpers.defineProperty({ - }, key, JSON.stringify({ + client.cache = swcHelpers.objectSpread({}, client.cache, swcHelpers.defineProperty({}, key, JSON.stringify({ results: results.rawResults }))); - }, helper = algoliasearchHelper(searchClient, indexName, swcHelpers.objectSpread({ - }, HIGHLIGHT_TAGS)); + }, helper = algoliasearchHelper(searchClient, indexName, swcHelpers.objectSpread({}, HIGHLIGHT_TAGS)); addAlgoliaAgents(searchClient), helper.on("search", function() { stalledSearchTimer || (stalledSearchTimer = setTimeout(function() { var _ref = store.getState(), resultsFacetValues = _ref.resultsFacetValues, partialState = swcHelpers.objectWithoutProperties(_ref, [ "resultsFacetValues" ]); - store.setState(swcHelpers.objectSpread({ - }, partialState, { + store.setState(swcHelpers.objectSpread({}, partialState, { isSearchStalled: !0 })); }, stalledSearchDelay)); @@ -200,8 +185,7 @@ export default function createInstantSearchManager(param1) { })).on("error", handleSearchError); var skip = !1, stalledSearchTimer = null, initialSearchParameters = helper.state, widgetsManager = createWidgetsManager(function() { var metadata = getMetadata(store.getState().widgets); - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { metadata: metadata, searching: !0 })), search(); @@ -214,8 +198,7 @@ export default function createInstantSearchManager(param1) { client.search = function(requests) { for(var _len1 = arguments.length, methodArgs = new Array(_len1 > 1 ? _len1 - 1 : 0), _key1 = 1; _key1 < _len1; _key1++)methodArgs[_key1 - 1] = arguments[_key1]; var requestsWithSerializedParams = requests.map(function(request) { - return swcHelpers.objectSpread({ - }, request, { + return swcHelpers.objectSpread({}, request, { params: function(parameters) { var encode = function(format) { for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)args[_key - 1] = arguments[_key]; @@ -251,15 +234,11 @@ export default function createInstantSearchManager(param1) { } }(searchClient, resultsState); var results1, state1, listeners, store = (state1 = { - widgets: void 0 === _initialState ? { - } : _initialState, + widgets: void 0 === _initialState ? {} : _initialState, metadata: hydrateMetadata(resultsState), results: (results1 = resultsState) ? Array.isArray(results1.results) ? results1.results.reduce(function(acc, result) { - return swcHelpers.objectSpread({ - }, acc, swcHelpers.defineProperty({ - }, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults))); - }, { - }) : new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results1.state), results1.rawResults) : null, + return swcHelpers.objectSpread({}, acc, swcHelpers.defineProperty({}, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults))); + }, {}) : new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results1.state), results1.rawResults) : null, error: null, searching: !1, isSearchStalled: !0, @@ -290,21 +269,16 @@ export default function createInstantSearchManager(param1) { getSearchParameters: getSearchParameters, onSearchForFacetValues: function(param) { var facetName = param.facetName, query = param.query, _maxFacetHits = param.maxFacetHits; - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { searchingForFacetValues: !0 })), helper.searchForFacetValues(facetName, query, Math.max(1, Math.min(void 0 === _maxFacetHits ? 10 : _maxFacetHits, 100))).then(function(content) { - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { error: null, searchingForFacetValues: !1, - resultsFacetValues: swcHelpers.objectSpread({ - }, store.getState().resultsFacetValues, (_obj = { - }, swcHelpers.defineProperty(_obj, facetName, content.facetHits), swcHelpers.defineProperty(_obj, "query", query), _obj)) + resultsFacetValues: swcHelpers.objectSpread({}, store.getState().resultsFacetValues, (_obj = {}, swcHelpers.defineProperty(_obj, facetName, content.facetHits), swcHelpers.defineProperty(_obj, "query", query), _obj)) })); }, function(error) { - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { searchingForFacetValues: !1, error: error })); @@ -316,8 +290,7 @@ export default function createInstantSearchManager(param1) { }, onExternalStateUpdate: function(nextSearchState) { var metadata = getMetadata(nextSearchState); - store.setState(swcHelpers.objectSpread({ - }, store.getState(), { + store.setState(swcHelpers.objectSpread({}, store.getState(), { widgets: nextSearchState, metadata: metadata, searching: !0 @@ -349,22 +322,19 @@ function hydrateMetadata(resultsState) { return resultsState ? resultsState.metadata.map(function(datum) { return swcHelpers.objectSpread({ value: function() { - return { - }; + return {}; } }, datum, { items: datum.items && datum.items.map(function(item) { return swcHelpers.objectSpread({ value: function() { - return { - }; + return {}; } }, item, { items: item.items && item.items.map(function(nestedItem) { return swcHelpers.objectSpread({ value: function() { - return { - }; + return {}; } }, nestedItem); }) diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/1/output.js index 2c92345e21f..7cdf76786f1 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/1/output.js @@ -4,6 +4,5 @@ import { useProject } from "@swr/use-project"; import useTeam from "@swr/use-team"; export default function MyComp() { var projectInfo = useProject(useRouter().query.project).data; - return useTeam().teamSlug, useProjectBranches(null == projectInfo ? void 0 : projectInfo.id).data, _jsx(_Fragment, { - }); + return useTeam().teamSlug, useProjectBranches(null == projectInfo ? void 0 : projectInfo.id).data, _jsx(_Fragment, {}); }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/3/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/3/output.js index 7fa08faeb7e..c60f0ae5b86 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/3/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/3/output.js @@ -14,6 +14,5 @@ export function EnvironmentsSelector() { return (0, fetch_api.Z)(endpoint, token, { throwOnHTTPError: !0 }); - }, void 0)).data, { - }; + }, void 0)).data, {}; } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/5/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/5/output.js index 6d7bac0cac4..dd5ec2d1bf5 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/5/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/react/hooks/5/output.js @@ -1,7 +1,6 @@ export function HeaderCTA() { const varB = function() { - const [a1, a1_set] = useState({ - }); + const [a1, a1_set] = useState({}); return useEffect(()=>{ a1_set(JSON.parse(GLOBALS.get(CONST1) || "{}")); }, []), a1; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/003/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/003/output.js index ee275aae706..35ac5c79577 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/003/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/003/output.js @@ -13,8 +13,7 @@ const manager = function() { } return { d: function(e) { - return (function(g = { - }) { + return (function(g = {}) { const h = b(g); for (const i of c.keys())if (a(i, h)) return i; return null; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/006/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/006/output.js index 2d3d4381c01..5600db5313b 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/006/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/vercel/006/output.js @@ -46,8 +46,7 @@ class LoadScript extends React.PureComponent { _jsx("div", { ref: this.check }), - this.state.loaded ? this.props.children : this.props.loadingElement || _jsx(DefaultLoadingElement, { - }) + this.state.loaded ? this.props.children : this.props.loadingElement || _jsx(DefaultLoadingElement, {}) ] }); } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/10/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/10/output.js index 4e1752e8b42..eb3a6e3c1c7 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/10/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/10/output.js @@ -2,8 +2,7 @@ const obj = { _ensureElement: function() { if (this.el) this.setElement(_.result(this, "el"), !1); else { - var attrs = _.extend({ - }, _.result(this, "attributes")); + var attrs = _.extend({}, _.result(this, "attributes")); this.id && (attrs.id = _.result(this, "id")), this.className && (attrs.class = _.result(this, "className")); var $el = Backbone.$("<" + _.result(this, "tagName") + ">").attr(attrs); this.setElement($el, !1); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/13/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/13/output.js index 960116109b8..bdd50504167 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/13/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/13/output.js @@ -1,8 +1,7 @@ export const obj = { _validate: function(attrs, options) { if (!options.validate || !this.validate) return !0; - attrs = _.extend({ - }, this.attributes, attrs); + attrs = _.extend({}, this.attributes, attrs); var error = this.validationError = this.validate(attrs, options) || null; return !error || (this.trigger("invalid", this, error, _.extend(options, { validationError: error diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/14/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/14/output.js index 6ce6cdc1fdb..b9243e30f1b 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/14/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/14/output.js @@ -2,11 +2,8 @@ export const obj = { set: function(key, val, options) { var attr, attrs, unset, changes, silent, changing, prev, current; if (null == key) return this; - if ("object" == typeof key ? (attrs = key, options = val) : (attrs = { - })[key] = val, options || (options = { - }), !this._validate(attrs, options)) return !1; - for(attr in unset = options.unset, silent = options.silent, changes = [], changing = this._changing, this._changing = !0, changing || (this._previousAttributes = _.clone(this.attributes), this.changed = { - }), current = this.attributes, prev = this._previousAttributes, this.idAttribute in attrs && (this.id = attrs[this.idAttribute]), attrs)val = attrs[attr], _.isEqual(current[attr], val) || changes.push(attr), _.isEqual(prev[attr], val) ? delete this.changed[attr] : this.changed[attr] = val, unset ? delete current[attr] : current[attr] = val; + if ("object" == typeof key ? (attrs = key, options = val) : (attrs = {})[key] = val, options || (options = {}), !this._validate(attrs, options)) return !1; + for(attr in unset = options.unset, silent = options.silent, changes = [], changing = this._changing, this._changing = !0, changing || (this._previousAttributes = _.clone(this.attributes), this.changed = {}), current = this.attributes, prev = this._previousAttributes, this.idAttribute in attrs && (this.id = attrs[this.idAttribute]), attrs)val = attrs[attr], _.isEqual(current[attr], val) || changes.push(attr), _.isEqual(prev[attr], val) ? delete this.changed[attr] : this.changed[attr] = val, unset ? delete current[attr] : current[attr] = val; if (!silent) { changes.length && (this._pending = !0); for(var i = 0, l = changes.length; i < l; i++)this.trigger("change:" + changes[i], this, current[changes[i]], options); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/15/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/15/output.js index e85be6aca92..e378c9f2fea 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/15/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/15/output.js @@ -2,8 +2,7 @@ export const obj = { changedAttributes: function(diff) { if (!diff) return !!this.hasChanged() && _.clone(this.changed); var val, changed = !1, old = this._changing ? this._previousAttributes : this.attributes; - for(var attr in diff)_.isEqual(old[attr], val = diff[attr]) || ((changed || (changed = { - }))[attr] = val); + for(var attr in diff)_.isEqual(old[attr], val = diff[attr]) || ((changed || (changed = {}))[attr] = val); return changed; } }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/16/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/16/output.js index a0c32526d61..4f4d10cbe3c 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/16/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/16/output.js @@ -1,8 +1,7 @@ export const obj = { remove: function(models, options) { var i, l, index, model, singular = !_.isArray(models); - for(options || (options = { - }), i = 0, l = (models = singular ? [ + for(options || (options = {}), i = 0, l = (models = singular ? [ models ] : _.clone(models)).length; i < l; i++)(model = models[i] = this.get(models[i])) && (delete this._byId[model.id], delete this._byId[model.cid], index = this.indexOf(model), this.models.splice(index, 1), this.length--, options.silent || (options.index = index, model.trigger("remove", model, this, options)), this._removeReference(model)); return singular ? models[0] : models; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/17/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/17/output.js index 847ac91c267..e971cd9f24c 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/17/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/17/output.js @@ -1,7 +1,6 @@ export const obj = { create: function(model1, options1) { - if (options1 = options1 ? _.clone(options1) : { - }, !(model1 = this._prepareModel(model1, options1))) return !1; + if (options1 = options1 ? _.clone(options1) : {}, !(model1 = this._prepareModel(model1, options1))) return !1; options1.wait || this.add(model1, options1); var collection = this, success = options1.success; return options1.success = function(model, resp, options) { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/19/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/19/output.js index f1a7197aded..d78d77090c6 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/19/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/19/output.js @@ -6,8 +6,7 @@ export const obj = { }); var url = this.root + (fragment = this.getFragment(fragment || "")); if (fragment = fragment.replace(pathStripper, ""), this.fragment !== fragment) { - if (this.fragment = fragment, "" === fragment && "/" !== url && (url = url.slice(0, -1)), this._hasPushState) this.history[options.replace ? "replaceState" : "pushState"]({ - }, document.title, url); + if (this.fragment = fragment, "" === fragment && "/" !== url && (url = url.slice(0, -1)), this._hasPushState) this.history[options.replace ? "replaceState" : "pushState"]({}, document.title, url); else { if (!this._wantsHashChange) return this.location.assign(url); this._updateHash(this.location, fragment, options.replace), this.iframe && fragment !== this.getFragment(this.getHash(this.iframe)) && (options.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, fragment, options.replace)); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/2/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/2/output.js index 8670ad147ba..5cc45dde2bf 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/2/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/2/output.js @@ -2,8 +2,7 @@ function foo() { return eventsApi(this, "on", name, [ callback, context - ]) && callback && (this._events || (this._events = { - }), (this._events[name] || (this._events[name] = [])).push({ + ]) && callback && (this._events || (this._events = {}), (this._events[name] || (this._events[name] = [])).push({ callback: callback, context: context, ctx: context || this diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/20/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/20/output.js index fb258f083e4..df1ba541e2f 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/20/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/20/output.js @@ -1,13 +1,11 @@ export const E = { set: function(models, options) { - (options = _.defaults({ - }, options, setOptions)).parse && (models = this.parse(models, options)); + (options = _.defaults({}, options, setOptions)).parse && (models = this.parse(models, options)); var i, l, id, model, attrs, existing, sort, singular = !_.isArray(models); models = singular ? models ? [ models ] : [] : _.clone(models); - var at = options.at, targetModel = this.model, sortable = this.comparator && null == at && !1 !== options.sort, sortAttr = _.isString(this.comparator) ? this.comparator : null, toAdd = [], toRemove = [], modelMap = { - }, add = options.add, merge = options.merge, remove = options.remove, order = !sortable && !!add && !!remove && []; + var at = options.at, targetModel = this.model, sortable = this.comparator && null == at && !1 !== options.sort, sortAttr = _.isString(this.comparator) ? this.comparator : null, toAdd = [], toRemove = [], modelMap = {}, add = options.add, merge = options.merge, remove = options.remove, order = !sortable && !!add && !!remove && []; for(i = 0, l = models.length; i < l; i++){ if (id = (attrs = models[i]) instanceof Model ? model = attrs : attrs[targetModel.prototype.idAttribute], existing = this.get(id)) remove && (modelMap[existing.cid] = !0), merge && (attrs = attrs === model ? model.attributes : attrs, options.parse && (attrs = existing.parse(attrs, options)), existing.set(attrs, options), sortable && !sort && existing.hasChanged(sortAttr) && (sort = !0)), models[i] = existing; else if (add) { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/4/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/4/output.js index 64b00ac8570..668a364da56 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/4/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/4/output.js @@ -1,7 +1,6 @@ function foo(attrs, options) { if (!options.validate || !this.validate) return !0; - attrs = _.extend({ - }, this.attributes, attrs); + attrs = _.extend({}, this.attributes, attrs); var error = this.validationError = this.validate(attrs, options) || null; return !error || (this.trigger("invalid", this, error, _.extend(options, { validationError: error diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/5/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/5/output.js index 6063b77605d..0f5b04a48a8 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/5/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/5/output.js @@ -3,8 +3,7 @@ var Events = { return eventsApi(this, "on", name, [ callback, context - ]) && callback && (this._events || (this._events = { - }), (this._events[name] || (this._events[name] = [])).push({ + ]) && callback && (this._events || (this._events = {}), (this._events[name] || (this._events[name] = [])).push({ callback: callback, context: context, ctx: context || this diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/9/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/9/output.js index 4df8639b1a9..6c43ec8a3a8 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/9/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/backbone/9/output.js @@ -1,5 +1,4 @@ !function() { var Backbone; - this.Backbone, (Backbone = "undefined" != typeof exports ? exports : this.Backbone = { - }).VERSION = "1.1.0", this._, console.log(Backbone); + this.Backbone, (Backbone = "undefined" != typeof exports ? exports : this.Backbone = {}).VERSION = "1.1.0", this._, console.log(Backbone); }(); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/11/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/11/output.js index 3319eb818ea..c38fe878ab5 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/11/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/11/output.js @@ -1,7 +1,6 @@ jQuery.support = (function() { var support, all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); - if (div.setAttribute("className", "t"), div.innerHTML = "
a", all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0], !all || !a || !all.length) return { - }; + if (div.setAttribute("className", "t"), div.innerHTML = "
a", all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0], !all || !a || !all.length) return {}; opt = (select = document.createElement("select")).appendChild(document.createElement("option")), input = div.getElementsByTagName("input")[0], a.style.cssText = "top:1px;float:left;opacity:.5", support = { getSetAttribute: "t" !== div.className, leadingWhitespace: 3 === div.firstChild.nodeType, @@ -38,10 +37,8 @@ jQuery.support = (function() { })div.setAttribute(eventName = "on" + i, "t"), support[i + "Bubbles"] = eventName in window || !1 === div.attributes[eventName].expando; return div.style.backgroundClip = "content-box", div.cloneNode(!0).style.backgroundClip = "", support.clearCloneStyle = "content-box" === div.style.backgroundClip, jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; - body && ((container = document.createElement("div")).style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", body.appendChild(container).appendChild(div), div.innerHTML = "
t
", (tds = div.getElementsByTagName("td"))[0].style.cssText = "padding:0;margin:0;border:0;display:none", isSupported = 0 === tds[0].offsetHeight, tds[0].style.display = "", tds[1].style.display = "none", support.reliableHiddenOffsets = isSupported && 0 === tds[0].offsetHeight, div.innerHTML = "", div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", support.boxSizing = 4 === div.offsetWidth, support.doesNotIncludeMarginInBodyOffset = 1 !== body.offsetTop, window.getComputedStyle && (support.pixelPosition = "1%" !== (window.getComputedStyle(div, null) || { - }).top, support.boxSizingReliable = "4px" === (window.getComputedStyle(div, null) || { + body && ((container = document.createElement("div")).style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", body.appendChild(container).appendChild(div), div.innerHTML = "
t
", (tds = div.getElementsByTagName("td"))[0].style.cssText = "padding:0;margin:0;border:0;display:none", isSupported = 0 === tds[0].offsetHeight, tds[0].style.display = "", tds[1].style.display = "none", support.reliableHiddenOffsets = isSupported && 0 === tds[0].offsetHeight, div.innerHTML = "", div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", support.boxSizing = 4 === div.offsetWidth, support.doesNotIncludeMarginInBodyOffset = 1 !== body.offsetTop, window.getComputedStyle && (support.pixelPosition = "1%" !== (window.getComputedStyle(div, null) || {}).top, support.boxSizingReliable = "4px" === (window.getComputedStyle(div, null) || { width: "4px" - }).width, (marginDiv = div.appendChild(document.createElement("div"))).style.cssText = div.style.cssText = divReset, marginDiv.style.marginRight = marginDiv.style.width = "0", div.style.width = "1px", support.reliableMarginRight = !parseFloat((window.getComputedStyle(marginDiv, null) || { - }).marginRight)), typeof div.style.zoom !== core_strundefined && (div.innerHTML = "", div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1", support.inlineBlockNeedsLayout = 3 === div.offsetWidth, div.style.display = "block", div.innerHTML = "
", div.firstChild.style.width = "5px", support.shrinkWrapBlocks = 3 !== div.offsetWidth, support.inlineBlockNeedsLayout && (body.style.zoom = 1)), body.removeChild(container), container = div = tds = marginDiv = null); + }).width, (marginDiv = div.appendChild(document.createElement("div"))).style.cssText = div.style.cssText = divReset, marginDiv.style.marginRight = marginDiv.style.width = "0", div.style.width = "1px", support.reliableMarginRight = !parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight)), typeof div.style.zoom !== core_strundefined && (div.innerHTML = "", div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1", support.inlineBlockNeedsLayout = 3 === div.offsetWidth, div.style.display = "block", div.innerHTML = "
", div.firstChild.style.width = "5px", support.shrinkWrapBlocks = 3 !== div.offsetWidth, support.inlineBlockNeedsLayout && (body.style.zoom = 1)), body.removeChild(container), container = div = tds = marginDiv = null); }), all = select = fragment = opt = a = input = null, support; })(); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/12/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/12/output.js index 5690a809c83..80fdd82b664 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/12/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/12/output.js @@ -2,8 +2,6 @@ var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData(elem, name, data, pvt) { if (jQuery.acceptData(elem)) { var thisCache, ret, internalKey = jQuery.expando, getByName = "string" == typeof name, isNode = elem.nodeType, cache = isNode ? jQuery.cache : elem, id = isNode ? elem[internalKey] : elem[internalKey] && internalKey; - if (id && cache[id] && (pvt || cache[id].data) || !getByName || void 0 !== data) return id || (isNode ? elem[internalKey] = id = core_deletedIds.pop() || jQuery.guid++ : id = internalKey), cache[id] || (cache[id] = { - }, isNode || (cache[id].toJSON = jQuery.noop)), ("object" == typeof name || "function" == typeof name) && (pvt ? cache[id] = jQuery.extend(cache[id], name) : cache[id].data = jQuery.extend(cache[id].data, name)), thisCache = cache[id], pvt || (thisCache.data || (thisCache.data = { - }), thisCache = thisCache.data), void 0 !== data && (thisCache[jQuery.camelCase(name)] = data), getByName ? null == (ret = thisCache[name]) && (ret = thisCache[jQuery.camelCase(name)]) : ret = thisCache, ret; + if (id && cache[id] && (pvt || cache[id].data) || !getByName || void 0 !== data) return id || (isNode ? elem[internalKey] = id = core_deletedIds.pop() || jQuery.guid++ : id = internalKey), cache[id] || (cache[id] = {}, isNode || (cache[id].toJSON = jQuery.noop)), ("object" == typeof name || "function" == typeof name) && (pvt ? cache[id] = jQuery.extend(cache[id], name) : cache[id].data = jQuery.extend(cache[id].data, name)), thisCache = cache[id], pvt || (thisCache.data || (thisCache.data = {}), thisCache = thisCache.data), void 0 !== data && (thisCache[jQuery.camelCase(name)] = data), getByName ? null == (ret = thisCache[name]) && (ret = thisCache[jQuery.camelCase(name)]) : ret = thisCache, ret; } } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/16/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/16/output.js index 08b08590e35..b5daddfae14 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/16/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/16/output.js @@ -5,9 +5,7 @@ export const obj = { var curTop, curLeft, curElem = jQuery(elem), curOffset = curElem.offset(), curCSSTop = jQuery.css(elem, "top"), curCSSLeft = jQuery.css(elem, "left"), calculatePosition = ("absolute" === position || "fixed" === position) && jQuery.inArray("auto", [ curCSSTop, curCSSLeft - ]) > -1, props = { - }, curPosition = { - }; + ]) > -1, props = {}, curPosition = {}; calculatePosition ? (curTop = (curPosition = curElem.position()).top, curLeft = curPosition.left) : (curTop = parseFloat(curCSSTop) || 0, curLeft = parseFloat(curCSSLeft) || 0), jQuery.isFunction(options) && (options = options.call(elem, i, curOffset)), null != options.top && (props.top = options.top - curOffset.top + curTop), null != options.left && (props.left = options.left - curOffset.left + curLeft), "using" in options ? options.using.call(elem, props) : curElem.css(props); } }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/2/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/2/output.js index cb7780f1bb9..53caf96a007 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/2/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/2/output.js @@ -1,9 +1,5 @@ jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, target = arguments[0] || { - }, i = 1, length = arguments.length, deep = !1; - for("boolean" == typeof target && (deep = target, target = arguments[1] || { - }, i = 2), "object" == typeof target || jQuery.isFunction(target) || (target = { - }), length === i && (target = this, --i); i < length; i++)if (null != (options = arguments[i])) for(name in options)src = target[name], copy = options[name], target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, clone = src && jQuery.isArray(src) ? src : []) : clone = src && jQuery.isPlainObject(src) ? src : { - }, target[name] = jQuery.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy)); + var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1; + for("boolean" == typeof target && (deep = target, target = arguments[1] || {}, i = 2), "object" == typeof target || jQuery.isFunction(target) || (target = {}), length === i && (target = this, --i); i < length; i++)if (null != (options = arguments[i])) for(name in options)src = target[name], copy = options[name], target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, clone = src && jQuery.isArray(src) ? src : []) : clone = src && jQuery.isPlainObject(src) ? src : {}, target[name] = jQuery.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy)); return target; }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/23/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/23/output.js index 3b092087beb..edf8dfbbf81 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/23/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/jquery/23/output.js @@ -5,8 +5,7 @@ export const obj = { if (name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], void 0 === value) return hooks && "get" in hooks && void 0 !== (ret = hooks.get(elem, !1, extra)) ? ret : style[name]; if ("string" == (type = typeof value) && (ret = rrelNum.exec(value)) && (value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)), type = "number"), !(null == value || "number" === type && isNaN(value)) && ("number" !== type || jQuery.cssNumber[origName] || (value += "px"), jQuery.support.clearCloneStyle || "" !== value || 0 !== name.indexOf("background") || (style[name] = "inherit"), !hooks || !("set" in hooks) || void 0 !== (value = hooks.set(elem, value, extra)))) try { style[name] = value; - } catch (e) { - } + } catch (e) {} } } }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/mootools/7/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/mootools/7/output.js index f9ceaaddf3b..24fa93a2f52 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/mootools/7/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/mootools/7/output.js @@ -7,8 +7,7 @@ export const exported = { result = Object.toQueryString(value, key); break; case "array": - var result, qs = { - }; + var result, qs = {}; value.each(function(val, i) { qs[i] = val; }), result = Object.toQueryString(qs, key); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/383.5942fafdbede773d29c7/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/383.5942fafdbede773d29c7/output.js index 230a6e23c6f..2854ba2a987 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/383.5942fafdbede773d29c7/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/383.5942fafdbede773d29c7/output.js @@ -60,8 +60,7 @@ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: "Nested 2" }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BrowserLoaded, { - }), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BrowserLoaded, {}), ] }); }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/808.7518829f34ebf3ce0082/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/808.7518829f34ebf3ce0082/output.js index bda4bb2ef37..02167dc5548 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/808.7518829f34ebf3ce0082/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-1/808.7518829f34ebf3ce0082/output.js @@ -24,8 +24,7 @@ return (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "Nested 1", - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Nested2, { - }), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Nested2, {}), ] }); }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/chunkfilename-b114cf1d23876beaa712/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/chunkfilename-b114cf1d23876beaa712/output.js index ac5e0e7ba30..6d02d91e235 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/chunkfilename-b114cf1d23876beaa712/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/chunkfilename-b114cf1d23876beaa712/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/function-7fe8439c89afccb77983/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/function-7fe8439c89afccb77983/output.js index 058878e665c..b9b091853a8 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/function-7fe8439c89afccb77983/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/function-7fe8439c89afccb77983/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/head-432fc3a9a66c90ce2ec2/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/head-432fc3a9a66c90ce2ec2/output.js index 2a04dcc56f7..94bef5f5892 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/head-432fc3a9a66c90ce2ec2/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/head-432fc3a9a66c90ce2ec2/output.js @@ -50,8 +50,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -68,10 +67,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -112,8 +108,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -174,21 +169,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -256,8 +246,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/multiple-modules-d02ebebcfa5282e50b34/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/multiple-modules-d02ebebcfa5282e50b34/output.js index f813f8a5205..c32ad6a5819 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/multiple-modules-d02ebebcfa5282e50b34/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/multiple-modules-d02ebebcfa5282e50b34/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { @@ -361,20 +350,13 @@ }), __webpack_exports__.default = function() { return (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), - (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, { - }), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), + (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hello, {}), ] }); }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/nested-05a7ce04b1f7eb6da341/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/nested-05a7ce04b1f7eb6da341/output.js index bafc6e2cf81..5bdf1c8c1ac 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/nested-05a7ce04b1f7eb6da341/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/nested-05a7ce04b1f7eb6da341/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-chunk-e2d9573b8d7df68a6cde/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-chunk-e2d9573b8d7df68a6cde/output.js index 9a1022de516..34670c4aa03 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-chunk-e2d9573b8d7df68a6cde/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-chunk-e2d9573b8d7df68a6cde/output.js @@ -129,8 +129,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -147,10 +146,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -191,8 +187,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -253,21 +248,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -335,8 +325,7 @@ } })(o3)) || 0) { it && (o3 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { @@ -454,8 +443,7 @@ if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function() { - })), !0; + return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-9ced90e71a0d75a11cdd/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-9ced90e71a0d75a11cdd/output.js index 26da1ce9875..531bbd9666b 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-9ced90e71a0d75a11cdd/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-9ced90e71a0d75a11cdd/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-custom-loading-7f61b2e27708ca1854e0/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-custom-loading-7f61b2e27708ca1854e0/output.js index 68b908e33fc..71448c1b165 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-custom-loading-7f61b2e27708ca1854e0/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/no-ssr-custom-loading-7f61b2e27708ca1854e0/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-994266264fb6ff57d32c/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-994266264fb6ff57d32c/output.js index 11071777bcf..baa525dcd25 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-994266264fb6ff57d32c/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-994266264fb6ff57d32c/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-true-6d4aa8fc503b9d073aef/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-true-6d4aa8fc503b9d073aef/output.js index fa4f7883213..121a6b0a76f 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-true-6d4aa8fc503b9d073aef/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/next/archive-3/pages/dynamic/ssr-true-6d4aa8fc503b9d073aef/output.js @@ -18,8 +18,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -36,10 +35,7 @@ }; if (dynamicOptions instanceof Promise ? loadableOptions.loader = function() { return dynamicOptions; - } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({ - }, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { + } : "function" == typeof dynamicOptions ? loadableOptions.loader = dynamicOptions : "object" == typeof dynamicOptions && (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), dynamicOptions)), (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), options)).loadableGenerated && delete (loadableOptions = _objectSpread(_objectSpread({}, loadableOptions), loadableOptions.loadableGenerated)).loadableGenerated, "boolean" == typeof loadableOptions.ssr) { if (!loadableOptions.ssr) return delete loadableOptions.ssr, noSSR(loadableFn, loadableOptions); delete loadableOptions.ssr; } @@ -80,8 +76,7 @@ } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ - var source = null != arguments[i] ? arguments[i] : { - }; + var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { @@ -142,21 +137,16 @@ timedOut: !0 }); }, opts1.timeout))), this._res.promise.then(function() { - _this._update({ - }), _this._clearTimeouts(); + _this._update({}), _this._clearTimeouts(); }).catch(function(_err) { - _this._update({ - }), _this._clearTimeouts(); - }), this._update({ - }); + _this._update({}), _this._clearTimeouts(); + }), this._update({}); } }, { key: "_update", value: function(partial) { - this._state = _objectSpread(_objectSpread({ - }, this._state), { - }, { + this._state = _objectSpread(_objectSpread({}, this._state), {}, { error: this._res.error, loaded: this._res.loaded, loading: this._res.loading @@ -224,8 +214,7 @@ } })(o1)) || 0) { it && (o1 = it); - var i = 0, F = function() { - }; + var i = 0, F = function() {}; return { s: F, n: function() { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/10/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/10/output.js index 7a769cd47ed..462750542c8 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/10/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/10/output.js @@ -22,8 +22,7 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { var lazyComponent = type, payload = lazyComponent._payload, init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) { - } + } catch (x) {} } return ""; } diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/5/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/5/output.js index 3db0d11fdd3..f126059b0aa 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/5/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/react/5/output.js @@ -1,7 +1,5 @@ -var emptyObject = { -}; +var emptyObject = {}; function Component(props, context, updater) { this.props = props, this.context = context, this.refs = emptyObject, this.updater = updater || ReactNoopUpdateQueue; } -Object.freeze(emptyObject), Component.prototype.isReactComponent = { -}; +Object.freeze(emptyObject), Component.prototype.isReactComponent = {}; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/underscore/8/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/underscore/8/output.js index 361c7b56c3e..ec20e0eeb14 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/underscore/8/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/underscore/8/output.js @@ -1,7 +1,6 @@ _.throttle = function(func, wait, options) { var context, args, result, timeout = null, previous = 0; - options || (options = { - }); + options || (options = {}); var later = function() { previous = !1 === options.leading ? 0 : new Date, timeout = null, result = func.apply(context, args); }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/hoofd.module.6c5395cb/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/hoofd.module.6c5395cb/output.js index c6aec375d3f..a244f5244fe 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/hoofd.module.6c5395cb/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/hoofd.module.6c5395cb/output.js @@ -66,8 +66,7 @@ var isServerSide = "undefined" == typeof document, META = "M", TITLE = "T", LINK var _ref; return "charset" === meta.keyword ? { charset: meta[meta.keyword] - } : ((_ref = { - })[meta.keyword] = meta[meta.keyword], _ref.content = meta.content, _ref); + } : ((_ref = {})[meta.keyword] = meta[meta.keyword], _ref.content = meta.content, _ref); }) }; } @@ -101,8 +100,7 @@ var isServerSide = "undefined" == typeof document, META = "M", TITLE = "T", LINK }), found && (node.current = x); }), node.current ? originalOptions.current = Object.keys(options).reduce(function(acc, key) { return acc[key] = node.current.getAttribute(key), acc; - }, { - }) : (node.current = document.createElement("link"), Object.keys(options).forEach(function(key) { + }, {}) : (node.current = document.createElement("link"), Object.keys(options).forEach(function(key) { node.current.setAttribute(key, options[key]); }), document.head.appendChild(node.current)), function() { hasMounted.current = !1, originalOptions.current ? Object.keys(originalOptions.current).forEach(function(key) { diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/13/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/13/output.js index d7e328075b4..028387654c8 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/13/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/13/output.js @@ -5,8 +5,7 @@ export const E = { urls ]), (options = Y.merge(this.options, options)).attributes = Y.merge(this.options.attributes, options.attributes), i = 0, len = urls.length; i < len; ++i){ if (req = { - attributes: { - } + attributes: {} }, "string" == typeof (url = urls[i])) req.url = url; else { if (!url.url) continue; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/3/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/3/output.js index 26569e64540..cb4e2b476ec 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/3/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/3/output.js @@ -1,7 +1,6 @@ Y.Loader.prototype._rollup = function() { var i, j, m, s, roll, rolled, c, smod, r = this.required, info = this.moduleInfo; - if (this.dirty || !this.rollups) for(i in this.rollups = { - }, info)info.hasOwnProperty(i) && (m = this.getModule(i)) && m.rollup && (this.rollups[i] = m); + if (this.dirty || !this.rollups) for(i in this.rollups = {}, info)info.hasOwnProperty(i) && (m = this.getModule(i)) && m.rollup && (this.rollups[i] = m); for(;;){ for(i in rolled = !1, this.rollups)if (this.rollups.hasOwnProperty(i) && !r[i] && (!this.loaded[i] || this.forceMap[i])) { if (s = (m = this.getModule(i)).supersedes || [], roll = !1, !m.rollup) continue; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/4/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/4/output.js index 0da5001a08e..f99d4277774 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/4/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/4/output.js @@ -1,2 +1 @@ -export function foo() { -} +export function foo() {} diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/7/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/7/output.js index 9f04cc5563f..1822f8466be 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/7/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/7/output.js @@ -1,7 +1,6 @@ export const E = { _sort: function() { - for(var l, a, b, j, k, moved, doneKey, s = YObject.keys(this.required), done = { - }, p = 0;;){ + for(var l, a, b, j, k, moved, doneKey, s = YObject.keys(this.required), done = {}, p = 0;;){ for(l = s.length, moved = !1, j = p; j < l; j++){ for(a = s[j], k = j + 1; k < l; k++)if (!done[doneKey = a + s[k]] && this._requires(a, s[k])) { b = s.splice(k, 1), s.splice(j, 0, b[0]), done[doneKey] = !0, moved = !0; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/9/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/9/output.js index 92c215b6737..b5f9b6fa202 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/9/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/yui/9/output.js @@ -8,8 +8,6 @@ export const E = { ext: m.ext, group: m.group, supersedes: [] - }, m.root && (conf.root = m.root), m.base && (conf.base = m.base), m.configFn && (conf.configFn = m.configFn), this.addModule(conf, packName), lang && (Y.Env.lang = Y.Env.lang || { - }, Y.Env.lang[lang] = Y.Env.lang[lang] || { - }, Y.Env.lang[lang][name] = !0)), this.moduleInfo[packName]; + }, m.root && (conf.root = m.root), m.base && (conf.base = m.base), m.configFn && (conf.configFn = m.configFn), this.addModule(conf, packName), lang && (Y.Env.lang = Y.Env.lang || {}, Y.Env.lang[lang] = Y.Env.lang[lang] || {}, Y.Env.lang[lang][name] = !0)), this.moduleInfo[packName]; } }; diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/simple/issues/2007/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/simple/issues/2007/1/output.js index afcd849289b..a28dedf9cff 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/simple/issues/2007/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/simple/issues/2007/1/output.js @@ -1,8 +1,6 @@ -const obj = { -}; +const obj = {}; for(let key in obj)obj[key] = obj[key].trim(); let arr = [ "foo", ]; -arr.forEach(()=>{ -}); +arr.forEach(()=>{}); diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/simple/order/fn/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/simple/order/fn/1/output.js index 5b52598a950..3d6dd5e97b8 100644 --- a/crates/swc_ecma_minifier/tests/compress/fixture/simple/order/fn/1/output.js +++ b/crates/swc_ecma_minifier/tests/compress/fixture/simple/order/fn/1/output.js @@ -1,5 +1,3 @@ -function foo() { -} -function bar() { -} +function foo() {} +function bar() {} console.log("foo"); diff --git a/crates/swc_ecma_minifier/tests/mangle/1/output.js b/crates/swc_ecma_minifier/tests/mangle/1/output.js index 8549d5ae64f..7c4f3d323d6 100644 --- a/crates/swc_ecma_minifier/tests/mangle/1/output.js +++ b/crates/swc_ecma_minifier/tests/mangle/1/output.js @@ -8,8 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const b = a(require("./config.json")); -function c({ config: a = b.default } = { -}) { +function c({ config: a = b.default } = {}) { function c(b) { const c = a[b] || null; if (!c) { diff --git a/crates/swc_ecma_minifier/tests/mangle/reuse/2/output.js b/crates/swc_ecma_minifier/tests/mangle/reuse/2/output.js index 1527d6002e4..f92e96fb53f 100644 --- a/crates/swc_ecma_minifier/tests/mangle/reuse/2/output.js +++ b/crates/swc_ecma_minifier/tests/mangle/reuse/2/output.js @@ -1,5 +1,4 @@ -function a(a, b = { -}, c = false) { +function a(a, b = {}, c = false) { return { rule: a, params: b, @@ -49,16 +48,12 @@ const i = (a, b, c, d, e)=>{ return a[`${b}.${c}`] || a[`${b}.${d}`] || a[b] || a[c] || a[d] || e; }; const j = (a, { messages: b , attributes: c })=>{ - const d = { - }; - const e = (b || { - })["default"] || ":attr is invalid"; + const d = {}; + const e = (b || {})["default"] || ":attr is invalid"; for(let f in a){ const k = a[f]; - const l = (c || { - })[f] || f; - d[f] = { - }; + const l = (c || {})[f] || f; + d[f] = {}; for (let m of k){ const n = h(m.rule); const o = n ? m.rule.substr(0, m.rule.length - n.length - 1) : m.rule; @@ -73,8 +68,7 @@ const j = (a, { messages: b , attributes: c })=>{ attributes: c }); } else { - const p = i(b || { - }, f, m.rule, o, e); + const p = i(b || {}, f, m.rule, o, e); d[f][o] = g(p, m.params, l, n); } } @@ -189,8 +183,7 @@ const r = async (a, b, e)=>{ return g; }; const s = async (a, b)=>{ - const c = { - }; + const c = {}; const d = n(a); for(let e in b){ const f = b[e] instanceof Array ? b[e] : [ @@ -209,8 +202,7 @@ const t = async (a, b, c = { })=>{ const d = await s(a, b); const e = Object.keys(d).length === 0; - const f = e ? { - } : j(d, c); + const f = e ? {} : j(d, c); return [ e, f diff --git a/crates/swc_ecma_minifier/tests/mangle/reuse/3/output.js b/crates/swc_ecma_minifier/tests/mangle/reuse/3/output.js index 7ed3be46929..86bd7229508 100644 --- a/crates/swc_ecma_minifier/tests/mangle/reuse/3/output.js +++ b/crates/swc_ecma_minifier/tests/mangle/reuse/3/output.js @@ -200,8 +200,7 @@ var y; a["STRING"] = 'string'; a["NUMBER"] = 'number'; a["BOOLEAN"] = 'boolean'; -})(y || (y = { -})); +})(y || (y = {})); const z = (a, b, c)=>{ if (~[ '1', @@ -243,8 +242,7 @@ function D(a, b) { return; } function E(a, b, c, d) { - const e = { - }; + const e = {}; for (const f of a){ const g = v(f.name); if (typeof b[g] === 'undefined' && typeof f.default !== 'undefined') { @@ -310,14 +308,12 @@ function E(a, b, c, d) { throw new Error('No arguments.'); } } -function F(a, b = { -}) { +function F(a, b = {}) { !b.flags && (b.flags = []); const c = x(a); let d = false; let e = false; - const f = { - }; + const f = {}; const g = []; const h = []; let i = false; @@ -691,15 +687,13 @@ class sa { static from(ta) { const ua = new this(ta); if (ta instanceof sa) { - ua.options = Object.assign({ - }, ta.options); + ua.options = Object.assign({}, ta.options); } return ua; } constructor(va){ this.value = va; - this.options = { - }; + this.options = {}; } toString() { return this.value.toString(); @@ -710,8 +704,7 @@ class sa { } clone(xa) { const ya = new sa(xa ?? this); - ya.options = Object.assign({ - }, this.options); + ya.options = Object.assign({}, this.options); return ya; } border(za, Aa = true) { @@ -746,16 +739,14 @@ class Fa extends Array { static from(Ga) { const Ha = new this(...Ga); if (Ga instanceof Fa) { - Ha.options = Object.assign({ - }, Ga.options); + Ha.options = Object.assign({}, Ga.options); } return Ha; } clone() { const Ia = new Fa(...this.map((a)=>a instanceof sa ? a.clone() : a )); - Ia.options = Object.assign({ - }, this.options); + Ia.options = Object.assign({}, this.options); return Ia; } border(Ja, Ka = true) { @@ -773,8 +764,7 @@ class Fa extends Array { } constructor(...La){ super(...La); - this.options = { - }; + this.options = {}; } } function Ma(a, b) { @@ -1159,8 +1149,7 @@ class Jc extends Array { static from(Kc) { const Lc = new this(...Kc); if (Kc instanceof Jc) { - Lc.options = Object.assign({ - }, Kc.options); + Lc.options = Object.assign({}, Kc.options); Lc.headerRow = Kc.headerRow ? Fa.from(Kc.headerRow) : undefined; } return Lc; @@ -1189,8 +1178,7 @@ class Jc extends Array { clone() { const Rc = new Jc(...this.map((a)=>a instanceof Fa ? a.clone() : Fa.from(a).clone() )); - Rc.options = Object.assign({ - }, this.options); + Rc.options = Object.assign({}, this.options); Rc.headerRow = this.headerRow?.clone(); return Rc; } @@ -1747,8 +1735,7 @@ class vd { await this.executeExecutable(this.rawArgs); } return { - options: { - }, + options: {}, args: this.rawArgs, cmd: this, literal: this.literalArgs @@ -1756,15 +1743,13 @@ class vd { } else if (this._useRawArgs) { if (ye) { return { - options: { - }, + options: {}, args: this.rawArgs, cmd: this, literal: this.literalArgs }; } - return await this.execute({ - }, ...this.rawArgs); + return await this.execute({}, ...this.rawArgs); } else { const { flags: Ae , unknown: Be , literal: Ce } = this.parseFlags(this.rawArgs); this.literalArgs = Ce; @@ -1795,8 +1780,7 @@ class vd { await Deno.stdout.writeSync(b(this.getVersion() + '\n')); Deno.exit(0); } - }, this._versionOption?.opts ?? { - })); + }, this._versionOption?.opts ?? {})); } if (this._helpOption !== false) { this.option(this._helpOption?.flags || '-h, --help', this._helpOption?.desc || 'Show this help.', Object.assign({ @@ -1807,8 +1791,7 @@ class vd { this.help(); Deno.exit(0); } - }, this._helpOption?.opts ?? { - })); + }, this._helpOption?.opts ?? {})); } return this; } diff --git a/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js b/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js index 6f0fcbb14db..607cc190a57 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js +++ b/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js @@ -14,8 +14,7 @@ return isString(string) ? string.toLowerCase() : string; }, uppercase = function(string) { return isString(string) ? string.toUpperCase() : string; - }, slice = [].slice, push = [].push, toString = Object.prototype.toString, ngMinErr1 = minErr("ng"), _angular = window1.angular, angular1 = window1.angular || (window1.angular = { - }), uid = [ + }, slice = [].slice, push = [].push, toString = Object.prototype.toString, ngMinErr1 = minErr("ng"), _angular = window1.angular, angular1 = window1.angular || (window1.angular = {}), uid = [ "0", "0", "0" @@ -66,13 +65,11 @@ return parseInt(str, 10); } function inherit(parent, extra) { - return extend(new (extend(function() { - }, { + return extend(new (extend(function() {}, { prototype: parent }))(), extra); } - function noop() { - } + function noop() {} function identity($) { return $; } @@ -146,8 +143,7 @@ }), source)destination[key] = copy(source[key]); setHashKey(destination, h); } - } else destination = source, source && (isArray(source) ? destination = copy(source, []) : isDate(source) ? destination = new Date(source.getTime()) : isRegExp(source) ? destination = new RegExp(source.source) : isObject(source) && (destination = copy(source, { - }))); + } else destination = source, source && (isArray(source) ? destination = copy(source, []) : isDate(source) ? destination = new Date(source.getTime()) : isRegExp(source) ? destination = new RegExp(source.source) : isObject(source) && (destination = copy(source, {}))); return destination; } function equals(o1, o2) { @@ -165,8 +161,7 @@ if (isDate(o1)) return isDate(o2) && o1.getTime() == o2.getTime(); if (isRegExp(o1) && isRegExp(o2)) return o1.toString() == o2.toString(); if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return !1; - for(key in keySet = { - }, o1)if (!("$" === key.charAt(0) || isFunction(o1[key]))) { + for(key in keySet = {}, o1)if (!("$" === key.charAt(0) || isFunction(o1[key]))) { if (!equals(o1[key], o2[key])) return !1; keySet[key] = !0; } @@ -213,8 +208,7 @@ element = jqLite(element).clone(); try { element.empty(); - } catch (e) { - } + } catch (e) {} var elemHtml = jqLite("
").append(element).html(); try { return 3 === element[0].nodeType ? lowercase(elemHtml) : elemHtml.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function(match, nodeName) { @@ -227,12 +221,10 @@ function tryDecodeURIComponent(value) { try { return decodeURIComponent(value); - } catch (e) { - } + } catch (e) {} } function parseKeyValue(keyValue1) { - var key_value, key, obj = { - }; + var key_value, key, obj = {}; return forEach((keyValue1 || "").split("&"), function(keyValue) { if (keyValue && isDefined(key = tryDecodeURIComponent((key_value = keyValue.split("="))[0]))) { var val = !isDefined(key_value[1]) || tryDecodeURIComponent(key_value[1]); @@ -331,8 +323,7 @@ minor: 2, dot: 5, codeName: "singularity-expansion" - }, jqCache = JQLite.cache = { - }, jqName = JQLite.expando = "ng-" + new Date().getTime(), jqId = 1, addEventListenerFn = window1.document.addEventListener ? function(element, type, fn) { + }, jqCache = JQLite.cache = {}, jqName = JQLite.expando = "ng-" + new Date().getTime(), jqId = 1, addEventListenerFn = window1.document.addEventListener ? function(element, type, fn) { element.addEventListener(type, fn, !1); } : function(element, type, fn) { element.attachEvent("on" + type, fn); @@ -393,20 +384,17 @@ delete jqCache[expandoId].data[name]; return; } - expandoStore.handle && (expandoStore.events.$destroy && expandoStore.handle({ - }, "$destroy"), jqLiteOff(element)), delete jqCache[expandoId], element[jqName] = undefined; + expandoStore.handle && (expandoStore.events.$destroy && expandoStore.handle({}, "$destroy"), jqLiteOff(element)), delete jqCache[expandoId], element[jqName] = undefined; } } function jqLiteExpandoStore(element, key, value) { var expandoId = element[jqName], expandoStore = jqCache[expandoId || -1]; if (!isDefined(value)) return expandoStore && expandoStore[key]; - expandoStore || (element[jqName] = expandoId = ++jqId, expandoStore = jqCache[expandoId] = { - }), expandoStore[key] = value; + expandoStore || (element[jqName] = expandoId = ++jqId, expandoStore = jqCache[expandoId] = {}), expandoStore[key] = value; } function jqLiteData(element, key, value) { var data = jqLiteExpandoStore(element, "data"), isSetter = isDefined(value), keyDefined = !isSetter && isDefined(key), isSimpleGetter = keyDefined && !isObject(key); - if (data || isSimpleGetter || jqLiteExpandoStore(element, "data", data = { - }), isSetter) data[key] = value; + if (data || isSimpleGetter || jqLiteExpandoStore(element, "data", data = {}), isSetter) data[key] = value; else { if (!keyDefined) return data; if (isSimpleGetter) return data && data[key]; @@ -474,13 +462,11 @@ push: push, sort: [].sort, splice: [].splice - }, BOOLEAN_ATTR = { - }; + }, BOOLEAN_ATTR = {}; forEach("multiple,selected,checked,disabled,readOnly,required,open".split(","), function(value) { BOOLEAN_ATTR[lowercase(value)] = value; }); - var BOOLEAN_ELEMENTS = { - }; + var BOOLEAN_ELEMENTS = {}; function getBooleanAttrName(element, name) { var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; return booleanAttr && BOOLEAN_ELEMENTS[element.nodeName] && booleanAttr; @@ -587,8 +573,7 @@ on: function onFn(element, type2, fn1, unsupported) { if (isDefined(unsupported)) throw jqLiteMinErr("onargs", "jqLite#on() does not support the `selector` or `eventData` parameters"); var element2, events, eventHandler, events1 = jqLiteExpandoStore(element, "events"), handle = jqLiteExpandoStore(element, "handle"); - events1 || jqLiteExpandoStore(element, "events", events1 = { - }), handle || jqLiteExpandoStore(element, "handle", handle = (element2 = element, events = events1, (eventHandler = function(event, type) { + events1 || jqLiteExpandoStore(element, "events", events1 = {}), handle || jqLiteExpandoStore(element, "handle", handle = (element2 = element, events = events1, (eventHandler = function(event, type) { if (event.preventDefault || (event.preventDefault = function() { event.returnValue = !1; }), event.stopPropagation || (event.stopPropagation = function() { @@ -694,8 +679,7 @@ }, clone: jqLiteClone, triggerHandler: function(element, eventName, eventData) { - var eventFns = (jqLiteExpandoStore(element, "events") || { - })[eventName]; + var eventFns = (jqLiteExpandoStore(element, "events") || {})[eventName]; eventData = eventData || []; var event = [ { @@ -734,8 +718,7 @@ }), fn.$inject = $inject) : isArray(fn) ? (last = fn.length - 1, assertArgFn(fn[last], "fn"), $inject = fn.slice(0, last)) : assertArgFn(fn, "fn", !0), $inject; } function createInjector(modulesToLoad1) { - var INSTANTIATING = { - }, providerSuffix = "Provider", path = [], loadedModules = new HashMap(), providerCache = { + var INSTANTIATING = {}, providerSuffix = "Provider", path = [], loadedModules = new HashMap(), providerCache = { $provide: { provider: supportObject(provider1), factory: supportObject(factory1), @@ -765,8 +748,7 @@ } }, providerInjector = providerCache.$injector = createInternalInjector(providerCache, function() { throw $injectorMinErr1("unpr", "Unknown provider: {0}", path.join(" <- ")); - }), instanceCache = { - }, instanceInjector = instanceCache.$injector = createInternalInjector(instanceCache, function(servicename) { + }), instanceCache = {}, instanceInjector = instanceCache.$injector = createInternalInjector(instanceCache, function(servicename) { var provider = providerInjector.get(servicename + providerSuffix); return instanceInjector.invoke(provider.$get, provider); }); @@ -828,8 +810,7 @@ return { invoke: invoke, instantiate: function(Type, locals) { - var instance, returnedValue, Constructor = function() { - }; + var instance, returnedValue, Constructor = function() {}; return Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype, isObject(returnedValue = invoke(Type, instance = new Constructor(), locals)) || isFunction(returnedValue) ? returnedValue : instance; }, get: getService, @@ -867,8 +848,7 @@ var $animateMinErr = minErr("$animate"), $AnimateProvider = [ "$provide", function($provide) { - this.$$selectors = { - }, this.register = function(name, factory) { + this.$$selectors = {}, this.register = function(name, factory) { var key = name + "-animation"; if (name && "." != name.charAt(0)) throw $animateMinErr("notcsel", "Expecting class selector starting with '.' got '{0}'.", name); this.$$selectors[name.substr(1)] = key, $provide.factory(key, factory); @@ -902,8 +882,7 @@ } ]; function Browser(window, document, $log, $sniffer) { - var self = this, rawDocument = document[0], location = window.location, history = window.history, setTimeout1 = window.setTimeout, clearTimeout = window.clearTimeout, pendingDeferIds = { - }; + var self = this, rawDocument = document[0], location = window.location, history = window.history, setTimeout1 = window.setTimeout, clearTimeout = window.clearTimeout, pendingDeferIds = {}; self.isMock = !1; var outstandingRequestCount = 0, outstandingRequestCallbacks = []; function completeOutstandingRequest(fn) { @@ -949,14 +928,12 @@ var href = baseElement.attr("href"); return href ? href.replace(/^https?\:\/\/[^\/]*/, "") : ""; }; - var lastCookies = { - }, lastCookieString = "", cookiePath = self.baseHref(); + var lastCookies = {}, lastCookieString = "", cookiePath = self.baseHref(); self.cookies = function(name, value) { var cookieLength, cookieArray, cookie, i, index; if (name) value === undefined ? rawDocument.cookie = escape(name) + "=;path=" + cookiePath + ";expires=Thu, 01 Jan 1970 00:00:00 GMT" : isString(value) && (cookieLength = (rawDocument.cookie = escape(name) + "=" + escape(value) + ";path=" + cookiePath).length + 1) > 4096 && $log.warn("Cookie '" + name + "' possibly not set or overflowed because it was too large (" + cookieLength + " > 4096 bytes)!"); else { - if (rawDocument.cookie !== lastCookieString) for(i = 0, cookieArray = (lastCookieString = rawDocument.cookie).split("; "), lastCookies = { - }; i < cookieArray.length; i++)(index = (cookie = cookieArray[i]).indexOf("=")) > 0 && undefined === lastCookies[name = unescape(cookie.substring(0, index))] && (lastCookies[name] = unescape(cookie.substring(index + 1))); + if (rawDocument.cookie !== lastCookieString) for(i = 0, cookieArray = (lastCookieString = rawDocument.cookie).split("; "), lastCookies = {}; i < cookieArray.length; i++)(index = (cookie = cookieArray[i]).indexOf("=")) > 0 && undefined === lastCookies[name = unescape(cookie.substring(0, index))] && (lastCookies[name] = unescape(cookie.substring(index + 1))); return lastCookies; } }, self.defer = function(fn, delay) { @@ -981,16 +958,12 @@ } function $CacheFactoryProvider() { this.$get = function() { - var caches = { - }; + var caches = {}; function cacheFactory(cacheId, options) { if (cacheId in caches) throw minErr("$cacheFactory")("iid", "CacheId '{0}' is already taken!", cacheId); - var size = 0, stats = extend({ - }, options, { + var size = 0, stats = extend({}, options, { id: cacheId - }), data = { - }, capacity = options && options.capacity || Number.MAX_VALUE, lruHash = { - }, freshEnd = null, staleEnd = null; + }), data = {}, capacity = options && options.capacity || Number.MAX_VALUE, lruHash = {}, freshEnd = null, staleEnd = null; return caches[cacheId] = { put: function(key, value) { if (refresh(lruHash[key] || (lruHash[key] = { @@ -1006,16 +979,13 @@ !!lruEntry && (lruEntry == freshEnd && (freshEnd = lruEntry.p), lruEntry == staleEnd && (staleEnd = lruEntry.n), link(lruEntry.n, lruEntry.p), delete lruHash[key], delete data[key], size--); }, removeAll: function() { - data = { - }, size = 0, lruHash = { - }, freshEnd = staleEnd = null; + data = {}, size = 0, lruHash = {}, freshEnd = staleEnd = null; }, destroy: function() { data = null, stats = null, lruHash = null, delete caches[cacheId]; }, info: function() { - return extend({ - }, stats, { + return extend({}, stats, { size: size }); } @@ -1028,8 +998,7 @@ } } return cacheFactory.info = function() { - var info = { - }; + var info = {}; return forEach(caches, function(cache, cacheId) { info[cacheId] = cache.info(); }), info; @@ -1048,8 +1017,7 @@ } var $compileMinErr = minErr("$compile"); function $CompileProvider($provide, $$sanitizeUriProvider) { - var hasDirectives = { - }, Suffix = "Directive", COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/, EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; + var hasDirectives = {}, Suffix = "Directive", COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/, EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; this.directive = function registerDirective(name, directiveFactory1) { return assertNotHasOwnProperty(name, "directive"), isString(name) ? (assertArg(directiveFactory1, "directiveFactory"), hasDirectives.hasOwnProperty(name) || (hasDirectives[name] = [], $provide.factory(name + Suffix, [ "$injector", @@ -1087,8 +1055,7 @@ "$$sanitizeUri", function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse, $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { var Attributes = function(element, attr) { - this.$$element = element, this.$attr = attr || { - }; + this.$$element = element, this.$attr = attr || {}; }; Attributes.prototype = { $normalize: directiveNormalize, @@ -1114,8 +1081,7 @@ }); }, $observe: function(key, fn) { - var attrs = this, $$observers = attrs.$$observers || (attrs.$$observers = { - }), listeners = $$observers[key] || ($$observers[key] = []); + var attrs = this, $$observers = attrs.$$observers || (attrs.$$observers = {}), listeners = $$observers[key] || ($$observers[key] = []); return listeners.push(fn), $rootScope.$evalAsync(function() { listeners.$$inter || fn(attrs[key]); }), fn; @@ -1146,8 +1112,7 @@ function safeAddClass($element, className) { try { $element.addClass(className); - } catch (e) { - } + } catch (e) {} } function compileNodes(nodeList1, transcludeFn, $rootElement1, maxPriority, ignoreDirective, previousCompileContext) { for(var nodeLinkFn1, childLinkFn1, directives, attrs, linkFnFound, linkFns = [], i1 = 0; i1 < nodeList1.length; i1++)attrs = new Attributes(), childLinkFn1 = (nodeLinkFn1 = (directives = collectDirectives(nodeList1[i1], [], attrs, 0 === i1 ? maxPriority : undefined, ignoreDirective)).length ? applyDirectivesToNode(directives, nodeList1[i1], attrs, transcludeFn, $rootElement1, null, [], [], previousCompileContext) : null) && nodeLinkFn1.terminal || !nodeList1[i1].childNodes || !nodeList1[i1].childNodes.length ? null : compileNodes(nodeList1[i1].childNodes, nodeLinkFn1 ? nodeLinkFn1.transclude : transcludeFn), linkFns.push(nodeLinkFn1), linkFns.push(childLinkFn1), linkFnFound = linkFnFound || nodeLinkFn1 || childLinkFn1, previousCompileContext = null; @@ -1186,8 +1151,7 @@ case 8: try { (match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue)) && (nName = directiveNormalize(match[1]), addDirective(directives, nName, "M", maxPriority, ignoreDirective) && (attrs[nName] = trim1(match[2]))); - } catch (e) { - } + } catch (e) {} break; } return directives.sort(byPriority), directives; @@ -1207,20 +1171,17 @@ }; } function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn1, jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, previousCompileContext) { - previousCompileContext = previousCompileContext || { - }; + previousCompileContext = previousCompileContext || {}; for(var newScopeDirective, directive1, directiveName, $template, linkFn1, directiveValue, terminalPriority = -Number.MAX_VALUE, controllerDirectives = previousCompileContext.controllerDirectives, newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, templateDirective = previousCompileContext.templateDirective, nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, hasTranscludeDirective = !1, hasElementTranscludeDirective = !1, $compileNode = templateAttrs.$$element = jqLite(compileNode), replaceDirective = originalReplaceDirective, childTranscludeFn = transcludeFn1, i2 = 0, ii1 = directives.length; i2 < ii1; i2++){ var attrStart = (directive1 = directives[i2]).$$start, attrEnd = directive1.$$end; if (attrStart && ($compileNode = groupScan(compileNode, attrStart, attrEnd)), $template = undefined, terminalPriority > directive1.priority) break; - if ((directiveValue = directive1.scope) && (newScopeDirective = newScopeDirective || directive1, !directive1.templateUrl && (assertNoDuplicate("new/isolated scope", newIsolateScopeDirective, directive1, $compileNode), isObject(directiveValue) && (newIsolateScopeDirective = directive1))), directiveName = directive1.name, !directive1.templateUrl && directive1.controller && (directiveValue = directive1.controller, assertNoDuplicate("'" + directiveName + "' controller", (controllerDirectives = controllerDirectives || { - })[directiveName], directive1, $compileNode), controllerDirectives[directiveName] = directive1), (directiveValue = directive1.transclude) && (hasTranscludeDirective = !0, directive1.$$tlb || (assertNoDuplicate("transclusion", nonTlbTranscludeDirective, directive1, $compileNode), nonTlbTranscludeDirective = directive1), "element" == directiveValue ? (hasElementTranscludeDirective = !0, terminalPriority = directive1.priority, $template = groupScan(compileNode, attrStart, attrEnd), compileNode = ($compileNode = templateAttrs.$$element = jqLite(document1.createComment(" " + directiveName + ": " + templateAttrs[directiveName] + " ")))[0], replaceWith(jqCollection, jqLite(sliceArgs($template)), compileNode), childTranscludeFn = compile($template, transcludeFn1, terminalPriority, replaceDirective && replaceDirective.name, { + if ((directiveValue = directive1.scope) && (newScopeDirective = newScopeDirective || directive1, !directive1.templateUrl && (assertNoDuplicate("new/isolated scope", newIsolateScopeDirective, directive1, $compileNode), isObject(directiveValue) && (newIsolateScopeDirective = directive1))), directiveName = directive1.name, !directive1.templateUrl && directive1.controller && (directiveValue = directive1.controller, assertNoDuplicate("'" + directiveName + "' controller", (controllerDirectives = controllerDirectives || {})[directiveName], directive1, $compileNode), controllerDirectives[directiveName] = directive1), (directiveValue = directive1.transclude) && (hasTranscludeDirective = !0, directive1.$$tlb || (assertNoDuplicate("transclusion", nonTlbTranscludeDirective, directive1, $compileNode), nonTlbTranscludeDirective = directive1), "element" == directiveValue ? (hasElementTranscludeDirective = !0, terminalPriority = directive1.priority, $template = groupScan(compileNode, attrStart, attrEnd), compileNode = ($compileNode = templateAttrs.$$element = jqLite(document1.createComment(" " + directiveName + ": " + templateAttrs[directiveName] + " ")))[0], replaceWith(jqCollection, jqLite(sliceArgs($template)), compileNode), childTranscludeFn = compile($template, transcludeFn1, terminalPriority, replaceDirective && replaceDirective.name, { nonTlbTranscludeDirective: nonTlbTranscludeDirective })) : ($template = jqLite(jqLiteClone(compileNode)).contents(), $compileNode.empty(), childTranscludeFn = compile($template, transcludeFn1))), directive1.template) if (assertNoDuplicate("template", templateDirective, directive1, $compileNode), templateDirective = directive1, directiveValue = isFunction(directive1.template) ? directive1.template($compileNode, templateAttrs) : directive1.template, directiveValue = denormalizeTemplate(directiveValue), directive1.replace) { if (replaceDirective = directive1, compileNode = ($template = jqLite("
" + trim1(directiveValue) + "
").contents())[0], 1 != $template.length || 1 !== compileNode.nodeType) throw $compileMinErr("tplrt", "Template for directive '{0}' must have exactly one root element. {1}", directiveName, ""); replaceWith(jqCollection, $compileNode, compileNode); var newTemplateAttrs = { - $attr: { - } + $attr: {} }, templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs), unprocessedDirectives = directives.splice(i2 + 1, directives.length - (i2 + 1)); newIsolateScopeDirective && markDirectivesAsIsolate(templateDirectives), directives = directives.concat(templateDirectives).concat(unprocessedDirectives), mergeTemplateAttributes(templateAttrs, newTemplateAttrs), ii1 = directives.length; } else $compileNode.html(directiveValue); @@ -1257,11 +1218,9 @@ })), value; } function nodeLinkFn(childLinkFn, scope1, linkNode, $rootElement, boundTranscludeFn) { - var attrs, $element, i, ii, linkFn, controller, isolateScope, transcludeFn, elementControllers = { - }; + var attrs, $element, i, ii, linkFn, controller, isolateScope, transcludeFn, elementControllers = {}; if ($element = (attrs = compileNode === linkNode ? templateAttrs : (function(src, dst) { - for(var key in dst = dst || { - }, src)src.hasOwnProperty(key) && "$$" !== key.substr(0, 2) && (dst[key] = src[key]); + for(var key in dst = dst || {}, src)src.hasOwnProperty(key) && "$$" !== key.substr(0, 2) && (dst[key] = src[key]); return dst; })(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr))).$$element, newIsolateScopeDirective) { var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/, $linkNode = jqLite(linkNode); @@ -1345,8 +1304,7 @@ }); } function compileTemplateUrl(directives, $compileNode, tAttrs, $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { - var afterTemplateNodeLinkFn, afterTemplateChildLinkFn, linkQueue = [], beforeTemplateCompileNode = $compileNode[0], origAsyncDirective = directives.shift(), derivedSyncDirective = extend({ - }, origAsyncDirective, { + var afterTemplateNodeLinkFn, afterTemplateChildLinkFn, linkQueue = [], beforeTemplateCompileNode = $compileNode[0], origAsyncDirective = directives.shift(), derivedSyncDirective = extend({}, origAsyncDirective, { templateUrl: null, transclude: null, replace: null, @@ -1359,8 +1317,7 @@ if (content = denormalizeTemplate(content), origAsyncDirective.replace) { if (compileNode = ($template = jqLite("
" + trim1(content) + "
").contents())[0], 1 != $template.length || 1 !== compileNode.nodeType) throw $compileMinErr("tplrt", "Template for directive '{0}' must have exactly one root element. {1}", origAsyncDirective.name, templateUrl); tempTemplateAttrs = { - $attr: { - } + $attr: {} }, replaceWith($rootElement, $compileNode, compileNode); var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); isObject(origAsyncDirective.scope) && markDirectivesAsIsolate(templateDirectives), directives = templateDirectives.concat(directives), mergeTemplateAttributes(tAttrs, tempTemplateAttrs); @@ -1406,8 +1363,7 @@ compile: function() { return { pre: function(scope, element, attr) { - var $$observers = attr.$$observers || (attr.$$observers = { - }); + var $$observers = attr.$$observers || (attr.$$observers = {}); if (EVENT_HANDLER_ATTR_REGEXP.test(name)) throw $compileMinErr("nodomevents", "Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead."); (interpolateFn = $interpolate(attr[name], !0, function(node, attrNormalizedName) { if ("srcdoc" == attrNormalizedName) return $sce.HTML; @@ -1466,8 +1422,7 @@ return values; } function $ControllerProvider() { - var controllers = { - }, CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; + var controllers = {}, CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; this.register = function(name, constructor) { assertNotHasOwnProperty(name, "controller"), isObject(name) ? extend(controllers, name) : controllers[name] = constructor; }, this.$get = [ @@ -1504,8 +1459,7 @@ ]; } function parseHeaders(headers) { - var key, val, i, parsed = { - }; + var key, val, i, parsed = {}; return headers && forEach(headers.split("\n"), function(line) { i = line.indexOf(":"), key = lowercase(trim1(line.substr(0, i))), val = trim1(line.substr(i + 1)), key && (parsed[key] ? parsed[key] += ", " + val : parsed[key] = val); }), parsed; @@ -1564,10 +1518,8 @@ transformRequest: defaults.transformRequest, transformResponse: defaults.transformResponse }, headers1 = function(config) { - var defHeaderName, lowercaseDefHeaderName, reqHeaderName, defHeaders = defaults.headers, reqHeaders = extend({ - }, config.headers); - execHeaders(defHeaders = extend({ - }, defHeaders.common, defHeaders[lowercase(config.method)])), execHeaders(reqHeaders); + var defHeaderName, lowercaseDefHeaderName, reqHeaderName, defHeaders = defaults.headers, reqHeaders = extend({}, config.headers); + execHeaders(defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)])), execHeaders(reqHeaders); defaultHeadersIteration: for(defHeaderName in defHeaders){ for(reqHeaderName in lowercaseDefHeaderName = lowercase(defHeaderName), reqHeaders)if (lowercase(reqHeaderName) === lowercaseDefHeaderName) continue defaultHeadersIteration; reqHeaders[defHeaderName] = defHeaders[defHeaderName]; @@ -1609,8 +1561,7 @@ }), promise; }, promise; function transformResponse(response) { - var resp = extend({ - }, response, { + var resp = extend({}, response, { data: transformData(response.data, response.headers, config1.transformResponse) }); return isSuccess(response.status) ? resp : $q.reject(resp); @@ -1631,8 +1582,7 @@ }), $http.pendingRequests = [], (function(names) { forEach(arguments, function(name) { $http[name] = function(url, config) { - return $http(extend(config || { - }, { + return $http(extend(config || {}, { method: name, url: url })); @@ -1641,8 +1591,7 @@ })("get", "delete", "head", "jsonp"), (function(name1) { forEach(arguments, function(name) { $http[name] = function(url, data, config) { - return $http(extend(config || { - }, { + return $http(extend(config || {}, { method: name, url: url, data: data @@ -1654,8 +1603,7 @@ var cache, cachedResp, deferred = $q.defer(), promise = deferred.promise, url = buildUrl(config.url, config.params); if ($http.pendingRequests.push(config), promise.then(removePendingReq, removePendingReq), (config.cache || defaults.cache) && !1 !== config.cache && "GET" == config.method && (cache = isObject(config.cache) ? config.cache : isObject(defaults.cache) ? defaults.cache : defaultCache), cache) if (isDefined(cachedResp = cache.get(url))) { if (cachedResp.then) return cachedResp.then(removePendingReq, removePendingReq), cachedResp; - isArray(cachedResp) ? resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2])) : resolvePromise(cachedResp, 200, { - }); + isArray(cachedResp) ? resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2])) : resolvePromise(cachedResp, 200, {}); } else cache.put(url, promise); return isUndefined(cachedResp) && $httpBackend(config.method, url, reqData, function(status, response, headersString) { cache && (isSuccess(status) ? cache.put(url, [ @@ -1696,16 +1644,13 @@ var XHR1 = window1.XMLHttpRequest || function() { try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); - } catch (e1) { - } + } catch (e1) {} try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); - } catch (e2) { - } + } catch (e2) {} try { return new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e3) { - } + } catch (e3) {} throw minErr("$httpBackend")("noxhr", "This browser does not support XMLHttpRequest."); }; function $HttpBackendProvider() { @@ -1800,8 +1745,7 @@ "$window", "$q", function($rootScope, $window, $q) { - var intervals = { - }; + var intervals = {}; function interval(fn, delay, count, invokeApply) { var setInterval = $window.setInterval, clearInterval = $window.clearInterval, deferred = $q.defer(), promise = deferred.promise, iteration = 0, skipApply = isDefined(invokeApply) && !invokeApply; return count = isDefined(count) ? count : 0, promise.then(null, null, fn), promise.$$intervalId = setInterval(function() { @@ -2010,8 +1954,7 @@ })() }; function consoleLog(type) { - var console = $window.console || { - }, logFn = console[type] || console.log || noop; + var console = $window.console || {}, logFn = console[type] || console.log || noop; return logFn.apply ? function() { var args = []; return forEach(arguments, function(arg) { @@ -2059,8 +2002,7 @@ return this.$$replace = !0, this; } }; - var $parseMinErr = minErr("$parse"), promiseWarningCache = { - }; + var $parseMinErr = minErr("$parse"), promiseWarningCache = {}; function ensureSafeMemberName(name, fullExpression) { if ("constructor" === name) throw $parseMinErr("isecfld", "Referencing \"constructor\" field in Angular expressions is disallowed! Expression: {0}", fullExpression); return name; @@ -2312,17 +2254,14 @@ this.lexer = lexer, this.$filter = $filter, this.options = options; }; function setter(obj, path, setValue, fullExp, options) { - options = options || { - }; + options = options || {}; for(var key, element = path.split("."), i = 0; element.length > 1; i++){ var propertyObj = obj[key = ensureSafeMemberName(element.shift(), fullExp)]; - propertyObj || (propertyObj = { - }, obj[key] = propertyObj), (obj = propertyObj).then && options.unwrapPromises && (promiseWarning(fullExp), "$$v" in obj || (function(promise) { + propertyObj || (propertyObj = {}, obj[key] = propertyObj), (obj = propertyObj).then && options.unwrapPromises && (promiseWarning(fullExp), "$$v" in obj || (function(promise) { promise.then(function(val) { promise.$$v = val; }); - })(obj), undefined === obj.$$v && (obj.$$v = { - }), obj = obj.$$v); + })(obj), undefined === obj.$$v && (obj.$$v = {}), obj = obj.$$v); } return obj[key = ensureSafeMemberName(element.shift(), fullExp)] = setValue, setValue; } @@ -2527,8 +2466,7 @@ }), value.constant || (allConstant = !1); }while (this.expect(",")) return this.consume("}"), extend(function(self, locals) { - for(var object = { - }, i = 0; i < keyValues.length; i++){ + for(var object = {}, i = 0; i < keyValues.length; i++){ var keyValue = keyValues[i]; object[keyValue.key] = keyValue.value(self, locals); } @@ -2539,8 +2477,7 @@ }); } }; - var getterFnCache = { - }; + var getterFnCache = {}; function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) { return ensureSafeMemberName(key0, fullExp), ensureSafeMemberName(key1, fullExp), ensureSafeMemberName(key2, fullExp), ensureSafeMemberName(key3, fullExp), ensureSafeMemberName(key4, fullExp), options.unwrapPromises ? function(scope, locals) { var promise, pathVal = locals && locals.hasOwnProperty(key0) ? locals : scope; @@ -2584,8 +2521,7 @@ return "hasOwnProperty" !== path && (getterFnCache[path] = fn), fn; } function $ParseProvider() { - var cache = { - }, $parseOptions = { + var cache = {}, $parseOptions = { csp: !1, unwrapPromises: !1, logPromiseWarnings: !0 @@ -2770,8 +2706,7 @@ }), result.promise; }, all: function(promises) { - var deferred = defer(), counter = 0, results = isArray(promises) ? [] : { - }; + var deferred = defer(), counter = 0, results = isArray(promises) ? [] : {}; return forEach(promises, function(promise, key) { counter++, ref(promise).then(function(value) { results.hasOwnProperty(key) || (results[key] = value, --counter || deferred.resolve(results)); @@ -2793,17 +2728,13 @@ "$browser", function($injector, $exceptionHandler, $parse, $browser) { function Scope() { - this.$id = nextUid(), this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null, this.this = this.$root = this, this.$$destroyed = !1, this.$$asyncQueue = [], this.$$postDigestQueue = [], this.$$listeners = { - }, this.$$isolateBindings = { - }; + this.$id = nextUid(), this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null, this.this = this.$root = this, this.$$destroyed = !1, this.$$asyncQueue = [], this.$$postDigestQueue = [], this.$$listeners = {}, this.$$isolateBindings = {}; } Scope.prototype = { constructor: Scope, $new: function(isolate) { var ChildScope, child; - return isolate ? ((child = new Scope()).$root = this.$root, child.$$asyncQueue = this.$$asyncQueue, child.$$postDigestQueue = this.$$postDigestQueue) : ((ChildScope = function() { - }).prototype = this, (child = new ChildScope()).$id = nextUid()), child.this = child, child.$$listeners = { - }, child.$parent = this, child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null, child.$$prevSibling = this.$$childTail, this.$$childHead ? (this.$$childTail.$$nextSibling = child, this.$$childTail = child) : this.$$childHead = this.$$childTail = child, child; + return isolate ? ((child = new Scope()).$root = this.$root, child.$$asyncQueue = this.$$asyncQueue, child.$$postDigestQueue = this.$$postDigestQueue) : ((ChildScope = function() {}).prototype = this, (child = new ChildScope()).$id = nextUid()), child.this = child, child.$$listeners = {}, child.$parent = this, child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null, child.$$prevSibling = this.$$childTail, this.$$childHead ? (this.$$childTail.$$nextSibling = child, this.$$childTail = child) : this.$$childHead = this.$$childTail = child, child; }, $watch: function(watchExp, listener, objectEquality) { var get = compileToFn(watchExp, "watch"), array = this.$$watchers, watcher = { @@ -2830,15 +2761,13 @@ }; }, $watchCollection: function(obj, listener) { - var oldValue, newValue, self = this, changeDetected = 0, objGetter = $parse(obj), internalArray = [], internalObject = { - }, oldLength = 0; + var oldValue, newValue, self = this, changeDetected = 0, objGetter = $parse(obj), internalArray = [], internalObject = {}, oldLength = 0; return this.$watch(function() { if (isObject(newValue = objGetter(self))) if (isArrayLike(newValue)) { oldValue !== internalArray && (oldLength = (oldValue = internalArray).length = 0, changeDetected++), oldLength !== (newLength = newValue.length) && (changeDetected++, oldValue.length = oldLength = newLength); for(var newLength, key, i = 0; i < newLength; i++)oldValue[i] !== newValue[i] && (changeDetected++, oldValue[i] = newValue[i]); } else { - for(key in oldValue !== internalObject && (oldValue = internalObject = { - }, oldLength = 0, changeDetected++), newLength = 0, newValue)newValue.hasOwnProperty(key) && (newLength++, oldValue.hasOwnProperty(key) ? oldValue[key] !== newValue[key] && (changeDetected++, oldValue[key] = newValue[key]) : (oldLength++, oldValue[key] = newValue[key], changeDetected++)); + for(key in oldValue !== internalObject && (oldValue = internalObject = {}, oldLength = 0, changeDetected++), newLength = 0, newValue)newValue.hasOwnProperty(key) && (newLength++, oldValue.hasOwnProperty(key) ? oldValue[key] !== newValue[key] && (changeDetected++, oldValue[key] = newValue[key]) : (oldLength++, oldValue[key] = newValue[key], changeDetected++)); if (oldLength > newLength) for(key in changeDetected++, oldValue)oldValue.hasOwnProperty(key) && !newValue.hasOwnProperty(key) && (oldLength--, delete oldValue[key]); } else oldValue !== newValue && (oldValue = newValue, changeDetected++); @@ -2992,8 +2921,7 @@ var fn = $parse(exp); return assertArgFn(fn, name), fn; } - function initWatchVal() { - } + function initWatchVal() {} } ]; } @@ -3062,8 +2990,7 @@ }, holderType; } $injector.has("$sanitize") && (htmlSanitizer = $injector.get("$sanitize")); - var trustedValueHolderBase = generateHolderType(), byType = { - }; + var trustedValueHolderBase = generateHolderType(), byType = {}; return byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase), byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase), byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase), byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase), byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]), { trustAs: function(type, trustedValue) { var Constructor = byType.hasOwnProperty(type) ? byType[type] : null; @@ -3143,11 +3070,7 @@ "$window", "$document", function($window, $document) { - var vendorPrefix, match, eventSupport = { - }, android = int((/android (\d+)/.exec(lowercase(($window.navigator || { - }).userAgent)) || [])[1]), boxee = /Boxee/i.test(($window.navigator || { - }).userAgent), document = $document[0] || { - }, documentMode = document.documentMode, vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/, bodyStyle = document.body && document.body.style, transitions = !1, animations = !1; + var vendorPrefix, match, eventSupport = {}, android = int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), boxee = /Boxee/i.test(($window.navigator || {}).userAgent), document = $document[0] || {}, documentMode = document.documentMode, vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/, bodyStyle = document.body && document.body.style, transitions = !1, animations = !1; if (bodyStyle) { for(var prop in bodyStyle)if (match = vendorRegex.exec(prop)) { vendorPrefix = (vendorPrefix = match[0]).substr(0, 1).toUpperCase() + vendorPrefix.substr(1); @@ -3183,8 +3106,7 @@ "$q", "$exceptionHandler", function($rootScope, $browser, $q, $exceptionHandler) { - var deferreds = { - }; + var deferreds = {}; function timeout(fn, delay, invokeApply) { var timeoutId, deferred = $q.defer(), promise = deferred.promise, skipApply = isDefined(invokeApply) && !invokeApply; return timeoutId = $browser.defer(function() { @@ -3229,8 +3151,7 @@ var suffix = "Filter"; function register(name, factory) { if (!isObject(name)) return $provide.factory(name + suffix, factory); - var filters = { - }; + var filters = {}; return forEach(name, function(filter, key) { filters[key] = register(key, filter); }), filters; @@ -3494,8 +3415,7 @@ }); }; } - }), ngAttributeAliasDirectives = { - }; + }), ngAttributeAliasDirectives = {}; forEach(BOOLEAN_ATTR, function(propName, attrName) { if ("multiple" != propName) { var normalized = directiveNormalize("ng-" + attrName); @@ -3537,8 +3457,7 @@ $setPristine: noop }; function FormController(element, attrs) { - var form = this, parentForm = element.parent().controller("form") || nullFormCtrl, invalidCount = 0, errors = form.$error = { - }, controls = []; + var form = this, parentForm = element.parent().controller("form") || nullFormCtrl, invalidCount = 0, errors = form.$error = {}, controls = []; function toggleValidCss(isValid, validationErrorKey) { validationErrorKey = validationErrorKey ? "-" + snake_case(validationErrorKey, "-") : "", element.removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey); } @@ -3758,8 +3677,7 @@ this.$render = noop, this.$isEmpty = function(value) { return isUndefined(value) || "" === value || null === value || value != value; }; - var parentForm = $element.inheritedData("$formController") || nullFormCtrl, invalidCount = 0, $error = this.$error = { - }; + var parentForm = $element.inheritedData("$formController") || nullFormCtrl, invalidCount = 0, $error = this.$error = {}; function toggleValidCss(isValid, validationErrorKey) { validationErrorKey = validationErrorKey ? "-" + snake_case(validationErrorKey, "-") : "", $element.removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey); } @@ -3922,8 +3840,7 @@ priority: 500 }; } - ], ngEventDirectives = { - }; + ], ngEventDirectives = {}; forEach("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), function(name) { var directiveName = directiveNormalize("ng-" + name); ngEventDirectives[directiveName] = [ @@ -4041,9 +3958,7 @@ return { restrict: "EA", link: function(scope, element, attr) { - var numberExp = attr.count, whenExp = attr.$attr.when && element.attr(attr.$attr.when), offset = attr.offset || 0, whens = scope.$eval(whenExp) || { - }, whensExpFns = { - }, startSymbol = $interpolate.startSymbol(), endSymbol = $interpolate.endSymbol(), isWhen = /^when(Minus)?(.+)$/; + var numberExp = attr.count, whenExp = attr.$attr.when && element.attr(attr.$attr.when), offset = attr.offset || 0, whens = scope.$eval(whenExp) || {}, whensExpFns = {}, startSymbol = $interpolate.startSymbol(), endSymbol = $interpolate.endSymbol(), isWhen = /^when(Minus)?(.+)$/; forEach(attr, function(expression, attributeName) { isWhen.test(attributeName) && (whens[lowercase(attributeName.replace("when", "").replace("Minus", "-"))] = element.attr(attr.$attr[attributeName])); }), forEach(whens, function(expression, key) { @@ -4080,11 +3995,9 @@ return key; }), match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/), !match) throw ngRepeatMinErr("iidexp", "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.", lhs); valueIdentifier = match[3] || match[1], keyIdentifier = match[2]; - var lastBlockMap = { - }; + var lastBlockMap = {}; $scope.$watchCollection(rhs, function(collection) { - var index, length, nextNode, arrayLength, childScope, key, value, trackById, trackByIdFn, collectionKeys, block1, elementsToRemove, previousNode = $element[0], nextBlockMap = { - }, nextBlockOrder = []; + var index, length, nextNode, arrayLength, childScope, key, value, trackById, trackByIdFn, collectionKeys, block1, elementsToRemove, previousNode = $element[0], nextBlockMap = {}, nextBlockOrder = []; if (isArrayLike(collection)) collectionKeys = collection, trackByIdFn = trackByIdExpFn || trackByIdArrayFn; else { for(key in trackByIdFn = trackByIdExpFn || trackByIdObjFn, collectionKeys = [], collection)collection.hasOwnProperty(key) && "$" != key.charAt(0) && collectionKeys.push(key); @@ -4155,8 +4068,7 @@ controller: [ "$scope", function() { - this.cases = { - }; + this.cases = {}; } ], link: function(scope, element, attr, ngSwitchController) { @@ -4244,8 +4156,7 @@ "$scope", "$attrs", function($element, $scope, $attrs) { - var nullOption, unknownOption, self = this, optionsMap = { - }, ngModelCtrl = nullModelCtrl; + var nullOption, unknownOption, self = this, optionsMap = {}, ngModelCtrl = nullModelCtrl; self.databound = $attrs.ngModel, self.init = function(ngModelCtrl_, nullOption_, unknownOption_) { ngModelCtrl = ngModelCtrl_, nullOption = nullOption_, unknownOption = unknownOption_; }, self.addOption = function(value) { @@ -4291,8 +4202,7 @@ "": [] }, optionGroupNames = [ "" - ], modelValue = ctrl.$modelValue, values = valuesFn(scope) || [], keys = keyName ? sortedKeys(values) : values, locals = { - }, selectedSet = !1; + ], modelValue = ctrl.$modelValue, values = valuesFn(scope) || [], keys = keyName ? sortedKeys(values) : values, locals = {}, selectedSet = !1; if (multiple) if (trackFn && isArray(modelValue)) { selectedSet = new HashMap([]); for(var trackIndex = 0; trackIndex < modelValue.length; trackIndex++)locals[valueName] = modelValue[trackIndex], selectedSet.put(trackFn(scope, locals), modelValue[trackIndex]); @@ -4305,8 +4215,7 @@ if (locals[valueName] = values[key], (optionGroup = optionGroups[optionGroupName = groupByFn(scope, locals) || ""]) || (optionGroup = optionGroups[optionGroupName] = [], optionGroupNames.push(optionGroupName)), multiple) selected = isDefined(selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals))); else { if (trackFn) { - var modelCast = { - }; + var modelCast = {}; modelCast[valueName] = modelValue, selected = trackFn(scope, modelCast) === trackFn(scope, locals); } else selected = modelValue === valueFn(scope, locals); selectedSet = selectedSet || selected; @@ -4343,8 +4252,7 @@ } nullOption && ($compile(nullOption)(scope), nullOption.removeClass("ng-scope"), nullOption.remove()), selectElement.empty(), selectElement.on("change", function() { scope.$apply(function() { - var optionGroup, key, value, optionElement, index, groupIndex, length, groupLength, trackIndex, collection = valuesFn(scope) || [], locals = { - }; + var optionGroup, key, value, optionElement, index, groupIndex, length, groupLength, trackIndex, collection = valuesFn(scope) || [], locals = {}; if (multiple) { for(groupIndex = 0, value = [], groupLength = optionGroupsCache.length; groupIndex < groupLength; groupIndex++)for(index = 1, length = (optionGroup = optionGroupsCache[groupIndex]).length; index < length; index++)if ((optionElement = optionGroup[index].element)[0].selected) { if (key = optionElement.val(), keyName && (locals[keyName] = key), trackFn) for(trackIndex = 0; trackIndex < collection.length && (locals[valueName] = collection[trackIndex], trackFn(scope, locals) != key); trackIndex++); @@ -4462,8 +4370,7 @@ } var angular = ensure(window, "angular", Object); return angular.$$minErr = angular.$$minErr || minErr, ensure(angular, "module", function() { - var modules = { - }; + var modules = {}; return function(name2, requires, configFn) { return (function(name, context) { if ("hasOwnProperty" === name) throw ngMinErr("badname", "hasOwnProperty is not a valid {0} name", context); diff --git a/crates/swc_ecma_minifier/tests/projects/output/backbone-1.1.0.js b/crates/swc_ecma_minifier/tests/projects/output/backbone-1.1.0.js index 2b0159b8c42..e5a888ede98 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/backbone-1.1.0.js +++ b/crates/swc_ecma_minifier/tests/projects/output/backbone-1.1.0.js @@ -1,7 +1,6 @@ (function() { var Backbone, root1 = this, previousBackbone = root1.Backbone, slice = [].slice; - (Backbone = "undefined" != typeof exports ? exports : root1.Backbone = { - }).VERSION = "1.1.0"; + (Backbone = "undefined" != typeof exports ? exports : root1.Backbone = {}).VERSION = "1.1.0"; var _ = root1._; _ || "undefined" == typeof require || (_ = require("underscore")), Backbone.$ = root1.jQuery || root1.Zepto || root1.ender || root1.$, Backbone.noConflict = function() { return root1.Backbone = previousBackbone, this; @@ -11,8 +10,7 @@ return eventsApi(this, "on", name, [ callback, context - ]) && callback && (this._events || (this._events = { - }), (this._events[name] || (this._events[name] = [])).push({ + ]) && callback && (this._events || (this._events = {}), (this._events[name] || (this._events[name] = [])).push({ callback: callback, context: context, ctx: context || this @@ -34,8 +32,7 @@ callback, context ])) return this; - if (!name && !callback && !context) return this._events = { - }, this; + if (!name && !callback && !context) return this._events = {}, this; for(i = 0, l = (names = name ? [ name ] : _.keys(this._events)).length; i < l; i++)if (name = names[i], events = this._events[name]) { @@ -55,8 +52,7 @@ var listeningTo = this._listeningTo; if (!listeningTo) return this; var remove = !name && !callback; - for(var id in callback || "object" != typeof name || (callback = this), obj && ((listeningTo = { - })[obj._listenId] = obj), listeningTo)(obj = listeningTo[id]).off(name, callback, this), (remove || _.isEmpty(obj._events)) && delete this._listeningTo[id]; + for(var id in callback || "object" != typeof name || (callback = this), obj && ((listeningTo = {})[obj._listenId] = obj), listeningTo)(obj = listeningTo[id]).off(name, callback, this), (remove || _.isEmpty(obj._events)) && delete this._listeningTo[id]; return this; } }, eventSplitter = /\s+/, eventsApi = function(obj, action, name, rest) { @@ -99,26 +95,18 @@ listenToOnce: "once" }, function(implementation, method) { Events[method] = function(obj, name, callback) { - return (this._listeningTo || (this._listeningTo = { - }))[obj._listenId || (obj._listenId = _.uniqueId("l"))] = obj, callback || "object" != typeof name || (callback = this), obj[implementation](name, callback, this), this; + return (this._listeningTo || (this._listeningTo = {}))[obj._listenId || (obj._listenId = _.uniqueId("l"))] = obj, callback || "object" != typeof name || (callback = this), obj[implementation](name, callback, this), this; }; }), Events.bind = Events.on, Events.unbind = Events.off, _.extend(Backbone, Events); var Model = Backbone.Model = function(attributes, options) { - var attrs = attributes || { - }; - options || (options = { - }), this.cid = _.uniqueId("c"), this.attributes = { - }, options.collection && (this.collection = options.collection), options.parse && (attrs = this.parse(attrs, options) || { - }), attrs = _.defaults({ - }, attrs, _.result(this, "defaults")), this.set(attrs, options), this.changed = { - }, this.initialize.apply(this, arguments); + var attrs = attributes || {}; + options || (options = {}), this.cid = _.uniqueId("c"), this.attributes = {}, options.collection && (this.collection = options.collection), options.parse && (attrs = this.parse(attrs, options) || {}), attrs = _.defaults({}, attrs, _.result(this, "defaults")), this.set(attrs, options), this.changed = {}, this.initialize.apply(this, arguments); }; _.extend(Model.prototype, Events, { changed: null, validationError: null, idAttribute: "id", - initialize: function() { - }, + initialize: function() {}, toJSON: function(options) { return _.clone(this.attributes); }, @@ -137,11 +125,8 @@ set: function(key, val, options) { var attr, attrs, unset, changes, silent, changing, prev, current; if (null == key) return this; - if ("object" == typeof key ? (attrs = key, options = val) : (attrs = { - })[key] = val, options || (options = { - }), !this._validate(attrs, options)) return !1; - for(attr in unset = options.unset, silent = options.silent, changes = [], changing = this._changing, this._changing = !0, changing || (this._previousAttributes = _.clone(this.attributes), this.changed = { - }), current = this.attributes, prev = this._previousAttributes, this.idAttribute in attrs && (this.id = attrs[this.idAttribute]), attrs)val = attrs[attr], _.isEqual(current[attr], val) || changes.push(attr), _.isEqual(prev[attr], val) ? delete this.changed[attr] : this.changed[attr] = val, unset ? delete current[attr] : current[attr] = val; + if ("object" == typeof key ? (attrs = key, options = val) : (attrs = {})[key] = val, options || (options = {}), !this._validate(attrs, options)) return !1; + for(attr in unset = options.unset, silent = options.silent, changes = [], changing = this._changing, this._changing = !0, changing || (this._previousAttributes = _.clone(this.attributes), this.changed = {}), current = this.attributes, prev = this._previousAttributes, this.idAttribute in attrs && (this.id = attrs[this.idAttribute]), attrs)val = attrs[attr], _.isEqual(current[attr], val) || changes.push(attr), _.isEqual(prev[attr], val) ? delete this.changed[attr] : this.changed[attr] = val, unset ? delete current[attr] : current[attr] = val; if (!silent) { changes.length && (this._pending = !0); for(var i = 0, l = changes.length; i < l; i++)this.trigger("change:" + changes[i], this, current[changes[i]], options); @@ -151,17 +136,14 @@ return this._pending = !1, this._changing = !1, this; }, unset: function(attr, options) { - return this.set(attr, void 0, _.extend({ - }, options, { + return this.set(attr, void 0, _.extend({}, options, { unset: !0 })); }, clear: function(options) { - var attrs = { - }; + var attrs = {}; for(var key in this.attributes)attrs[key] = void 0; - return this.set(attrs, _.extend({ - }, options, { + return this.set(attrs, _.extend({}, options, { unset: !0 })); }, @@ -171,8 +153,7 @@ changedAttributes: function(diff) { if (!diff) return !!this.hasChanged() && _.clone(this.changed); var val, changed = !1, old = this._changing ? this._previousAttributes : this.attributes; - for(var attr in diff)_.isEqual(old[attr], val = diff[attr]) || ((changed || (changed = { - }))[attr] = val); + for(var attr in diff)_.isEqual(old[attr], val = diff[attr]) || ((changed || (changed = {}))[attr] = val); return changed; }, previous: function(attr) { @@ -182,8 +163,7 @@ return _.clone(this._previousAttributes); }, fetch: function(options) { - void 0 === (options = options ? _.clone(options) : { - }).parse && (options.parse = !0); + void 0 === (options = options ? _.clone(options) : {}).parse && (options.parse = !0); var model = this, success = options.success; return options.success = function(resp) { if (!model.set(model.parse(resp, options), options)) return !1; @@ -192,26 +172,22 @@ }, save: function(key, val, options) { var attrs, method, xhr, attributes = this.attributes; - if (null == key || "object" == typeof key ? (attrs = key, options = val) : (attrs = { - })[key] = val, options = _.extend({ + if (null == key || "object" == typeof key ? (attrs = key, options = val) : (attrs = {})[key] = val, options = _.extend({ validate: !0 }, options), attrs && !options.wait) { if (!this.set(attrs, options)) return !1; } else if (!this._validate(attrs, options)) return !1; - attrs && options.wait && (this.attributes = _.extend({ - }, attributes, attrs)), void 0 === options.parse && (options.parse = !0); + attrs && options.wait && (this.attributes = _.extend({}, attributes, attrs)), void 0 === options.parse && (options.parse = !0); var model = this, success = options.success; return options.success = function(resp) { model.attributes = attributes; var serverAttrs = model.parse(resp, options); - if (options.wait && (serverAttrs = _.extend(attrs || { - }, serverAttrs)), _.isObject(serverAttrs) && !model.set(serverAttrs, options)) return !1; + if (options.wait && (serverAttrs = _.extend(attrs || {}, serverAttrs)), _.isObject(serverAttrs) && !model.set(serverAttrs, options)) return !1; success && success(model, resp, options), model.trigger("sync", model, resp, options); }, wrapError(this, options), "patch" == (method = this.isNew() ? "create" : options.patch ? "patch" : "update") && (options.attrs = attrs), xhr = this.sync(method, this, options), attrs && options.wait && (this.attributes = attributes), xhr; }, destroy: function(options) { - options = options ? _.clone(options) : { - }; + options = options ? _.clone(options) : {}; var model = this, success = options.success, destroy = function() { model.trigger("destroy", model, model.collection, options); }; @@ -236,16 +212,13 @@ return null == this.id; }, isValid: function(options) { - return this._validate({ - }, _.extend(options || { - }, { + return this._validate({}, _.extend(options || {}, { validate: !0 })); }, _validate: function(attrs, options) { if (!options.validate || !this.validate) return !0; - attrs = _.extend({ - }, this.attributes, attrs); + attrs = _.extend({}, this.attributes, attrs); var error = this.validationError = this.validate(attrs, options) || null; return !error || (this.trigger("invalid", this, error, _.extend(options, { validationError: error @@ -265,8 +238,7 @@ }; }); var Collection = Backbone.Collection = function(models, options) { - options || (options = { - }), options.model && (this.model = options.model), void 0 !== options.comparator && (this.comparator = options.comparator), this._reset(), this.initialize.apply(this, arguments), models && this.reset(models, _.extend({ + options || (options = {}), options.model && (this.model = options.model), void 0 !== options.comparator && (this.comparator = options.comparator), this._reset(), this.initialize.apply(this, arguments), models && this.reset(models, _.extend({ silent: !0 }, options)); }, setOptions = { @@ -279,8 +251,7 @@ }; _.extend(Collection.prototype, Events, { model: Model, - initialize: function() { - }, + initialize: function() {}, toJSON: function(options) { return this.map(function(model) { return model.toJSON(options); @@ -296,21 +267,18 @@ }, remove: function(models, options) { var i, l, index, model, singular = !_.isArray(models); - for(options || (options = { - }), i = 0, l = (models = singular ? [ + for(options || (options = {}), i = 0, l = (models = singular ? [ models ] : _.clone(models)).length; i < l; i++)(model = models[i] = this.get(models[i])) && (delete this._byId[model.id], delete this._byId[model.cid], index = this.indexOf(model), this.models.splice(index, 1), this.length--, options.silent || (options.index = index, model.trigger("remove", model, this, options)), this._removeReference(model)); return singular ? models[0] : models; }, set: function(models, options) { - (options = _.defaults({ - }, options, setOptions)).parse && (models = this.parse(models, options)); + (options = _.defaults({}, options, setOptions)).parse && (models = this.parse(models, options)); var i, l, id, model, attrs, existing, sort, singular = !_.isArray(models); models = singular ? models ? [ models ] : [] : _.clone(models); - var at = options.at, targetModel = this.model, sortable = this.comparator && null == at && !1 !== options.sort, sortAttr = _.isString(this.comparator) ? this.comparator : null, toAdd = [], toRemove = [], modelMap = { - }, add = options.add, merge = options.merge, remove = options.remove, order = !sortable && !!add && !!remove && []; + var at = options.at, targetModel = this.model, sortable = this.comparator && null == at && !1 !== options.sort, sortAttr = _.isString(this.comparator) ? this.comparator : null, toAdd = [], toRemove = [], modelMap = {}, add = options.add, merge = options.merge, remove = options.remove, order = !sortable && !!add && !!remove && []; for(i = 0, l = models.length; i < l; i++){ if (id = (attrs = models[i]) instanceof Model ? model = attrs : attrs[targetModel.prototype.idAttribute], existing = this.get(id)) remove && (modelMap[existing.cid] = !0), merge && (attrs = attrs === model ? model.attributes : attrs, options.parse && (attrs = existing.parse(attrs, options)), existing.set(attrs, options), sortable && !sort && existing.hasChanged(sortAttr) && (sort = !0)), models[i] = existing; else if (add) { @@ -338,8 +306,7 @@ return singular ? models[0] : models; }, reset: function(models, options) { - options || (options = { - }); + options || (options = {}); for(var i = 0, l = this.models.length; i < l; i++)this._removeReference(this.models[i]); return options.previousModels = this.models, this._reset(), models = this.add(models, _.extend({ silent: !0 @@ -383,23 +350,20 @@ }, sort: function(options) { if (!this.comparator) throw new Error("Cannot sort a set without a comparator"); - return options || (options = { - }), _.isString(this.comparator) || 1 === this.comparator.length ? this.models = this.sortBy(this.comparator, this) : this.models.sort(_.bind(this.comparator, this)), options.silent || this.trigger("sort", this, options), this; + return options || (options = {}), _.isString(this.comparator) || 1 === this.comparator.length ? this.models = this.sortBy(this.comparator, this) : this.models.sort(_.bind(this.comparator, this)), options.silent || this.trigger("sort", this, options), this; }, pluck: function(attr) { return _.invoke(this.models, "get", attr); }, fetch: function(options) { - void 0 === (options = options ? _.clone(options) : { - }).parse && (options.parse = !0); + void 0 === (options = options ? _.clone(options) : {}).parse && (options.parse = !0); var success = options.success, collection = this; return options.success = function(resp) { collection[options.reset ? "reset" : "set"](resp, options), success && success(collection, resp, options), collection.trigger("sync", collection, resp, options); }, wrapError(this, options), this.sync("read", this, options); }, create: function(model1, options1) { - if (options1 = options1 ? _.clone(options1) : { - }, !(model1 = this._prepareModel(model1, options1))) return !1; + if (options1 = options1 ? _.clone(options1) : {}, !(model1 = this._prepareModel(model1, options1))) return !1; options1.wait || this.add(model1, options1); var collection = this, success = options1.success; return options1.success = function(model, resp, options) { @@ -413,13 +377,11 @@ return new this.constructor(this.models); }, _reset: function() { - this.length = 0, this.models = [], this._byId = { - }; + this.length = 0, this.models = [], this._byId = {}; }, _prepareModel: function(attrs, options) { if (attrs instanceof Model) return attrs.collection || (attrs.collection = this), attrs; - (options = options ? _.clone(options) : { - }).collection = this; + (options = options ? _.clone(options) : {}).collection = this; var model = new this.model(attrs, options); return model.validationError ? (this.trigger("invalid", this, model.validationError, options), !1) : model; }, @@ -488,8 +450,7 @@ }; }); var View = Backbone.View = function(options) { - this.cid = _.uniqueId("view"), options || (options = { - }), _.extend(this, _.pick(options, viewOptions)), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents(); + this.cid = _.uniqueId("view"), options || (options = {}), _.extend(this, _.pick(options, viewOptions)), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents(); }, delegateEventSplitter = /^(\S+)\s*(.*)$/, viewOptions = [ "model", "collection", @@ -505,8 +466,7 @@ $: function(selector) { return this.$el.find(selector); }, - initialize: function() { - }, + initialize: function() {}, render: function() { return this; }, @@ -533,8 +493,7 @@ _ensureElement: function() { if (this.el) this.setElement(_.result(this, "el"), !1); else { - var attrs = _.extend({ - }, _.result(this, "attributes")); + var attrs = _.extend({}, _.result(this, "attributes")); this.id && (attrs.id = _.result(this, "id")), this.className && (attrs.class = _.result(this, "className")); var $el = Backbone.$("<" + _.result(this, "tagName") + ">").attr(attrs); this.setElement($el, !1); @@ -542,8 +501,7 @@ } }), Backbone.sync = function(method, model, options) { var type = methodMap[method]; - _.defaults(options || (options = { - }), { + _.defaults(options || (options = {}), { emulateHTTP: Backbone.emulateHTTP, emulateJSON: Backbone.emulateJSON }); @@ -553,8 +511,7 @@ }; if (options.url || (params.url = _.result(model, "url") || urlError()), null == options.data && model && ("create" === method || "update" === method || "patch" === method) && (params.contentType = "application/json", params.data = JSON.stringify(options.attrs || model.toJSON(options))), options.emulateJSON && (params.contentType = "application/x-www-form-urlencoded", params.data = params.data ? { model: params.data - } : { - }), options.emulateHTTP && ("PUT" === type || "DELETE" === type || "PATCH" === type)) { + } : {}), options.emulateHTTP && ("PUT" === type || "DELETE" === type || "PATCH" === type)) { params.type = "POST", options.emulateJSON && (params.data._method = type); var beforeSend = options.beforeSend; options.beforeSend = function(xhr) { @@ -578,12 +535,10 @@ return Backbone.$.ajax.apply(Backbone.$, arguments); }; var Router = Backbone.Router = function(options) { - options || (options = { - }), options.routes && (this.routes = options.routes), this._bindRoutes(), this.initialize.apply(this, arguments); + options || (options = {}), options.routes && (this.routes = options.routes), this._bindRoutes(), this.initialize.apply(this, arguments); }, optionalParam = /\((.*?)\)/g, namedParam = /(\(\?)?:\w+/g, splatParam = /\*\w+/g, escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; _.extend(Router.prototype, Events, { - initialize: function() { - }, + initialize: function() {}, route: function(route, name, callback) { _.isRegExp(route) || (route = this._routeToRegExp(route)), _.isFunction(name) && (callback = name, name = ""), callback || (callback = this[name]); var router = this; @@ -642,8 +597,7 @@ var loc = this.location, atRoot = loc.pathname.replace(/[^\/]$/, "$&/") === this.root; if (this._wantsHashChange && this._wantsPushState) { if (!this._hasPushState && !atRoot) return this.fragment = this.getFragment(null, !0), this.location.replace(this.root + this.location.search + "#" + this.fragment), !0; - this._hasPushState && atRoot && loc.hash && (this.fragment = this.getHash().replace(routeStripper, ""), this.history.replaceState({ - }, document.title, this.root + this.fragment + loc.search)); + this._hasPushState && atRoot && loc.hash && (this.fragment = this.getHash().replace(routeStripper, ""), this.history.replaceState({}, document.title, this.root + this.fragment + loc.search)); } if (!this.options.silent) return this.loadUrl(); }, @@ -673,8 +627,7 @@ }); var url = this.root + (fragment = this.getFragment(fragment || "")); if (fragment = fragment.replace(pathStripper, ""), this.fragment !== fragment) { - if (this.fragment = fragment, "" === fragment && "/" !== url && (url = url.slice(0, -1)), this._hasPushState) this.history[options.replace ? "replaceState" : "pushState"]({ - }, document.title, url); + if (this.fragment = fragment, "" === fragment && "/" !== url && (url = url.slice(0, -1)), this._hasPushState) this.history[options.replace ? "replaceState" : "pushState"]({}, document.title, url); else { if (!this._wantsHashChange) return this.location.assign(url); this._updateHash(this.location, fragment, options.replace), this.iframe && fragment !== this.getFragment(this.getHash(this.iframe)) && (options.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, fragment, options.replace)); diff --git a/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js b/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js index 74bc8c0154f..d1272d80d12 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js +++ b/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js @@ -1,6 +1,5 @@ !function(window1, undefined1) { - var readyList, rootjQuery1, core_strundefined = "undefined", document1 = window1.document, location = window1.location, _jQuery = window1.jQuery, _$ = window1.$, class2type = { - }, core_deletedIds = [], core_version = "1.9.1", core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, jQuery = function(selector, context) { + var readyList, rootjQuery1, core_strundefined = "undefined", document1 = window1.document, location = window1.location, _jQuery = window1.jQuery, _$ = window1.$, class2type = {}, core_deletedIds = [], core_version = "1.9.1", core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, jQuery = function(selector, context) { return new jQuery.fn.init(selector, context, rootjQuery1); }, core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, core_rnotwhite = /\S+/g, rtrim1 = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, rquickExpr1 = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, completed = function(event) { (document1.addEventListener || "load" === event.type || "complete" === document1.readyState) && (detach(), jQuery.ready()); @@ -85,12 +84,8 @@ sort: [].sort, splice: [].splice }, jQuery.fn.init.prototype = jQuery.fn, jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, target = arguments[0] || { - }, i = 1, length = arguments.length, deep = !1; - for("boolean" == typeof target && (deep = target, target = arguments[1] || { - }, i = 2), "object" == typeof target || jQuery.isFunction(target) || (target = { - }), length === i && (target = this, --i); i < length; i++)if (null != (options = arguments[i])) for(name in options)src = target[name], copy = options[name], target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, clone = src && jQuery.isArray(src) ? src : []) : clone = src && jQuery.isPlainObject(src) ? src : { - }, target[name] = jQuery.extend(deep, clone, copy)) : copy !== undefined1 && (target[name] = copy)); + var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1; + for("boolean" == typeof target && (deep = target, target = arguments[1] || {}, i = 2), "object" == typeof target || jQuery.isFunction(target) || (target = {}), length === i && (target = this, --i); i < length; i++)if (null != (options = arguments[i])) for(name in options)src = target[name], copy = options[name], target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, clone = src && jQuery.isArray(src) ? src : []) : clone = src && jQuery.isPlainObject(src) ? src : {}, target[name] = jQuery.extend(deep, clone, copy)) : copy !== undefined1 && (target[name] = copy)); return target; }, jQuery.extend({ noConflict: function(deep) { @@ -166,8 +161,7 @@ } return xml && xml.documentElement && !xml.getElementsByTagName("parsererror").length || jQuery.error("Invalid XML: " + data), xml; }, - noop: function() { - }, + noop: function() {}, globalEval: function(data1) { data1 && jQuery.trim(data1) && (window1.execScript || function(data) { window1.eval.call(window1, data); @@ -252,8 +246,7 @@ var top = !1; try { top = null == window1.frameElement && document1.documentElement; - } catch (e) { - } + } catch (e) {} top && top.doScroll && (function doScrollCheck() { if (!jQuery.isReady) { try { @@ -269,15 +262,12 @@ }, jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type["[object " + name + "]"] = name.toLowerCase(); }), rootjQuery1 = jQuery(document1); - var optionsCache = { - }; + var optionsCache = {}; jQuery.Callbacks = function(options) { var options1, object; - options = "string" == typeof options ? optionsCache[options] || (object = optionsCache[options1 = options] = { - }, jQuery.each(options1.match(core_rnotwhite) || [], function(_, flag) { + options = "string" == typeof options ? optionsCache[options] || (object = optionsCache[options1 = options] = {}, jQuery.each(options1.match(core_rnotwhite) || [], function(_, flag) { object[flag] = !0; - }), object) : jQuery.extend({ - }, options); + }), object) : jQuery.extend({}, options); var firing, memory, fired, firingLength, firingIndex, firingStart, list = [], stack = !options.once && [], fire = function(data) { for(memory = options.memory && data, fired = !0, firingIndex = firingStart || 0, firingStart = 0, firingLength = list.length, firing = !0; list && firingIndex < firingLength; firingIndex++)if (!1 === list[firingIndex].apply(data[0], data[1]) && options.stopOnFalse) { memory = !1; @@ -378,8 +368,7 @@ promise: function(obj) { return null != obj ? jQuery.extend(obj, promise) : promise; } - }, deferred = { - }; + }, deferred = {}; return promise.pipe = promise.then, jQuery.each(tuples, function(i, tuple) { var list = tuple[2], stateString = tuple[3]; promise[tuple[1]] = list.add, stateString && list.add(function() { @@ -400,8 +389,7 @@ } }), jQuery.support = (function() { var support, all, a, input, select, fragment, opt, eventName, isSupported, i, div = document1.createElement("div"); - if (div.setAttribute("className", "t"), div.innerHTML = "
a", all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0], !all || !a || !all.length) return { - }; + if (div.setAttribute("className", "t"), div.innerHTML = "
a", all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0], !all || !a || !all.length) return {}; opt = (select = document1.createElement("select")).appendChild(document1.createElement("option")), input = div.getElementsByTagName("input")[0], a.style.cssText = "top:1px;float:left;opacity:.5", support = { getSetAttribute: "t" !== div.className, leadingWhitespace: 3 === div.firstChild.nodeType, @@ -438,20 +426,16 @@ })div.setAttribute(eventName = "on" + i, "t"), support[i + "Bubbles"] = eventName in window1 || !1 === div.attributes[eventName].expando; return div.style.backgroundClip = "content-box", div.cloneNode(!0).style.backgroundClip = "", support.clearCloneStyle = "content-box" === div.style.backgroundClip, jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document1.getElementsByTagName("body")[0]; - body && ((container = document1.createElement("div")).style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", body.appendChild(container).appendChild(div), div.innerHTML = "
t
", (tds = div.getElementsByTagName("td"))[0].style.cssText = "padding:0;margin:0;border:0;display:none", isSupported = 0 === tds[0].offsetHeight, tds[0].style.display = "", tds[1].style.display = "none", support.reliableHiddenOffsets = isSupported && 0 === tds[0].offsetHeight, div.innerHTML = "", div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", support.boxSizing = 4 === div.offsetWidth, support.doesNotIncludeMarginInBodyOffset = 1 !== body.offsetTop, window1.getComputedStyle && (support.pixelPosition = "1%" !== (window1.getComputedStyle(div, null) || { - }).top, support.boxSizingReliable = "4px" === (window1.getComputedStyle(div, null) || { + body && ((container = document1.createElement("div")).style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", body.appendChild(container).appendChild(div), div.innerHTML = "
t
", (tds = div.getElementsByTagName("td"))[0].style.cssText = "padding:0;margin:0;border:0;display:none", isSupported = 0 === tds[0].offsetHeight, tds[0].style.display = "", tds[1].style.display = "none", support.reliableHiddenOffsets = isSupported && 0 === tds[0].offsetHeight, div.innerHTML = "", div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", support.boxSizing = 4 === div.offsetWidth, support.doesNotIncludeMarginInBodyOffset = 1 !== body.offsetTop, window1.getComputedStyle && (support.pixelPosition = "1%" !== (window1.getComputedStyle(div, null) || {}).top, support.boxSizingReliable = "4px" === (window1.getComputedStyle(div, null) || { width: "4px" - }).width, (marginDiv = div.appendChild(document1.createElement("div"))).style.cssText = div.style.cssText = divReset, marginDiv.style.marginRight = marginDiv.style.width = "0", div.style.width = "1px", support.reliableMarginRight = !parseFloat((window1.getComputedStyle(marginDiv, null) || { - }).marginRight)), typeof div.style.zoom !== core_strundefined && (div.innerHTML = "", div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1", support.inlineBlockNeedsLayout = 3 === div.offsetWidth, div.style.display = "block", div.innerHTML = "
", div.firstChild.style.width = "5px", support.shrinkWrapBlocks = 3 !== div.offsetWidth, support.inlineBlockNeedsLayout && (body.style.zoom = 1)), body.removeChild(container), container = div = tds = marginDiv = null); + }).width, (marginDiv = div.appendChild(document1.createElement("div"))).style.cssText = div.style.cssText = divReset, marginDiv.style.marginRight = marginDiv.style.width = "0", div.style.width = "1px", support.reliableMarginRight = !parseFloat((window1.getComputedStyle(marginDiv, null) || {}).marginRight)), typeof div.style.zoom !== core_strundefined && (div.innerHTML = "", div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1", support.inlineBlockNeedsLayout = 3 === div.offsetWidth, div.style.display = "block", div.innerHTML = "
", div.firstChild.style.width = "5px", support.shrinkWrapBlocks = 3 !== div.offsetWidth, support.inlineBlockNeedsLayout && (body.style.zoom = 1)), body.removeChild(container), container = div = tds = marginDiv = null); }), all = select = fragment = opt = a = input = null, support; })(); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData(elem, name, data, pvt) { if (jQuery.acceptData(elem)) { var thisCache, ret, internalKey = jQuery.expando, getByName = "string" == typeof name, isNode = elem.nodeType, cache = isNode ? jQuery.cache : elem, id = isNode ? elem[internalKey] : elem[internalKey] && internalKey; - if (id && cache[id] && (pvt || cache[id].data) || !getByName || data !== undefined1) return id || (isNode ? elem[internalKey] = id = core_deletedIds.pop() || jQuery.guid++ : id = internalKey), cache[id] || (cache[id] = { - }, isNode || (cache[id].toJSON = jQuery.noop)), ("object" == typeof name || "function" == typeof name) && (pvt ? cache[id] = jQuery.extend(cache[id], name) : cache[id].data = jQuery.extend(cache[id].data, name)), thisCache = cache[id], pvt || (thisCache.data || (thisCache.data = { - }), thisCache = thisCache.data), data !== undefined1 && (thisCache[jQuery.camelCase(name)] = data), getByName ? null == (ret = thisCache[name]) && (ret = thisCache[jQuery.camelCase(name)]) : ret = thisCache, ret; + if (id && cache[id] && (pvt || cache[id].data) || !getByName || data !== undefined1) return id || (isNode ? elem[internalKey] = id = core_deletedIds.pop() || jQuery.guid++ : id = internalKey), cache[id] || (cache[id] = {}, isNode || (cache[id].toJSON = jQuery.noop)), ("object" == typeof name || "function" == typeof name) && (pvt ? cache[id] = jQuery.extend(cache[id], name) : cache[id].data = jQuery.extend(cache[id].data, name)), thisCache = cache[id], pvt || (thisCache.data || (thisCache.data = {}), thisCache = thisCache.data), data !== undefined1 && (thisCache[jQuery.camelCase(name)] = data), getByName ? null == (ret = thisCache[name]) && (ret = thisCache[jQuery.camelCase(name)]) : ret = thisCache, ret; } } function internalRemoveData(elem, name, pvt) { @@ -478,8 +462,7 @@ if ("string" == typeof (data = elem.getAttribute(name))) { try { data = "true" === data || "false" !== data && ("null" === data ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data); - } catch (e) { - } + } catch (e) {} jQuery.data(elem, key, data); } else data = undefined1; } @@ -491,8 +474,7 @@ return !0; } jQuery.extend({ - cache: { - }, + cache: {}, expando: "jQuery" + (core_version + Math.random()).replace(/\D/g, ""), noData: { embed: !0, @@ -614,8 +596,7 @@ return name = jQuery.propFix[name] || name, this.each(function() { try { this[name] = undefined1, delete this[name]; - } catch (e) { - } + } catch (e) {} }); }, addClass: function(value) { @@ -841,18 +822,14 @@ return !1; } jQuery.event = { - global: { - }, + global: {}, add: function(elem, types, handler, data, selector) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data(null); - if (elemData) for(handler.handler && (handler = (handleObjIn = handler).handler, selector = handleObjIn.selector), handler.guid || (handler.guid = jQuery.guid++), (events = elemData.events) || (events = elemData.events = { - }), (eventHandle = elemData.handle) || ((eventHandle = elemData.handle = function(e) { + if (elemData) for(handler.handler && (handler = (handleObjIn = handler).handler, selector = handleObjIn.selector), handler.guid || (handler.guid = jQuery.guid++), (events = elemData.events) || (events = elemData.events = {}), (eventHandle = elemData.handle) || ((eventHandle = elemData.handle = function(e) { return "function" === core_strundefined || e && jQuery.event.triggered === e.type ? undefined1 : jQuery.event.dispatch.apply(eventHandle.elem, arguments); }).elem = null), t = (types = (types || "").match(core_rnotwhite) || [ "" - ]).length; t--;)type = origType = (tmp = rtypenamespace.exec(types[t]) || [])[1], namespaces = (tmp[2] || "").split(".").sort(), special = jQuery.event.special[type] || { - }, type = (selector ? special.delegateType : special.bindType) || type, special = jQuery.event.special[type] || { - }, handleObj = jQuery.extend({ + ]).length; t--;)type = origType = (tmp = rtypenamespace.exec(types[t]) || [])[1], namespaces = (tmp[2] || "").split(".").sort(), special = jQuery.event.special[type] || {}, type = (selector ? special.delegateType : special.bindType) || type, special = jQuery.event.special[type] || {}, handleObj = jQuery.extend({ type: type, origType: origType, data: data, @@ -873,8 +850,7 @@ for(type in events)jQuery.event.remove(elem, type + types[t], handler, selector, !0); continue; } - for(special = jQuery.event.special[type] || { - }, handlers = events[type = (selector ? special.delegateType : special.bindType) || type] || [], tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"), origCount = j = handlers.length; j--;)handleObj = handlers[j], (mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || "**" === selector && handleObj.selector) && (handlers.splice(j, 1), handleObj.selector && handlers.delegateCount--, special.remove && special.remove.call(elem, handleObj)); + for(special = jQuery.event.special[type] || {}, handlers = events[type = (selector ? special.delegateType : special.bindType) || type] || [], tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"), origCount = j = handlers.length; j--;)handleObj = handlers[j], (mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || "**" === selector && handleObj.selector) && (handlers.splice(j, 1), handleObj.selector && handlers.delegateCount--, special.remove && special.remove.call(elem, handleObj)); origCount && !handlers.length && (special.teardown && !1 !== special.teardown.call(elem, namespaces, elemData.handle) || jQuery.removeEvent(elem, type, elemData.handle), delete events[type]); } jQuery.isEmptyObject(events) && (delete elemData.handle, jQuery._removeData(elem, "events")); @@ -888,20 +864,17 @@ event ] : jQuery.makeArray(data, [ event - ]), special = jQuery.event.special[type] || { - }, onlyHandlers || !special.trigger || !1 !== special.trigger.apply(elem, data))) { + ]), special = jQuery.event.special[type] || {}, onlyHandlers || !special.trigger || !1 !== special.trigger.apply(elem, data))) { if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) { for(bubbleType = special.delegateType || type, rfocusMorph.test(bubbleType + type) || (cur = cur.parentNode); cur; cur = cur.parentNode)eventPath.push(cur), tmp = cur; tmp === (elem.ownerDocument || document1) && eventPath.push(tmp.defaultView || tmp.parentWindow || window1); } - for(i = 0; (cur = eventPath[i++]) && !event.isPropagationStopped();)event.type = i > 1 ? bubbleType : special.bindType || type, (handle = (jQuery._data(cur, "events") || { - })[event.type] && jQuery._data(cur, "handle")) && handle.apply(cur, data), (handle = ontype && cur[ontype]) && jQuery.acceptData(cur) && handle.apply && !1 === handle.apply(cur, data) && event.preventDefault(); + for(i = 0; (cur = eventPath[i++]) && !event.isPropagationStopped();)event.type = i > 1 ? bubbleType : special.bindType || type, (handle = (jQuery._data(cur, "events") || {})[event.type] && jQuery._data(cur, "handle")) && handle.apply(cur, data), (handle = ontype && cur[ontype]) && jQuery.acceptData(cur) && handle.apply && !1 === handle.apply(cur, data) && event.preventDefault(); if (event.type = type, !onlyHandlers && !event.isDefaultPrevented() && (!special._default || !1 === special._default.apply(elem.ownerDocument, data)) && !("click" === type && jQuery.nodeName(elem, "a")) && jQuery.acceptData(elem) && ontype && elem[type] && !jQuery.isWindow(elem)) { (tmp = elem[ontype]) && (elem[ontype] = null), jQuery.event.triggered = type; try { elem[type](); - } catch (e) { - } + } catch (e) {} jQuery.event.triggered = undefined1, tmp && (elem[ontype] = tmp); } return event.result; @@ -909,12 +882,9 @@ }, dispatch: function(event) { event = jQuery.event.fix(event); - var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call(arguments), handlers = (jQuery._data(this, "events") || { - })[event.type] || [], special = jQuery.event.special[event.type] || { - }; + var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call(arguments), handlers = (jQuery._data(this, "events") || {})[event.type] || [], special = jQuery.event.special[event.type] || {}; if (args[0] = event, event.delegateTarget = this, !special.preDispatch || !1 !== special.preDispatch.call(this, event)) { - for(handlerQueue = jQuery.event.handlers.call(this, event, handlers); (matched = handlerQueue[i++]) && !event.isPropagationStopped();)for(event.currentTarget = matched.elem; (handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped();)(!event.namespace_re || event.namespace_re.test(handleObj.namespace)) && (event.handleObj = handleObj, event.data = handleObj.data, undefined1 !== (ret = ((jQuery.event.special[handleObj.origType] || { - }).handle || handleObj.handler).apply(matched.elem, args)) && !1 === (event.result = ret) && (event.preventDefault(), event.stopPropagation())); + for(handlerQueue = jQuery.event.handlers.call(this, event, handlers); (matched = handlerQueue[i++]) && !event.isPropagationStopped();)for(event.currentTarget = matched.elem; (handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped();)(!event.namespace_re || event.namespace_re.test(handleObj.namespace)) && (event.handleObj = handleObj, event.data = handleObj.data, undefined1 !== (ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args)) && !1 === (event.result = ret) && (event.preventDefault(), event.stopPropagation())); return special.postDispatch && special.postDispatch.call(this, event), event.result; } }, @@ -939,13 +909,11 @@ fix: function(event) { if (event[jQuery.expando]) return event; var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[type]; - for(fixHook || (this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : { - }), copy = fixHook.props ? this.props.concat(fixHook.props) : this.props, event = new jQuery.Event(originalEvent), i = copy.length; i--;)event[prop = copy[i]] = originalEvent[prop]; + for(fixHook || (this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {}), copy = fixHook.props ? this.props.concat(fixHook.props) : this.props, event = new jQuery.Event(originalEvent), i = copy.length; i--;)event[prop = copy[i]] = originalEvent[prop]; return event.target || (event.target = originalEvent.srcElement || document1), 3 === event.target.nodeType && (event.target = event.target.parentNode), event.metaKey = !!event.metaKey, fixHook.filter ? fixHook.filter(event, originalEvent) : event; }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - fixHooks: { - }, + fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function(event, original) { @@ -972,8 +940,7 @@ trigger: function() { if (this !== document1.activeElement && this.focus) try { return this.focus(), !1; - } catch (e) { - } + } catch (e) {} }, delegateType: "focusin" }, @@ -993,8 +960,7 @@ var e = jQuery.extend(new jQuery.Event(), event, { type: type, isSimulated: !0, - originalEvent: { - } + originalEvent: {} }); bubble ? jQuery.event.trigger(e, null, elem) : jQuery.event.dispatch.call(elem, e), e.isDefaultPrevented() && event.preventDefault(); } @@ -1137,8 +1103,7 @@ if (elem) return jQuery.event.trigger(type, data, elem, !0); } }), (function(window, undefined) { - var i1, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches1, contains, sortOrder, expando = "sizzle" + -new Date(), preferredDoc = window.document, support = { - }, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), strundefined = "undefined", arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, indexOf = arr.indexOf || function(elem) { + var i1, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches1, contains, sortOrder, expando = "sizzle" + -new Date(), preferredDoc = window.document, support = {}, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), strundefined = "undefined", arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, indexOf = arr.indexOf || function(elem) { for(var i = 0, len = this.length; i < len; i++)if (this[i] === elem) return i; return -1; }, whitespace = "[\\x20\\t\\r\\n\\f]", characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", identifier = characterEncoding.replace("w", "w#"), attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace(3, 8) + ")*)|.*)\\)|)", rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = { @@ -1180,8 +1145,7 @@ return fn(null); } catch (e) { return !1; - } finally{ - } + } finally{} } function Sizzle(selector, context, results, seed) { var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector; @@ -1204,8 +1168,7 @@ } if (newSelector) try { return push.apply(results, slice.call(newContext.querySelectorAll(newSelector), 0)), results; - } catch (qsaError) { - } finally{ + } catch (qsaError) {} finally{ old || context.removeAttribute("id"); } } @@ -1257,8 +1220,7 @@ return support.getIdNotName = !doc.getElementById(expando), docElem.removeChild(div), pass; }), Expr.attrHandle = assert(function(div) { return div.innerHTML = "", div.firstChild && typeof div.firstChild.getAttribute !== strundefined && "#" === div.firstChild.getAttribute("href"); - }) ? { - } : { + }) ? {} : { href: function(elem) { return elem.getAttribute("href", 2); }, @@ -1345,8 +1307,7 @@ if ((elem.ownerDocument || elem) !== document && setDocument(elem), expr = expr.replace(rattributeQuotes, "='$1']"), support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr)) try { var ret = matches1.call(elem, expr); if (ret || support.disconnectedMatch || elem.document && 11 !== elem.document.nodeType) return ret; - } catch (e) { - } + } catch (e) {} return Sizzle(expr, document, null, [ elem ]).length > 0; @@ -1377,8 +1338,7 @@ cacheLength: 50, createPseudo: markFunction, match: matchExpr, - find: { - }, + find: {}, relative: { ">": { dir: "parentNode", @@ -1444,8 +1404,7 @@ if (start = [ forward ? parent.firstChild : parent.lastChild ], forward && useCache) { - for(nodeIndex = (cache = (outerCache = parent[expando] || (parent[expando] = { - }))[type] || [])[0] === dirruns && cache[1], diff = cache[0] === dirruns && cache[2], node = nodeIndex && parent.childNodes[nodeIndex]; node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop();)if (1 === node.nodeType && ++diff && node === elem) { + for(nodeIndex = (cache = (outerCache = parent[expando] || (parent[expando] = {}))[type] || [])[0] === dirruns && cache[1], diff = cache[0] === dirruns && cache[2], node = nodeIndex && parent.childNodes[nodeIndex]; node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop();)if (1 === node.nodeType && ++diff && node === elem) { outerCache[type] = [ dirruns, nodeIndex, @@ -1453,10 +1412,8 @@ ]; break; } - } else if (useCache && (cache = (elem[expando] || (elem[expando] = { - }))[type]) && cache[0] === dirruns) diff = cache[1]; - else for(; (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) && (!((ofType ? node.nodeName.toLowerCase() === name : 1 === node.nodeType) && ++diff) || (useCache && ((node[expando] || (node[expando] = { - }))[type] = [ + } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) diff = cache[1]; + else for(; (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) && (!((ofType ? node.nodeName.toLowerCase() === name : 1 === node.nodeType) && ++diff) || (useCache && ((node[expando] || (node[expando] = {}))[type] = [ dirruns, diff ]), node !== elem));); @@ -1621,8 +1578,7 @@ if (xml) { for(; elem = elem[dir];)if ((1 === elem.nodeType || checkNonElements) && matcher(elem, context, xml)) return !0; } else for(; elem = elem[dir];)if (1 === elem.nodeType || checkNonElements) { - if ((cache = (outerCache = elem[expando] || (elem[expando] = { - }))[dir]) && cache[0] === dirkey) { + if ((cache = (outerCache = elem[expando] || (elem[expando] = {}))[dir]) && cache[0] === dirkey) { if (!0 === (data = cache[1]) || data === cachedruns) return !0 === data; } else if ((cache = outerCache[dir] = [ dirkey @@ -1699,8 +1655,7 @@ } return compile(selector, match)(seed, context, documentIsXML, results, rsibling.test(selector)), results; } - function setFilters() { - } + function setFilters() {} compile = Sizzle.compile = function(selector, group) { var elementMatchers, setMatchers, matcherCachedRuns, bySet, byElement, superMatcher, i2, setMatchers1 = [], elementMatchers1 = [], cached = compilerCache[selector + " "]; if (!cached) { @@ -1841,8 +1796,7 @@ return jQuery.dir(elem, "previousSibling", until); }, siblings: function(elem) { - return jQuery.sibling((elem.parentNode || { - }).firstChild, elem); + return jQuery.sibling((elem.parentNode || {}).firstChild, elem); }, children: function(elem) { return jQuery.sibling(elem.firstChild); @@ -1938,10 +1892,8 @@ function cloneCopyEvent(src, dest) { if (1 === dest.nodeType && jQuery.hasData(src)) { var type, i, l, oldData = jQuery._data(src), curData = jQuery._data(dest, oldData), events = oldData.events; - if (events) for(type in delete curData.handle, curData.events = { - }, events)for(i = 0, l = events[type].length; i < l; i++)jQuery.event.add(dest, type, events[type][i]); - curData.data && (curData.data = jQuery.extend({ - }, curData.data)); + if (events) for(type in delete curData.handle, curData.events = {}, events)for(i = 0, l = events[type].length; i < l; i++)jQuery.event.add(dest, type, events[type][i]); + curData.data && (curData.data = jQuery.extend({}, curData.data)); } } function fixCloneNodeIssues(src, dest) { @@ -2042,8 +1994,7 @@ }, html: function(value5) { return jQuery.access(this, function(value) { - var elem = this[0] || { - }, i = 0, l = this.length; + var elem = this[0] || {}, i = 0, l = this.length; if (value === undefined1) return 1 === elem.nodeType ? elem.innerHTML.replace(rinlinejQuery, "") : undefined1; if ("string" == typeof value && !rnoInnerhtml.test(value) && (jQuery.support.htmlSerialize || !rnoshimcache.test(value)) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test(value)) && !wrapMap[(rtagName.exec(value) || [ "", @@ -2051,11 +2002,9 @@ ])[1].toLowerCase()]) { value = value.replace(rxhtmlTag, "<$1>"); try { - for(; i < l; i++)elem = this[i] || { - }, 1 === elem.nodeType && (jQuery.cleanData(getAll(elem, !1)), elem.innerHTML = value); + for(; i < l; i++)elem = this[i] || {}, 1 === elem.nodeType && (jQuery.cleanData(getAll(elem, !1)), elem.innerHTML = value); elem = 0; - } catch (e) { - } + } catch (e) {} } elem && this.empty().append(value); }, null, value5, arguments.length); @@ -2194,8 +2143,7 @@ jQuery.fn.extend({ css: function(name1, value6) { return jQuery.access(this, function(elem, name, value) { - var len, styles, map = { - }, i = 0; + var len, styles, map = {}, i = 0; if (jQuery.isArray(name)) { for(styles = getStyles(elem), len = name.length; i < len; i++)map[name[i]] = jQuery.css(elem, name[i], !1, styles); return map; @@ -2246,8 +2194,7 @@ if (name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], value === undefined1) return hooks && "get" in hooks && undefined1 !== (ret = hooks.get(elem, !1, extra)) ? ret : style[name]; if ("string" == (type = typeof value) && (ret = rrelNum.exec(value)) && (value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)), type = "number"), !(null == value || "number" === type && isNaN(value)) && ("number" !== type || jQuery.cssNumber[origName] || (value += "px"), jQuery.support.clearCloneStyle || "" !== value || 0 !== name.indexOf("background") || (style[name] = "inherit"), !hooks || !("set" in hooks) || undefined1 !== (value = hooks.set(elem, value, extra)))) try { style[name] = value; - } catch (e) { - } + } catch (e) {} } }, css: function(elem, name, extra, styles) { @@ -2255,8 +2202,7 @@ return (name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], hooks && "get" in hooks && (val = hooks.get(elem, !0, extra)), val === undefined1 && (val = curCSS(elem, name, styles)), "normal" === val && name in cssNormalTransform && (val = cssNormalTransform[name]), "" === extra || extra) ? (num = parseFloat(val), !0 === extra || jQuery.isNumeric(num) ? num || 0 : val) : val; }, swap: function(elem, options, callback, args) { - var ret, name, old = { - }; + var ret, name, old = {}; for(name in options)old[name] = elem.style[name], elem.style[name] = options[name]; for(name in ret = callback.apply(elem, args || []), options)elem.style[name] = old[name]; return ret; @@ -2325,8 +2271,7 @@ }, function(prefix, suffix) { jQuery.cssHooks[prefix + suffix] = { expand: function(value) { - for(var i = 0, expanded = { - }, parts = "string" == typeof value ? value.split(" ") : [ + for(var i = 0, expanded = {}, parts = "string" == typeof value ? value.split(" ") : [ value ]; i < 4; i++)expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; return expanded; @@ -2382,9 +2327,7 @@ }), jQuery.fn.hover = function(fnOver, fnOut) { return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); }; - var ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, _load = jQuery.fn.load, prefilters = { - }, transports = { - }, allTypes = "*/".concat("*"); + var ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, _load = jQuery.fn.load, prefilters = {}, transports = {}, allTypes = "*/".concat("*"); try { ajaxLocation = location.href; } catch (e1) { @@ -2398,8 +2341,7 @@ }; } function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { - var inspected = { - }, seekingTransport = structure === transports; + var inspected = {}, seekingTransport = structure === transports; function inspect(dataType) { var selected; return inspected[dataType] = !0, jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) { @@ -2410,10 +2352,8 @@ return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); } function ajaxExtend(target, src) { - var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || { - }; - for(key in src)undefined1 !== src[key] && ((flatOptions[key] ? target : deep || (deep = { - }))[key] = src[key]); + var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; + for(key in src)undefined1 !== src[key] && ((flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]); return deep && jQuery.extend(!0, target, deep), target; } ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [], jQuery.fn.load = function(url, params, callback) { @@ -2459,10 +2399,8 @@ }; }), jQuery.extend({ active: 0, - lastModified: { - }, - etag: { - }, + lastModified: {}, + etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", @@ -2504,19 +2442,13 @@ ajaxPrefilter: addToPrefiltersOrTransports(prefilters), ajaxTransport: addToPrefiltersOrTransports(transports), ajax: function(url, options) { - "object" == typeof url && (options = url, url = undefined1), options = options || { - }; - var parts, i3, cacheURL, responseHeadersString, timeoutTimer, fireGlobals, transport, responseHeaders, s1 = jQuery.ajaxSetup({ - }, options), callbackContext = s1.context || s1, globalEventContext = s1.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s1.statusCode || { - }, requestHeaders = { - }, requestHeadersNames = { - }, state = 0, strAbort = "canceled", jqXHR1 = { + "object" == typeof url && (options = url, url = undefined1), options = options || {}; + var parts, i3, cacheURL, responseHeadersString, timeoutTimer, fireGlobals, transport, responseHeaders, s1 = jQuery.ajaxSetup({}, options), callbackContext = s1.context || s1, globalEventContext = s1.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s1.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, state = 0, strAbort = "canceled", jqXHR1 = { readyState: 0, getResponseHeader: function(key) { var match; if (2 === state) { - if (!responseHeaders) for(responseHeaders = { - }; match = rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()] = match[2]; + if (!responseHeaders) for(responseHeaders = {}; match = rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()] = match[2]; match = responseHeaders[key.toLowerCase()]; } return null == match ? null : match; @@ -2594,8 +2526,7 @@ } if (finalDataType) return finalDataType !== dataTypes[0] && dataTypes.unshift(finalDataType), responses[finalDataType]; })(s1, jqXHR1, responses1)), status >= 200 && status < 300 || 304 === status ? (s1.ifModified && ((modified = jqXHR1.getResponseHeader("Last-Modified")) && (jQuery.lastModified[cacheURL] = modified), (modified = jqXHR1.getResponseHeader("etag")) && (jQuery.etag[cacheURL] = modified)), 204 === status ? (isSuccess = !0, statusText = "nocontent") : 304 === status ? (isSuccess = !0, statusText = "notmodified") : (statusText = (isSuccess = (function(s, response) { - var conv2, current, conv, tmp, converters = { - }, i = 0, dataTypes = s.dataTypes.slice(), prev = dataTypes[0]; + var conv2, current, conv, tmp, converters = {}, i = 0, dataTypes = s.dataTypes.slice(), prev = dataTypes[0]; if (s.dataFilter && (response = s.dataFilter(response, s.dataType)), dataTypes[1]) for(conv in s.converters)converters[conv.toLowerCase()] = s.converters[conv]; for(; current = dataTypes[++i];)if ("*" !== current) { if ("*" !== prev && prev !== current) { @@ -2702,15 +2633,13 @@ function createStandardXHR() { try { return new window1.XMLHttpRequest(); - } catch (e) { - } + } catch (e) {} } jQuery.ajaxSettings.xhr = window1.ActiveXObject ? function() { return !this.isLocal && createStandardXHR() || (function() { try { return new window1.ActiveXObject("Microsoft.XMLHTTP"); - } catch (e) { - } + } catch (e) {} })(); } : createStandardXHR, xhrSupported = jQuery.ajaxSettings.xhr(), jQuery.support.cors = !!xhrSupported && "withCredentials" in xhrSupported, xhrSupported = jQuery.support.ajax = !!xhrSupported, xhrSupported && jQuery.ajaxTransport(function(s) { if (!s.crossDomain || jQuery.support.cors) { @@ -2722,15 +2651,13 @@ s.mimeType && xhr.overrideMimeType && xhr.overrideMimeType(s.mimeType), s.crossDomain || headers["X-Requested-With"] || (headers["X-Requested-With"] = "XMLHttpRequest"); try { for(i in headers)xhr.setRequestHeader(i, headers[i]); - } catch (err) { - } + } catch (err) {} xhr.send(s.hasContent && s.data || null), callback = function(_, isAbort) { var status, responseHeaders, statusText, responses; try { if (callback && (isAbort || 4 === xhr.readyState)) if (callback = undefined1, handle && (xhr.onreadystatechange = jQuery.noop, xhrOnUnloadAbort && delete xhrCallbacks[handle]), isAbort) 4 !== xhr.readyState && xhr.abort(); else { - responses = { - }, status = xhr.status, responseHeaders = xhr.getAllResponseHeaders(), "string" == typeof xhr.responseText && (responses.text = xhr.responseText); + responses = {}, status = xhr.status, responseHeaders = xhr.getAllResponseHeaders(), "string" == typeof xhr.responseText && (responses.text = xhr.responseText); try { statusText = xhr.statusText; } catch (e) { @@ -2742,8 +2669,7 @@ isAbort || complete(-1, firefoxAccessException); } responses && complete(status, statusText, responses, responseHeaders); - }, s.async ? 4 === xhr.readyState ? setTimeout(callback) : (handle = ++xhrId, xhrOnUnloadAbort && (xhrCallbacks || (xhrCallbacks = { - }, jQuery(window1).unload(xhrOnUnloadAbort)), xhrCallbacks[handle] = callback), xhr.onreadystatechange = callback) : callback(); + }, s.async ? 4 === xhr.readyState ? setTimeout(callback) : (handle = ++xhrId, xhrOnUnloadAbort && (xhrCallbacks || (xhrCallbacks = {}, jQuery(window1).unload(xhrOnUnloadAbort)), xhrCallbacks[handle] = callback), xhr.onreadystatechange = callback) : callback(); }, abort: function() { callback && callback(undefined1, !0); @@ -2753,8 +2679,7 @@ }); var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp("^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i"), rrun = /queueHooks$/, animationPrefilters = [ function(elem, props, opts) { - var prop1, index, length, value, dataShow, toggle, tween, hooks, oldfire, anim = this, style = elem.style, orig = { - }, handled = [], hidden = elem.nodeType && isHidden(elem); + var prop1, index, length, value, dataShow, toggle, tween, hooks, oldfire, anim = this, style = elem.style, orig = {}, handled = [], hidden = elem.nodeType && isHidden(elem); for(index in opts.queue || (null == (hooks = jQuery._queueHooks(elem, "fx")).unqueued && (hooks.unqueued = 0, oldfire = hooks.empty.fire, hooks.empty.fire = function() { hooks.unqueued || oldfire(); }), hooks.unqueued++, anim.always(function() { @@ -2771,8 +2696,7 @@ if (delete props[index], toggle = toggle || "toggle" === value, value === (hidden ? "hide" : "show")) continue; handled.push(index); } - if (length = handled.length) for(("hidden" in (dataShow = jQuery._data(elem, "fxshow") || jQuery._data(elem, "fxshow", { - }))) && (hidden = dataShow.hidden), toggle && (dataShow.hidden = !hidden), hidden ? jQuery(elem).show() : anim.done(function() { + if (length = handled.length) for(("hidden" in (dataShow = jQuery._data(elem, "fxshow") || jQuery._data(elem, "fxshow", {}))) && (hidden = dataShow.hidden), toggle && (dataShow.hidden = !hidden), hidden ? jQuery(elem).show() : anim.done(function() { jQuery(elem).hide(); }), anim.done(function() { var prop; @@ -2815,11 +2739,9 @@ ]), !1); }, animation1 = deferred.promise({ elem: elem, - props: jQuery.extend({ - }, properties), + props: jQuery.extend({}, properties), opts: jQuery.extend(!0, { - specialEasing: { - } + specialEasing: {} }, options), originalProperties: properties, originalOptions: options, @@ -2924,8 +2846,7 @@ }, animate: function(prop, speed, easing, callback) { var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() { - var anim = Animation(this, jQuery.extend({ - }, prop), optall); + var anim = Animation(this, jQuery.extend({}, prop), optall); doAnimation.finish = function() { anim.stop(!0); }, (empty || jQuery._data(this, "finish")) && anim.stop(!0); @@ -2971,8 +2892,7 @@ return this.animate(props, speed, easing, callback); }; }), jQuery.speed = function(speed, easing, fn) { - var opt = speed && "object" == typeof speed ? jQuery.extend({ - }, speed) : { + var opt = speed && "object" == typeof speed ? jQuery.extend({}, speed) : { complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction(easing) && easing @@ -3001,8 +2921,7 @@ slow: 600, fast: 200, _default: 400 - }, jQuery.fx.step = { - }, jQuery.expr && jQuery.expr.filters && (jQuery.expr.filters.animated = function(elem) { + }, jQuery.fx.step = {}, jQuery.expr && jQuery.expr.filters && (jQuery.expr.filters.animated = function(elem) { return jQuery.grep(jQuery.timers, function(fn) { return elem === fn.elem; }).length; @@ -3025,9 +2944,7 @@ var curTop, curLeft, curElem = jQuery(elem), curOffset = curElem.offset(), curCSSTop = jQuery.css(elem, "top"), curCSSLeft = jQuery.css(elem, "left"), calculatePosition = ("absolute" === position || "fixed" === position) && jQuery.inArray("auto", [ curCSSTop, curCSSLeft - ]) > -1, props = { - }, curPosition = { - }; + ]) > -1, props = {}, curPosition = {}; calculatePosition ? (curTop = (curPosition = curElem.position()).top, curLeft = curPosition.left) : (curTop = parseFloat(curCSSTop) || 0, curLeft = parseFloat(curCSSLeft) || 0), jQuery.isFunction(options) && (options = options.call(elem, i, curOffset)), null != options.top && (props.top = options.top - curOffset.top + curTop), null != options.left && (props.left = options.left - curOffset.left + curLeft), "using" in options ? options.using.call(elem, props) : curElem.css(props); } }, jQuery.fn.extend({ diff --git a/crates/swc_ecma_minifier/tests/projects/output/jquery.mobile-1.4.2.js b/crates/swc_ecma_minifier/tests/projects/output/jquery.mobile-1.4.2.js index 09756bcdc27..8e443a41b89 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/jquery.mobile-1.4.2.js +++ b/crates/swc_ecma_minifier/tests/projects/output/jquery.mobile-1.4.2.js @@ -6,8 +6,7 @@ }) : factory(root.jQuery, root, doc); }(this, document, function(jQuery, window1, document1, undefined5) { var $18, rcapitals, $1, doc1, bool, docElem, refNode, fakeBody1, div1, $2, support1, $3, self1, $win1, dummyFnToInitNavigate, $4, undefined1, path2, $base, dialogHashKey, $5, undefined2, $6, path1, initialHref, $7, heldCall, curr, diff1, handler1, lastCall, $8, baseElement, base1, $9, $10, $11, $12, undefined3, rInitialLetter, iconposClass1, $13, $14, $15, meta, initialContent1, disabledZoom, enabledZoom, disabledInitially, $16, $17, undefined4, rDividerListItem, origDefaultFilterCallback; - jQuery.mobile = { - }, (function($, window, undefined) { + jQuery.mobile = {}, (function($, window, undefined) { $.extend($.mobile, { version: "1.4.2", subPageUrlKey: "ui-page", @@ -38,8 +37,7 @@ dialogHashKey: "&ui-state=dialog" }); })(jQuery, this), (function($, window, undefined) { - var nsNormalizeDict = { - }, oldFind = $.find, rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, jqmDataRE = /:jqmData\(([^)]*)\)/g; + var nsNormalizeDict = {}, oldFind = $.find, rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, jqmDataRE = /:jqmData\(([^)]*)\)/g; $.extend($.mobile, { ns: "", getAttribute: function(element, key) { @@ -47,8 +45,7 @@ (element = element.jquery ? element[0] : element) && element.getAttribute && (data = element.getAttribute("data-" + $.mobile.ns + key)); try { data = "true" === data || "false" !== data && ("null" === data ? null : +data + "" === data ? +data : rbrace.test(data) ? JSON.parse(data) : data); - } catch (err) { - } + } catch (err) {} return data; }, nsNormalizeDict: nsNormalizeDict, @@ -82,8 +79,7 @@ return "hidden" === $.css(this, "visibility"); }).length; } - $.ui = $.ui || { - }, $.extend($.ui, { + $.ui = $.ui || {}, $.extend($.ui, { version: "c0ab71056b936627e8a7821f03c044aec6280a40", keyCode: { BACKSPACE: 8, @@ -224,8 +220,7 @@ window: $(window), document: $(document1), keyCode: $.ui.keyCode, - behaviors: { - }, + behaviors: {}, silentScroll: function(ypos) { "number" !== $.type(ypos) && (ypos = $.mobile.defaultHomeScroll), $.event.special.scrollstart.enabled = !1, setTimeout(function() { window.scrollTo(0, ypos), $.mobile.document.trigger("silentscroll", { @@ -290,8 +285,7 @@ $.removeWithDependents(this); }, enhanceWithin: function() { - var index, widgetElements = { - }, keepNative = $.mobile.page.prototype.keepNativeSelector(), that = this; + var index, widgetElements = {}, keepNative = $.mobile.page.prototype.keepNativeSelector(), that = this; for(index in $.mobile.nojs && $.mobile.nojs(this), $.mobile.links && $.mobile.links(this), $.mobile.degradeInputsWithin && $.mobile.degradeInputsWithin(this), $.fn.buttonMarkup && this.find($.fn.buttonMarkup.initSelector).not(keepNative).jqmEnhanceable().buttonMarkup(), $.fn.fieldcontain && this.find(":jqmData(role='fieldcontain')").not(keepNative).jqmEnhanceable().fieldcontain(), $.each($.mobile.widgets, function(name, constructor) { if (constructor.initSelector) { var elements = $.mobile.enhanceable(that.find(constructor.initSelector)); @@ -330,25 +324,20 @@ $.cleanData = function(elems) { for(var elem, i = 0; null != (elem = elems[i]); i++)try { $(elem).triggerHandler("remove"); - } catch (e) { - } + } catch (e) {} _cleanData(elems); }, $.widget = function(name, base, prototype) { - var fullName, existingConstructor, constructor, basePrototype, proxiedPrototype = { - }, namespace = name.split(".")[0]; + var fullName, existingConstructor, constructor, basePrototype, proxiedPrototype = {}, namespace = name.split(".")[0]; return fullName = namespace + "-" + (name = name.split(".")[1]), prototype || (prototype = base, base = $.Widget), $.expr[":"][fullName.toLowerCase()] = function(elem) { return !!$.data(elem, fullName); - }, $[namespace] = $[namespace] || { - }, existingConstructor = $[namespace][name], constructor = $[namespace][name] = function(options, element) { + }, $[namespace] = $[namespace] || {}, existingConstructor = $[namespace][name], constructor = $[namespace][name] = function(options, element) { if (!this._createWidget) return new constructor(options, element); arguments.length && this._createWidget(options, element); }, $.extend(constructor, existingConstructor, { version: prototype.version, - _proto: $.extend({ - }, prototype), + _proto: $.extend({}, prototype), _childConstructors: [] - }), basePrototype = new base(), basePrototype.options = $.widget.extend({ - }, basePrototype.options), $.each(prototype, function(prop, value) { + }), basePrototype = new base(), basePrototype.options = $.widget.extend({}, basePrototype.options), $.each(prototype, function(prop, value) { if (!$.isFunction(value)) { proxiedPrototype[prop] = value; return; @@ -375,9 +364,7 @@ $.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto); }), delete existingConstructor._childConstructors) : base._childConstructors.push(constructor), $.widget.bridge(name, constructor), constructor; }, $.widget.extend = function(target) { - for(var key, value, input = slice.call(arguments, 1), inputIndex = 0, inputLength = input.length; inputIndex < inputLength; inputIndex++)for(key in input[inputIndex])value = input[inputIndex][key], input[inputIndex].hasOwnProperty(key) && value !== undefined && ($.isPlainObject(value) ? target[key] = $.isPlainObject(target[key]) ? $.widget.extend({ - }, target[key], value) : $.widget.extend({ - }, value) : target[key] = value); + for(var key, value, input = slice.call(arguments, 1), inputIndex = 0, inputLength = input.length; inputIndex < inputLength; inputIndex++)for(key in input[inputIndex])value = input[inputIndex][key], input[inputIndex].hasOwnProperty(key) && value !== undefined && ($.isPlainObject(value) ? target[key] = $.isPlainObject(target[key]) ? $.widget.extend({}, target[key], value) : $.widget.extend({}, value) : target[key] = value); return target; }, $.widget.bridge = function(name, object) { var fullName = object.prototype.widgetFullName || name; @@ -390,12 +377,10 @@ return "instance" === options ? (returnValue = instance, !1) : instance ? $.isFunction(instance[options]) && "_" !== options.charAt(0) ? (methodValue = instance[options].apply(instance, args)) !== instance && methodValue !== undefined ? (returnValue = methodValue && methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue, !1) : void 0 : $.error("no such method '" + options + "' for " + name + " widget instance") : $.error("cannot call methods on " + name + " prior to initialization; attempted to call method '" + options + "'"); }) : this.each(function() { var instance = $.data(this, fullName); - instance ? instance.option(options || { - })._init() : $.data(this, fullName, new object(options, this)); + instance ? instance.option(options || {})._init() : $.data(this, fullName, new object(options, this)); }), returnValue; }; - }, $.Widget = function() { - }, $.Widget._childConstructors = [], $.Widget.prototype = { + }, $.Widget = function() {}, $.Widget._childConstructors = [], $.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "
", @@ -404,8 +389,7 @@ create: null }, _createWidget: function(options, element) { - element = $(element || this.defaultElement || this)[0], this.element = $(element), this.uuid = uuid++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = $.widget.extend({ - }, this.options, this._getCreateOptions(), options), this.bindings = $(), this.hoverable = $(), this.focusable = $(), element !== this && ($.data(element, this.widgetFullName, this), this._on(!0, this.element, { + element = $(element || this.defaultElement || this)[0], this.element = $(element), this.uuid = uuid++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = $.widget.extend({}, this.options, this._getCreateOptions(), options), this.bindings = $(), this.hoverable = $(), this.focusable = $(), element !== this && ($.data(element, this.widgetFullName, this), this._on(!0, this.element, { remove: function(event) { event.target === element && this.destroy(); } @@ -424,13 +408,9 @@ }, option: function(key, value) { var parts, curOption, i, options = key; - if (0 === arguments.length) return $.widget.extend({ - }, this.options); - if ("string" == typeof key) if (options = { - }, key = (parts = key.split(".")).shift(), parts.length) { - for(i = 0, curOption = options[key] = $.widget.extend({ - }, this.options[key]); i < parts.length - 1; i++)curOption[parts[i]] = curOption[parts[i]] || { - }, curOption = curOption[parts[i]]; + if (0 === arguments.length) return $.widget.extend({}, this.options); + if ("string" == typeof key) if (options = {}, key = (parts = key.split(".")).shift(), parts.length) { + for(i = 0, curOption = options[key] = $.widget.extend({}, this.options[key]); i < parts.length - 1; i++)curOption[parts[i]] = curOption[parts[i]] || {}, curOption = curOption[parts[i]]; if (key = parts.pop(), value === undefined) return undefined === curOption[key] ? null : curOption[key]; curOption[key] = value; } else { @@ -499,8 +479,7 @@ }, _trigger: function(type, event, data) { var prop, orig, callback = this.options[type]; - if (data = data || { - }, (event = $.Event(event)).type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase(), event.target = this.element[0], orig = event.originalEvent) for(prop in orig)prop in event || (event[prop] = orig[prop]); + if (data = data || {}, (event = $.Event(event)).type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase(), event.target = this.element[0], orig = event.originalEvent) for(prop in orig)prop in event || (event[prop] = orig[prop]); return this.element.trigger(event, data), !($.isFunction(callback) && !1 === callback.apply(this.element[0], [ event ].concat(data)) || event.isDefaultPrevented()); @@ -514,8 +493,7 @@ effect: options }); var hasOptions, effectName = options ? !0 === options || "number" == typeof options ? defaultEffect : options.effect || defaultEffect : method; - "number" == typeof (options = options || { - }) && (options = { + "number" == typeof (options = options || {}) && (options = { duration: options }), hasOptions = !$.isEmptyObject(options), options.complete = callback, options.delay && element.delay(options.delay), hasOptions && $.effects && $.effects.effect[effectName] ? element[method](options) : effectName !== method && element[effectName] ? element[effectName](options.duration, options.easing, callback) : element.queue(function(next) { $(this)[method](), callback && callback.call(element[0]), next(); @@ -524,8 +502,7 @@ }); })(jQuery), rcapitals = /[A-Z]/g, ($18 = jQuery).extend($18.Widget.prototype, { _getCreateOptions: function() { - var option, value, elem = this.element[0], options = { - }; + var option, value, elem = this.element[0], options = {}; if (!$18.mobile.getAttribute(elem, "defaults")) for(option in this.options)null != (value = $18.mobile.getAttribute(elem, option.replace(rcapitals, function(c) { return "-" + c.toLowerCase(); }))) && (options[option] = value); @@ -556,8 +533,7 @@ }, show: function(theme, msgText, textonly) { var message, loadSettings; - this.resetHtml(), "object" === $.type(theme) ? theme = (loadSettings = $.extend({ - }, this.options, theme)).theme : (loadSettings = this.options, theme = theme || loadSettings.theme), message = msgText || (!1 === loadSettings.text ? "" : loadSettings.text), $html.addClass("ui-loading"), loadSettings.textVisible, this.element.attr("class", loaderClass + " ui-corner-all ui-body-" + theme + " ui-loader-" + (loadSettings.textVisible || msgText || theme.text ? "verbose" : "default") + (loadSettings.textonly || textonly ? " ui-loader-textonly" : "")), loadSettings.html ? this.element.html(loadSettings.html) : this.element.find("h1").text(message), this.element.appendTo($.mobile.pageContainer), this.checkLoaderPosition(), this.window.bind("scroll", $.proxy(this.checkLoaderPosition, this)); + this.resetHtml(), "object" === $.type(theme) ? theme = (loadSettings = $.extend({}, this.options, theme)).theme : (loadSettings = this.options, theme = theme || loadSettings.theme), message = msgText || (!1 === loadSettings.text ? "" : loadSettings.text), $html.addClass("ui-loading"), loadSettings.textVisible, this.element.attr("class", loaderClass + " ui-corner-all ui-body-" + theme + " ui-loader-" + (loadSettings.textVisible || msgText || theme.text ? "verbose" : "default") + (loadSettings.textonly || textonly ? " ui-loader-textonly" : "")), loadSettings.html ? this.element.html(loadSettings.html) : this.element.find("h1").text(message), this.element.appendTo($.mobile.pageContainer), this.checkLoaderPosition(), this.window.bind("scroll", $.proxy(this.checkLoaderPosition, this)); }, hide: function() { $html.removeClass("ui-loading"), this.options.text && this.element.removeClass("ui-loader-fakefix"), $.mobile.window.unbind("scroll", this.fakeFixLoader), $.mobile.window.unbind("scroll", this.checkLoaderPosition); @@ -581,8 +557,7 @@ $(fake_onhashchange.stop); } }), fake_onhashchange = (function() { - var iframe, iframe_src, timeout_id, self = { - }, last_hash = get_fragment(), fn_retval = function(val) { + var iframe, iframe_src, timeout_id, self = {}, last_hash = get_fragment(), fn_retval = function(val) { return val; }, history_set = fn_retval, history_get = fn_retval; function poll() { @@ -599,8 +574,7 @@ }).attr("src", iframe_src || "javascript:0").insertAfter("body")[0].contentWindow, doc.onpropertychange = function() { try { "title" === event.propertyName && (iframe.document.title = doc.title); - } catch (e) { - } + } catch (e) {} }); }, self.stop = fn_retval, history_get = function() { return get_fragment(iframe.location.href); @@ -618,8 +592,7 @@ return window1.matchMedia(q).matches; }, $2 = jQuery, support1 = { touch: "ontouchend" in document1 - }, $2.mobile.support = $2.mobile.support || { - }, $2.extend($2.support, support1), $2.extend($2.mobile.support, support1), (function($, undefined) { + }, $2.mobile.support = $2.mobile.support || {}, $2.extend($2.support, support1), $2.extend($2.mobile.support, support1), (function($, undefined) { $.extend($.support, { orientation: "orientation" in window1 && "onorientationchange" in window1 }); @@ -632,11 +605,9 @@ "Webkit", "Moz", "O" - ], operamini = window1.operamini && "[object OperaMini]" === ({ - }).toString.call(window1.operamini), bb = window1.blackberry && !propExists("-webkit-transform"); + ], operamini = window1.operamini && "[object OperaMini]" === ({}).toString.call(window1.operamini), bb = window1.blackberry && !propExists("-webkit-transform"); $.extend($.mobile, { - browser: { - } + browser: {} }), $.mobile.browser.oldIE = (function() { var v = 3, div = document1.createElement("div"), a = div.all || []; do div.innerHTML = ""; @@ -657,8 +628,7 @@ return !!ret && "none" !== ret; }(), boxShadow: !!propExists("boxShadow") && !bb, - fixedPosition: (w1 = window1, ua = navigator.userAgent, platform = navigator.platform, wkmatch = ua.match(/AppleWebKit\/([0-9]+)/), wkversion = !!wkmatch && wkmatch[1], ffmatch = ua.match(/Fennec\/([0-9]+)/), ffversion = !!ffmatch && ffmatch[1], operammobilematch = ua.match(/Opera Mobi\/([0-9]+)/), omversion = !!operammobilematch && operammobilematch[1], !((platform.indexOf("iPhone") > -1 || platform.indexOf("iPad") > -1 || platform.indexOf("iPod") > -1) && wkversion && wkversion < 534 || w1.operamini && "[object OperaMini]" === ({ - }).toString.call(w1.operamini) || operammobilematch && omversion < 7458 || ua.indexOf("Android") > -1 && wkversion && wkversion < 533 || ffversion && ffversion < 6 || "palmGetResource" in window1 && wkversion && wkversion < 534 || ua.indexOf("MeeGo") > -1 && ua.indexOf("NokiaBrowser/8.5.0") > -1)), + fixedPosition: (w1 = window1, ua = navigator.userAgent, platform = navigator.platform, wkmatch = ua.match(/AppleWebKit\/([0-9]+)/), wkversion = !!wkmatch && wkmatch[1], ffmatch = ua.match(/Fennec\/([0-9]+)/), ffversion = !!ffmatch && ffmatch[1], operammobilematch = ua.match(/Opera Mobi\/([0-9]+)/), omversion = !!operammobilematch && operammobilematch[1], !((platform.indexOf("iPhone") > -1 || platform.indexOf("iPad") > -1 || platform.indexOf("iPod") > -1) && wkversion && wkversion < 534 || w1.operamini && "[object OperaMini]" === ({}).toString.call(w1.operamini) || operammobilematch && omversion < 7458 || ua.indexOf("Android") > -1 && wkversion && wkversion < 533 || ffversion && ffversion < 6 || "palmGetResource" in window1 && wkversion && wkversion < 534 || ua.indexOf("MeeGo") > -1 && ua.indexOf("NokiaBrowser/8.5.0") > -1)), scrollTop: ("pageXOffset" in window1 || "scrollTop" in document1.documentElement || "scrollTop" in fakeBody[0]) && !("palmGetResource" in window1) && !operamini, dynamicBaseTag: (fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/", (base = $("head base")).length ? base.attr("href") : base = $("", { href: fauxBase @@ -680,8 +650,7 @@ }, $.mobile.ajaxBlacklist = window1.blackberry && !window1.WebKitPoint || operamini || nokiaLTE7_3, nokiaLTE7_3 && $(function() { $("head link[rel='stylesheet']").attr("rel", "alternate stylesheet").attr("rel", "stylesheet"); }), $.support.boxShadow || $("html").addClass("ui-noboxshadow"); - })(jQuery), $win1 = ($3 = jQuery).mobile.window, dummyFnToInitNavigate = function() { - }, $3.event.special.beforenavigate = { + })(jQuery), $win1 = ($3 = jQuery).mobile.window, dummyFnToInitNavigate = function() {}, $3.event.special.beforenavigate = { setup: function() { $win1.on("navigate", dummyFnToInitNavigate); }, @@ -699,8 +668,7 @@ return !0 === $3.mobile.hashListeningEnabled; }, popstate: function(event) { - var newEvent = new $3.Event("navigate"), beforeNavigate = new $3.Event("beforenavigate"), state = event.originalEvent.state || { - }; + var newEvent = new $3.Event("navigate"), beforeNavigate = new $3.Event("beforenavigate"), state = event.originalEvent.state || {}; beforeNavigate.originalEvent = event, $win1.trigger(beforeNavigate), beforeNavigate.isDefaultPrevented() || (event.historyState && $3.extend(state, event.historyState), newEvent.originalEvent = event, setTimeout(function() { $win1.trigger(newEvent, { state: state @@ -710,8 +678,7 @@ hashchange: function(event) { var newEvent = new $3.Event("navigate"), beforeNavigate = new $3.Event("beforenavigate"); beforeNavigate.originalEvent = event, $win1.trigger(beforeNavigate), beforeNavigate.isDefaultPrevented() || (newEvent.originalEvent = event, $win1.trigger(newEvent, { - state: event.hashchangeState || { - } + state: event.hashchangeState || {} })); }, setup: function() { @@ -725,8 +692,7 @@ return hash = "#" === hash ? "" : hash, uri.protocol + "//" + uri.host + uri.pathname + uri.search + hash; }, getDocumentUrl: function(asParsedObject) { - return asParsedObject ? $4.extend({ - }, path2.documentUrl) : path2.documentUrl.href; + return asParsedObject ? $4.extend({}, path2.documentUrl) : path2.documentUrl.href; }, parseLocation: function() { return this.parseUrl(this.getLocation()); @@ -850,8 +816,7 @@ return $4.mobile.allowCrossDomainPages && ("file:" === docUrl.protocol || "content:" === docUrl.protocol) && -1 !== reqUrl.search(/^https?:/); } }, path2.documentUrl = path2.parseLocation(), $base = $4("head").find("base"), path2.documentBase = $base.length ? path2.parseUrl(path2.makeUrlAbsolute($base.attr("href"), path2.documentUrl.href)) : path2.documentUrl, path2.documentBaseDiffers = path2.documentUrl.hrefNoHash !== path2.documentBase.hrefNoHash, path2.getDocumentBase = function(asParsedObject) { - return asParsedObject ? $4.extend({ - }, path2.documentBase) : path2.documentBase.href; + return asParsedObject ? $4.extend({}, path2.documentBase) : path2.documentBase.href; }, $4.extend($4.mobile, { getDocumentUrl: path2.getDocumentUrl, getDocumentBase: path2.getDocumentBase @@ -871,8 +836,7 @@ return this.stack[this.activeIndex - 1]; }, add: function(url, data) { - data = data || { - }, this.getNext() && this.clearForward(), data.hash && -1 === data.hash.indexOf("#") && (data.hash = "#" + data.hash), data.url = url, this.stack.push(data), this.activeIndex = this.stack.length - 1; + data = data || {}, this.getNext() && this.clearForward(), data.hash && -1 === data.hash.indexOf("#") && (data.hash = "#" + data.hash), data.url = url, this.stack.push(data), this.activeIndex = this.stack.length - 1; }, clearForward: function() { this.stack = this.stack.slice(0, this.activeIndex + 1); @@ -938,11 +902,9 @@ return; } this.history.direct({ - url: (event.originalEvent.state || { - }).url || hash, + url: (event.originalEvent.state || {}).url || hash, present: function(historyEntry, direction) { - event.historyState = $6.extend({ - }, historyEntry), event.historyState.direction = direction; + event.historyState = $6.extend({}, historyEntry), event.historyState.direction = direction; } }); } @@ -957,8 +919,7 @@ history = this.history, hash = path1.parseLocation().hash, this.history.direct({ url: hash, present: function(historyEntry, direction) { - event.hashchangeState = $6.extend({ - }, historyEntry), event.hashchangeState.direction = direction; + event.hashchangeState = $6.extend({}, historyEntry), event.hashchangeState.direction = direction; }, missing: function() { history.add(hash, { @@ -979,10 +940,8 @@ }); })(jQuery), (function($, undefined) { var props = { - animation: { - }, - transition: { - } + animation: {}, + transition: {} }, testElement = document1.createElement("a"), vendorPrefixes = [ "", "webkit-", @@ -1006,15 +965,13 @@ })) : (setTimeout($.proxy(callback, this), 0), $(this)); }, $.fn.animationComplete.defaultDuration = 1000; })(jQuery), (function($, window, document, undefined) { - var threshold, i1, dataPropertyName = "virtualMouseBindings", touchTargetPropertyName = "virtualTouchID", virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "), touchEventProps = "clientX clientY pageX pageY screenX screenY".split(" "), mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [], mouseEventProps = $.event.props.concat(mouseHookProps), activeDocHandlers = { - }, resetTimerID = 0, startX = 0, startY = 0, didScroll = !1, clickBlockList = [], blockMouseTriggers = !1, blockTouchTriggers = !1, eventCaptureSupported = "addEventListener" in document, $document = $(document), nextTouchID = 1, lastTouchID = 0; + var threshold, i1, dataPropertyName = "virtualMouseBindings", touchTargetPropertyName = "virtualTouchID", virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "), touchEventProps = "clientX clientY pageX pageY screenX screenY".split(" "), mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [], mouseEventProps = $.event.props.concat(mouseHookProps), activeDocHandlers = {}, resetTimerID = 0, startX = 0, startY = 0, didScroll = !1, clickBlockList = [], blockMouseTriggers = !1, blockTouchTriggers = !1, eventCaptureSupported = "addEventListener" in document, $document = $(document), nextTouchID = 1, lastTouchID = 0; function getNativeEvent(event) { for(; event && void 0 !== event.originalEvent;)event = event.originalEvent; return event; } function getVirtualBindingFlags(element) { - for(var b, k, flags = { - }; element;){ + for(var b, k, flags = {}; element;){ for(k in b = $.data(element, dataPropertyName))b[k] && (flags[k] = flags.hasVirtualBinding = !0); element = element.parentNode; } @@ -1081,14 +1038,12 @@ } return !1; } - function dummyMouseHandler() { - } + function dummyMouseHandler() {} function getSpecialEventObject(eventType) { var realType = eventType.substr(1); return { setup: function() { - hasVirtualBindings(this) || $.data(this, dataPropertyName, { - }), $.data(this, dataPropertyName)[eventType] = !0, activeDocHandlers[eventType] = (activeDocHandlers[eventType] || 0) + 1, 1 === activeDocHandlers[eventType] && $document.bind(realType, mouseEventCallback), $(this).bind(realType, dummyMouseHandler), eventCaptureSupported && (activeDocHandlers.touchstart = (activeDocHandlers.touchstart || 0) + 1, 1 === activeDocHandlers.touchstart && $document.bind("touchstart", handleTouchStart).bind("touchend", handleTouchEnd).bind("touchmove", handleTouchMove).bind("scroll", handleScroll)); + hasVirtualBindings(this) || $.data(this, dataPropertyName, {}), $.data(this, dataPropertyName)[eventType] = !0, activeDocHandlers[eventType] = (activeDocHandlers[eventType] || 0) + 1, 1 === activeDocHandlers[eventType] && $document.bind(realType, mouseEventCallback), $(this).bind(realType, dummyMouseHandler), eventCaptureSupported && (activeDocHandlers.touchstart = (activeDocHandlers.touchstart || 0) + 1, 1 === activeDocHandlers.touchstart && $document.bind("touchstart", handleTouchStart).bind("touchend", handleTouchEnd).bind("touchmove", handleTouchMove).bind("scroll", handleScroll)); }, teardown: function() { --activeDocHandlers[eventType], activeDocHandlers[eventType] || $document.unbind(realType, mouseEventCallback), eventCaptureSupported && (--activeDocHandlers.touchstart, activeDocHandlers.touchstart || $document.unbind("touchstart", handleTouchStart).unbind("touchmove", handleTouchMove).unbind("touchend", handleTouchEnd).unbind("scroll", handleScroll)); @@ -1215,8 +1170,7 @@ }, eventInProgress: !1, setup: function() { - var events, thisObject = this, $this = $(thisObject), context = { - }; + var events, thisObject = this, $this = $(thisObject), context = {}; (events = $.data(this, "mobile-events")) || (events = { length: 0 }, $.data(this, "mobile-events", events)), events.length++, events.swipe = context, context.start = function(event3) { @@ -1271,8 +1225,7 @@ $.support.orientation && (ww = window.innerWidth || win.width(), wh = window.innerHeight || win.height(), landscape_threshold = 50, initial_orientation_is_landscape = ww > wh && ww - wh > landscape_threshold, initial_orientation_is_default = portrait_map[window.orientation], (initial_orientation_is_landscape && initial_orientation_is_default || !initial_orientation_is_landscape && !initial_orientation_is_default) && (portrait_map = { "-90": !0, "90": !0 - })), $.event.special.orientationchange = $.extend({ - }, $.event.special.orientationchange, { + })), $.event.special.orientationchange = $.extend({}, $.event.special.orientationchange, { setup: function() { if ($.support.orientation && !$.event.special.orientationchange.disabled) return !1; last_orientation = get_orientation(), win.bind("throttledresize", handler); @@ -1312,8 +1265,7 @@ base1.element.attr("href", $8.mobile.path.documentBase.hrefNoSearch); } }, $8.mobile.base = base1, (function($, undefined) { - $.mobile.widgets = { - }; + $.mobile.widgets = {}; var originalWidget = $.widget, keepNativeFactoryDefault = $.mobile.keepNative; $.widget = (function(orig) { return function() { @@ -1491,8 +1443,7 @@ reverse: "back" === data.direction }; $.extend(changePageOptions, data, { - transition: (history.getLast() || { - }).transition || transition + transition: (history.getLast() || {}).transition || transition }), history.activeIndex > 0 && to.indexOf($.mobile.dialogHashKey) > -1 && history.initialDst !== to && !1 === (to = this._handleDialog(changePageOptions, data)) || this._changeContent(this._handleDestination(to), changePageOptions); }, _changeContent: function(to, opts) { @@ -1571,8 +1522,7 @@ loadMsgDelay: 50 }, load: function(url, options) { - var fileUrl, dataUrl, pblEvent, triggerData, deferred = options && options.deferred || $.Deferred(), settings = $.extend({ - }, this._loadDefaults, options), content = null, absUrl = $.mobile.path.makeUrlAbsolute(url, this._findBaseWithDefault()); + var fileUrl, dataUrl, pblEvent, triggerData, deferred = options && options.deferred || $.Deferred(), settings = $.extend({}, this._loadDefaults, options), content = null, absUrl = $.mobile.path.makeUrlAbsolute(url, this._findBaseWithDefault()); if (settings.reload = settings.reloadPage, settings.data && "get" === settings.type && (absUrl = $.mobile.path.addSearchParams(absUrl, settings.data), settings.data = undefined), settings.data && "post" === settings.type && (settings.reload = !0), fileUrl = this._createFileUrl(absUrl), dataUrl = this._createDataUrl(absUrl), 0 === (content = this._find(absUrl)).length && $.mobile.path.isEmbeddedPage(fileUrl) && !$.mobile.path.isFirstPageUrl(fileUrl)) { deferred.reject(absUrl, settings); return; @@ -1655,9 +1605,7 @@ pageTransitionQueue.unshift(arguments); return; } - var settings = $.extend({ - }, $.mobile.changePage.defaults, options), triggerData = { - }; + var settings = $.extend({}, $.mobile.changePage.defaults, options), triggerData = {}; settings.fromPage = settings.fromPage || this.activePage, this._triggerPageBeforeChange(to, triggerData, settings) && (to = triggerData.toPage, "string" === $.type(to) ? (isPageTransitioning = !0, this._loadUrl(to, triggerData, settings)) : this.transition(to, triggerData, settings)); }, transition: function(toPage, triggerData, settings) { @@ -1681,8 +1629,7 @@ }), settings.fromHashChange && (historyDir = "back" === settings.direction ? -1 : 1); try { document1.activeElement && "body" !== document1.activeElement.nodeName.toLowerCase() ? $(document1.activeElement).blur() : $("input:focus, textarea:focus, select:focus").blur(); - } catch (e) { - } + } catch (e) {} alreadyThere = !1, isDialog && active && (active.url && active.url.indexOf($.mobile.dialogHashKey) > -1 && this.activePage && !this.activePage.hasClass("ui-dialog") && $.mobile.navigate.history.activeIndex > 0 && (settings.changeHash = !1, alreadyThere = !0), url = active.url || "", !alreadyThere && url.indexOf("#") > -1 ? url += $.mobile.dialogHashKey : url += "#" + $.mobile.dialogHashKey, 0 === $.mobile.navigate.history.activeIndex && url === $.mobile.navigate.history.initialDst && (url += $.mobile.dialogHashKey)), (newPageTitle = active ? toPage.jqmData("title") || toPage.children(":jqmData(role='header')").find(".ui-title").text() : pageTitle) && pageTitle === document1.title && (pageTitle = newPageTitle), toPage.jqmData("title") || toPage.jqmData("title", pageTitle), settings.transition = settings.transition || (historyDir && !activeIsInitialPage ? active.transition : undefined) || (isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition), !historyDir && alreadyThere && ($.mobile.navigate.history.getActive().pageUrl = pageUrl), url && !settings.fromHashChange && (!$.mobile.path.isPath(url) && 0 > url.indexOf("#") && (url = "#" + url), params = { transition: settings.transition, title: pageTitle, @@ -1713,8 +1660,7 @@ } $.mobile.loadPage = function(url, opts) { var container; - return container = (opts = opts || { - }).pageContainer || $.mobile.pageContainer, opts.deferred = $.Deferred(), container.pagecontainer("load", url, opts), opts.deferred.promise(); + return container = (opts = opts || {}).pageContainer || $.mobile.pageContainer, opts.deferred = $.Deferred(), container.pagecontainer("load", url, opts), opts.deferred.promise(); }, $.mobile.back = function() { var nav = window1.navigator; this.phonegapNavigationEnabled && nav && nav.app && nav.app.backHistory ? nav.app.backHistory() : $.mobile.pageContainer.pagecontainer("back"); @@ -1841,12 +1787,9 @@ cleanFrom: function() { this.$from.removeClass($.mobile.activePageClass + " out in reverse " + this.name).height(""); }, - beforeDoneIn: function() { - }, - beforeDoneOut: function() { - }, - beforeStartOut: function() { - }, + beforeDoneIn: function() {}, + beforeDoneOut: function() {}, + beforeStartOut: function() {}, doneIn: function() { this.beforeDoneIn(), this.$to.removeClass("out in reverse " + this.name).height(""), this.toggleViewportClass(), $.mobile.window.scrollTop() !== this.toScroll && this.scrollPage(), this.sequential || this.$to.addClass($.mobile.activePageClass), this.deferred.resolve(this.name, this.reverse, this.$to, this.$from, !0); }, @@ -1908,8 +1851,7 @@ })(jQuery), ($9 = jQuery).mobile.transitionHandlers = { sequential: $9.mobile.SerialTransition, simultaneous: $9.mobile.ConcurrentTransition - }, $9.mobile.defaultTransitionHandler = $9.mobile.transitionHandlers.sequential, $9.mobile.transitionFallbacks = { - }, $9.mobile._maybeDegradeTransition = function(transition) { + }, $9.mobile.defaultTransitionHandler = $9.mobile.transitionHandlers.sequential, $9.mobile.transitionFallbacks = {}, $9.mobile._maybeDegradeTransition = function(transition) { return transition && !$9.support.cssTransform3d && $9.mobile.transitionFallbacks[transition] && (transition = $9.mobile.transitionFallbacks[transition]), transition; }, $9.mobile.getMaxScrollForTransition = $9.mobile.getMaxScrollForTransition || function() { return 3 * $9.mobile.getScreenHeight(); @@ -1984,9 +1926,7 @@ }, _handleVClickSubmit: function(event) { var attrs, $target = $(event.target).closest("vclick" === event.type ? "a" : "form"); - $target.length && !$target.jqmData("transition") && ((attrs = { - })["data-" + $.mobile.ns + "transition"] = ($.mobile.navigate.history.getActive() || { - }).transition || $.mobile.defaultDialogTransition, attrs["data-" + $.mobile.ns + "direction"] = "reverse", $target.attr(attrs)); + $target.length && !$target.jqmData("transition") && ((attrs = {})["data-" + $.mobile.ns + "transition"] = ($.mobile.navigate.history.getActive() || {}).transition || $.mobile.defaultDialogTransition, attrs["data-" + $.mobile.ns + "direction"] = "reverse", $target.attr(attrs)); }, _create: function() { var elem = this.element, opts = this.options; @@ -2056,8 +1996,7 @@ }, _getOptions: function(options) { var key, accordion = this._ui.accordion, accordionWidget = this._ui.accordionWidget; - for(key in options = $12.extend({ - }, options), accordion.length && !accordionWidget && (this._ui.accordionWidget = accordionWidget = accordion.data("mobile-collapsibleset")), options)options[key] = null != options[key] ? options[key] : accordionWidget ? accordionWidget.options[key] : accordion.length ? $12.mobile.getAttribute(accordion[0], key.replace(rInitialLetter, "-$1").toLowerCase()) : null, null == options[key] && (options[key] = $12.mobile.collapsible.defaults[key]); + for(key in options = $12.extend({}, options), accordion.length && !accordionWidget && (this._ui.accordionWidget = accordionWidget = accordion.data("mobile-collapsibleset")), options)options[key] = null != options[key] ? options[key] : accordionWidget ? accordionWidget.options[key] : accordion.length ? $12.mobile.getAttribute(accordion[0], key.replace(rInitialLetter, "-$1").toLowerCase()) : null, null == options[key] && (options[key] = $12.mobile.collapsible.defaults[key]); return options; }, _themeClassFromOption: function(prefix, value) { @@ -2225,8 +2164,7 @@ listviewClasses += this.options.inset ? " ui-listview-inset" : "", this.options.inset && (listviewClasses += this.options.corners ? " ui-corner-all" : "", listviewClasses += this.options.shadow ? " ui-shadow" : ""), this.element.addClass(" ui-listview" + listviewClasses), this.refresh(!0); }, _findFirstElementByTagName: function(ele, nextProp, lcName, ucName) { - var dict = { - }; + var dict = {}; for(dict[lcName] = dict[ucName] = !0; ele;){ if (dict[ele.nodeName]) return ele; ele = ele[nextProp]; @@ -2238,16 +2176,14 @@ for(i = 0; i < len; i++)(img = $(this._findFirstElementByTagName(containers[i].firstChild, "nextSibling", "img", "IMG"))).length && $(this._findFirstElementByTagName(img[0].parentNode, "parentNode", "li", "LI")).addClass(img.hasClass("ui-li-icon") ? "ui-li-has-icon" : "ui-li-has-thumb"); }, _getChildrenByTagName: function(ele, lcName, ucName) { - var results = [], dict = { - }; + var results = [], dict = {}; for(dict[lcName] = dict[ucName] = !0, ele = ele.firstChild; ele;)dict[ele.nodeName] && results.push(ele), ele = ele.nextSibling; return $(results); }, _beforeListviewRefresh: $.noop, _afterListviewRefresh: $.noop, refresh: function(create) { - var buttonClass, pos, numli, item, itemClass, itemTheme, itemIcon, icon, a, isDivider, startCount, newStartCount, value, last, splittheme, splitThemeClass, spliticon, altButtonClass, li, o = this.options, $list = this.element, ol = !!$.nodeName($list[0], "ol"), start = $list.attr("start"), itemClassDict = { - }, countBubbles = $list.find(".ui-li-count"), countTheme = getAttr($list[0], "counttheme") || this.options.countTheme, countThemeClass = countTheme ? "ui-body-" + countTheme : "ui-body-inherit"; + var buttonClass, pos, numli, item, itemClass, itemTheme, itemIcon, icon, a, isDivider, startCount, newStartCount, value, last, splittheme, splitThemeClass, spliticon, altButtonClass, li, o = this.options, $list = this.element, ol = !!$.nodeName($list[0], "ol"), start = $list.attr("start"), itemClassDict = {}, countBubbles = $list.find(".ui-li-count"), countTheme = getAttr($list[0], "counttheme") || this.options.countTheme, countThemeClass = countTheme ? "ui-body-" + countTheme : "ui-body-inherit"; for(o.theme && $list.addClass("ui-group-theme-" + o.theme), ol && (start || 0 === start) && (startCount = parseInt(start, 10) - 1, $list.css("counter-reset", "listnumbering " + startCount)), this._beforeListviewRefresh(), pos = 0, numli = (li = this._getChildrenByTagName($list[0], "li", "LI")).length; pos < numli; pos++)item = li.eq(pos), itemClass = "", (create || 0 > item[0].className.search(/\bui-li-static\b|\bui-li-divider\b/)) && (a = this._getChildrenByTagName(item[0], "a", "A"), isDivider = "list-divider" === getAttr(item[0], "role"), value = item.attr("value"), itemTheme = getAttr(item[0], "theme"), a.length && 0 > a[0].className.search(/\bui-btn\b/) && !isDivider ? (icon = !1 !== (itemIcon = getAttr(item[0], "icon")) && (itemIcon || o.icon), a.removeClass("ui-link"), buttonClass = "ui-btn", itemTheme && (buttonClass += " ui-btn-" + itemTheme), a.length > 1 ? (itemClass = "ui-li-has-alt", splitThemeClass = (splittheme = getAttr((last = a.last())[0], "theme") || o.splitTheme || getAttr(item[0], "theme", !0)) ? " ui-btn-" + splittheme : "", spliticon = getAttr(last[0], "icon") || getAttr(item[0], "icon") || o.splitIcon, altButtonClass = "ui-btn ui-btn-icon-notext ui-icon-" + spliticon + splitThemeClass, last.attr("title", $.trim(last.getEncodedText())).addClass(altButtonClass).empty()) : icon && (buttonClass += " ui-btn-icon-right ui-icon-" + icon), a.first().addClass(buttonClass)) : isDivider ? (itemClass = "ui-li-divider ui-bar-" + (getAttr(item[0], "theme") || o.dividerTheme || o.theme || "inherit"), item.attr("role", "heading")) : a.length <= 0 && (itemClass = "ui-li-static ui-body-" + (itemTheme || "inherit")), ol && value && (newStartCount = parseInt(value, 10) - 1, item.css("counter-reset", "listnumbering " + newStartCount))), itemClassDict[itemClass] || (itemClassDict[itemClass] = []), itemClassDict[itemClass].push(item[0]); for(itemClass in itemClassDict)$(itemClassDict[itemClass]).addClass(itemClass); countBubbles.each(function() { @@ -2439,8 +2375,7 @@ }, _setOptions: function(options) { var outer = this.widget(); - undefined !== options.theme && outer.removeClass(this.options.theme).addClass("ui-btn-" + options.theme), undefined !== options.corners && outer.toggleClass("ui-corner-all", options.corners), undefined !== options.shadow && outer.toggleClass("ui-shadow", options.shadow), undefined !== options.inline && outer.toggleClass("ui-btn-inline", options.inline), undefined !== options.mini && outer.toggleClass("ui-mini", options.mini), undefined !== options.disabled && (this.element.prop("disabled", options.disabled), outer.toggleClass("ui-state-disabled", options.disabled)), (undefined !== options.icon || undefined !== options.iconshadow || undefined !== options.iconpos) && outer.removeClass(this._getIconClasses(this.options)).addClass(this._getIconClasses($.extend({ - }, this.options, options))), this._super(options); + undefined !== options.theme && outer.removeClass(this.options.theme).addClass("ui-btn-" + options.theme), undefined !== options.corners && outer.toggleClass("ui-corner-all", options.corners), undefined !== options.shadow && outer.toggleClass("ui-shadow", options.shadow), undefined !== options.inline && outer.toggleClass("ui-btn-inline", options.inline), undefined !== options.mini && outer.toggleClass("ui-mini", options.mini), undefined !== options.disabled && (this.element.prop("disabled", options.disabled), outer.toggleClass("ui-state-disabled", options.disabled)), (undefined !== options.icon || undefined !== options.iconshadow || undefined !== options.iconpos) && outer.removeClass(this._getIconClasses(this.options)).addClass(this._getIconClasses($.extend({}, this.options, options))), this._super(options); }, refresh: function(create) { var originalElement, isDisabled = this.element.prop("disabled"); @@ -2449,8 +2384,7 @@ }); } }); - })(jQuery), disabledZoom = (initialContent1 = (meta = ($15 = jQuery)("meta[name=viewport]")).attr("content")) + ",maximum-scale=1, user-scalable=no", enabledZoom = initialContent1 + ",maximum-scale=10, user-scalable=yes", disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test(initialContent1), $15.mobile.zoom = $15.extend({ - }, { + })(jQuery), disabledZoom = (initialContent1 = (meta = ($15 = jQuery)("meta[name=viewport]")).attr("content")) + ",maximum-scale=1, user-scalable=no", enabledZoom = initialContent1 + ",maximum-scale=10, user-scalable=yes", disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test(initialContent1), $15.mobile.zoom = $15.extend({}, { enabled: !disabledInitially, locked: !1, disable: function(lock) { @@ -3391,8 +3325,7 @@ this._ui.container.addClass("ui-popup-active"), this._isOpen = !0, this._resizeScreen(), this._ui.container.attr("tabindex", "0").focus(), this._ignoreResizeEvents(), id && this.document.find("[aria-haspopup='true'][aria-owns='" + id + "']").attr("aria-expanded", !0), this._trigger("afteropen"); }, _open: function(options) { - var ua, wkmatch, wkversion, androidmatch, andversion, chromematch, openOptions = $.extend({ - }, this.options, options), androidBlacklist = (wkversion = !!(wkmatch = (ua = navigator.userAgent).match(/AppleWebKit\/([0-9\.]+)/)) && wkmatch[1], androidmatch = ua.match(/Android (\d+(?:\.\d+))/), andversion = !!androidmatch && androidmatch[1], chromematch = ua.indexOf("Chrome") > -1, null !== androidmatch && "4.0" === andversion && !!wkversion && wkversion > 534.13 && !chromematch); + var ua, wkmatch, wkversion, androidmatch, andversion, chromematch, openOptions = $.extend({}, this.options, options), androidBlacklist = (wkversion = !!(wkmatch = (ua = navigator.userAgent).match(/AppleWebKit\/([0-9\.]+)/)) && wkmatch[1], androidmatch = ua.match(/Android (\d+(?:\.\d+))/), andversion = !!androidmatch && androidmatch[1], chromematch = ua.indexOf("Chrome") > -1, null !== androidmatch && "4.0" === andversion && !!wkversion && wkversion > 534.13 && !chromematch); this._createPrerequisites($.noop, $.noop, $.proxy(this, "_openPrerequisitesComplete")), this._currentTransition = openOptions.transition, this._applyTransition(openOptions.transition), this._ui.screen.removeClass("ui-screen-hidden"), this._ui.container.removeClass("ui-popup-truncate"), this._reposition(openOptions), this._ui.container.removeClass("ui-popup-hidden"), this.options.overlayTheme && androidBlacklist && this.element.closest(".ui-page").addClass("ui-popup-open"), this._animate({ additionalCondition: !0, transition: openOptions.transition, @@ -3663,11 +3596,8 @@ if (el = this[idx], data = overwriteClasses ? { alreadyEnhanced: !1, unknownClasses: [] - } : classNameToOptions(el.className), retrievedOptions = $.extend({ - }, data.alreadyEnhanced ? data.options : { - }, options), !data.alreadyEnhanced) for(optionKey in defaults)undefined === retrievedOptions[optionKey] && (retrievedOptions[optionKey] = getAttrFixed(el, optionKey.replace(capitalLettersRE, camelCase2Hyphenated))); - el.className = optionsToClasses($.extend({ - }, defaults, retrievedOptions), data.unknownClasses).join(" "), "button" !== el.tagName.toLowerCase() && el.setAttribute("role", "button"); + } : classNameToOptions(el.className), retrievedOptions = $.extend({}, data.alreadyEnhanced ? data.options : {}, options), !data.alreadyEnhanced) for(optionKey in defaults)undefined === retrievedOptions[optionKey] && (retrievedOptions[optionKey] = getAttrFixed(el, optionKey.replace(capitalLettersRE, camelCase2Hyphenated))); + el.className = optionsToClasses($.extend({}, defaults, retrievedOptions), data.unknownClasses).join(" "), "button" !== el.tagName.toLowerCase() && el.setAttribute("role", "button"); } return this; }, $.fn.buttonMarkup.defaults = { @@ -3969,9 +3899,7 @@ return ar && ar.arEls.remove(), this._super(); }, _tryAnArrow: function(p, dir, desired, s, best) { - var result, r, diff, desiredForArrow = { - }, tip = { - }; + var result, r, diff, desiredForArrow = {}, tip = {}; return s.arFull[p.dimKey] > s.guideDims[p.dimKey] || (desiredForArrow[p.fst] = desired[p.fst] + (s.arHalf[p.oDimKey] + s.menuHalf[p.oDimKey]) * p.offsetFactor - s.contentBox[p.fst] + (s.clampInfo.menuSize[p.oDimKey] - s.contentBox[p.oDimKey]) * p.arrowOffsetFactor, desiredForArrow[p.snd] = desired[p.snd], r = { x: (result = s.result || this._calculateFinalLocation(desiredForArrow, s.clampInfo)).left, y: result.top @@ -4019,8 +3947,7 @@ }, _placementCoords: function(desired) { var state, best, params, elOffset, bgRef, optionValue = this.options.arrow, ar = this._ui.arrow; - return ar ? (ar.arEls.show(), bgRef = { - }, params = { + return ar ? (ar.arEls.show(), bgRef = {}, params = { l: { fst: "x", snd: "y", @@ -4479,8 +4406,7 @@ "selectmenu", "controlgroup", "listview" - ], createHandlers = { - }; + ], createHandlers = {}; for(this._super(), $17.extend(this, { _widget: null }), idx = recognizedWidgets.length - 1; idx > -1; idx--)if (widgetName = recognizedWidgets[idx], $17.mobile[widgetName]) { @@ -4508,8 +4434,7 @@ return this._search && this._search.jqmData("ui-filterable-" + this.uuid + "-internal"); }, _setInput: function(selector) { - var opts = this.options, updatePlaceholder = !0, textinputOpts = { - }; + var opts = this.options, updatePlaceholder = !0, textinputOpts = {}; if (!selector) { if (this._isSearchInternal()) return; updatePlaceholder = !1, selector = $17("").jqmData("ui-filterable-" + this.uuid + "-internal", !0), $17("
").append(selector).submit(function(evt) { @@ -4526,8 +4451,7 @@ this._isSearchInternal() && this._search.remove(), this._super(); }, _syncTextInputOptions: function(options) { - var idx, textinputOptions = { - }; + var idx, textinputOptions = {}; if (this._isSearchInternal() && $17.mobile.textinput) { for(idx in $17.mobile.textinput.prototype.options)undefined4 !== options[idx] && ("theme" === idx && null != this.options.filterTheme ? textinputOptions[idx] = this.options.filterTheme : textinputOptions[idx] = options[idx]); this._search.textinput("option", textinputOptions); diff --git a/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js b/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js index 33981fc8a32..2e943cdedf9 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js +++ b/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js @@ -50,8 +50,7 @@ if ("string" != typeof a ? args = a : arguments.length > 1 ? args = arguments : usePlural && (args = [ a ]), args) { - result = { - }; + result = {}; for(var i = 0; i < args.length; i++)result[args[i]] = self.call(this, args[i]); } else result = self.call(this, a); return result; @@ -97,8 +96,7 @@ Type.isEnumerable = function(item) { return null != item && "number" == typeof item.length && "[object Function]" != toString.call(item); }; - var hooks1 = { - }, hooksOf = function(object) { + var hooks1 = {}, hooksOf = function(object) { var type = typeOf(object.prototype); return hooks1[type] || (hooks1[type] = []); }, implement = function(name, method) { @@ -264,15 +262,13 @@ return source; }, clone: function(object) { - var clone = { - }; + var clone = {}; for(var key in object)clone[key] = cloneOf(object[key]); return clone; }, append: function(original) { for(var i = 1, l = arguments.length; i < l; i++){ - var extended = arguments[i] || { - }; + var extended = arguments[i] || {}; for(var key in extended)original[key] = extended[key]; } return original; @@ -299,8 +295,7 @@ Object.forEach(this, fn, bind); }, getClean: function() { - var clean = { - }; + var clean = {}; for(var key in this)this.hasOwnProperty(key) && (clean[key] = this[key]); return clean; }, @@ -335,15 +330,13 @@ }, this.$each = function(iterable, fn, bind) { var type = typeOf(iterable); ("arguments" == type || "collection" == type || "array" == type || "elements" == type ? Array : Object).each(iterable, fn, bind); - }, this.$empty = function() { - }, this.$extend = function(original, extended) { + }, this.$empty = function() {}, this.$extend = function(original, extended) { return Object.append(original, extended); }, this.$H = function(object) { return new Hash(object); }, this.$merge = function() { var args = Array.slice(arguments); - return args.unshift({ - }), Object.merge.apply(null, args); + return args.unshift({}), Object.merge.apply(null, args); }, this.$lambda = Function.from, this.$mixin = Object.merge, this.$random = Number.random, this.$splat = Array.from, this.$time = Date.now, this.$type = function(object) { var type = typeOf(object); return "elements" == type ? "array" : "null" != type && type; @@ -392,13 +385,11 @@ }); }, associate: function(keys) { - for(var obj = { - }, length = Math.min(this.length, keys.length), i = 0; i < length; i++)obj[keys[i]] = this[i]; + for(var obj = {}, length = Math.min(this.length, keys.length), i = 0; i < length; i++)obj[keys[i]] = this[i]; return obj; }, link: function(object) { - for(var result = { - }, i = 0, l = this.length; i < l; i++)for(var key in object)if (object[key](this[i])) { + for(var result = {}, i = 0, l = this.length; i < l; i++)for(var key in object)if (object[key](this[i])) { result[key] = this[i], delete object[key]; break; } @@ -528,8 +519,7 @@ String.implement({ return parseInt(this, base || 10); } }), Number.alias("each", "times"), (function(math) { - var methods = { - }; + var methods = {}; math.each(function(name) { Number[name] || (methods[name] = function() { return Math[name].apply(null, [ @@ -558,21 +548,18 @@ String.implement({ attempt: function() { for(var i = 0, l = arguments.length; i < l; i++)try { return arguments[i](); - } catch (e) { - } + } catch (e) {} return null; } }), Function.implement({ attempt: function(args, bind) { try { return this.apply(bind, Array.from(args)); - } catch (e) { - } + } catch (e) {} return null; }, bind: function(that) { - var self = this, args = arguments.length > 1 ? Array.slice(arguments, 1) : null, F = function() { - }, bound = function() { + var self = this, args = arguments.length > 1 ? Array.slice(arguments, 1) : null, F = function() {}, bound = function() { var context = that, length = arguments.length; this instanceof bound && (F.prototype = self.prototype, context = new F); var result = args || length ? self.apply(context, args && length ? args.concat(Array.slice(arguments)) : args || arguments) : self.call(context); @@ -595,8 +582,7 @@ String.implement({ }), delete Function.prototype.bind, Function.implement({ create: function(options) { var self = this; - return options = options || { - }, function(event) { + return options = options || {}, function(event) { var args = options.arguments; args = null != args ? Array.from(args) : Array.slice(arguments, options.event ? 1 : 0), options.event && (args = [ event || window.event @@ -630,22 +616,19 @@ var $try = Function.attempt; var hasOwnProperty = Object.prototype.hasOwnProperty; Object.extend({ subset: function(object, keys) { - for(var results = { - }, i = 0, l = keys.length; i < l; i++){ + for(var results = {}, i = 0, l = keys.length; i < l; i++){ var k = keys[i]; k in object && (results[k] = object[k]); } return results; }, map: function(object, fn, bind) { - var results = { - }; + var results = {}; for(var key in object)hasOwnProperty.call(object, key) && (results[key] = fn.call(bind, object[key], key, object)); return results; }, filter: function(object, fn, bind) { - var results = { - }; + var results = {}; for(var key in object){ var value = object[key]; hasOwnProperty.call(object, key) && fn.call(bind, value, key, object) && (results[key] = value); @@ -688,8 +671,7 @@ var $try = Function.attempt; result = Object.toQueryString(value, key); break; case "array": - var result, qs = { - }; + var result, qs = {}; value.each(function(val, i) { qs[i] = val; }), result = Object.toQueryString(qs, key); @@ -710,14 +692,12 @@ var $try = Function.attempt; return Object.contains(this, value); }, extend: function(properties) { - return Hash.each(properties || { - }, function(value, key) { + return Hash.each(properties || {}, function(value, key) { Hash.set(this, key, value); }, this), this; }, combine: function(properties) { - return Hash.each(properties || { - }, function(value, key) { + return Hash.each(properties || {}, function(value, key) { Hash.include(this, key, value); }, this), this; }, @@ -782,8 +762,7 @@ var $try = Function.attempt; query: !!document.querySelector, json: !!window.JSON }, - Plugins: { - } + Plugins: {} }; Browser[Browser.name] = !0, Browser[Browser.name + parseInt(Browser.version, 10)] = !0, Browser.Platform[Browser.Platform.name] = !0, XMLHTTP = function() { return new XMLHttpRequest(); @@ -824,16 +803,13 @@ var $try = Function.attempt; Window: this.Window, Element: this.Element, Event: this.Event - }), this.Window = this.$constructor = new Type("Window", function() { - }), this.$family = Function.from("window").hide(), Window.mirror(function(name, method) { + }), this.Window = this.$constructor = new Type("Window", function() {}), this.$family = Function.from("window").hide(), Window.mirror(function(name, method) { window[name] = method; - }), this.Document = document.$constructor = new Type("Document", function() { - }), document.$family = Function.from("document").hide(), Document.mirror(function(name, method) { + }), this.Document = document.$constructor = new Type("Document", function() {}), document.$family = Function.from("document").hide(), Document.mirror(function(name, method) { document[name] = method; }), document.html = document.documentElement, document.head || (document.head = document.getElementsByTagName("head")[0]), document.execCommand) try { document.execCommand("BackgroundImageCache", !1, !0); - } catch (e) { - } + } catch (e) {} if (this.attachEvent && !this.addEventListener) { var unloadEvent = function() { this.detachEvent("onunload", unloadEvent), document.head = document.html = document.window = null; @@ -870,8 +846,7 @@ var $try = Function.attempt; }; }); } - Browser.Platform.ios && (Browser.Platform.ipod = !0), Browser.Engine = { - }; + Browser.Platform.ios && (Browser.Platform.ipod = !0), Browser.Engine = {}; var setEngine = function(name, version) { Browser.Engine.name = name, Browser.Engine[name + version] = !0, Browser.Engine.version = version; }; @@ -905,8 +880,7 @@ var $try = Function.attempt; } this.$exec = Browser.exec; })(), (function() { - var _keys = { - }, DOMEvent = this.DOMEvent = new Type("DOMEvent", function(event, win) { + var _keys = {}, DOMEvent = this.DOMEvent = new Type("DOMEvent", function(event, win) { if (win || (win = window), (event = event || win.event).$extended) return event; this.event = event, this.$extended = !0, this.shift = event.shiftKey, this.control = event.ctrlKey, this.alt = event.altKey, this.meta = event.metaKey; for(var type = this.type = event.type, target = event.target || event.srcElement; target && 3 == target.nodeType;)target = target.parentNode; @@ -939,9 +913,7 @@ var $try = Function.attempt; }; } } - this.client || (this.client = { - }), this.page || (this.page = { - }); + this.client || (this.client = {}), this.page || (this.page = {}); }); DOMEvent.implement({ stop: function() { @@ -969,8 +941,7 @@ var $try = Function.attempt; }); })(); var Event = DOMEvent; -Event.Keys = { -}, Event.Keys = new Hash(Event.Keys), (function() { +Event.Keys = {}, Event.Keys = new Hash(Event.Keys), (function() { var Class = this.Class = new Type("Class", function(params) { instanceOf(params, Function) && (params = { initialize: params @@ -992,8 +963,7 @@ Event.Keys = { var value = object[key]; switch(typeOf(value)){ case "object": - var F = function() { - }; + var F = function() {}; F.prototype = value, object[key] = reset(new F); break; case "array": @@ -1058,8 +1028,7 @@ Event.Keys = { }); }; this.Events = new Class({ - $events: { - }, + $events: {}, addEvent: function(type, fn, internal) { return type = removeOn(type), fn == $empty || (this.$events[type] = (this.$events[type] || []).include(fn), internal && (fn.internal = !0)), this; }, @@ -1095,8 +1064,7 @@ Event.Keys = { }), this.Options = new Class({ setOptions: function() { var options = this.options = Object.merge.apply(null, [ - { - }, + {}, this.options ].append(arguments)); if (this.addEvent) for(var option in options)"function" == typeOf(options[option]) && /^on[A-Z]/.test(option) && (this.addEvent(option, options[option]), delete options[option]); @@ -1104,9 +1072,7 @@ Event.Keys = { } }); })(), (function() { - var parsed, separatorIndex, combinatorIndex, reversed, cache = { - }, reverseCache = { - }, reUnescape = /\\/g, parse = function(expression, isReversed) { + var parsed, separatorIndex, combinatorIndex, reversed, cache = {}, reverseCache = {}, reUnescape = /\\/g, parse = function(expression, isReversed) { if (null == expression) return null; if (!0 === expression.Slick) return expression; expression = ("" + expression).replace(/^\s+|\s+$/g, ""); @@ -1210,15 +1176,12 @@ Event.Keys = { } return ""; } - var Slick = this.Slick || { - }; + var Slick = this.Slick || {}; Slick.parse = function(expression) { return parse(expression); }, Slick.escapeRegExp = escapeRegExp, this.Slick || (this.Slick = Slick); }).apply("undefined" != typeof exports ? exports : this), (function() { - var local = { - }, featuresCache = { - }, toString = Object.prototype.toString; + var local = {}, featuresCache = {}, toString = Object.prototype.toString; local.isNativeCode = function(fn) { return /\{\s*\[native code\]\s*\}/.test("" + fn); }, local.isXML = function(document) { @@ -1238,62 +1201,50 @@ Event.Keys = { for(feature in features)this[feature] = features[feature]; return; } - (features = featuresCache[rootUid] = { - }).root = root, features.isXMLDocument = this.isXML(document), features.brokenStarGEBTN = features.starSelectsClosedQSA = features.idGetsName = features.brokenMixedCaseQSA = features.brokenGEBCN = features.brokenCheckedQSA = features.brokenEmptyAttributeQSA = features.isHTMLDocument = features.nativeMatchesSelector = !1; + (features = featuresCache[rootUid] = {}).root = root, features.isXMLDocument = this.isXML(document), features.brokenStarGEBTN = features.starSelectsClosedQSA = features.idGetsName = features.brokenMixedCaseQSA = features.brokenGEBCN = features.brokenCheckedQSA = features.brokenEmptyAttributeQSA = features.isHTMLDocument = features.nativeMatchesSelector = !1; var starSelectsClosed, starSelectsComments, brokenSecondClassNameGEBCN, cachedGetElementsByClassName, brokenFormAttributeGetter, selected, id = "slick_uniqueid", testNode = document.createElement("div"), testRoot = document.body || document.getElementsByTagName("body")[0] || root; testRoot.appendChild(testNode); try { testNode.innerHTML = "", features.isHTMLDocument = !!document.getElementById(id); - } catch (e) { - } + } catch (e) {} if (features.isHTMLDocument) { testNode.style.display = "none", testNode.appendChild(document.createComment("")), starSelectsComments = testNode.getElementsByTagName("*").length > 1; try { testNode.innerHTML = "foo", starSelectsClosed = (selected = testNode.getElementsByTagName("*")) && !!selected.length && "/" == selected[0].nodeName.charAt(0); - } catch (e) { - } + } catch (e) {} features.brokenStarGEBTN = starSelectsComments || starSelectsClosed; try { testNode.innerHTML = "", features.idGetsName = document.getElementById(id) === testNode.firstChild; - } catch (e2) { - } + } catch (e2) {} if (testNode.getElementsByClassName) { try { testNode.innerHTML = "", testNode.getElementsByClassName("b").length, testNode.firstChild.className = "b", cachedGetElementsByClassName = 2 != testNode.getElementsByClassName("b").length; - } catch (e) { - } + } catch (e) {} try { testNode.innerHTML = "", brokenSecondClassNameGEBCN = 2 != testNode.getElementsByClassName("a").length; - } catch (e3) { - } + } catch (e3) {} features.brokenGEBCN = cachedGetElementsByClassName || brokenSecondClassNameGEBCN; } if (testNode.querySelectorAll) { try { testNode.innerHTML = "foo", selected = testNode.querySelectorAll("*"), features.starSelectsClosedQSA = selected && !!selected.length && "/" == selected[0].nodeName.charAt(0); - } catch (e) { - } + } catch (e) {} try { testNode.innerHTML = "", features.brokenMixedCaseQSA = !testNode.querySelectorAll(".MiX").length; - } catch (e4) { - } + } catch (e4) {} try { testNode.innerHTML = "", features.brokenCheckedQSA = 0 == testNode.querySelectorAll(":checked").length; - } catch (e5) { - } + } catch (e5) {} try { testNode.innerHTML = "", features.brokenEmptyAttributeQSA = 0 != testNode.querySelectorAll("[class*=\"\"]").length; - } catch (e6) { - } + } catch (e6) {} } try { testNode.innerHTML = "
", brokenFormAttributeGetter = "s" != testNode.firstChild.getAttribute("action"); - } catch (e7) { - } + } catch (e7) {} if (features.nativeMatchesSelector = root.matchesSelector || root.mozMatchesSelector || root.webkitMatchesSelector, features.nativeMatchesSelector) try { features.nativeMatchesSelector.call(root, ":slick"), features.nativeMatchesSelector = null; - } catch (e8) { - } + } catch (e8) {} } try { root.slick_expando = 1, delete root.slick_expando, features.getUID = this.getUIDHTML; @@ -1335,15 +1286,13 @@ Event.Keys = { } : null, root = null, features)this[feature] = features[feature]; } }; - var reSimpleSelector = /^([#.]?)((?:[\w-]+|\*))$/, reEmptyAttribute = /\[.+[*$^]=(?:""|'')?\]/, qsaFailExpCache = { - }; + var reSimpleSelector = /^([#.]?)((?:[\w-]+|\*))$/, reEmptyAttribute = /\[.+[*$^]=(?:""|'')?\]/, qsaFailExpCache = {}; local.search = function(context, expression, append, first) { var found = this.found = first ? null : append || []; if (!context) return found; if (context.navigator) context = context.document; else if (!context.nodeType) return found; - var parsed, i, uniques = this.uniques = { - }, hasOthers = !!(append && append.length), contextIsDocument = 9 == context.nodeType; + var parsed, i, uniques = this.uniques = {}, hasOthers = !!(append && append.length), contextIsDocument = 9 == context.nodeType; if (this.document !== (contextIsDocument ? context : context.ownerDocument) && this.setDocument(context), hasOthers) for(i = found.length; i--;)uniques[this.getUID(found[i])] = !0; if ("string" == typeof expression) { var simpleSelector = expression.match(reSimpleSelector); @@ -1401,17 +1350,11 @@ Event.Keys = { else if (expression.Slick) parsed = expression; else if (this.contains(context.documentElement || context, expression)) return found ? found.push(expression) : found = expression, found; else return found; - this.posNTH = { - }, this.posNTHLast = { - }, this.posNTHType = { - }, this.posNTHTypeLast = { - }, this.push = !hasOthers && (first || 1 == parsed.length && 1 == parsed.expressions[0].length) ? this.pushArray : this.pushUID, null == found && (found = []); + this.posNTH = {}, this.posNTHLast = {}, this.posNTHType = {}, this.posNTHTypeLast = {}, this.push = !hasOthers && (first || 1 == parsed.length && 1 == parsed.expressions[0].length) ? this.pushArray : this.pushUID, null == found && (found = []); var j, m, n, combinator, tag, id, classList, classes, attributes, pseudos, currentItems, currentExpression, currentBit, lastBit, expressions = parsed.expressions; search: for(i = 0; currentExpression = expressions[i]; i++)for(j = 0; currentBit = currentExpression[j]; j++){ if (!this[combinator = "combinator:" + currentBit.combinator]) continue search; - if (tag = this.isXMLDocument ? currentBit.tag : currentBit.tag.toUpperCase(), id = currentBit.id, classList = currentBit.classList, classes = currentBit.classes, attributes = currentBit.attributes, pseudos = currentBit.pseudos, lastBit = j === currentExpression.length - 1, this.bitUniques = { - }, lastBit ? (this.uniques = uniques, this.found = found) : (this.uniques = { - }, this.found = []), 0 === j) { + if (tag = this.isXMLDocument ? currentBit.tag : currentBit.tag.toUpperCase(), id = currentBit.id, classList = currentBit.classList, classes = currentBit.classes, attributes = currentBit.attributes, pseudos = currentBit.pseudos, lastBit = j === currentExpression.length - 1, this.bitUniques = {}, lastBit ? (this.uniques = uniques, this.found = found) : (this.uniques = {}, this.found = []), 0 === j) { if (this[combinator](context, tag, id, classes, attributes, pseudos, classList), first && lastBit && found.length) break search; } else if (first && lastBit) { for(m = 0, n = currentItems.length; m < n; m++)if (this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList), found.length) break search; @@ -1426,8 +1369,7 @@ Event.Keys = { return node.uniqueNumber || (node.uniqueNumber = this.uidx++); }, local.sort = function(results) { return this.documentSorter && results.sort(this.documentSorter), results; - }, local.cacheNTH = { - }, local.matchNTH = /^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/, local.parseNTHArgument = function(argument) { + }, local.cacheNTH = {}, local.matchNTH = /^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/, local.parseNTHArgument = function(argument) { var parsed = argument.match(this.matchNTH); if (!parsed) return !1; var special = parsed[2] || !1, a = parsed[1] || 1; @@ -1482,8 +1424,7 @@ Event.Keys = { }, local.matchNode = function(node, selector) { if (this.isHTMLDocument && this.nativeMatchesSelector) try { return this.nativeMatchesSelector.call(node, selector.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g, "[$1=\"$2\"]")); - } catch (matchError) { - } + } catch (matchError) {} var parsed = this.Slick.parse(selector); if (!parsed) return !0; var i, expressions = parsed.expressions, simpleExpCounter = 0; @@ -1701,8 +1642,7 @@ Event.Keys = { } }; attributeGetters.MAXLENGTH = attributeGetters.maxLength = attributeGetters.maxlength; - var Slick = local.Slick = this.Slick || { - }; + var Slick = local.Slick = this.Slick || {}; Slick.version = "1.1.7", Slick.search = function(context, expression, append) { return local.search(context, expression, append); }, Slick.find = function(context, expression) { @@ -1738,8 +1678,7 @@ var Element = function(tag, props) { var konstructor = Element.Constructors[tag]; if (konstructor) return konstructor(props); if ("string" != typeof tag) return document.id(tag).set(props); - if (props || (props = { - }), !/^[\w-]+$/.test(tag)) { + if (props || (props = {}), !/^[\w-]+$/.test(tag)) { var parsed = Slick.parse(tag).expressions[0][0]; tag = "*" == parsed.tag ? "div" : parsed.tag, parsed.id && null == props.id && (props.id = parsed.id); var attributes = parsed.attributes; @@ -1752,8 +1691,7 @@ Browser.Element && (Element.prototype = Browser.Element.prototype, fireEvent = E return fireEvent.call(this, type, event); }), new Type("Element", Element).mirror(function(name) { if (!Array.prototype[name]) { - var obj = { - }; + var obj = {}; obj[name] = function() { for(var results = [], args = arguments, elements = !0, i = 0, l = this.length; i < l; i++){ var element = this[i], result = results[i] = element[name].apply(element, args); @@ -1767,19 +1705,16 @@ Browser.Element && (Element.prototype = Browser.Element.prototype, fireEvent = E "$family": Function.from("element").hide() }, Element.mirror(function(name, method) { Element.Prototype[name] = method; -})), Element.Constructors = { -}, Element.Constructors = new Hash; +})), Element.Constructors = {}, Element.Constructors = new Hash; var IFrame = new Type("IFrame", function() { var iframe, params = Array.link(arguments, { properties: Type.isObject, iframe: function(obj) { return null != obj; } - }), props = params.properties || { - }; + }), props = params.properties || {}; params.iframe && (iframe = document.id(params.iframe)); - var onload = props.onload || function() { - }; + var onload = props.onload || function() {}; delete props.onload, props.id = props.name = [ props.id, props.name, @@ -1790,8 +1725,7 @@ var IFrame = new Type("IFrame", function() { }; return window.frames[props.id] ? onLoad() : iframe.addListener("load", onLoad), iframe; }), Elements = this.Elements = function(nodes) { - if (nodes && nodes.length) for(var node, uniques = { - }, i = 0; node = nodes[i++];){ + if (nodes && nodes.length) for(var node, uniques = {}, i = 0; node = nodes[i++];){ var uid = Slick.uidOf(node); uniques[uid] || (uniques[uid] = !0, this.push(node)); } @@ -1847,8 +1781,7 @@ Elements.prototype = { }), Array.mirror(Elements); try { createElementAcceptsHTML = "x" == document.createElement("").name; - } catch (e) { - } + } catch (e) {} var escapeQuotes = function(html) { return ("" + html).replace(/&/g, "&").replace(/"/g, """); }; @@ -1918,8 +1851,7 @@ Elements.prototype = { }; document.contains || Document.implement(contains), document.createElement("div").contains || Element.implement(contains), Element.implement("hasChild", function(element) { return this !== element && this.contains(element); - }), search = Slick.search, find = Slick.find, match = Slick.match, this.Selectors = { - }, pseudos = this.Selectors.Pseudo = new Hash(), addSlickPseudos = function() { + }), search = Slick.search, find = Slick.find, match = Slick.match, this.Selectors = {}, pseudos = this.Selectors.Pseudo = new Hash(), addSlickPseudos = function() { for(var name in pseudos)pseudos.hasOwnProperty(name) && (Slick.definePseudo(name, pseudos[name]), delete pseudos[name]); }, Slick.search = function(context, expression, append) { return addSlickPseudos(), search.call(this, context, expression, append); @@ -2009,18 +1941,14 @@ Elements.prototype = { }; inserters.inside = inserters.bottom, Object.each(inserters, function(inserter, where) { where = where.capitalize(); - var methods = { - }; + var methods = {}; methods["inject" + where] = function(el) { return inserter(this, document.id(el, !0)), this; }, methods["grab" + where] = function(el) { return inserter(document.id(el, !0), this), this; }, Element.implement(methods); }); - var propertyGetters = { - }, propertySetters = { - }, properties = { - }; + var propertyGetters = {}, propertySetters = {}, properties = {}; Array.forEach([ "type", "value", @@ -2060,8 +1988,7 @@ Elements.prototype = { "controls", "autoplay", "loop" - ], booleans = { - }; + ], booleans = {}; Array.forEach(bools, function(bool) { var lower = bool.toLowerCase(); booleans[lower] = bool, propertySetters[lower] = function(node, value) { @@ -2088,8 +2015,7 @@ Elements.prototype = { var el1 = document.createElement("button"); try { el1.type = "button"; - } catch (e) { - } + } catch (e) {} "button" != el1.type && (propertySetters.type = function(node, value) { node.setAttribute("type", value); }), el1 = null; @@ -2104,8 +2030,7 @@ Elements.prototype = { var setter = propertySetters[name.toLowerCase()]; if (setter) setter(this, value); else { - if (pollutesGetAttribute) var attributeWhiteList = this.retrieve("$attributeWhiteList", { - }); + if (pollutesGetAttribute) var attributeWhiteList = this.retrieve("$attributeWhiteList", {}); null == value ? (this.removeAttribute(name), pollutesGetAttribute && delete attributeWhiteList[name]) : (this.setAttribute(name, "" + value), pollutesGetAttribute && (attributeWhiteList[name] = !0)); } return this; @@ -2118,8 +2043,7 @@ Elements.prototype = { var getter = propertyGetters[name.toLowerCase()]; if (getter) return getter(this); if (pollutesGetAttribute) { - var attr = this.getAttributeNode(name), attributeWhiteList = this.retrieve("$attributeWhiteList", { - }); + var attr = this.getAttributeNode(name), attributeWhiteList = this.retrieve("$attributeWhiteList", {}); if (!attr) return null; if (attr.expando && !attributeWhiteList[name]) { var outer = this.outerHTML; @@ -2208,11 +2132,8 @@ Elements.prototype = { }), queryString.join("&"); } }); - var collected = { - }, storage1 = { - }, get = function(uid) { - return storage1[uid] || (storage1[uid] = { - }); + var collected = {}, storage1 = {}, get = function(uid) { + return storage1[uid] || (storage1[uid] = {}); }, clean = function(item) { var uid = item.uniqueNumber; return item.removeEvents && item.removeEvents(), item.clearAttributes && item.clearAttributes(), null != uid && (delete collected[uid], delete storage1[uid]), item; @@ -2280,8 +2201,7 @@ Elements.prototype = { } }), window.attachEvent && !window.addEventListener && window.addListener("unload", function() { Object.each(collected, clean), window.CollectGarbage && CollectGarbage(); - }), Element.Properties = { - }, Element.Properties = new Hash, Element.Properties.style = { + }), Element.Properties = {}, Element.Properties = new Hash, Element.Properties.style = { set: function(style) { this.style.cssText = style; }, @@ -2457,8 +2377,7 @@ Elements.prototype = { return this; }, getStyles: function() { - var result = { - }; + var result = {}; return Array.flatten(arguments).each(function(key) { result[key] = this.getStyle(key); }, this), result; @@ -2507,18 +2426,12 @@ Elements.prototype = { return getOpacity(this); } }, Element.Styles = new Hash(Element.Styles), Element.ShortStyles = { - margin: { - }, - padding: { - }, - border: { - }, - borderWidth: { - }, - borderStyle: { - }, - borderColor: { - } + margin: {}, + padding: {}, + border: {}, + borderWidth: {}, + borderStyle: {}, + borderColor: {} }, [ "Top", "Right", @@ -2536,8 +2449,7 @@ Elements.prototype = { var bd = "border" + direction; Short.border[bd] = All[bd] = "@px @ rgb(@, @, @)"; var bdw = bd + "Width", bds = bd + "Style", bdc = bd + "Color"; - Short[bd] = { - }, Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = "@px", Short.borderStyle[bds] = Short[bd][bds] = All[bds] = "@", Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = "rgb(@, @, @)"; + Short[bd] = {}, Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = "@px", Short.borderStyle[bds] = Short[bd][bds] = All[bds] = "@", Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = "rgb(@, @, @)"; }); })(), (function() { if (Element.Properties.events = { @@ -2550,8 +2462,7 @@ Elements.prototype = { Document ].invoke("implement", { addEvent: function(type, fn) { - var events = this.retrieve("events", { - }); + var events = this.retrieve("events", {}); if (events[type] || (events[type] = { keys: [], values: [] @@ -2710,15 +2621,13 @@ Elements.prototype = { return { base: "focusin", remove: function(self, uid) { - var list = self.retrieve(_key + type + "listeners", { - })[uid]; + var list = self.retrieve(_key + type + "listeners", {})[uid]; if (list && list.forms) for(var i = list.forms.length; i--;)list.forms[i].removeEvent(type, list.fns[i]); }, listen: function(self, match, fn, event1, target, uid) { var form = "form" == target.get("tag") ? target : event1.target.getParent("form"); if (form) { - var listeners = self.retrieve(_key + type + "listeners", { - }), listener = listeners[uid] || { + var listeners = self.retrieve(_key + type + "listeners", {}), listener = listeners[uid] || { forms: [], fns: [] }, forms = listener.forms, fns = listener.fns; @@ -2765,13 +2674,11 @@ Elements.prototype = { }; }, delegation = { addEvent: function(type, match, fn) { - var storage = this.retrieve("$delegates", { - }), stored = storage[type]; + var storage = this.retrieve("$delegates", {}), stored = storage[type]; if (stored) { for(var _uid in stored)if (stored[_uid].fn == fn && stored[_uid].match == match) return this; } - var _type = type, _match = match, _fn = fn, _map = map[type] || { - }; + var _type = type, _match = match, _fn = fn, _map = map[type] || {}; type = _map.base || _type, match = function(target) { return Slick.match(target, _match); }; @@ -2787,20 +2694,17 @@ Elements.prototype = { } : function(event, target) { !target && event && event.target && (target = event.target), target && bubbleUp(self, match, fn, event, target); }; - return stored || (stored = { - }), stored[uid] = { + return stored || (stored = {}), stored[uid] = { match: _match, fn: _fn, delegator: delegator }, storage[_type] = stored, addEvent.call(this, type, delegator, _map.capture); }, removeEvent: function(type, match, fn, _uid) { - var __uid, s, storage = this.retrieve("$delegates", { - }), stored = storage[type]; + var __uid, s, storage = this.retrieve("$delegates", {}), stored = storage[type]; if (!stored) return this; if (_uid) { - var _type = type, delegator = stored[_uid].delegator, _map = map[type] || { - }; + var _type = type, delegator = stored[_uid].delegator, _map = map[type] || {}; return type = _map.base || _type, _map.remove && _map.remove(this, _uid), delete stored[_uid], storage[_type] = stored, removeEvent.call(this, type, delegator); } if (fn) { @@ -2866,8 +2770,7 @@ Elements.prototype = { if (isBody(element) || "fixed" == styleString(element, "position")) return null; try { return element.offsetParent; - } catch (e) { - } + } catch (e) {} return null; }, getOffsets: function() { @@ -3099,9 +3002,7 @@ Elements.prototype = { normal: 500, "long": 1000 }; - var instances = { - }, timers = { - }, loop = function() { + var instances = {}, timers = {}, loop = function() { for(var now = Date.now(), i = this.length; i--;){ var instance = this[i]; instance && instance.step(now); @@ -3174,8 +3075,7 @@ Elements.prototype = { }, search: function(selector) { if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector]; - var to = { - }, selectorTest = new RegExp("^" + selector.escapeRegExp() + "$"); + var to = {}, selectorTest = new RegExp("^" + selector.escapeRegExp() + "$"); return Array.each(document.styleSheets, function(sheet, j) { var href = sheet.href; if (!(href && href.contains("://")) || href.contains(document.domain)) { @@ -3193,8 +3093,7 @@ Elements.prototype = { } }), Fx.CSS.Cache[selector] = to; } -}), Fx.CSS.Cache = { -}, Fx.CSS.Parsers = { +}), Fx.CSS.Cache = {}, Fx.CSS.Parsers = { Color: { parse: function(value) { return value.match(/^#[0-9a-f]{3,6}$/i) ? value.hexToRgb(!0) : !!(value = value.match(/(\d+),\s*(\d+),\s*(\d+)/)) && [ @@ -3304,17 +3203,14 @@ Elements.prototype = { return this; }, compute: function(from, to, delta) { - var now = { - }; + var now = {}; for(var p in from)now[p] = this.parent(from[p], to[p], delta); return now; }, start: function(properties) { if (!this.check(properties)) return this; "string" == typeof properties && (properties = this.search(properties)); - var from = { - }, to = { - }; + var from = {}, to = {}; for(var p in properties){ var parsed = this.prepare(this.element, p, properties[p]); from[p] = parsed.from, to[p] = parsed.to; @@ -3400,8 +3296,7 @@ Elements.prototype = { return Math.pow(p, i + 2); }); }), (function() { - var empty = function() { - }, progressSupport = "onprogress" in new Browser.Request, Request = this.Request = new Class({ + var empty = function() {}, progressSupport = "onprogress" in new Browser.Request, Request = this.Request = new Class({ Implements: [ Chain, Events, @@ -3554,8 +3449,7 @@ Elements.prototype = { var xhr = this.xhr; return xhr.abort(), clearTimeout(this.timer), xhr.onreadystatechange = empty, progressSupport && (xhr.onprogress = xhr.onloadstart = empty), this.xhr = new Browser.Request(), this.fireEvent("cancel"), this; } - }), methods = { - }; + }), methods = {}; [ "get", "post", @@ -3642,8 +3536,7 @@ Elements.prototype = { url: Type.isString })), this; } -}), "undefined" == typeof JSON && (this.JSON = { -}), JSON = new Hash({ +}), "undefined" == typeof JSON && (this.JSON = {}), JSON = new Hash({ stringify: JSON.stringify, parse: JSON.parse }), (function() { @@ -3740,8 +3633,7 @@ var Cookie = new Class({ return value ? decodeURIComponent(value[1]) : null; }, dispose: function() { - return new Cookie(this.key, Object.merge({ - }, this.options, { + return new Cookie(this.key, Object.merge({}, this.options, { duration: -1 })).write(""), this; } @@ -3765,8 +3657,7 @@ Cookie.write = function(key, value, options) { var doScrollWorks = function() { try { return testElement.doScroll(), !0; - } catch (e) { - } + } catch (e) {} return !1; }; testElement.doScroll && !doScrollWorks() && (checks.push(doScrollWorks), shouldPoll = !0), document.readyState && checks.push(function() { @@ -3795,18 +3686,15 @@ Cookie.write = function(key, value, options) { height: 1, width: 1, container: null, - properties: { - }, + properties: {}, params: { quality: "high", allowScriptAccess: "always", wMode: "window", swLiveConnect: !0 }, - callBacks: { - }, - vars: { - } + callBacks: {}, + vars: {} }, toElement: function() { return this.object; @@ -3814,8 +3702,7 @@ Cookie.write = function(key, value, options) { initialize: function(path, options) { this.instance = "Swiff_" + String.uniqueID(), this.setOptions(options), options = this.options; var id = this.id = options.id || this.instance, container = document.id(options.container); - Swiff.CallBacks[this.instance] = { - }; + Swiff.CallBacks[this.instance] = {}; var params = options.params, vars = options.vars, callBacks = options.callBacks, properties = Object.append({ height: options.height, width: options.width @@ -3843,8 +3730,7 @@ Cookie.write = function(key, value, options) { ].append(arguments)); } }); - Swiff.CallBacks = { - }, Swiff.remote = function(obj, fn) { + Swiff.CallBacks = {}, Swiff.remote = function(obj, fn) { var rs = obj.CallFunction("" + __flash__argumentsToXML(arguments, 2) + ""); return eval(rs); }; diff --git a/crates/swc_ecma_minifier/tests/projects/output/react-17.0.2.js b/crates/swc_ecma_minifier/tests/projects/output/react-17.0.2.js index ba8796a1ac9..c3d7cfff368 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/react-17.0.2.js +++ b/crates/swc_ecma_minifier/tests/projects/output/react-17.0.2.js @@ -1,8 +1,7 @@ !function(global, factory) { "object" == typeof exports && "undefined" != typeof module ? factory(exports) : "function" == typeof define && define.amd ? define([ "exports" - ], factory) : factory((global = global || self).React = { - }); + ], factory) : factory((global = global || self).React = {}); }(this, function(exports) { "use strict"; var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs, prevLog, prevInfo, prevWarn, prevError, prevGroup, prevGroupCollapsed, prevGroupEnd, prefix, componentFrameCache, propTypesMisspellWarningShown, requestHostCallback, requestHostTimeout, cancelHostTimeout, shouldYieldToHost, requestPaint, getCurrentTime, forceFrameRate, REACT_ELEMENT_TYPE = 60103, REACT_PORTAL_TYPE = 60106; @@ -35,8 +34,7 @@ transition: 0 }, ReactCurrentOwner = { current: null - }, ReactDebugCurrentFrame = { - }, currentExtraStackFrame = null; + }, ReactDebugCurrentFrame = {}, currentExtraStackFrame = null; function setExtraStackFrame(stack) { currentExtraStackFrame = stack; } @@ -76,8 +74,7 @@ argsWithFormat.unshift("Warning: " + format), Function.prototype.apply.call(console[level], console, argsWithFormat); } ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; - var didWarnStateUpdateForUnmountedComponent = { - }; + var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { var _constructor = publicInstance.constructor, componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass", warningKey = componentName + "." + callerName; didWarnStateUpdateForUnmountedComponent[warningKey] || (error1("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName), didWarnStateUpdateForUnmountedComponent[warningKey] = !0); @@ -95,13 +92,11 @@ enqueueSetState: function(publicInstance, partialState, callback, callerName) { warnNoop(publicInstance, "setState"); } - }, emptyObject = { - }; + }, emptyObject = {}; function Component(props, context, updater) { this.props = props, this.context = context, this.refs = emptyObject, this.updater = updater || ReactNoopUpdateQueue; } - Object.freeze(emptyObject), Component.prototype.isReactComponent = { - }, Component.prototype.setState = function(partialState, callback) { + Object.freeze(emptyObject), Component.prototype.isReactComponent = {}, Component.prototype.setState = function(partialState, callback) { if (!("object" == typeof partialState || "function" == typeof partialState || null == partialState)) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); this.updater.enqueueSetState(this, partialState, callback, "setState"); }, Component.prototype.forceUpdate = function(callback) { @@ -122,8 +117,7 @@ warn("%s(...) is deprecated in plain JavaScript React classes. %s", info1[0], info1[1]); } })); - function ComponentDummy() { - } + function ComponentDummy() {} function PureComponent(props, context, updater) { this.props = props, this.context = context, this.refs = emptyObject, this.updater = updater || ReactNoopUpdateQueue; } @@ -192,8 +186,7 @@ } return void 0 !== config.key; } - didWarnAboutStringRefs = { - }; + didWarnAboutStringRefs = {}; var ReactElement = function(type, key, ref, self, source, owner, props) { var element = { $$typeof: REACT_ELEMENT_TYPE, @@ -203,8 +196,7 @@ props: props, _owner: owner }; - return element._store = { - }, Object.defineProperty(element._store, "validated", { + return element._store = {}, Object.defineProperty(element._store, "validated", { configurable: !1, enumerable: !1, writable: !0, @@ -222,8 +214,7 @@ }), Object.freeze && (Object.freeze(element.props), Object.freeze(element)), element; }; function createElement(type, config1, children) { - var propName, props = { - }, key = null, ref = null, self = null, source = null; + var propName, props = {}, key = null, ref = null, self = null, source = null; if (null != config1) for(propName in hasValidRef(config1) && (ref = config1.ref, (function(config) { if ("string" == typeof config.ref && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { var componentName = getComponentName(ReactCurrentOwner.current.type); @@ -258,8 +249,7 @@ } function cloneElement(element, config, children) { if (!(null != element)) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); - var propName, defaultProps, props = assign({ - }, element.props), key = element.key, ref = element.ref, self = element._self, source = element._source, owner = element._owner; + var propName, defaultProps, props = assign({}, element.props), key = element.key, ref = element.ref, self = element._self, source = element._source, owner = element._owner; if (null != config) for(propName in hasValidRef(config) && (ref = config.ref, owner = ReactCurrentOwner.current), hasValidKey(config) && (key = "" + config.key), element.type && element.type.defaultProps && (defaultProps = element.type.defaultProps), config)hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName) && (void 0 === config[propName] && void 0 !== defaultProps ? props[propName] = defaultProps[propName] : props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; @@ -366,8 +356,7 @@ return dispatcher; } var disabledDepth = 0; - function disabledLog() { - } + function disabledLog() {} disabledLog.__reactDisabledLog = !0; var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; function describeBuiltInComponentFrame(name, source, ownerFn) { @@ -460,32 +449,25 @@ writable: !0 }; Object.defineProperties(console, { - log: assign({ - }, props, { + log: assign({}, props, { value: prevLog }), - info: assign({ - }, props, { + info: assign({}, props, { value: prevInfo }), - warn: assign({ - }, props, { + warn: assign({}, props, { value: prevWarn }), - error: assign({ - }, props, { + error: assign({}, props, { value: prevError }), - group: assign({ - }, props, { + group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({ - }, props, { + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({ - }, props, { + groupEnd: assign({}, props, { value: prevGroupEnd }) }); @@ -523,14 +505,12 @@ var lazyComponent = type, payload = lazyComponent._payload, init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) { - } + } catch (x) {} } return ""; } componentFrameCache = new ("function" == typeof WeakMap ? WeakMap : Map)(); - var loggedTypeFailures = { - }, ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + var loggedTypeFailures = {}, ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { if (element) { var owner = element._owner, stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); @@ -551,8 +531,7 @@ return ""; } propTypesMisspellWarningShown = !1; - var ownerHasKeyUseWarning = { - }; + var ownerHasKeyUseWarning = {}; function validateExplicitKey(element, parentType1) { if (element._store && !element._store.validated && null == element.key) { element._store.validated = !0; @@ -671,8 +650,7 @@ clearTimeout(_timeoutID); }, shouldYieldToHost = function() { return !1; - }, requestPaint = forceFrameRate = function() { - }; + }, requestPaint = forceFrameRate = function() {}; } else { var _setTimeout = window.setTimeout, _clearTimeout = window.clearTimeout; if ("undefined" != typeof console) { @@ -682,8 +660,7 @@ var isMessageLoopRunning = !1, scheduledHostCallback = null, taskTimeoutID = -1, yieldInterval = 5, deadline = 0; shouldYieldToHost = function() { return getCurrentTime() >= deadline; - }, requestPaint = function() { - }, forceFrameRate = function(fps) { + }, requestPaint = function() {}, forceFrameRate = function(fps) { if (fps < 0 || fps > 125) { console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); return; @@ -894,8 +871,7 @@ unstable_continueExecution: function() { isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = !0, requestHostCallback(flushWork)); }, - unstable_pauseExecution: function() { - }, + unstable_pauseExecution: function() {}, unstable_getFirstCallbackNode: function() { return peek(taskQueue); }, @@ -1087,8 +1063,7 @@ }; ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame; try { - var frozenObject = Object.freeze({ - }); + var frozenObject = Object.freeze({}); new Map([ [ frozenObject, @@ -1097,8 +1072,7 @@ ]), new Set([ frozenObject ]); - } catch (e) { - } + } catch (e) {} exports.Children = { map: mapChildren, forEach: function(children, forEachFunc, forEachContext) { diff --git a/crates/swc_ecma_minifier/tests/projects/output/react-dom-17.0.2.js b/crates/swc_ecma_minifier/tests/projects/output/react-dom-17.0.2.js index 392a114338d..358b23cbe2b 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/react-dom-17.0.2.js +++ b/crates/swc_ecma_minifier/tests/projects/output/react-dom-17.0.2.js @@ -2,8 +2,7 @@ "object" == typeof exports && "undefined" != typeof module ? factory(exports, require("react")) : "function" == typeof define && define.amd ? define([ "exports", "react" - ], factory) : factory((global = global || self).ReactDOM = { - }, global.React); + ], factory) : factory((global = global || self).ReactDOM = {}, global.React); }(this, function(exports, React) { "use strict"; var devToolsConfig, prevLog, prevInfo, prevWarn, prevError, prevGroup, prevGroupCollapsed, prevGroupEnd, prefix1, componentFrameCache, didWarnValueDefaultValue$1, reusableSVGContainer, attemptUserBlockingHydration, attemptContinuousHydration, attemptHydrationAtCurrentPriority, attemptHydrationAtPriority, lastMovementX, lastMovementY, lastMouseEvent, warnedUnknownTags, suppressHydrationWarning, validatePropertiesInDevelopment, warnForTextDifference, warnForPropDifference, warnForExtraAttributes, warnForInvalidEventListener, canDiffStyleForHydrationWarning, normalizeMarkupForTextOrAttribute, normalizeHTML, SUPPRESS_HYDRATION_WARNING$1, fiberStack, warnedAboutMissingGetChildContext, rendererSigil, didWarnUpdateInsideUpdate, currentlyProcessingQueue, didWarnAboutStateAssignmentForComponent, didWarnAboutUninitializedState, didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate, didWarnAboutLegacyLifecyclesAndDerivedState, didWarnAboutUndefinedDerivedState, warnOnUndefinedDerivedState, warnOnInvalidCallback, didWarnAboutDirectlyAssigningPropsToState, didWarnAboutContextTypeAndContextTypes, didWarnAboutInvalidateContextType, didWarnAboutMaps, didWarnAboutGenerators, didWarnAboutStringRefs, ownerHasKeyUseWarning, ownerHasFunctionTypeWarning, rendererSigil$1, didWarnAboutMismatchedHooksForComponent, didWarnAboutUseOpaqueIdentifier, didWarnAboutBadClass, didWarnAboutModulePatternComponent, didWarnAboutContextTypeOnFunctionComponent, didWarnAboutGetDerivedStateOnFunctionComponent, didWarnAboutFunctionRefs, didWarnAboutReassigningProps, didWarnAboutRevealOrder, didWarnAboutTailOptions, appendAllChildren, updateHostContainer, updateHostComponent$1, updateHostText$1, beginWork$1, didWarnAboutUpdateInRenderForAnotherComponent, hasBadMapPolyfill, didWarnAboutNestedUpdates, didWarnAboutFindNodeInStrictMode, topLevelUpdateWarnings, ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -26,9 +25,7 @@ argsWithFormat.unshift("Warning: " + format), Function.prototype.apply.call(console[level], console, argsWithFormat); } if (!React) throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."); - var enableProfilerTimer = !0, enableFundamentalAPI = !1, enableNewReconciler = !1, allNativeEvents = new Set(), registrationNameDependencies1 = { - }, possibleRegistrationNames1 = { - }; + var enableProfilerTimer = !0, enableFundamentalAPI = !1, enableNewReconciler = !1, allNativeEvents = new Set(), registrationNameDependencies1 = {}, possibleRegistrationNames1 = {}; function registerTwoPhaseEvent(registrationName, dependencies) { registerDirectEvent(registrationName, dependencies), registerDirectEvent(registrationName + "Capture", dependencies); } @@ -36,9 +33,7 @@ registrationNameDependencies1[registrationName] && error1("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName), registrationNameDependencies1[registrationName] = dependencies, possibleRegistrationNames1[registrationName.toLowerCase()] = registrationName, "onDoubleClick" === registrationName && (possibleRegistrationNames1.ondblclick = registrationName); for(var i = 0; i < dependencies.length; i++)allNativeEvents.add(dependencies[i]); } - var canUseDOM = !!("undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement), ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", ROOT_ATTRIBUTE_NAME = "data-reactroot", VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"), hasOwnProperty = Object.prototype.hasOwnProperty, illegalAttributeNameCache = { - }, validatedAttributeNameCache = { - }; + var canUseDOM = !!("undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement), ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", ROOT_ATTRIBUTE_NAME = "data-reactroot", VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"), hasOwnProperty = Object.prototype.hasOwnProperty, illegalAttributeNameCache = {}, validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { return !!hasOwnProperty.call(validatedAttributeNameCache, attributeName) || !hasOwnProperty.call(illegalAttributeNameCache, attributeName) && (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName) ? (validatedAttributeNameCache[attributeName] = !0, !0) : (illegalAttributeNameCache[attributeName] = !0, error1("Invalid attribute name: `%s`", attributeName), !1)); } @@ -82,8 +77,7 @@ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { this.acceptsBooleans = 2 === type || 3 === type || 4 === type, this.attributeName = attributeName, this.attributeNamespace = attributeNamespace, this.mustUseProperty = mustUseProperty, this.propertyName = name, this.type = type, this.sanitizeURL = sanitizeURL, this.removeEmptyString = removeEmptyString; } - var properties = { - }; + var properties = {}; [ "children", "dangerouslySetInnerHTML", @@ -356,8 +350,7 @@ return "function" == typeof maybeIterator ? maybeIterator : null; } var disabledDepth = 0; - function disabledLog() { - } + function disabledLog() {} function disableLogs() { if (0 === disabledDepth) { prevLog = console.log, prevInfo = console.info, prevWarn = console.warn, prevError = console.error, prevGroup = console.group, prevGroupCollapsed = console.groupCollapsed, prevGroupEnd = console.groupEnd; @@ -387,32 +380,25 @@ writable: !0 }; Object.defineProperties(console, { - log: _assign({ - }, props, { + log: _assign({}, props, { value: prevLog }), - info: _assign({ - }, props, { + info: _assign({}, props, { value: prevInfo }), - warn: _assign({ - }, props, { + warn: _assign({}, props, { value: prevWarn }), - error: _assign({ - }, props, { + error: _assign({}, props, { value: prevError }), - group: _assign({ - }, props, { + group: _assign({}, props, { value: prevGroup }), - groupCollapsed: _assign({ - }, props, { + groupCollapsed: _assign({}, props, { value: prevGroupCollapsed }), - groupEnd: _assign({ - }, props, { + groupEnd: _assign({}, props, { value: prevGroupEnd }) }); @@ -515,8 +501,7 @@ var lazyComponent = type, payload = lazyComponent._payload, init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) { - } + } catch (x) {} } return ""; } @@ -699,8 +684,7 @@ } function getHostProps(element, props) { var checked = props.checked; - return _assign({ - }, props, { + return _assign({}, props, { defaultChecked: void 0, defaultValue: void 0, value: void 0, @@ -771,8 +755,7 @@ function updateOptions(node, multiple, propValue, setDefaultSelected) { var options = node.options; if (multiple) { - for(var selectedValues = propValue, selectedValue = { - }, i = 0; i < selectedValues.length; i++)selectedValue["$" + selectedValues[i]] = !0; + for(var selectedValues = propValue, selectedValue = {}, i = 0; i < selectedValues.length; i++)selectedValue["$" + selectedValues[i]] = !0; for(var _i = 0; _i < options.length; _i++){ var selected = selectedValue.hasOwnProperty("$" + options[_i].value); options[_i].selected !== selected && (options[_i].selected = selected), selected && setDefaultSelected && (options[_i].defaultSelected = !0); @@ -789,8 +772,7 @@ } } function getHostProps$2(element, props) { - return _assign({ - }, props, { + return _assign({}, props, { value: void 0 }); } @@ -812,8 +794,7 @@ var didWarnValDefaultVal = !1; function getHostProps$3(element, props) { if (null != props.dangerouslySetInnerHTML) throw Error("`dangerouslySetInnerHTML` does not make sense on