@jackctaylor/roblox-ts 3.0.0-projectrefs.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +716 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/include/Promise.lua +2068 -0
- package/include/RuntimeLib.lua +258 -0
- package/out/CLI/cli.d.ts +2 -0
- package/out/CLI/cli.js +41 -0
- package/out/CLI/commands/build.d.ts +7 -0
- package/out/CLI/commands/build.js +438 -0
- package/out/CLI/errors/CLIError.d.ts +4 -0
- package/out/CLI/errors/CLIError.js +12 -0
- package/out/CLI/index.d.ts +3 -0
- package/out/CLI/index.js +22 -0
- package/out/CLI/test.d.ts +1 -0
- package/out/CLI/test.js +82 -0
- package/out/CLI/util/patchFs.d.ts +1 -0
- package/out/CLI/util/patchFs.js +26 -0
- package/out/Project/classes/VirtualFileSystem.d.ts +14 -0
- package/out/Project/classes/VirtualFileSystem.js +102 -0
- package/out/Project/classes/VirtualProject.d.ts +15 -0
- package/out/Project/classes/VirtualProject.js +121 -0
- package/out/Project/functions/buildProject.d.ts +18 -0
- package/out/Project/functions/buildProject.js +48 -0
- package/out/Project/functions/buildProjectReferences.d.ts +3 -0
- package/out/Project/functions/buildProjectReferences.js +78 -0
- package/out/Project/functions/buildSolution.d.ts +10 -0
- package/out/Project/functions/buildSolution.js +97 -0
- package/out/Project/functions/checkFileName.d.ts +1 -0
- package/out/Project/functions/checkFileName.js +18 -0
- package/out/Project/functions/checkRojoConfig.d.ts +4 -0
- package/out/Project/functions/checkRojoConfig.js +26 -0
- package/out/Project/functions/cleanup.d.ts +2 -0
- package/out/Project/functions/cleanup.js +30 -0
- package/out/Project/functions/compileFiles.d.ts +4 -0
- package/out/Project/functions/compileFiles.js +160 -0
- package/out/Project/functions/compileProject.d.ts +14 -0
- package/out/Project/functions/compileProject.js +71 -0
- package/out/Project/functions/copyFiles.d.ts +3 -0
- package/out/Project/functions/copyFiles.js +13 -0
- package/out/Project/functions/copyInclude.d.ts +2 -0
- package/out/Project/functions/copyInclude.js +17 -0
- package/out/Project/functions/copyItem.d.ts +3 -0
- package/out/Project/functions/copyItem.js +27 -0
- package/out/Project/functions/createNodeModulesPathMapping.d.ts +1 -0
- package/out/Project/functions/createNodeModulesPathMapping.js +31 -0
- package/out/Project/functions/createPathTranslator.d.ts +4 -0
- package/out/Project/functions/createPathTranslator.js +22 -0
- package/out/Project/functions/createProgramFactory.d.ts +3 -0
- package/out/Project/functions/createProgramFactory.js +31 -0
- package/out/Project/functions/createProjectData.d.ts +2 -0
- package/out/Project/functions/createProjectData.js +102 -0
- package/out/Project/functions/createProjectProgram.d.ts +3 -0
- package/out/Project/functions/createProjectProgram.js +11 -0
- package/out/Project/functions/getChangedFilePaths.d.ts +2 -0
- package/out/Project/functions/getChangedFilePaths.js +47 -0
- package/out/Project/functions/getChangedSourceFiles.d.ts +2 -0
- package/out/Project/functions/getChangedSourceFiles.js +19 -0
- package/out/Project/functions/getParsedCommandLine.d.ts +3 -0
- package/out/Project/functions/getParsedCommandLine.js +41 -0
- package/out/Project/functions/getProjectReferences.d.ts +2 -0
- package/out/Project/functions/getProjectReferences.js +65 -0
- package/out/Project/functions/getResolvedProjectReferences.d.ts +3 -0
- package/out/Project/functions/getResolvedProjectReferences.js +43 -0
- package/out/Project/functions/setupProjectWatchProgram.d.ts +2 -0
- package/out/Project/functions/setupProjectWatchProgram.js +352 -0
- package/out/Project/functions/setupSolutionWatchProgram.d.ts +2 -0
- package/out/Project/functions/setupSolutionWatchProgram.js +355 -0
- package/out/Project/functions/tryRemoveOutput.d.ts +2 -0
- package/out/Project/functions/tryRemoveOutput.js +30 -0
- package/out/Project/functions/validateCompilerOptions.d.ts +2 -0
- package/out/Project/functions/validateCompilerOptions.js +87 -0
- package/out/Project/index.d.ts +4 -0
- package/out/Project/index.js +20 -0
- package/out/Project/preEmitDiagnostics/fileUsesCommentDirectives.d.ts +3 -0
- package/out/Project/preEmitDiagnostics/fileUsesCommentDirectives.js +28 -0
- package/out/Project/transformers/builtin/transformPaths.d.ts +5 -0
- package/out/Project/transformers/builtin/transformPaths.js +129 -0
- package/out/Project/transformers/builtin/transformTypeReferenceDirectives.d.ts +2 -0
- package/out/Project/transformers/builtin/transformTypeReferenceDirectives.js +23 -0
- package/out/Project/transformers/createTransformerList.d.ts +4 -0
- package/out/Project/transformers/createTransformerList.js +87 -0
- package/out/Project/transformers/createTransformerWatcher.d.ts +3 -0
- package/out/Project/transformers/createTransformerWatcher.js +59 -0
- package/out/Project/transformers/getPluginConfigs.d.ts +2 -0
- package/out/Project/transformers/getPluginConfigs.js +34 -0
- package/out/Project/util/createReadBuildProgramHost.d.ts +5 -0
- package/out/Project/util/createReadBuildProgramHost.js +15 -0
- package/out/Project/util/getCustomPreEmitDiagnostics.d.ts +4 -0
- package/out/Project/util/getCustomPreEmitDiagnostics.js +13 -0
- package/out/Project/util/isCompilableFile.d.ts +1 -0
- package/out/Project/util/isCompilableFile.js +18 -0
- package/out/Project/util/walkDirectorySync.d.ts +1 -0
- package/out/Project/util/walkDirectorySync.js +22 -0
- package/out/Shared/classes/Lazy.d.ts +8 -0
- package/out/Shared/classes/Lazy.js +22 -0
- package/out/Shared/classes/LogService.d.ts +9 -0
- package/out/Shared/classes/LogService.js +37 -0
- package/out/Shared/constants.d.ts +23 -0
- package/out/Shared/constants.js +50 -0
- package/out/Shared/diagnostics.d.ts +79 -0
- package/out/Shared/diagnostics.js +140 -0
- package/out/Shared/errors/DiagnosticError.d.ts +7 -0
- package/out/Shared/errors/DiagnosticError.js +16 -0
- package/out/Shared/errors/LoggableError.d.ts +5 -0
- package/out/Shared/errors/LoggableError.js +14 -0
- package/out/Shared/errors/ProjectError.d.ts +4 -0
- package/out/Shared/errors/ProjectError.js +12 -0
- package/out/Shared/index.d.ts +0 -0
- package/out/Shared/index.js +2 -0
- package/out/Shared/types.d.ts +50 -0
- package/out/Shared/types.js +3 -0
- package/out/Shared/util/assert.d.ts +1 -0
- package/out/Shared/util/assert.js +12 -0
- package/out/Shared/util/benchmark.d.ts +3 -0
- package/out/Shared/util/benchmark.js +32 -0
- package/out/Shared/util/createDiagnosticWithLocation.d.ts +3 -0
- package/out/Shared/util/createDiagnosticWithLocation.js +29 -0
- package/out/Shared/util/createGithubLink.d.ts +1 -0
- package/out/Shared/util/createGithubLink.js +12 -0
- package/out/Shared/util/createTextDiagnostic.d.ts +2 -0
- package/out/Shared/util/createTextDiagnostic.js +18 -0
- package/out/Shared/util/findAncestorDir.d.ts +1 -0
- package/out/Shared/util/findAncestorDir.js +16 -0
- package/out/Shared/util/findLastIndex.d.ts +1 -0
- package/out/Shared/util/findLastIndex.js +12 -0
- package/out/Shared/util/formatDiagnostics.d.ts +2 -0
- package/out/Shared/util/formatDiagnostics.js +19 -0
- package/out/Shared/util/getCanonicalFileName.d.ts +2 -0
- package/out/Shared/util/getCanonicalFileName.js +10 -0
- package/out/Shared/util/getOrSetDefault.d.ts +1 -0
- package/out/Shared/util/getOrSetDefault.js +12 -0
- package/out/Shared/util/getRootDirs.d.ts +2 -0
- package/out/Shared/util/getRootDirs.js +10 -0
- package/out/Shared/util/hasErrors.d.ts +2 -0
- package/out/Shared/util/hasErrors.js +11 -0
- package/out/Shared/util/isPathDescendantOf.d.ts +1 -0
- package/out/Shared/util/isPathDescendantOf.js +11 -0
- package/out/Shared/util/realPathExistsSync.d.ts +1 -0
- package/out/Shared/util/realPathExistsSync.js +13 -0
- package/out/Shared/warn.d.ts +1 -0
- package/out/Shared/warn.js +12 -0
- package/out/TSTransformer/classes/DiagnosticService.d.ts +11 -0
- package/out/TSTransformer/classes/DiagnosticService.js +37 -0
- package/out/TSTransformer/classes/MacroManager.d.ts +46 -0
- package/out/TSTransformer/classes/MacroManager.js +178 -0
- package/out/TSTransformer/classes/MultiTransformState.d.ts +9 -0
- package/out/TSTransformer/classes/MultiTransformState.js +15 -0
- package/out/TSTransformer/classes/TransformState.d.ts +73 -0
- package/out/TSTransformer/classes/TransformState.js +307 -0
- package/out/TSTransformer/index.d.ts +4 -0
- package/out/TSTransformer/index.js +23 -0
- package/out/TSTransformer/macros/callMacros.d.ts +2 -0
- package/out/TSTransformer/macros/callMacros.js +56 -0
- package/out/TSTransformer/macros/constructorMacros.d.ts +2 -0
- package/out/TSTransformer/macros/constructorMacros.js +97 -0
- package/out/TSTransformer/macros/identifierMacros.d.ts +2 -0
- package/out/TSTransformer/macros/identifierMacros.js +7 -0
- package/out/TSTransformer/macros/propertyCallMacros.d.ts +4 -0
- package/out/TSTransformer/macros/propertyCallMacros.js +726 -0
- package/out/TSTransformer/macros/types.d.ts +12 -0
- package/out/TSTransformer/macros/types.js +3 -0
- package/out/TSTransformer/nodes/binding/transformArrayAssignmentPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformArrayAssignmentPattern.js +78 -0
- package/out/TSTransformer/nodes/binding/transformArrayBindingPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformArrayBindingPattern.js +52 -0
- package/out/TSTransformer/nodes/binding/transformBindingName.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformBindingName.js +30 -0
- package/out/TSTransformer/nodes/binding/transformObjectAssignmentPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformObjectAssignmentPattern.js +97 -0
- package/out/TSTransformer/nodes/binding/transformObjectBindingPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformObjectBindingPattern.js +57 -0
- package/out/TSTransformer/nodes/class/transformClassConstructor.d.ts +7 -0
- package/out/TSTransformer/nodes/class/transformClassConstructor.js +96 -0
- package/out/TSTransformer/nodes/class/transformClassLikeDeclaration.d.ts +7 -0
- package/out/TSTransformer/nodes/class/transformClassLikeDeclaration.js +262 -0
- package/out/TSTransformer/nodes/class/transformDecorators.d.ts +4 -0
- package/out/TSTransformer/nodes/class/transformDecorators.js +179 -0
- package/out/TSTransformer/nodes/class/transformPropertyDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/class/transformPropertyDeclaration.js +33 -0
- package/out/TSTransformer/nodes/expressions/transformArrayLiteralExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformArrayLiteralExpression.js +79 -0
- package/out/TSTransformer/nodes/expressions/transformAwaitExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformAwaitExpression.js +13 -0
- package/out/TSTransformer/nodes/expressions/transformBinaryExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformBinaryExpression.js +199 -0
- package/out/TSTransformer/nodes/expressions/transformBooleanLiteral.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformBooleanLiteral.js +15 -0
- package/out/TSTransformer/nodes/expressions/transformCallExpression.d.ts +7 -0
- package/out/TSTransformer/nodes/expressions/transformCallExpression.js +191 -0
- package/out/TSTransformer/nodes/expressions/transformClassExpression.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformClassExpression.js +10 -0
- package/out/TSTransformer/nodes/expressions/transformConditionalExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformConditionalExpression.js +55 -0
- package/out/TSTransformer/nodes/expressions/transformDeleteExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformDeleteExpression.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformElementAccessExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformElementAccessExpression.js +62 -0
- package/out/TSTransformer/nodes/expressions/transformExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformExpression.js +107 -0
- package/out/TSTransformer/nodes/expressions/transformFunctionExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformFunctionExpression.js +46 -0
- package/out/TSTransformer/nodes/expressions/transformIdentifier.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformIdentifier.js +147 -0
- package/out/TSTransformer/nodes/expressions/transformImportExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformImportExpression.js +30 -0
- package/out/TSTransformer/nodes/expressions/transformJsxElement.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformJsxElement.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformJsxExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformJsxExpression.js +19 -0
- package/out/TSTransformer/nodes/expressions/transformJsxFragment.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformJsxFragment.js +28 -0
- package/out/TSTransformer/nodes/expressions/transformJsxSelfClosingElement.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformJsxSelfClosingElement.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformNewExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNewExpression.js +26 -0
- package/out/TSTransformer/nodes/expressions/transformNoSubstitutionTemplateLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNoSubstitutionTemplateLiteral.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformNumericLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNumericLiteral.js +13 -0
- package/out/TSTransformer/nodes/expressions/transformObjectLiteralExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformObjectLiteralExpression.js +98 -0
- package/out/TSTransformer/nodes/expressions/transformOmittedExpression.d.ts +2 -0
- package/out/TSTransformer/nodes/expressions/transformOmittedExpression.js +11 -0
- package/out/TSTransformer/nodes/expressions/transformParenthesizedExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformParenthesizedExpression.js +19 -0
- package/out/TSTransformer/nodes/expressions/transformPropertyAccessExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformPropertyAccessExpression.js +36 -0
- package/out/TSTransformer/nodes/expressions/transformSpreadElement.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformSpreadElement.js +35 -0
- package/out/TSTransformer/nodes/expressions/transformStringLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformStringLiteral.js +12 -0
- package/out/TSTransformer/nodes/expressions/transformSuperKeyword.d.ts +2 -0
- package/out/TSTransformer/nodes/expressions/transformSuperKeyword.js +11 -0
- package/out/TSTransformer/nodes/expressions/transformTaggedTemplateExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformTaggedTemplateExpression.js +27 -0
- package/out/TSTransformer/nodes/expressions/transformTemplateExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformTemplateExpression.js +25 -0
- package/out/TSTransformer/nodes/expressions/transformThisExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformThisExpression.js +29 -0
- package/out/TSTransformer/nodes/expressions/transformTypeExpression.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformTypeExpression.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformUnaryExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformUnaryExpression.js +68 -0
- package/out/TSTransformer/nodes/expressions/transformVoidExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformVoidExpression.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformYieldExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformYieldExpression.js +46 -0
- package/out/TSTransformer/nodes/jsx/transformJsx.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsx.js +36 -0
- package/out/TSTransformer/nodes/jsx/transformJsxAttributes.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxAttributes.js +83 -0
- package/out/TSTransformer/nodes/jsx/transformJsxChildren.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxChildren.js +34 -0
- package/out/TSTransformer/nodes/jsx/transformJsxTagName.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxTagName.js +42 -0
- package/out/TSTransformer/nodes/statements/transformBlock.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformBlock.js +14 -0
- package/out/TSTransformer/nodes/statements/transformBreakStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformBreakStatement.js +24 -0
- package/out/TSTransformer/nodes/statements/transformClassDeclaration.d.ts +3 -0
- package/out/TSTransformer/nodes/statements/transformClassDeclaration.js +8 -0
- package/out/TSTransformer/nodes/statements/transformContinueStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformContinueStatement.js +24 -0
- package/out/TSTransformer/nodes/statements/transformDoStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformDoStatement.js +31 -0
- package/out/TSTransformer/nodes/statements/transformEnumDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformEnumDeclaration.js +97 -0
- package/out/TSTransformer/nodes/statements/transformExportAssignment.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformExportAssignment.js +53 -0
- package/out/TSTransformer/nodes/statements/transformExportDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformExportDeclaration.js +109 -0
- package/out/TSTransformer/nodes/statements/transformExpressionStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformExpressionStatement.js +62 -0
- package/out/TSTransformer/nodes/statements/transformForOfStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformForOfStatement.js +375 -0
- package/out/TSTransformer/nodes/statements/transformForStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformForStatement.js +371 -0
- package/out/TSTransformer/nodes/statements/transformFunctionDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformFunctionDeclaration.js +68 -0
- package/out/TSTransformer/nodes/statements/transformIfStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformIfStatement.js +46 -0
- package/out/TSTransformer/nodes/statements/transformImportDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformImportDeclaration.js +98 -0
- package/out/TSTransformer/nodes/statements/transformImportEqualsDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformImportEqualsDeclaration.js +36 -0
- package/out/TSTransformer/nodes/statements/transformModuleDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformModuleDeclaration.js +122 -0
- package/out/TSTransformer/nodes/statements/transformReturnStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformReturnStatement.js +74 -0
- package/out/TSTransformer/nodes/statements/transformStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformStatement.js +83 -0
- package/out/TSTransformer/nodes/statements/transformSwitchStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformSwitchStatement.js +105 -0
- package/out/TSTransformer/nodes/statements/transformThrowStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformThrowStatement.js +18 -0
- package/out/TSTransformer/nodes/statements/transformTryStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformTryStatement.js +148 -0
- package/out/TSTransformer/nodes/statements/transformVariableStatement.d.ts +8 -0
- package/out/TSTransformer/nodes/statements/transformVariableStatement.js +155 -0
- package/out/TSTransformer/nodes/statements/transformWhileStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformWhileStatement.js +30 -0
- package/out/TSTransformer/nodes/transformEntityName.d.ts +4 -0
- package/out/TSTransformer/nodes/transformEntityName.js +24 -0
- package/out/TSTransformer/nodes/transformInitializer.d.ts +4 -0
- package/out/TSTransformer/nodes/transformInitializer.js +22 -0
- package/out/TSTransformer/nodes/transformInterpolatedStringPart.d.ts +3 -0
- package/out/TSTransformer/nodes/transformInterpolatedStringPart.js +12 -0
- package/out/TSTransformer/nodes/transformLogical.d.ts +4 -0
- package/out/TSTransformer/nodes/transformLogical.js +103 -0
- package/out/TSTransformer/nodes/transformLogicalOrCoalescingAssignmentExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/transformLogicalOrCoalescingAssignmentExpression.js +91 -0
- package/out/TSTransformer/nodes/transformMethodDeclaration.d.ts +5 -0
- package/out/TSTransformer/nodes/transformMethodDeclaration.js +82 -0
- package/out/TSTransformer/nodes/transformOptionalChain.d.ts +46 -0
- package/out/TSTransformer/nodes/transformOptionalChain.js +257 -0
- package/out/TSTransformer/nodes/transformParameters.d.ts +8 -0
- package/out/TSTransformer/nodes/transformParameters.js +104 -0
- package/out/TSTransformer/nodes/transformPropertyName.d.ts +4 -0
- package/out/TSTransformer/nodes/transformPropertyName.js +18 -0
- package/out/TSTransformer/nodes/transformSourceFile.d.ts +4 -0
- package/out/TSTransformer/nodes/transformSourceFile.js +171 -0
- package/out/TSTransformer/nodes/transformStatementList.d.ts +7 -0
- package/out/TSTransformer/nodes/transformStatementList.js +63 -0
- package/out/TSTransformer/nodes/transformWritable.d.ts +9 -0
- package/out/TSTransformer/nodes/transformWritable.js +49 -0
- package/out/TSTransformer/typeGuards.d.ts +5 -0
- package/out/TSTransformer/typeGuards.js +27 -0
- package/out/TSTransformer/types.d.ts +9 -0
- package/out/TSTransformer/types.js +3 -0
- package/out/TSTransformer/util/addIndexDiagnostics.d.ts +3 -0
- package/out/TSTransformer/util/addIndexDiagnostics.js +24 -0
- package/out/TSTransformer/util/addOneIfArrayType.d.ts +4 -0
- package/out/TSTransformer/util/addOneIfArrayType.js +14 -0
- package/out/TSTransformer/util/arrayBindingPatternContainsHoists.d.ts +3 -0
- package/out/TSTransformer/util/arrayBindingPatternContainsHoists.js +23 -0
- package/out/TSTransformer/util/arrayLikeExpressionContainsSpread.d.ts +2 -0
- package/out/TSTransformer/util/arrayLikeExpressionContainsSpread.js +17 -0
- package/out/TSTransformer/util/assertNever.d.ts +1 -0
- package/out/TSTransformer/util/assertNever.js +36 -0
- package/out/TSTransformer/util/assignment.d.ts +7 -0
- package/out/TSTransformer/util/assignment.js +48 -0
- package/out/TSTransformer/util/binding/getAccessorForBindingType.d.ts +6 -0
- package/out/TSTransformer/util/binding/getAccessorForBindingType.js +141 -0
- package/out/TSTransformer/util/binding/getTargetIdForBindingPattern.d.ts +4 -0
- package/out/TSTransformer/util/binding/getTargetIdForBindingPattern.js +15 -0
- package/out/TSTransformer/util/binding/objectAccessor.d.ts +4 -0
- package/out/TSTransformer/util/binding/objectAccessor.js +39 -0
- package/out/TSTransformer/util/bitwise.d.ts +6 -0
- package/out/TSTransformer/util/bitwise.js +67 -0
- package/out/TSTransformer/util/checkVariableHoist.d.ts +3 -0
- package/out/TSTransformer/util/checkVariableHoist.js +33 -0
- package/out/TSTransformer/util/cleanModuleName.d.ts +1 -0
- package/out/TSTransformer/util/cleanModuleName.js +7 -0
- package/out/TSTransformer/util/convertToIndexableExpression.d.ts +3 -0
- package/out/TSTransformer/util/convertToIndexableExpression.js +14 -0
- package/out/TSTransformer/util/createBinaryFromOperator.d.ts +4 -0
- package/out/TSTransformer/util/createBinaryFromOperator.js +54 -0
- package/out/TSTransformer/util/createGetService.d.ts +2 -0
- package/out/TSTransformer/util/createGetService.js +15 -0
- package/out/TSTransformer/util/createHoistDeclaration.d.ts +4 -0
- package/out/TSTransformer/util/createHoistDeclaration.js +20 -0
- package/out/TSTransformer/util/createImportExpression.d.ts +5 -0
- package/out/TSTransformer/util/createImportExpression.js +181 -0
- package/out/TSTransformer/util/createStringFromLiteral.d.ts +2 -0
- package/out/TSTransformer/util/createStringFromLiteral.js +27 -0
- package/out/TSTransformer/util/createTransformServices.d.ts +3 -0
- package/out/TSTransformer/util/createTransformServices.js +9 -0
- package/out/TSTransformer/util/createTruthinessChecks.d.ts +5 -0
- package/out/TSTransformer/util/createTruthinessChecks.js +50 -0
- package/out/TSTransformer/util/createTypeCheck.d.ts +2 -0
- package/out/TSTransformer/util/createTypeCheck.js +11 -0
- package/out/TSTransformer/util/ensureTransformOrder.d.ts +5 -0
- package/out/TSTransformer/util/ensureTransformOrder.js +39 -0
- package/out/TSTransformer/util/expressionChain.d.ts +3 -0
- package/out/TSTransformer/util/expressionChain.js +16 -0
- package/out/TSTransformer/util/expressionMightMutate.d.ts +4 -0
- package/out/TSTransformer/util/expressionMightMutate.js +57 -0
- package/out/TSTransformer/util/findConstructor.d.ts +4 -0
- package/out/TSTransformer/util/findConstructor.js +11 -0
- package/out/TSTransformer/util/fixupWhitespaceAndDecodeEntities.d.ts +1 -0
- package/out/TSTransformer/util/fixupWhitespaceAndDecodeEntities.js +306 -0
- package/out/TSTransformer/util/getAddIterableToArrayBuilder.d.ts +6 -0
- package/out/TSTransformer/util/getAddIterableToArrayBuilder.js +253 -0
- package/out/TSTransformer/util/getAssignableValue.d.ts +3 -0
- package/out/TSTransformer/util/getAssignableValue.js +15 -0
- package/out/TSTransformer/util/getConstantValueLiteral.d.ts +4 -0
- package/out/TSTransformer/util/getConstantValueLiteral.js +19 -0
- package/out/TSTransformer/util/getDeclaredVariables.d.ts +2 -0
- package/out/TSTransformer/util/getDeclaredVariables.js +37 -0
- package/out/TSTransformer/util/getExtendsNode.d.ts +2 -0
- package/out/TSTransformer/util/getExtendsNode.js +16 -0
- package/out/TSTransformer/util/getFlags.d.ts +1 -0
- package/out/TSTransformer/util/getFlags.js +13 -0
- package/out/TSTransformer/util/getKindName.d.ts +2 -0
- package/out/TSTransformer/util/getKindName.js +61 -0
- package/out/TSTransformer/util/getOriginalSymbolOfNode.d.ts +2 -0
- package/out/TSTransformer/util/getOriginalSymbolOfNode.js +15 -0
- package/out/TSTransformer/util/getSourceFileFromModuleSpecifier.d.ts +3 -0
- package/out/TSTransformer/util/getSourceFileFromModuleSpecifier.js +33 -0
- package/out/TSTransformer/util/getStatements.d.ts +2 -0
- package/out/TSTransformer/util/getStatements.js +11 -0
- package/out/TSTransformer/util/hasMultipleDefinitions.d.ts +2 -0
- package/out/TSTransformer/util/hasMultipleDefinitions.js +17 -0
- package/out/TSTransformer/util/isBlockedByTryStatement.d.ts +3 -0
- package/out/TSTransformer/util/isBlockedByTryStatement.js +17 -0
- package/out/TSTransformer/util/isMethod.d.ts +4 -0
- package/out/TSTransformer/util/isMethod.js +90 -0
- package/out/TSTransformer/util/isSymbolMutable.d.ts +3 -0
- package/out/TSTransformer/util/isSymbolMutable.js +24 -0
- package/out/TSTransformer/util/isSymbolOfValue.d.ts +2 -0
- package/out/TSTransformer/util/isSymbolOfValue.js +11 -0
- package/out/TSTransformer/util/isUsedAsStatement.d.ts +2 -0
- package/out/TSTransformer/util/isUsedAsStatement.js +23 -0
- package/out/TSTransformer/util/isValidMethodIndexWithoutCall.d.ts +3 -0
- package/out/TSTransformer/util/isValidMethodIndexWithoutCall.js +31 -0
- package/out/TSTransformer/util/offset.d.ts +2 -0
- package/out/TSTransformer/util/offset.js +44 -0
- package/out/TSTransformer/util/pointer.d.ts +13 -0
- package/out/TSTransformer/util/pointer.js +46 -0
- package/out/TSTransformer/util/spreadDestructuring/index.d.ts +9 -0
- package/out/TSTransformer/util/spreadDestructuring/index.js +45 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureArray.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureArray.js +17 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureGenerator.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureGenerator.js +33 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureMap.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureMap.js +34 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureObject.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureObject.js +41 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureSet.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureSet.js +28 -0
- package/out/TSTransformer/util/traversal.d.ts +7 -0
- package/out/TSTransformer/util/traversal.js +57 -0
- package/out/TSTransformer/util/types.d.ts +31 -0
- package/out/TSTransformer/util/types.js +259 -0
- package/out/TSTransformer/util/validateIdentifier.d.ts +3 -0
- package/out/TSTransformer/util/validateIdentifier.js +18 -0
- package/out/TSTransformer/util/validateMethodAssignment.d.ts +3 -0
- package/out/TSTransformer/util/validateMethodAssignment.js +81 -0
- package/out/TSTransformer/util/validateNotAny.d.ts +3 -0
- package/out/TSTransformer/util/validateNotAny.js +37 -0
- package/out/TSTransformer/util/valueToIdStr.d.ts +2 -0
- package/out/TSTransformer/util/valueToIdStr.js +29 -0
- package/out/TSTransformer/util/wrapExpressionStatement.d.ts +2 -0
- package/out/TSTransformer/util/wrapExpressionStatement.js +22 -0
- package/out/TSTransformer/util/wrapReturnIfLuaTuple.d.ts +4 -0
- package/out/TSTransformer/util/wrapReturnIfLuaTuple.js +56 -0
- package/out/TSTransformer/util/wrapStatementsAsGenerator.d.ts +4 -0
- package/out/TSTransformer/util/wrapStatementsAsGenerator.js +19 -0
- package/package.json +72 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.convertToIndexableExpression = convertToIndexableExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
function convertToIndexableExpression(expression) {
|
|
9
|
+
if (luau_ast_1.default.isIndexableExpression(expression)) {
|
|
10
|
+
return expression;
|
|
11
|
+
}
|
|
12
|
+
return luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.ParenthesizedExpression, { expression });
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=convertToIndexableExpression.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../classes/TransformState";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function createBinaryFromOperator(state: TransformState, node: ts.Node, left: luau.Expression, leftType: ts.Type, operatorKind: ts.BinaryOperator, right: luau.Expression, rightType: ts.Type): luau.Expression;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createBinaryFromOperator = createBinaryFromOperator;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const assert_1 = require("../../Shared/util/assert");
|
|
9
|
+
const bitwise_1 = require("./bitwise");
|
|
10
|
+
const getKindName_1 = require("./getKindName");
|
|
11
|
+
const types_1 = require("./types");
|
|
12
|
+
const wrapExpressionStatement_1 = require("./wrapExpressionStatement");
|
|
13
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
14
|
+
const OPERATOR_MAP = new Map([
|
|
15
|
+
[typescript_1.default.SyntaxKind.LessThanToken, "<"],
|
|
16
|
+
[typescript_1.default.SyntaxKind.GreaterThanToken, ">"],
|
|
17
|
+
[typescript_1.default.SyntaxKind.LessThanEqualsToken, "<="],
|
|
18
|
+
[typescript_1.default.SyntaxKind.GreaterThanEqualsToken, ">="],
|
|
19
|
+
[typescript_1.default.SyntaxKind.EqualsEqualsEqualsToken, "=="],
|
|
20
|
+
[typescript_1.default.SyntaxKind.ExclamationEqualsEqualsToken, "~="],
|
|
21
|
+
[typescript_1.default.SyntaxKind.MinusToken, "-"],
|
|
22
|
+
[typescript_1.default.SyntaxKind.AsteriskToken, "*"],
|
|
23
|
+
[typescript_1.default.SyntaxKind.SlashToken, "/"],
|
|
24
|
+
[typescript_1.default.SyntaxKind.AsteriskAsteriskToken, "^"],
|
|
25
|
+
[typescript_1.default.SyntaxKind.PercentToken, "%"],
|
|
26
|
+
]);
|
|
27
|
+
function createBinaryAdd(left, leftType, right, rightType) {
|
|
28
|
+
const leftIsString = (0, types_1.isDefinitelyType)(leftType, types_1.isStringType);
|
|
29
|
+
const rightIsString = (0, types_1.isDefinitelyType)(rightType, types_1.isStringType);
|
|
30
|
+
if (leftIsString || rightIsString) {
|
|
31
|
+
return luau_ast_1.default.binary(leftIsString ? left : luau_ast_1.default.call(luau_ast_1.default.globals.tostring, [left]), "..", rightIsString ? right : luau_ast_1.default.call(luau_ast_1.default.globals.tostring, [right]));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return luau_ast_1.default.binary(left, "+", right);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function createBinaryFromOperator(state, node, left, leftType, operatorKind, right, rightType) {
|
|
38
|
+
const operator = OPERATOR_MAP.get(operatorKind);
|
|
39
|
+
if (operator !== undefined) {
|
|
40
|
+
return luau_ast_1.default.binary(left, operator, right);
|
|
41
|
+
}
|
|
42
|
+
if (operatorKind === typescript_1.default.SyntaxKind.PlusToken || operatorKind === typescript_1.default.SyntaxKind.PlusEqualsToken) {
|
|
43
|
+
return createBinaryAdd(left, leftType, right, rightType);
|
|
44
|
+
}
|
|
45
|
+
if ((0, bitwise_1.isBitwiseOperator)(operatorKind)) {
|
|
46
|
+
return (0, bitwise_1.createBitwiseCall)(operatorKind, [left, right]);
|
|
47
|
+
}
|
|
48
|
+
if (operatorKind === typescript_1.default.SyntaxKind.CommaToken) {
|
|
49
|
+
state.prereqList((0, wrapExpressionStatement_1.wrapExpressionStatement)(left));
|
|
50
|
+
return right;
|
|
51
|
+
}
|
|
52
|
+
(0, assert_1.assert)(false, `createBinaryFromOperator unknown operator: ${(0, getKindName_1.getKindName)(operatorKind)}`);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=createBinaryFromOperator.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createGetService = createGetService;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
function createGetService(serviceName) {
|
|
9
|
+
return luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.MethodCallExpression, {
|
|
10
|
+
expression: luau_ast_1.default.globals.game,
|
|
11
|
+
name: "GetService",
|
|
12
|
+
args: luau_ast_1.default.list.make(luau_ast_1.default.string(serviceName)),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=createGetService.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createHoistDeclaration = createHoistDeclaration;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const transformIdentifier_1 = require("../nodes/expressions/transformIdentifier");
|
|
9
|
+
const validateIdentifier_1 = require("./validateIdentifier");
|
|
10
|
+
function createHoistDeclaration(state, statement) {
|
|
11
|
+
const hoists = state.hoistsByStatement.get(statement);
|
|
12
|
+
if (hoists && hoists.length > 0) {
|
|
13
|
+
hoists.forEach(hoist => (0, validateIdentifier_1.validateIdentifier)(state, hoist));
|
|
14
|
+
return luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.VariableDeclaration, {
|
|
15
|
+
left: luau_ast_1.default.list.make(...hoists.map(hoistId => (0, transformIdentifier_1.transformIdentifierDefined)(state, hoistId))),
|
|
16
|
+
right: undefined,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=createHoistDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function getImportParts(state: TransformState, sourceFile: ts.SourceFile, moduleSpecifier: ts.Expression): luau.Expression<luau.SyntaxKind>[];
|
|
5
|
+
export declare function createImportExpression(state: TransformState, sourceFile: ts.SourceFile, moduleSpecifier: ts.Expression): luau.IndexableExpression;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getImportParts = getImportParts;
|
|
7
|
+
exports.createImportExpression = createImportExpression;
|
|
8
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
9
|
+
const rojo_resolver_1 = require("@roblox-ts/rojo-resolver");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const constants_1 = require("../../Shared/constants");
|
|
12
|
+
const diagnostics_1 = require("../../Shared/diagnostics");
|
|
13
|
+
const assert_1 = require("../../Shared/util/assert");
|
|
14
|
+
const getCanonicalFileName_1 = require("../../Shared/util/getCanonicalFileName");
|
|
15
|
+
const isPathDescendantOf_1 = require("../../Shared/util/isPathDescendantOf");
|
|
16
|
+
const DiagnosticService_1 = require("../classes/DiagnosticService");
|
|
17
|
+
const createGetService_1 = require("./createGetService");
|
|
18
|
+
const expressionChain_1 = require("./expressionChain");
|
|
19
|
+
const getSourceFileFromModuleSpecifier_1 = require("./getSourceFileFromModuleSpecifier");
|
|
20
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
21
|
+
function getAbsoluteImport(moduleRbxPath) {
|
|
22
|
+
const pathExpressions = new Array();
|
|
23
|
+
const serviceName = moduleRbxPath[0];
|
|
24
|
+
(0, assert_1.assert)(serviceName);
|
|
25
|
+
pathExpressions.push((0, createGetService_1.createGetService)(serviceName));
|
|
26
|
+
for (let i = 1; i < moduleRbxPath.length; i++) {
|
|
27
|
+
pathExpressions.push(luau_ast_1.default.string(moduleRbxPath[i]));
|
|
28
|
+
}
|
|
29
|
+
return pathExpressions;
|
|
30
|
+
}
|
|
31
|
+
function getRelativeImport(sourceRbxPath, moduleRbxPath) {
|
|
32
|
+
const relativePath = rojo_resolver_1.RojoResolver.relative(sourceRbxPath, moduleRbxPath);
|
|
33
|
+
const path = new Array();
|
|
34
|
+
let i = 0;
|
|
35
|
+
while (relativePath[i] === rojo_resolver_1.RbxPathParent) {
|
|
36
|
+
path.push(constants_1.PARENT_FIELD);
|
|
37
|
+
i++;
|
|
38
|
+
}
|
|
39
|
+
const pathExpressions = [(0, expressionChain_1.propertyAccessExpressionChain)(luau_ast_1.default.globals.script, path)];
|
|
40
|
+
for (; i < relativePath.length; i++) {
|
|
41
|
+
const pathPart = relativePath[i];
|
|
42
|
+
(0, assert_1.assert)(typeof pathPart === "string");
|
|
43
|
+
pathExpressions.push(luau_ast_1.default.string(pathPart));
|
|
44
|
+
}
|
|
45
|
+
return pathExpressions;
|
|
46
|
+
}
|
|
47
|
+
function validateModule(state, scope) {
|
|
48
|
+
const scopedModules = path_1.default.join(state.data.nodeModulesPath, scope);
|
|
49
|
+
if (state.compilerOptions.typeRoots) {
|
|
50
|
+
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
51
|
+
if (path_1.default.normalize(scopedModules) === path_1.default.normalize(typeRoot)) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
function findRelativeRbxPath(moduleOutPath, pkgRojoResolvers) {
|
|
59
|
+
for (const pkgRojoResolver of pkgRojoResolvers) {
|
|
60
|
+
const relativeRbxPath = pkgRojoResolver.getRbxPathFromFilePath(moduleOutPath);
|
|
61
|
+
if (relativeRbxPath) {
|
|
62
|
+
return relativeRbxPath;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function getNodeModulesImportParts(state, sourceFile, moduleSpecifier, moduleOutPath) {
|
|
67
|
+
const moduleScope = path_1.default.relative(state.data.nodeModulesPath, moduleOutPath).split(path_1.default.sep)[0];
|
|
68
|
+
(0, assert_1.assert)(moduleScope);
|
|
69
|
+
if (!moduleScope.startsWith("@")) {
|
|
70
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noUnscopedModule(moduleSpecifier));
|
|
71
|
+
return [luau_ast_1.default.none()];
|
|
72
|
+
}
|
|
73
|
+
if (!validateModule(state, moduleScope)) {
|
|
74
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noInvalidModule(moduleSpecifier));
|
|
75
|
+
return [luau_ast_1.default.none()];
|
|
76
|
+
}
|
|
77
|
+
if (state.projectType === constants_1.ProjectType.Package) {
|
|
78
|
+
const relativeRbxPath = findRelativeRbxPath(moduleOutPath, state.pkgRojoResolvers);
|
|
79
|
+
if (!relativeRbxPath) {
|
|
80
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noRojoData(moduleSpecifier, path_1.default.relative(state.data.projectPath, moduleOutPath), true));
|
|
81
|
+
return [luau_ast_1.default.none()];
|
|
82
|
+
}
|
|
83
|
+
const moduleName = relativeRbxPath[0];
|
|
84
|
+
(0, assert_1.assert)(moduleName);
|
|
85
|
+
return [
|
|
86
|
+
(0, expressionChain_1.propertyAccessExpressionChain)(luau_ast_1.default.call(state.TS(moduleSpecifier.parent, "getModule"), [
|
|
87
|
+
luau_ast_1.default.globals.script,
|
|
88
|
+
luau_ast_1.default.string(moduleScope),
|
|
89
|
+
luau_ast_1.default.string(moduleName),
|
|
90
|
+
]), relativeRbxPath.slice(1)),
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const moduleRbxPath = state.rojoResolver.getRbxPathFromFilePath(moduleOutPath);
|
|
95
|
+
if (!moduleRbxPath) {
|
|
96
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noRojoData(moduleSpecifier, path_1.default.relative(state.data.projectPath, moduleOutPath), true));
|
|
97
|
+
return [luau_ast_1.default.none()];
|
|
98
|
+
}
|
|
99
|
+
const indexOfScope = moduleRbxPath.indexOf(moduleScope);
|
|
100
|
+
if (indexOfScope === -1 || moduleRbxPath[indexOfScope - 1] !== constants_1.NODE_MODULES) {
|
|
101
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noPackageImportWithoutScope(moduleSpecifier, path_1.default.relative(state.data.projectPath, moduleOutPath), moduleRbxPath));
|
|
102
|
+
return [luau_ast_1.default.none()];
|
|
103
|
+
}
|
|
104
|
+
return getProjectImportParts(state, sourceFile, moduleSpecifier, moduleOutPath, moduleRbxPath);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function getProjectImportParts(state, sourceFile, moduleSpecifier, moduleOutPath, moduleRbxPath) {
|
|
108
|
+
const moduleRbxType = state.rojoResolver.getRbxTypeFromFilePath(moduleOutPath);
|
|
109
|
+
if (moduleRbxType === rojo_resolver_1.RbxType.Script || moduleRbxType === rojo_resolver_1.RbxType.LocalScript) {
|
|
110
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noNonModuleImport(moduleSpecifier));
|
|
111
|
+
return [luau_ast_1.default.none()];
|
|
112
|
+
}
|
|
113
|
+
const sourceOutPath = state.pathTranslator.getOutputPath(sourceFile.fileName);
|
|
114
|
+
const sourceRbxPath = state.rojoResolver.getRbxPathFromFilePath(sourceOutPath);
|
|
115
|
+
if (!sourceRbxPath) {
|
|
116
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noRojoData(sourceFile, path_1.default.relative(state.data.projectPath, sourceOutPath), false));
|
|
117
|
+
return [luau_ast_1.default.none()];
|
|
118
|
+
}
|
|
119
|
+
if (state.projectType === constants_1.ProjectType.Game) {
|
|
120
|
+
if (!typescript_1.default.isImportCall(moduleSpecifier.parent) &&
|
|
121
|
+
state.rojoResolver.getNetworkType(moduleRbxPath) === rojo_resolver_1.NetworkType.Server &&
|
|
122
|
+
state.rojoResolver.getNetworkType(sourceRbxPath) !== rojo_resolver_1.NetworkType.Server) {
|
|
123
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noServerImport(moduleSpecifier));
|
|
124
|
+
return [luau_ast_1.default.none()];
|
|
125
|
+
}
|
|
126
|
+
const fileRelation = state.rojoResolver.getFileRelation(sourceRbxPath, moduleRbxPath);
|
|
127
|
+
if (fileRelation === rojo_resolver_1.FileRelation.OutToOut || fileRelation === rojo_resolver_1.FileRelation.InToOut) {
|
|
128
|
+
return getAbsoluteImport(moduleRbxPath);
|
|
129
|
+
}
|
|
130
|
+
else if (fileRelation === rojo_resolver_1.FileRelation.InToIn) {
|
|
131
|
+
return getRelativeImport(sourceRbxPath, moduleRbxPath);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noIsolatedImport(moduleSpecifier));
|
|
135
|
+
return [luau_ast_1.default.none()];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return getRelativeImport(sourceRbxPath, moduleRbxPath);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function getImportParts(state, sourceFile, moduleSpecifier) {
|
|
143
|
+
var _a;
|
|
144
|
+
const moduleFile = (0, getSourceFileFromModuleSpecifier_1.getSourceFileFromModuleSpecifier)(state, moduleSpecifier);
|
|
145
|
+
if (!moduleFile) {
|
|
146
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noModuleSpecifierFile(moduleSpecifier));
|
|
147
|
+
return [luau_ast_1.default.none()];
|
|
148
|
+
}
|
|
149
|
+
const virtualPath = state.guessVirtualPath(moduleFile.fileName) || moduleFile.fileName;
|
|
150
|
+
if (typescript_1.default.isInsideNodeModules(virtualPath)) {
|
|
151
|
+
const moduleOutPath = state.pathTranslator.getImportPath((_a = state.nodeModulesPathMapping.get((0, getCanonicalFileName_1.getCanonicalFileName)(path_1.default.normalize(virtualPath)))) !== null && _a !== void 0 ? _a : virtualPath, true);
|
|
152
|
+
return getNodeModulesImportParts(state, sourceFile, moduleSpecifier, moduleOutPath);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
const modulePathTranslator = state.getPathTranslatorForFile(virtualPath);
|
|
156
|
+
let moduleOutPath;
|
|
157
|
+
if ((0, isPathDescendantOf_1.isPathDescendantOf)(virtualPath, modulePathTranslator.rootDir)) {
|
|
158
|
+
moduleOutPath = modulePathTranslator.getImportPath(virtualPath);
|
|
159
|
+
}
|
|
160
|
+
else if ((0, isPathDescendantOf_1.isPathDescendantOf)(virtualPath, modulePathTranslator.outDir)) {
|
|
161
|
+
const relativePath = path_1.default.relative(modulePathTranslator.outDir, virtualPath);
|
|
162
|
+
const sourcePath = path_1.default.join(modulePathTranslator.rootDir, relativePath);
|
|
163
|
+
moduleOutPath = modulePathTranslator.getImportPath(sourcePath);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
moduleOutPath = virtualPath;
|
|
167
|
+
}
|
|
168
|
+
const moduleRbxPath = state.rojoResolver.getRbxPathFromFilePath(moduleOutPath);
|
|
169
|
+
if (!moduleRbxPath) {
|
|
170
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noRojoData(moduleSpecifier, path_1.default.relative(state.data.projectPath, moduleOutPath), false));
|
|
171
|
+
return [luau_ast_1.default.none()];
|
|
172
|
+
}
|
|
173
|
+
return getProjectImportParts(state, sourceFile, moduleSpecifier, moduleOutPath, moduleRbxPath);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function createImportExpression(state, sourceFile, moduleSpecifier) {
|
|
177
|
+
const parts = getImportParts(state, sourceFile, moduleSpecifier);
|
|
178
|
+
parts.unshift(luau_ast_1.default.globals.script);
|
|
179
|
+
return luau_ast_1.default.call(state.TS(moduleSpecifier.parent, "import"), parts);
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=createImportExpression.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createStringFromLiteral = createStringFromLiteral;
|
|
7
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
+
const TEMPLATE_EDGE = "`".length;
|
|
9
|
+
const TEMPLATE_EXP_START = "${".length;
|
|
10
|
+
const TEMPLATE_EXP_END = "}".length;
|
|
11
|
+
function createStringFromLiteral(node) {
|
|
12
|
+
let text = node.getText();
|
|
13
|
+
if (typescript_1.default.isStringLiteral(node) || typescript_1.default.isNoSubstitutionTemplateLiteral(node)) {
|
|
14
|
+
text = typescript_1.default.stripQuotes(text);
|
|
15
|
+
}
|
|
16
|
+
else if (typescript_1.default.isTemplateHead(node)) {
|
|
17
|
+
text = text.slice(TEMPLATE_EDGE, -TEMPLATE_EXP_START);
|
|
18
|
+
}
|
|
19
|
+
else if (typescript_1.default.isTemplateMiddle(node)) {
|
|
20
|
+
text = text.slice(TEMPLATE_EXP_END, -TEMPLATE_EXP_START);
|
|
21
|
+
}
|
|
22
|
+
else if (typescript_1.default.isTemplateTail(node)) {
|
|
23
|
+
text = text.slice(TEMPLATE_EXP_END, -TEMPLATE_EDGE);
|
|
24
|
+
}
|
|
25
|
+
return text;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=createStringFromLiteral.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTransformServices = createTransformServices;
|
|
4
|
+
const TSTransformer_1 = require("..");
|
|
5
|
+
function createTransformServices(typeChecker) {
|
|
6
|
+
const macroManager = new TSTransformer_1.MacroManager(typeChecker);
|
|
7
|
+
return { macroManager };
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=createTransformServices.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function willCreateTruthinessChecks(type: ts.Type): boolean;
|
|
5
|
+
export declare function createTruthinessChecks(state: TransformState, exp: luau.Expression, node: ts.Expression): luau.Expression<luau.SyntaxKind>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.willCreateTruthinessChecks = willCreateTruthinessChecks;
|
|
7
|
+
exports.createTruthinessChecks = createTruthinessChecks;
|
|
8
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
9
|
+
const diagnostics_1 = require("../../Shared/diagnostics");
|
|
10
|
+
const DiagnosticService_1 = require("../classes/DiagnosticService");
|
|
11
|
+
const expressionChain_1 = require("./expressionChain");
|
|
12
|
+
const types_1 = require("./types");
|
|
13
|
+
function willCreateTruthinessChecks(type) {
|
|
14
|
+
return ((0, types_1.isPossiblyType)(type, (0, types_1.isNumberLiteralType)(0)) ||
|
|
15
|
+
(0, types_1.isPossiblyType)(type, types_1.isNaNType) ||
|
|
16
|
+
(0, types_1.isPossiblyType)(type, types_1.isEmptyStringType));
|
|
17
|
+
}
|
|
18
|
+
function createTruthinessChecks(state, exp, node) {
|
|
19
|
+
const type = state.getType(node);
|
|
20
|
+
const isAssignableToZero = (0, types_1.isPossiblyType)(type, (0, types_1.isNumberLiteralType)(0));
|
|
21
|
+
const isAssignableToNaN = (0, types_1.isPossiblyType)(type, types_1.isNaNType);
|
|
22
|
+
const isAssignableToEmptyString = (0, types_1.isPossiblyType)(type, types_1.isEmptyStringType);
|
|
23
|
+
if (isAssignableToZero || isAssignableToNaN || isAssignableToEmptyString) {
|
|
24
|
+
exp = state.pushToVarIfComplex(exp, "value");
|
|
25
|
+
}
|
|
26
|
+
const checks = new Array();
|
|
27
|
+
if (isAssignableToZero) {
|
|
28
|
+
checks.push(luau_ast_1.default.binary(exp, "~=", luau_ast_1.default.number(0)));
|
|
29
|
+
}
|
|
30
|
+
if (isAssignableToZero || isAssignableToNaN) {
|
|
31
|
+
checks.push(luau_ast_1.default.binary(exp, "==", exp));
|
|
32
|
+
}
|
|
33
|
+
if (isAssignableToEmptyString) {
|
|
34
|
+
checks.push(luau_ast_1.default.binary(exp, "~=", luau_ast_1.default.string("")));
|
|
35
|
+
}
|
|
36
|
+
checks.push(exp);
|
|
37
|
+
if (state.data.projectOptions.logTruthyChanges &&
|
|
38
|
+
(isAssignableToZero || isAssignableToNaN || isAssignableToEmptyString)) {
|
|
39
|
+
const checkStrs = new Array();
|
|
40
|
+
if (isAssignableToZero)
|
|
41
|
+
checkStrs.push("0");
|
|
42
|
+
if (isAssignableToZero || isAssignableToNaN)
|
|
43
|
+
checkStrs.push("NaN");
|
|
44
|
+
if (isAssignableToEmptyString)
|
|
45
|
+
checkStrs.push('""');
|
|
46
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.warnings.truthyChange(checkStrs.join(", "))(node));
|
|
47
|
+
}
|
|
48
|
+
return (0, expressionChain_1.binaryExpressionChain)(checks, "and");
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=createTruthinessChecks.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTypeCheck = createTypeCheck;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
function createTypeCheck(expression, typeName) {
|
|
9
|
+
return luau_ast_1.default.binary(luau_ast_1.default.call(luau_ast_1.default.globals.type, [expression]), "==", typeName);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=createTypeCheck.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function ensureTransformOrder(state: TransformState, nodes: ReadonlyArray<ts.Expression>, transformer?: (state: TransformState, node: ts.Expression) => luau.Expression): Array<luau.Expression>;
|
|
5
|
+
export declare function ensureTransformOrder<T extends ts.Node>(state: TransformState, nodes: ReadonlyArray<T>, transformer: (state: TransformState, node: T) => luau.Expression): Array<luau.Expression>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ensureTransformOrder = ensureTransformOrder;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const findLastIndex_1 = require("../../Shared/util/findLastIndex");
|
|
9
|
+
const transformExpression_1 = require("../nodes/expressions/transformExpression");
|
|
10
|
+
const isSymbolMutable_1 = require("./isSymbolMutable");
|
|
11
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
12
|
+
function ensureTransformOrder(state, nodes, transformer = transformExpression_1.transformExpression) {
|
|
13
|
+
const expressionInfoList = nodes.map(node => state.capture(() => transformer(state, node)));
|
|
14
|
+
const lastArgWithPrereqsIndex = (0, findLastIndex_1.findLastIndex)(expressionInfoList, ([, prereqs]) => !luau_ast_1.default.list.isEmpty(prereqs));
|
|
15
|
+
const result = new Array();
|
|
16
|
+
for (let i = 0; i < expressionInfoList.length; i++) {
|
|
17
|
+
const [expression, prereqs] = expressionInfoList[i];
|
|
18
|
+
state.prereqList(prereqs);
|
|
19
|
+
let isConstVar = false;
|
|
20
|
+
const exp = nodes[i];
|
|
21
|
+
if (typescript_1.default.isIdentifier(exp)) {
|
|
22
|
+
const symbol = state.typeChecker.getSymbolAtLocation(exp);
|
|
23
|
+
if (symbol && !(0, isSymbolMutable_1.isSymbolMutable)(state, symbol)) {
|
|
24
|
+
isConstVar = true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (i < lastArgWithPrereqsIndex &&
|
|
28
|
+
!luau_ast_1.default.isSimplePrimitive(expression) &&
|
|
29
|
+
!luau_ast_1.default.isTemporaryIdentifier(expression) &&
|
|
30
|
+
!isConstVar) {
|
|
31
|
+
result.push(state.pushToVar(expression, "exp"));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
result.push(expression);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=ensureTransformOrder.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
export declare function binaryExpressionChain(expressions: Array<luau.Expression>, operator: luau.BinaryOperator): luau.Expression;
|
|
3
|
+
export declare function propertyAccessExpressionChain(expression: luau.Expression, names: Array<string>): luau.IndexableExpression;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.binaryExpressionChain = binaryExpressionChain;
|
|
7
|
+
exports.propertyAccessExpressionChain = propertyAccessExpressionChain;
|
|
8
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
9
|
+
const convertToIndexableExpression_1 = require("./convertToIndexableExpression");
|
|
10
|
+
function binaryExpressionChain(expressions, operator) {
|
|
11
|
+
return expressions.reduce((acc, current) => luau_ast_1.default.binary(acc, operator, current));
|
|
12
|
+
}
|
|
13
|
+
function propertyAccessExpressionChain(expression, names) {
|
|
14
|
+
return names.reduce((acc, current) => luau_ast_1.default.property(acc, current), (0, convertToIndexableExpression_1.convertToIndexableExpression)(expression));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=expressionChain.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.expressionMightMutate = expressionMightMutate;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const isSymbolMutable_1 = require("./isSymbolMutable");
|
|
9
|
+
const traversal_1 = require("./traversal");
|
|
10
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
11
|
+
function expressionMightMutate(state, expression, node) {
|
|
12
|
+
if (luau_ast_1.default.isTemporaryIdentifier(expression)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
else if (luau_ast_1.default.isParenthesizedExpression(expression)) {
|
|
16
|
+
return expressionMightMutate(state, expression.expression);
|
|
17
|
+
}
|
|
18
|
+
else if (luau_ast_1.default.isSimplePrimitive(expression)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
else if (luau_ast_1.default.isFunctionExpression(expression)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
else if (luau_ast_1.default.isVarArgsLiteral(expression)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
else if (luau_ast_1.default.isIfExpression(expression)) {
|
|
28
|
+
return (expressionMightMutate(state, expression.condition) ||
|
|
29
|
+
expressionMightMutate(state, expression.expression) ||
|
|
30
|
+
expressionMightMutate(state, expression.alternative));
|
|
31
|
+
}
|
|
32
|
+
else if (luau_ast_1.default.isBinaryExpression(expression)) {
|
|
33
|
+
return expressionMightMutate(state, expression.left) || expressionMightMutate(state, expression.right);
|
|
34
|
+
}
|
|
35
|
+
else if (luau_ast_1.default.isUnaryExpression(expression)) {
|
|
36
|
+
return expressionMightMutate(state, expression.expression);
|
|
37
|
+
}
|
|
38
|
+
else if (luau_ast_1.default.isArray(expression) || luau_ast_1.default.isSet(expression)) {
|
|
39
|
+
return luau_ast_1.default.list.some(expression.members, member => expressionMightMutate(state, member));
|
|
40
|
+
}
|
|
41
|
+
else if (luau_ast_1.default.isMap(expression)) {
|
|
42
|
+
return luau_ast_1.default.list.some(expression.fields, field => expressionMightMutate(state, field.index) || expressionMightMutate(state, field.value));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
if (node) {
|
|
46
|
+
node = (0, traversal_1.skipDownwards)(node);
|
|
47
|
+
if (typescript_1.default.isIdentifier(node)) {
|
|
48
|
+
const symbol = state.typeChecker.getSymbolAtLocation(node);
|
|
49
|
+
if (symbol && !(0, isSymbolMutable_1.isSymbolMutable)(state, symbol)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=expressionMightMutate.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findConstructor = findConstructor;
|
|
7
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
+
function findConstructor(node) {
|
|
9
|
+
return node.members.find((member) => typescript_1.default.isConstructorDeclaration(member) && member.body !== undefined);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=findConstructor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fixupWhitespaceAndDecodeEntities(text: string): string | undefined;
|