diff --git a/microsoft/typescript-go b/microsoft/typescript-go index 93841b563..c15e7649c 160000 --- a/microsoft/typescript-go +++ b/microsoft/typescript-go @@ -1 +1 @@ -Subproject commit 93841b5634233e83029463e741d51b4ca359a68a +Subproject commit c15e7649ca152ac52d424558abae7addd3f43801 diff --git a/pkg/binder/binder.go b/pkg/binder/binder.go index 9f14c2499..529a9c6e6 100644 --- a/pkg/binder/binder.go +++ b/pkg/binder/binder.go @@ -46,32 +46,33 @@ type Binder struct { bindFunc func(*ast.Node) bool unreachableFlow *ast.FlowNode - container *ast.Node - thisContainer *ast.Node - blockScopeContainer *ast.Node - lastContainer *ast.Node - currentFlow *ast.FlowNode - currentBreakTarget *ast.FlowLabel - currentContinueTarget *ast.FlowLabel - currentReturnTarget *ast.FlowLabel - currentTrueTarget *ast.FlowLabel - currentFalseTarget *ast.FlowLabel - currentExceptionTarget *ast.FlowLabel - preSwitchCaseFlow *ast.FlowNode - activeLabelList *ActiveLabel - emitFlags ast.NodeFlags - seenThisKeyword bool - hasExplicitReturn bool - hasFlowEffects bool - inStrictMode bool - inAssignmentPattern bool - seenParseError bool - symbolCount int - classifiableNames collections.Set[string] - symbolPool core.Pool[ast.Symbol] - flowNodePool core.Pool[ast.FlowNode] - flowListPool core.Pool[ast.FlowList] - singleDeclarationsPool core.Pool[*ast.Node] + container *ast.Node + thisContainer *ast.Node + blockScopeContainer *ast.Node + lastContainer *ast.Node + currentFlow *ast.FlowNode + currentBreakTarget *ast.FlowLabel + currentContinueTarget *ast.FlowLabel + currentReturnTarget *ast.FlowLabel + currentTrueTarget *ast.FlowLabel + currentFalseTarget *ast.FlowLabel + currentExceptionTarget *ast.FlowLabel + preSwitchCaseFlow *ast.FlowNode + activeLabelList *ActiveLabel + emitFlags ast.NodeFlags + seenThisKeyword bool + hasExplicitReturn bool + hasFlowEffects bool + inStrictMode bool + inAssignmentPattern bool + seenParseError bool + symbolCount int + classifiableNames collections.Set[string] + notConstEnumOnlyModules collections.Set[*ast.Symbol] + symbolPool core.Pool[ast.Symbol] + flowNodePool core.Pool[ast.FlowNode] + flowListPool core.Pool[ast.FlowList] + singleDeclarationsPool core.Pool[*ast.Node] } func (b *Binder) options() core.SourceFileAffectingCompilerOptions { @@ -794,9 +795,17 @@ func (b *Binder) bindModuleDeclaration(node *ast.Node) { state := b.declareModuleSymbol(node) if state != ast.ModuleInstanceStateNonInstantiated { symbol := node.Symbol() - if symbol.Flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsClass|ast.SymbolFlagsRegularEnum) != 0 || state != ast.ModuleInstanceStateConstEnumOnly { - // if module was already merged with some function, class or non-const enum, treat it as non-const-enum-only + // if module was already merged with some function, class or non-const enum, treat it as non-const-enum-only + constEnumOnlyModule := (symbol.Flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsClass|ast.SymbolFlagsRegularEnum) == 0) && + // Current must be `const enum` only + state == ast.ModuleInstanceStateConstEnumOnly && + // Can't have been set to 'false' in a previous merged symbol. ('undefined' OK) + !b.notConstEnumOnlyModules.Has(symbol) + if constEnumOnlyModule { + symbol.Flags |= ast.SymbolFlagsConstEnumOnlyModule + } else { symbol.Flags &^= ast.SymbolFlagsConstEnumOnlyModule + b.notConstEnumOnlyModules.Add(symbol) } } } @@ -2424,6 +2433,7 @@ func (b *Binder) addDeclarationToSymbol(symbol *ast.Symbol, node *ast.Node, symb // On merge of const enum module with class or function, reset const enum only flag (namespaces will already recalculate) if symbol.Flags&ast.SymbolFlagsConstEnumOnlyModule != 0 && symbol.Flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsClass|ast.SymbolFlagsRegularEnum) != 0 { symbol.Flags &^= ast.SymbolFlagsConstEnumOnlyModule + b.notConstEnumOnlyModules.Add(symbol) } if symbolFlags&ast.SymbolFlagsValue != 0 { SetValueDeclaration(symbol, node) diff --git a/pkg/bundled/noembed.go b/pkg/bundled/noembed.go index 78db7a553..da1c2c67c 100644 --- a/pkg/bundled/noembed.go +++ b/pkg/bundled/noembed.go @@ -5,12 +5,12 @@ package bundled import ( "fmt" "os" - "path/filepath" "sync" "testing" "github.com/buke/typescript-go-internal/pkg/tspath" "github.com/buke/typescript-go-internal/pkg/vfs" + "github.com/buke/typescript-go-internal/pkg/vfs/osvfs" ) const embedded = false @@ -24,11 +24,9 @@ var executableDir = sync.OnceValue(func() string { if err != nil { panic(fmt.Sprintf("bundled: failed to get executable path: %v", err)) } - exe, err = filepath.EvalSymlinks(exe) - if err != nil { - panic(fmt.Sprintf("bundled: failed to evaluate symlinks: %v", err)) - } - return filepath.Dir(exe) + exe = tspath.NormalizeSlashes(exe) + exe = osvfs.FS().Realpath(exe) + return tspath.GetDirectoryPath(exe) }) var libPath = sync.OnceValue(func() string { @@ -37,10 +35,10 @@ var libPath = sync.OnceValue(func() string { } dir := executableDir() - libdts := filepath.Join(dir, "lib.d.ts") - if _, err := os.Stat(libdts); err != nil { + libdts := tspath.CombinePaths(dir, "lib.d.ts") + if info := osvfs.FS().Stat(libdts); info == nil { panic(fmt.Sprintf("bundled: %v does not exist; this executable may be misplaced", libdts)) } - return tspath.NormalizeSlashes(dir) + return dir }) diff --git a/pkg/checker/emitresolver.go b/pkg/checker/emitresolver.go index da378c025..fbb54eb35 100644 --- a/pkg/checker/emitresolver.go +++ b/pkg/checker/emitresolver.go @@ -764,7 +764,7 @@ func (r *EmitResolver) IsTopLevelValueImportEqualsWithEntityName(node *ast.Node) return false } if ast.IsImportEqualsDeclaration(node) && - (ast.NodeIsMissing(node.AsImportEqualsDeclaration().ModuleReference) || node.AsImportEqualsDeclaration().ModuleReference.Kind != ast.KindExternalModuleReference) { + (ast.NodeIsMissing(node.AsImportEqualsDeclaration().ModuleReference) || node.AsImportEqualsDeclaration().ModuleReference.Kind == ast.KindExternalModuleReference) { return false } diff --git a/pkg/fourslash/fourslash.go b/pkg/fourslash/fourslash.go index 576280ec3..b1d590ea3 100644 --- a/pkg/fourslash/fourslash.go +++ b/pkg/fourslash/fourslash.go @@ -492,6 +492,20 @@ var ( defaultDocumentSymbolCapabilities = &lsproto.DocumentSymbolClientCapabilities{ HierarchicalDocumentSymbolSupport: ptrTrue, } + defaultFoldingRangeCapabilities = &lsproto.FoldingRangeClientCapabilities{ + RangeLimit: ptrTo[uint32](5000), + // LineFoldingOnly: ptrTrue, + FoldingRangeKind: &lsproto.ClientFoldingRangeKindOptions{ + ValueSet: &[]lsproto.FoldingRangeKind{ + lsproto.FoldingRangeKindComment, + lsproto.FoldingRangeKindImports, + lsproto.FoldingRangeKindRegion, + }, + }, + FoldingRange: &lsproto.ClientFoldingRangeOptions{ + CollapsedText: ptrTrue, // Unused by our testing, but set to exercise the code. + }, + } ) func getCapabilitiesWithDefaults(capabilities *lsproto.ClientCapabilities) *lsproto.ClientCapabilities { @@ -554,6 +568,9 @@ func getCapabilitiesWithDefaults(capabilities *lsproto.ClientCapabilities) *lspr if capabilitiesWithDefaults.TextDocument.DocumentSymbol == nil { capabilitiesWithDefaults.TextDocument.DocumentSymbol = defaultDocumentSymbolCapabilities } + if capabilitiesWithDefaults.TextDocument.FoldingRange == nil { + capabilitiesWithDefaults.TextDocument.FoldingRange = defaultFoldingRangeCapabilities + } return &capabilitiesWithDefaults } diff --git a/pkg/ls/folding.go b/pkg/ls/folding.go index 4f648338a..59587e479 100644 --- a/pkg/ls/folding.go +++ b/pkg/ls/folding.go @@ -18,7 +18,7 @@ import ( func (l *LanguageService) ProvideFoldingRange(ctx context.Context, documentURI lsproto.DocumentUri) (lsproto.FoldingRangeResponse, error) { _, sourceFile := l.getProgramAndFile(documentURI) res := l.addNodeOutliningSpans(ctx, sourceFile) - res = append(res, l.addRegionOutliningSpans(sourceFile)...) + res = append(res, l.addRegionOutliningSpans(ctx, sourceFile)...) slices.SortFunc(res, func(a, b *lsproto.FoldingRange) int { if c := cmp.Compare(a.StartLine, b.StartLine); c != 0 { return c @@ -52,6 +52,7 @@ func (l *LanguageService) addNodeOutliningSpans(ctx context.Context, sourceFile if lastImport != firstImport { foldingRangeKind := lsproto.FoldingRangeKindImports foldingRange = append(foldingRange, createFoldingRangeFromBounds( + ctx, astnav.GetStartOfNode(astnav.FindChildOfKind(statements.Nodes[firstImport], ast.KindImportKeyword, sourceFile), sourceFile, false /*includeJSDoc*/), statements.Nodes[lastImport].End(), @@ -66,7 +67,7 @@ func (l *LanguageService) addNodeOutliningSpans(ctx context.Context, sourceFile return foldingRange } -func (l *LanguageService) addRegionOutliningSpans(sourceFile *ast.SourceFile) []*lsproto.FoldingRange { +func (l *LanguageService) addRegionOutliningSpans(ctx context.Context, sourceFile *ast.SourceFile) []*lsproto.FoldingRange { regions := make([]*lsproto.FoldingRange, 0, 40) out := make([]*lsproto.FoldingRange, 0, 40) lineStarts := scanner.GetECMALineStarts(sourceFile) @@ -81,19 +82,22 @@ func (l *LanguageService) addRegionOutliningSpans(sourceFile *ast.SourceFile) [] if result.isStart { commentStart := l.createLspPosition(strings.Index(sourceFile.Text()[currentLineStart:lineEnd], "//")+int(currentLineStart), sourceFile) foldingRangeKindRegion := lsproto.FoldingRangeKindRegion - collapsedText := "#region" - if result.name != "" { - collapsedText = result.name + region := &lsproto.FoldingRange{ + StartLine: commentStart.Line, + StartCharacter: &commentStart.Character, + Kind: &foldingRangeKindRegion, + } + if supportsCollapsedText(ctx) { + collapsedText := "#region" + if result.name != "" { + collapsedText = result.name + } + region.CollapsedText = &collapsedText } // Our spans start out with some initial data. // On every `#endregion`, we'll come back to these `FoldingRange`s // and fill in their EndLine/EndCharacter. - regions = append(regions, &lsproto.FoldingRange{ - StartLine: commentStart.Line, - StartCharacter: &commentStart.Character, - Kind: &foldingRangeKindRegion, - CollapsedText: &collapsedText, - }) + regions = append(regions, region) } else { if len(regions) > 0 { region := regions[len(regions)-1] @@ -145,7 +149,7 @@ func visitNode(ctx context.Context, n *ast.Node, depthRemaining int, sourceFile } } - span := getOutliningSpanForNode(n, sourceFile, l) + span := getOutliningSpanForNode(ctx, n, sourceFile, l) if span != nil { foldingRange = append(foldingRange, span) } @@ -218,7 +222,7 @@ func addOutliningForLeadingCommentsForPos(ctx context.Context, pos int, sourceFi combineAndAddMultipleSingleLineComments := func() *lsproto.FoldingRange { // Only outline spans of two or more consecutive single line comments if singleLineCommentCount > 1 { - return createFoldingRangeFromBounds(firstSingleLineCommentStart, lastSingleLineCommentEnd, foldingRangeKindComment, sourceFile, l) + return createFoldingRangeFromBounds(ctx, firstSingleLineCommentStart, lastSingleLineCommentEnd, foldingRangeKindComment, sourceFile, l) } return nil } @@ -257,7 +261,7 @@ func addOutliningForLeadingCommentsForPos(ctx context.Context, pos int, sourceFi if comments != nil { foldingRange = append(foldingRange, comments) } - foldingRange = append(foldingRange, createFoldingRangeFromBounds(commentPos, commentEnd, foldingRangeKindComment, sourceFile, l)) + foldingRange = append(foldingRange, createFoldingRangeFromBounds(ctx, commentPos, commentEnd, foldingRangeKindComment, sourceFile, l)) singleLineCommentCount = 0 break default: @@ -304,25 +308,25 @@ func parseRegionDelimiter(lineText string) *regionDelimiterResult { } } -func getOutliningSpanForNode(n *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func getOutliningSpanForNode(ctx context.Context, n *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { switch n.Kind { case ast.KindBlock: if ast.IsFunctionLike(n.Parent) { - return functionSpan(n.Parent, n, sourceFile, l) + return functionSpan(ctx, n.Parent, n, sourceFile, l) } // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch n.Parent.Kind { case ast.KindDoStatement, ast.KindForInStatement, ast.KindForOfStatement, ast.KindForStatement, ast.KindIfStatement, ast.KindWhileStatement, ast.KindWithStatement, ast.KindCatchClause: - return spanForNode(n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) case ast.KindTryStatement: // Could be the try-block, or the finally-block. tryStatement := n.Parent.AsTryStatement() if tryStatement.TryBlock == n { - return spanForNode(n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) } else if tryStatement.FinallyBlock == n { - if span := spanForNode(n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l); span != nil { + if span := spanForNode(ctx, n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l); span != nil { return span } } @@ -330,41 +334,41 @@ func getOutliningSpanForNode(n *ast.Node, sourceFile *ast.SourceFile, l *Languag default: // Block was a standalone block. In this case we want to only collapse // the span of the block, independent of any parent span. - return createFoldingRange(l.createLspRangeFromNode(n, sourceFile), "", "") + return createFoldingRange(ctx, l.createLspRangeFromNode(n, sourceFile), "", "") } case ast.KindModuleBlock: - return spanForNode(n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) case ast.KindClassDeclaration, ast.KindClassExpression, ast.KindInterfaceDeclaration, ast.KindEnumDeclaration, ast.KindCaseBlock, ast.KindTypeLiteral, ast.KindObjectBindingPattern: - return spanForNode(n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBraceToken, true /*useFullStart*/, sourceFile, l) case ast.KindTupleType: - return spanForNode(n, ast.KindOpenBracketToken, !ast.IsTupleTypeNode(n.Parent) /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBracketToken, !ast.IsTupleTypeNode(n.Parent) /*useFullStart*/, sourceFile, l) case ast.KindCaseClause, ast.KindDefaultClause: - return spanForNodeArray(n.AsCaseOrDefaultClause().Statements, sourceFile, l) + return spanForNodeArray(ctx, n.AsCaseOrDefaultClause().Statements, sourceFile, l) case ast.KindObjectLiteralExpression: - return spanForNode(n, ast.KindOpenBraceToken, !ast.IsArrayLiteralExpression(n.Parent) && !ast.IsCallExpression(n.Parent) /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBraceToken, !ast.IsArrayLiteralExpression(n.Parent) && !ast.IsCallExpression(n.Parent) /*useFullStart*/, sourceFile, l) case ast.KindArrayLiteralExpression: - return spanForNode(n, ast.KindOpenBracketToken, !ast.IsArrayLiteralExpression(n.Parent) && !ast.IsCallExpression(n.Parent) /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBracketToken, !ast.IsArrayLiteralExpression(n.Parent) && !ast.IsCallExpression(n.Parent) /*useFullStart*/, sourceFile, l) case ast.KindJsxElement, ast.KindJsxFragment: - return spanForJSXElement(n, sourceFile, l) + return spanForJSXElement(ctx, n, sourceFile, l) case ast.KindJsxSelfClosingElement, ast.KindJsxOpeningElement: - return spanForJSXAttributes(n, sourceFile, l) + return spanForJSXAttributes(ctx, n, sourceFile, l) case ast.KindTemplateExpression, ast.KindNoSubstitutionTemplateLiteral: - return spanForTemplateLiteral(n, sourceFile, l) + return spanForTemplateLiteral(ctx, n, sourceFile, l) case ast.KindArrayBindingPattern: - return spanForNode(n, ast.KindOpenBracketToken, !ast.IsBindingElement(n.Parent) /*useFullStart*/, sourceFile, l) + return spanForNode(ctx, n, ast.KindOpenBracketToken, !ast.IsBindingElement(n.Parent) /*useFullStart*/, sourceFile, l) case ast.KindArrowFunction: - return spanForArrowFunction(n, sourceFile, l) + return spanForArrowFunction(ctx, n, sourceFile, l) case ast.KindCallExpression: - return spanForCallExpression(n, sourceFile, l) + return spanForCallExpression(ctx, n, sourceFile, l) case ast.KindParenthesizedExpression: - return spanForParenthesizedExpression(n, sourceFile, l) + return spanForParenthesizedExpression(ctx, n, sourceFile, l) case ast.KindNamedImports, ast.KindNamedExports, ast.KindImportAttributes: - return spanForImportExportElements(n, sourceFile, l) + return spanForImportExportElements(ctx, n, sourceFile, l) } return nil } -func spanForImportExportElements(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForImportExportElements(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { var elements *ast.NodeList switch node.Kind { case ast.KindNamedImports: @@ -382,19 +386,19 @@ func spanForImportExportElements(node *ast.Node, sourceFile *ast.SourceFile, l * if openToken == nil || closeToken == nil || printer.PositionsAreOnSameLine(openToken.Pos(), closeToken.Pos(), sourceFile) { return nil } - return rangeBetweenTokens(openToken, closeToken, sourceFile, false /*useFullStart*/, l) + return rangeBetweenTokens(ctx, openToken, closeToken, sourceFile, false /*useFullStart*/, l) } -func spanForParenthesizedExpression(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForParenthesizedExpression(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { start := astnav.GetStartOfNode(node, sourceFile, false /*includeJSDoc*/) if printer.PositionsAreOnSameLine(start, node.End(), sourceFile) { return nil } textRange := l.createLspRangeFromBounds(start, node.End(), sourceFile) - return createFoldingRange(textRange, "", "") + return createFoldingRange(ctx, textRange, "", "") } -func spanForCallExpression(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForCallExpression(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { if node.AsCallExpression().Arguments == nil || len(node.AsCallExpression().Arguments.Nodes) == 0 { return nil } @@ -404,40 +408,40 @@ func spanForCallExpression(node *ast.Node, sourceFile *ast.SourceFile, l *Langua return nil } - return rangeBetweenTokens(openToken, closeToken, sourceFile, true /*useFullStart*/, l) + return rangeBetweenTokens(ctx, openToken, closeToken, sourceFile, true /*useFullStart*/, l) } -func spanForArrowFunction(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForArrowFunction(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { arrowFunctionNode := node.AsArrowFunction() if ast.IsBlock(arrowFunctionNode.Body) || ast.IsParenthesizedExpression(arrowFunctionNode.Body) || printer.PositionsAreOnSameLine(arrowFunctionNode.Body.Pos(), arrowFunctionNode.Body.End(), sourceFile) { return nil } textRange := l.createLspRangeFromBounds(arrowFunctionNode.Body.Pos(), arrowFunctionNode.Body.End(), sourceFile) - return createFoldingRange(textRange, "", "") + return createFoldingRange(ctx, textRange, "", "") } -func spanForTemplateLiteral(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForTemplateLiteral(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { if node.Kind == ast.KindNoSubstitutionTemplateLiteral && len(node.Text()) == 0 { return nil } - return createFoldingRangeFromBounds(astnav.GetStartOfNode(node, sourceFile, false /*includeJSDoc*/), node.End(), "", sourceFile, l) + return createFoldingRangeFromBounds(ctx, astnav.GetStartOfNode(node, sourceFile, false /*includeJSDoc*/), node.End(), "", sourceFile, l) } -func spanForJSXElement(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForJSXElement(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { if node.Kind == ast.KindJsxElement { jsxElement := node.AsJsxElement() textRange := l.createLspRangeFromBounds(astnav.GetStartOfNode(jsxElement.OpeningElement, sourceFile, false /*includeJSDoc*/), jsxElement.ClosingElement.End(), sourceFile) tagName := scanner.GetTextOfNode(jsxElement.OpeningElement.TagName()) bannerText := "<" + tagName + ">..." - return createFoldingRange(textRange, "", bannerText) + return createFoldingRange(ctx, textRange, "", bannerText) } // JsxFragment jsxFragment := node.AsJsxFragment() textRange := l.createLspRangeFromBounds(astnav.GetStartOfNode(jsxFragment.OpeningFragment, sourceFile, false /*includeJSDoc*/), jsxFragment.ClosingFragment.End(), sourceFile) - return createFoldingRange(textRange, "", "<>...") + return createFoldingRange(ctx, textRange, "", "<>...") } -func spanForJSXAttributes(node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForJSXAttributes(ctx context.Context, node *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { var attributes *ast.JsxAttributesNode if node.Kind == ast.KindJsxSelfClosingElement { attributes = node.AsJsxSelfClosingElement().Attributes @@ -447,17 +451,17 @@ func spanForJSXAttributes(node *ast.Node, sourceFile *ast.SourceFile, l *Languag if len(attributes.Properties()) == 0 { return nil } - return createFoldingRangeFromBounds(astnav.GetStartOfNode(node, sourceFile, false /*includeJSDoc*/), node.End(), "", sourceFile, l) + return createFoldingRangeFromBounds(ctx, astnav.GetStartOfNode(node, sourceFile, false /*includeJSDoc*/), node.End(), "", sourceFile, l) } -func spanForNodeArray(statements *ast.NodeList, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForNodeArray(ctx context.Context, statements *ast.NodeList, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { if statements != nil && len(statements.Nodes) != 0 { - return createFoldingRange(l.createLspRangeFromBounds(statements.Pos(), statements.End(), sourceFile), "", "") + return createFoldingRange(ctx, l.createLspRangeFromBounds(statements.Pos(), statements.End(), sourceFile), "", "") } return nil } -func spanForNode(node *ast.Node, open ast.Kind, useFullStart bool, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func spanForNode(ctx context.Context, node *ast.Node, open ast.Kind, useFullStart bool, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { closeBrace := ast.KindCloseBraceToken if open != ast.KindOpenBraceToken { closeBrace = ast.KindCloseBracketToken @@ -465,49 +469,52 @@ func spanForNode(node *ast.Node, open ast.Kind, useFullStart bool, sourceFile *a openToken := astnav.FindChildOfKind(node, open, sourceFile) closeToken := astnav.FindChildOfKind(node, closeBrace, sourceFile) if openToken != nil && closeToken != nil { - return rangeBetweenTokens(openToken, closeToken, sourceFile, useFullStart, l) + return rangeBetweenTokens(ctx, openToken, closeToken, sourceFile, useFullStart, l) } return nil } -func rangeBetweenTokens(openToken *ast.Node, closeToken *ast.Node, sourceFile *ast.SourceFile, useFullStart bool, l *LanguageService) *lsproto.FoldingRange { +func rangeBetweenTokens(ctx context.Context, openToken *ast.Node, closeToken *ast.Node, sourceFile *ast.SourceFile, useFullStart bool, l *LanguageService) *lsproto.FoldingRange { var textRange *lsproto.Range if useFullStart { textRange = l.createLspRangeFromBounds(openToken.Pos(), closeToken.End(), sourceFile) } else { textRange = l.createLspRangeFromBounds(astnav.GetStartOfNode(openToken, sourceFile, false /*includeJSDoc*/), closeToken.End(), sourceFile) } - return createFoldingRange(textRange, "", "") + return createFoldingRange(ctx, textRange, "", "") } -func createFoldingRange(textRange *lsproto.Range, foldingRangeKind lsproto.FoldingRangeKind, collapsedText string) *lsproto.FoldingRange { - if collapsedText == "" { - defaultText := "..." - collapsedText = defaultText - } +func supportsCollapsedText(ctx context.Context) bool { + return lsproto.GetClientCapabilities(ctx).TextDocument.FoldingRange.FoldingRange.CollapsedText +} + +func createFoldingRange(ctx context.Context, textRange *lsproto.Range, foldingRangeKind lsproto.FoldingRangeKind, collapsedText string) *lsproto.FoldingRange { var kind *lsproto.FoldingRangeKind if foldingRangeKind != "" { kind = &foldingRangeKind } - return &lsproto.FoldingRange{ + result := &lsproto.FoldingRange{ StartLine: textRange.Start.Line, StartCharacter: &textRange.Start.Character, EndLine: textRange.End.Line, EndCharacter: &textRange.End.Character, Kind: kind, - CollapsedText: &collapsedText, } + if collapsedText != "" && supportsCollapsedText(ctx) { + result.CollapsedText = &collapsedText + } + return result } -func createFoldingRangeFromBounds(pos int, end int, foldingRangeKind lsproto.FoldingRangeKind, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { - return createFoldingRange(l.createLspRangeFromBounds(pos, end, sourceFile), foldingRangeKind, "") +func createFoldingRangeFromBounds(ctx context.Context, pos int, end int, foldingRangeKind lsproto.FoldingRangeKind, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { + return createFoldingRange(ctx, l.createLspRangeFromBounds(pos, end, sourceFile), foldingRangeKind, "") } -func functionSpan(node *ast.Node, body *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { +func functionSpan(ctx context.Context, node *ast.Node, body *ast.Node, sourceFile *ast.SourceFile, l *LanguageService) *lsproto.FoldingRange { openToken := tryGetFunctionOpenToken(node, body, sourceFile) closeToken := astnav.FindChildOfKind(body, ast.KindCloseBraceToken, sourceFile) if openToken != nil && closeToken != nil { - return rangeBetweenTokens(openToken, closeToken, sourceFile, true /*useFullStart*/, l) + return rangeBetweenTokens(ctx, openToken, closeToken, sourceFile, true /*useFullStart*/, l) } return nil } diff --git a/pkg/pprof/pprof.go b/pkg/pprof/pprof.go index 2523c9488..554e7110f 100644 --- a/pkg/pprof/pprof.go +++ b/pkg/pprof/pprof.go @@ -6,6 +6,8 @@ import ( "os" "path/filepath" "runtime/pprof" + + "github.com/buke/typescript-go-internal/pkg/repo" ) type ProfileSession struct { @@ -61,3 +63,12 @@ func (p *ProfileSession) Stop() { fmt.Fprintf(p.logWriter, "CPU profile: %v\n", p.cpuFilePath) fmt.Fprintf(p.logWriter, "Memory profile: %v\n", p.memFilePath) } + +// ProfileInPprofDir is a convenience function that starts profiling in the 'pprof' directory under the repository root. +// The resulting files are logged to stderr. It returns a function that stops the profiling when called. +func ProfileInPprofDir() func() { + session := BeginProfiling(filepath.Join(repo.RootPath, "pprof"), os.Stderr) + return func() { + session.Stop() + } +} diff --git a/pkg/transformers/moduletransforms/commonjsmodule.go b/pkg/transformers/moduletransforms/commonjsmodule.go index f4e92c16b..fbc553f0a 100644 --- a/pkg/transformers/moduletransforms/commonjsmodule.go +++ b/pkg/transformers/moduletransforms/commonjsmodule.go @@ -1074,7 +1074,14 @@ func (tx *CommonJSModuleTransformer) visitTopLevelVariableStatement(node *ast.Va propertyAccess, v.Name().Clone(tx.Factory()), )) + } else if ast.IsIdentifier(v.Name()) { + expression := tx.transformInitializedVariable(v) + if expression != nil { + pushExpression(tx.Visitor().VisitNode(expression)) + } } else { + // For binding patterns, we can't do exports.{pattern} = value + // Just emit the assignment and let appendExportsOfVariableStatement handle the exports expression := transformers.ConvertVariableDeclarationToAssignmentExpression(tx.EmitContext(), v) if expression != nil { pushExpression(tx.Visitor().VisitNode(expression)) @@ -1090,6 +1097,21 @@ func (tx *CommonJSModuleTransformer) visitTopLevelVariableStatement(node *ast.Va return tx.visitTopLevelNestedVariableStatement(node) } +func (tx *CommonJSModuleTransformer) transformInitializedVariable(node *ast.VariableDeclaration) *ast.Expression { + if node.Initializer == nil { + return nil + } + name := node.Name() + propertyAccess := tx.Factory().NewPropertyAccessExpression( + tx.Factory().NewIdentifier("exports"), + nil, /*questionDotToken*/ + name, + ast.NodeFlagsNone, + ) + tx.EmitContext().AssignCommentAndSourceMapRanges(propertyAccess, name) + return tx.Factory().NewAssignmentExpression(propertyAccess, node.Initializer) +} + // Visits a top-level nested variable statement as it may contain `var` declarations that are hoisted and may still be // exported with `export {}`. func (tx *CommonJSModuleTransformer) visitTopLevelNestedVariableStatement(node *ast.VariableStatement) *ast.Node { diff --git a/pkg/transformers/tstransforms/importelision.go b/pkg/transformers/tstransforms/importelision.go index b64a21528..b7e831c30 100644 --- a/pkg/transformers/tstransforms/importelision.go +++ b/pkg/transformers/tstransforms/importelision.go @@ -27,8 +27,16 @@ func NewImportElisionTransformer(opt *transformers.TransformOptions) *transforme func (tx *ImportElisionTransformer) visit(node *ast.Node) *ast.Node { switch node.Kind { case ast.KindImportEqualsDeclaration: - if !tx.isElisionBlocked(node) && !tx.shouldEmitImportEqualsDeclaration(node.AsImportEqualsDeclaration()) { - return nil + if !tx.isElisionBlocked(node) { + if ast.IsExternalModuleImportEqualsDeclaration(node) { + if !tx.shouldEmitAliasDeclaration(node) { + return nil + } + } else { + if !tx.shouldEmitImportEqualsDeclaration(node.AsImportEqualsDeclaration()) { + return nil + } + } } return tx.Visitor().VisitEachChild(node) case ast.KindImportDeclaration: @@ -124,16 +132,10 @@ func (tx *ImportElisionTransformer) shouldEmitAliasDeclaration(node *ast.Node) b } func (tx *ImportElisionTransformer) shouldEmitImportEqualsDeclaration(node *ast.ImportEqualsDeclaration) bool { - if !tx.shouldEmitAliasDeclaration(node.AsNode()) { - return false - } - if node.ModuleReference.Kind == ast.KindExternalModuleReference { - return true - } // preserve old compiler's behavior: emit import declaration (even if we do not consider them referenced) when // - current file is not external module // - import declaration is top level and target is value imported by entity name - return tx.currentSourceFile != nil && ast.IsExternalModule(tx.currentSourceFile) && tx.isTopLevelValueImportEqualsWithEntityName(node.AsNode()) + return tx.shouldEmitAliasDeclaration(node.AsNode()) || (!ast.IsExternalModule(tx.currentSourceFile) && tx.isTopLevelValueImportEqualsWithEntityName(node.AsNode())) } func (tx *ImportElisionTransformer) isReferencedAliasDeclaration(node *ast.Node) bool { diff --git a/testdata/baselines/reference/compiler/exportDestructuring.js b/testdata/baselines/reference/compiler/exportDestructuring.js new file mode 100644 index 000000000..33d6858ab --- /dev/null +++ b/testdata/baselines/reference/compiler/exportDestructuring.js @@ -0,0 +1,13 @@ +//// [tests/cases/compiler/exportDestructuring.ts] //// + +//// [exportDestructuring.ts] +const arr = [1, 2]; +export const [a, b] = arr; + + +//// [exportDestructuring.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +const arr = [1, 2]; +[exports.a, exports.b] = arr; diff --git a/testdata/baselines/reference/compiler/exportDestructuring.symbols b/testdata/baselines/reference/compiler/exportDestructuring.symbols new file mode 100644 index 000000000..4c0d010b3 --- /dev/null +++ b/testdata/baselines/reference/compiler/exportDestructuring.symbols @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/exportDestructuring.ts] //// + +=== exportDestructuring.ts === +const arr = [1, 2]; +>arr : Symbol(arr, Decl(exportDestructuring.ts, 0, 5)) + +export const [a, b] = arr; +>a : Symbol(a, Decl(exportDestructuring.ts, 1, 14)) +>b : Symbol(b, Decl(exportDestructuring.ts, 1, 16)) +>arr : Symbol(arr, Decl(exportDestructuring.ts, 0, 5)) + diff --git a/testdata/baselines/reference/compiler/exportDestructuring.types b/testdata/baselines/reference/compiler/exportDestructuring.types new file mode 100644 index 000000000..1fc65436d --- /dev/null +++ b/testdata/baselines/reference/compiler/exportDestructuring.types @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/exportDestructuring.ts] //// + +=== exportDestructuring.ts === +const arr = [1, 2]; +>arr : number[] +>[1, 2] : number[] +>1 : 1 +>2 : 2 + +export const [a, b] = arr; +>a : number +>b : number +>arr : number[] + diff --git a/testdata/baselines/reference/submodule/compiler/aliasBug.js b/testdata/baselines/reference/submodule/compiler/aliasBug.js index 7c8e941cb..705e88a34 100644 --- a/testdata/baselines/reference/submodule/compiler/aliasBug.js +++ b/testdata/baselines/reference/submodule/compiler/aliasBug.js @@ -37,6 +37,8 @@ var foo; })(baz = bar.baz || (bar.baz = {})); })(bar = foo.bar || (foo.bar = {})); })(foo || (foo = {})); +var provide = foo; +var booz = foo.bar.baz; var p = new provide.Provide(); function use() { var p1; // error here, but should be okay diff --git a/testdata/baselines/reference/submodule/compiler/aliasBug.js.diff b/testdata/baselines/reference/submodule/compiler/aliasBug.js.diff deleted file mode 100644 index 190630741..000000000 --- a/testdata/baselines/reference/submodule/compiler/aliasBug.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.aliasBug.js -+++ new.aliasBug.js -@@= skipped -36, +36 lines =@@ - })(baz = bar.baz || (bar.baz = {})); - })(bar = foo.bar || (foo.bar = {})); - })(foo || (foo = {})); --var provide = foo; --var booz = foo.bar.baz; - var p = new provide.Provide(); - function use() { - var p1; // error here, but should be okay \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/aliasErrors.js b/testdata/baselines/reference/submodule/compiler/aliasErrors.js index dc63511f5..b8c6ba527 100644 --- a/testdata/baselines/reference/submodule/compiler/aliasErrors.js +++ b/testdata/baselines/reference/submodule/compiler/aliasErrors.js @@ -48,9 +48,15 @@ var foo; })(baz = bar.baz || (bar.baz = {})); })(bar = foo.bar || (foo.bar = {})); })(foo || (foo = {})); +var provide = foo; +var booz = foo.bar.baz; +var beez = foo.bar; +var m = no; +var m2 = no.mod; 5; "s"; null; +var r = undefined; var p = new provide.Provide(); function use() { beez.baz.boo; diff --git a/testdata/baselines/reference/submodule/compiler/aliasErrors.js.diff b/testdata/baselines/reference/submodule/compiler/aliasErrors.js.diff deleted file mode 100644 index 24b597fbc..000000000 --- a/testdata/baselines/reference/submodule/compiler/aliasErrors.js.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.aliasErrors.js -+++ new.aliasErrors.js -@@= skipped -47, +47 lines =@@ - })(baz = bar.baz || (bar.baz = {})); - })(bar = foo.bar || (foo.bar = {})); - })(foo || (foo = {})); --var provide = foo; --var booz = foo.bar.baz; --var beez = foo.bar; --var m = no; --var m2 = no.mod; - 5; - "s"; - null; --var r = undefined; - var p = new provide.Provide(); - function use() { - beez.baz.boo; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js b/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js index 744385e01..38e8d3ef7 100644 --- a/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js +++ b/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js @@ -24,4 +24,5 @@ var m; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const x = require("./chainedImportAlias_file0"); +var y = x; y.m.foo(); diff --git a/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js.diff b/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js.diff deleted file mode 100644 index aeaadd6c4..000000000 --- a/testdata/baselines/reference/submodule/compiler/chainedImportAlias.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.chainedImportAlias.js -+++ new.chainedImportAlias.js -@@= skipped -23, +23 lines =@@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - const x = require("./chainedImportAlias_file0"); --var y = x; - y.m.foo(); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js b/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js index f3c31830a..b17ca68e2 100644 --- a/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js +++ b/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js @@ -31,6 +31,8 @@ var mOfGloalFile; } mOfGloalFile.c = c; })(mOfGloalFile || (mOfGloalFile = {})); +var exports = mOfGloalFile.c; +var require = mOfGloalFile.c; new exports(); new require(); var m1; diff --git a/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js.diff b/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js.diff deleted file mode 100644 index 20192ebec..000000000 --- a/testdata/baselines/reference/submodule/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.collisionExportsRequireAndInternalModuleAliasInGlobalFile.js -+++ new.collisionExportsRequireAndInternalModuleAliasInGlobalFile.js -@@= skipped -30, +30 lines =@@ - } - mOfGloalFile.c = c; - })(mOfGloalFile || (mOfGloalFile = {})); --var exports = mOfGloalFile.c; --var require = mOfGloalFile.c; - new exports(); - new require(); - var m1; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js b/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js index 59d4def4b..7af0e409b 100644 --- a/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js +++ b/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js @@ -13,3 +13,4 @@ var a; a.b = 10; })(a || (a = {})); var f = () => this; +var _this = a; // Error diff --git a/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js.diff b/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js.diff deleted file mode 100644 index 484d9e87e..000000000 --- a/testdata/baselines/reference/submodule/compiler/collisionThisExpressionAndAliasInGlobal.js.diff +++ /dev/null @@ -1,7 +0,0 @@ ---- old.collisionThisExpressionAndAliasInGlobal.js -+++ new.collisionThisExpressionAndAliasInGlobal.js -@@= skipped -12, +12 lines =@@ - a.b = 10; - })(a || (a = {})); - var f = () => this; --var _this = a; // Error \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/constEnums.js b/testdata/baselines/reference/submodule/compiler/constEnums.js index 997e58ea4..30c1e17bf 100644 --- a/testdata/baselines/reference/submodule/compiler/constEnums.js +++ b/testdata/baselines/reference/submodule/compiler/constEnums.js @@ -192,6 +192,7 @@ var A2; })(C = B.C || (B.C = {})); })(B = A2.B || (A2.B = {})); })(A2 || (A2 = {})); +var I2 = A2.B; function foo0(e) { if (e === 1 /* I.V1 */) { } diff --git a/testdata/baselines/reference/submodule/compiler/constEnums.js.diff b/testdata/baselines/reference/submodule/compiler/constEnums.js.diff deleted file mode 100644 index 4e58af014..000000000 --- a/testdata/baselines/reference/submodule/compiler/constEnums.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.constEnums.js -+++ new.constEnums.js -@@= skipped -191, +191 lines =@@ - })(C = B.C || (B.C = {})); - })(B = A2.B || (A2.B = {})); - })(A2 || (A2 = {})); --var I2 = A2.B; - function foo0(e) { - if (e === 1 /* I.V1 */) { - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js index 6e7de480a..c4501ecf0 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js +++ b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js @@ -282,6 +282,7 @@ TypeScriptAllInOne.Program.Main(); //// [constructorWithIncompleteTypeAnnotation.js] +var fs = module; ("fs"); var TypeScriptAllInOne; (function (TypeScriptAllInOne) { diff --git a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js.diff b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js.diff index 4237e5af0..4cebc1b86 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js.diff +++ b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.js.diff @@ -1,11 +1,6 @@ --- old.constructorWithIncompleteTypeAnnotation.js +++ new.constructorWithIncompleteTypeAnnotation.js -@@= skipped -281, +281 lines =@@ - - - //// [constructorWithIncompleteTypeAnnotation.js] --var fs = module; - ("fs"); +@@= skipped -286, +286 lines =@@ var TypeScriptAllInOne; (function (TypeScriptAllInOne) { class Program { @@ -15,7 +10,7 @@ static Main(...args) { try { var bfs = new BasicFeatures(); -@@= skipped -15, +11 lines =@@ +@@= skipped -10, +7 lines =@@ retValue = bfs.VARIABLES(); if (retValue != 0) ^= { diff --git a/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js b/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js index 59c0faa81..10633bbae 100644 --- a/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js +++ b/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js @@ -28,6 +28,7 @@ export = m; var m3; (function (m3) { })(m3 || (m3 = {})); +var m = m3; module.exports = m; diff --git a/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js.diff b/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js.diff deleted file mode 100644 index f80e637d8..000000000 --- a/testdata/baselines/reference/submodule/compiler/declFileExportAssignmentImportInternalModule.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.declFileExportAssignmentImportInternalModule.js -+++ new.declFileExportAssignmentImportInternalModule.js -@@= skipped -27, +27 lines =@@ - var m3; - (function (m3) { - })(m3 || (m3 = {})); --var m = m3; - module.exports = m; - diff --git a/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js b/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js index 782e7f0b7..e1c25c7ea 100644 --- a/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js +++ b/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js @@ -18,9 +18,11 @@ exports.x = void 0; //// [declFileForExportedImport_1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; /// exports.a = require("./declFileForExportedImport_0"); var y = exports.a.x; +exports.b = exports.a; var z = exports.b.x; diff --git a/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js.diff b/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js.diff deleted file mode 100644 index 6f22734a5..000000000 --- a/testdata/baselines/reference/submodule/compiler/declFileForExportedImport.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.declFileForExportedImport.js -+++ new.declFileForExportedImport.js -@@= skipped -17, +17 lines =@@ - //// [declFileForExportedImport_1.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.b = void 0; - /// - exports.a = require("./declFileForExportedImport_0"); - var y = exports.a.x; --exports.b = exports.a; - var z = exports.b.x; - diff --git a/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js b/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js index e49bcf83f..e497fe9f5 100644 --- a/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js +++ b/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js @@ -22,6 +22,8 @@ var m; c_1.c = c; })(c = m.c || (m.c = {})); })(m || (m = {})); +var a = m.c; +var b = a; module.exports = b; diff --git a/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js.diff b/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js.diff deleted file mode 100644 index 4a8556727..000000000 --- a/testdata/baselines/reference/submodule/compiler/declFileImportChainInExportAssignment.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.declFileImportChainInExportAssignment.js -+++ new.declFileImportChainInExportAssignment.js -@@= skipped -21, +21 lines =@@ - c_1.c = c; - })(c = m.c || (m.c = {})); - })(m || (m = {})); --var a = m.c; --var b = a; - module.exports = b; - diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js b/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js index c52d37e97..33c93fef0 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js @@ -45,6 +45,7 @@ var Translation; Object.defineProperty(exports, "__esModule", { value: true }); exports.Test = void 0; const translation_1 = require("./translation"); +var TranslationKeyEnum = translation_1.Translation.TranslationKeyEnum; class Test { TranslationKeyEnum = TranslationKeyEnum; print() { diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js.diff index 33b3ee054..1fe6b161b 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitEnumReferenceViaImportEquals.js.diff @@ -1,10 +1,8 @@ --- old.declarationEmitEnumReferenceViaImportEquals.js +++ new.declarationEmitEnumReferenceViaImportEquals.js -@@= skipped -44, +44 lines =@@ - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Test = void 0; +@@= skipped -46, +46 lines =@@ const translation_1 = require("./translation"); --var TranslationKeyEnum = translation_1.Translation.TranslationKeyEnum; + var TranslationKeyEnum = translation_1.Translation.TranslationKeyEnum; class Test { - constructor() { - this.TranslationKeyEnum = TranslationKeyEnum; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js index f4c4d4eb1..09d55a0d3 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js @@ -8,6 +8,8 @@ export {Foo} "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Foo = void 0; +var Foo = SomeNonExistingName; +exports.Foo = Foo; //// [declarationEmitUnknownImport.d.ts] diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js.diff deleted file mode 100644 index 1791d89fc..000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.declarationEmitUnknownImport.js -+++ new.declarationEmitUnknownImport.js -@@= skipped -7, +7 lines =@@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Foo = void 0; --var Foo = SomeNonExistingName; --exports.Foo = Foo; - - - //// [declarationEmitUnknownImport.d.ts] \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js index 97a7d7285..62350a39a 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js @@ -6,8 +6,9 @@ export default Foo //// [declarationEmitUnknownImport2.js] "use strict"; -'./Foo'; // Syntax error Object.defineProperty(exports, "__esModule", { value: true }); +var Foo = From; +'./Foo'; // Syntax error exports.default = Foo; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js.diff deleted file mode 100644 index d13d1e070..000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.js.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.declarationEmitUnknownImport2.js -+++ new.declarationEmitUnknownImport2.js -@@= skipped -5, +5 lines =@@ - - //// [declarationEmitUnknownImport2.js] - "use strict"; --Object.defineProperty(exports, "__esModule", { value: true }); --var Foo = From; - './Foo'; // Syntax error -+Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = Foo; - diff --git a/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js b/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js index f2d8d458c..d399f4236 100644 --- a/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js +++ b/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js @@ -14,6 +14,7 @@ class E extends A.B.C{ } //// [declareDottedExtend.js] +var ab = A.B; class D extends ab.C { } class E extends A.B.C { diff --git a/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js.diff b/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js.diff deleted file mode 100644 index b21e4794d..000000000 --- a/testdata/baselines/reference/submodule/compiler/declareDottedExtend.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.declareDottedExtend.js -+++ new.declareDottedExtend.js -@@= skipped -13, +13 lines =@@ - - - //// [declareDottedExtend.js] --var ab = A.B; - class D extends ab.C { - } - class E extends A.B.C { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js b/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js index 61391fad5..b27003792 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js +++ b/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js @@ -13,3 +13,4 @@ var M; (function (M) { M.x = 1; })(M || (M = {})); +var a = M; diff --git a/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js.diff b/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js.diff deleted file mode 100644 index 274926376..000000000 --- a/testdata/baselines/reference/submodule/compiler/duplicateVarAndImport2.js.diff +++ /dev/null @@ -1,7 +0,0 @@ ---- old.duplicateVarAndImport2.js -+++ new.duplicateVarAndImport2.js -@@= skipped -12, +12 lines =@@ - (function (M) { - M.x = 1; - })(M || (M = {})); --var a = M; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js b/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js index f26b86699..4e60fa535 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js +++ b/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js @@ -43,6 +43,7 @@ var x = 0; var y = ""; var z = 0; //// [duplicateVarsAcrossFileBoundaries_4.js] +var p = P; var q; //// [duplicateVarsAcrossFileBoundaries_5.js] var p; diff --git a/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js.diff b/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js.diff deleted file mode 100644 index 961bffe8b..000000000 --- a/testdata/baselines/reference/submodule/compiler/duplicateVarsAcrossFileBoundaries.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.duplicateVarsAcrossFileBoundaries.js -+++ new.duplicateVarsAcrossFileBoundaries.js -@@= skipped -42, +42 lines =@@ - var y = ""; - var z = 0; - //// [duplicateVarsAcrossFileBoundaries_4.js] --var p = P; - var q; - //// [duplicateVarsAcrossFileBoundaries_5.js] - var p; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js b/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js index 4d8c8fa8b..3bd50cadb 100644 --- a/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js +++ b/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js @@ -139,6 +139,7 @@ var NotLegalEnum; (function (NotLegalEnum) { NotLegalEnum[NotLegalEnum["B"] = 1] = "B"; })(NotLegalEnum || (NotLegalEnum = {})); +var NoGoodAlias = NotLegalEnum.B; // No errors after this point class MyClassOk { // Not a parameter property, ok diff --git a/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js.diff b/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js.diff index a02611253..5e7ef9d67 100644 --- a/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js.diff +++ b/testdata/baselines/reference/submodule/compiler/erasableSyntaxOnly.js.diff @@ -8,15 +8,7 @@ // No parameter properties constructor(foo) { this.foo = foo; -@@= skipped -25, +26 lines =@@ - (function (NotLegalEnum) { - NotLegalEnum[NotLegalEnum["B"] = 1] = "B"; - })(NotLegalEnum || (NotLegalEnum = {})); --var NoGoodAlias = NotLegalEnum.B; - // No errors after this point - class MyClassOk { - // Not a parameter property, ok -@@= skipped -22, +21 lines =@@ +@@= skipped -47, +48 lines =@@ // at the start of an ExpressionStatement if followed by an object literal; though I'm not sure why one would use it there ({ foo() { } }.foo()); // at the start of an ExpressionStatement if followed by function keyword diff --git a/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js b/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js index e96e2e5bc..bc3c01d61 100644 --- a/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js +++ b/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js @@ -76,3 +76,4 @@ var Test5; var x = ""; var y = ""; })(Test5 || (Test5 = {})); +var lol = Test5.Foo.; diff --git a/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js.diff b/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js.diff index a2653054c..20e6f262e 100644 --- a/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js.diff +++ b/testdata/baselines/reference/submodule/compiler/errorForUsingPropertyOfTypeAsType01.js.diff @@ -7,9 +7,4 @@ + bar; } Test2.Foo = Foo; - var x = ""; -@@= skipped -20, +21 lines =@@ - var x = ""; - var y = ""; - })(Test5 || (Test5 = {})); --var lol = Test5.Foo.; \ No newline at end of file + var x = ""; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js b/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js index ddbd45a1d..7805bb300 100644 --- a/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js +++ b/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js @@ -24,6 +24,7 @@ var a; //// [es6ImportNamedImportInIndirectExportAssignment_1.js] "use strict"; const es6ImportNamedImportInIndirectExportAssignment_0_1 = require("./es6ImportNamedImportInIndirectExportAssignment_0"); +var x = es6ImportNamedImportInIndirectExportAssignment_0_1.a; module.exports = x; diff --git a/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js.diff b/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js.diff deleted file mode 100644 index cc9619f95..000000000 --- a/testdata/baselines/reference/submodule/compiler/es6ImportNamedImportInIndirectExportAssignment.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.es6ImportNamedImportInIndirectExportAssignment.js -+++ new.es6ImportNamedImportInIndirectExportAssignment.js -@@= skipped -23, +23 lines =@@ - //// [es6ImportNamedImportInIndirectExportAssignment_1.js] - "use strict"; - const es6ImportNamedImportInIndirectExportAssignment_0_1 = require("./es6ImportNamedImportInIndirectExportAssignment_0"); --var x = es6ImportNamedImportInIndirectExportAssignment_0_1.a; - module.exports = x; - diff --git a/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js b/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js index 91c06dd5b..509b15869 100644 --- a/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js +++ b/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js @@ -27,6 +27,8 @@ var m; (function (m) { m.a = 10; })(m || (m = {})); +export var a1 = m.a; +var a2 = m.a; var x = a1 + a2; export { m1 }; var m1; diff --git a/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js.diff b/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js.diff index 8ae4efec0..4446a4277 100644 --- a/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js.diff +++ b/testdata/baselines/reference/submodule/compiler/es6ModuleInternalImport.js.diff @@ -10,8 +10,8 @@ (function (m) { m.a = 10; })(m || (m = {})); --export var a1 = m.a; --var a2 = m.a; + export var a1 = m.a; + var a2 = m.a; var x = a1 + a2; -export var m1; +export { m1 }; diff --git a/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js b/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js index ed36cac0c..6b55cd96b 100644 --- a/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js +++ b/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js @@ -65,6 +65,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); /// const foobar_1 = __importDefault(require("foobar")); +var X = foobar_1.default.X; const foobarx_1 = __importDefault(require("foobarx")); const x = X; const x2 = foobarx_1.default; diff --git a/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js.diff b/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js.diff deleted file mode 100644 index 980e865d8..000000000 --- a/testdata/baselines/reference/submodule/compiler/exportDefaultProperty.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.exportDefaultProperty.js -+++ new.exportDefaultProperty.js -@@= skipped -64, +64 lines =@@ - Object.defineProperty(exports, "__esModule", { value: true }); - /// - const foobar_1 = __importDefault(require("foobar")); --var X = foobar_1.default.X; - const foobarx_1 = __importDefault(require("foobarx")); - const x = X; - const x2 = foobarx_1.default; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js b/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js index f0a3351f4..666bbe9ef 100644 --- a/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js +++ b/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js @@ -12,6 +12,8 @@ export { mod as variable }; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.variable = void 0; +var mod = globalThis; +exports.variable = mod; //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js.diff b/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js.diff deleted file mode 100644 index 5c8a78e22..000000000 --- a/testdata/baselines/reference/submodule/compiler/globalThisDeclarationEmit3.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.globalThisDeclarationEmit3.js -+++ new.globalThisDeclarationEmit3.js -@@= skipped -11, +11 lines =@@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.variable = void 0; --var mod = globalThis; --exports.variable = mod; - //// [index.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js index fd5ae8822..8d10b6408 100644 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js +++ b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js @@ -14,4 +14,5 @@ var m; (function (m_1) { m_1.m = ''; })(m || (m = {})); +var x = m.m; var x = ''; diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js.diff b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js.diff deleted file mode 100644 index 8a7b16b46..000000000 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict1.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.importAndVariableDeclarationConflict1.js -+++ new.importAndVariableDeclarationConflict1.js -@@= skipped -13, +13 lines =@@ - (function (m_1) { - m_1.m = ''; - })(m || (m = {})); --var x = m.m; - var x = ''; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js index 77267e73b..5e2c9df7d 100644 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js +++ b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js @@ -18,6 +18,7 @@ var m; (function (m_1) { m_1.m = ''; })(m || (m = {})); +var x = m.m; class C { foo() { var x = ''; diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js.diff b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js.diff deleted file mode 100644 index 13ec517e6..000000000 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict2.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.importAndVariableDeclarationConflict2.js -+++ new.importAndVariableDeclarationConflict2.js -@@= skipped -17, +17 lines =@@ - (function (m_1) { - m_1.m = ''; - })(m || (m = {})); --var x = m.m; - class C { - foo() { - var x = ''; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js index 2850f1e4f..6f48077d6 100644 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js +++ b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js @@ -14,3 +14,5 @@ var m; (function (m_1) { m_1.m = ''; })(m || (m = {})); +var x = m.m; +var x = m.m; diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js.diff b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js.diff deleted file mode 100644 index ea09adefd..000000000 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict3.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.importAndVariableDeclarationConflict3.js -+++ new.importAndVariableDeclarationConflict3.js -@@= skipped -13, +13 lines =@@ - (function (m_1) { - m_1.m = ''; - })(m || (m = {})); --var x = m.m; --var x = m.m; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js index 5502f2132..0467a5589 100644 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js +++ b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js @@ -15,3 +15,4 @@ var m; m_1.m = ''; })(m || (m = {})); var x = ''; +var x = m.m; diff --git a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js.diff b/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js.diff deleted file mode 100644 index a653d3277..000000000 --- a/testdata/baselines/reference/submodule/compiler/importAndVariableDeclarationConflict4.js.diff +++ /dev/null @@ -1,7 +0,0 @@ ---- old.importAndVariableDeclarationConflict4.js -+++ new.importAndVariableDeclarationConflict4.js -@@= skipped -14, +14 lines =@@ - m_1.m = ''; - })(m || (m = {})); - var x = ''; --var x = m.m; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js b/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js index daf66572a..8225d825e 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js @@ -14,4 +14,8 @@ var b: a; //// [importDeclWithClassModifiers.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = exports.b = exports.a = void 0; +exports.a = x.c; +exports.b = x.c; +exports.c = x.c; var b; diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js.diff b/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js.diff deleted file mode 100644 index 9f03b5ced..000000000 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.importDeclWithClassModifiers.js -+++ new.importDeclWithClassModifiers.js -@@= skipped -13, +13 lines =@@ - //// [importDeclWithClassModifiers.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.c = exports.b = exports.a = void 0; --exports.a = x.c; --exports.b = x.c; --exports.c = x.c; - var b; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js index 8f2fc5436..7ae4360ed 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js @@ -11,3 +11,5 @@ export = x; //// [importDeclWithExportModifierAndExportAssignment.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = x.c; diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff index fe1afa0e1..85a72d688 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff @@ -4,7 +4,7 @@ //// [importDeclWithExportModifierAndExportAssignment.js] "use strict"; --exports.a = void 0; --exports.a = x.c; --module.exports = x; -+Object.defineProperty(exports, "__esModule", { value: true }); \ No newline at end of file ++Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = x.c; +-module.exports = x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js b/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js index 641699eb7..04bd76a6f 100644 --- a/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js +++ b/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js @@ -16,5 +16,6 @@ var globals; (function (globals) { globals.Bar = {}; })(globals || (globals = {})); +var Foo = globals.toString.Blah; //// [index.js] const Foo = {}; diff --git a/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js.diff b/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js.diff deleted file mode 100644 index 40839fa8b..000000000 --- a/testdata/baselines/reference/submodule/compiler/importEqualsError45874.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.importEqualsError45874.js -+++ new.importEqualsError45874.js -@@= skipped -15, +15 lines =@@ - (function (globals) { - globals.Bar = {}; - })(globals || (globals = {})); --var Foo = globals.toString.Blah; - //// [index.js] - const Foo = {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js b/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js index a4c686d9f..f74b0f0b8 100644 --- a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js +++ b/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js @@ -16,7 +16,7 @@ var cReturnVal = cProp.foo(10); //// [internalAliasClassInsideTopLevelModuleWithExport.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.cProp = exports.x = void 0; +exports.cProp = exports.xc = exports.x = void 0; var x; (function (x) { class c { @@ -26,6 +26,7 @@ var x; } x.c = c; })(x || (exports.x = x = {})); +exports.xc = x.c; exports.cProp = new exports.xc(); var cReturnVal = exports.cProp.foo(10); diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js.diff b/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js.diff deleted file mode 100644 index 5bc6b0a91..000000000 --- a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithExport.js.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.internalAliasClassInsideTopLevelModuleWithExport.js -+++ new.internalAliasClassInsideTopLevelModuleWithExport.js -@@= skipped -15, +15 lines =@@ - //// [internalAliasClassInsideTopLevelModuleWithExport.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.cProp = exports.xc = exports.x = void 0; -+exports.cProp = exports.x = void 0; - var x; - (function (x) { - class c { -@@= skipped -10, +10 lines =@@ - } - x.c = c; - })(x || (exports.x = x = {})); --exports.xc = x.c; - exports.cProp = new exports.xc(); - var cReturnVal = exports.cProp.foo(10); diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js b/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js index a08a45976..ee6fabef1 100644 --- a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js +++ b/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js @@ -26,6 +26,7 @@ var x; } x.c = c; })(x || (exports.x = x = {})); +var xc = x.c; exports.cProp = new xc(); var cReturnVal = exports.cProp.foo(10); diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js.diff b/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js.diff deleted file mode 100644 index 02dab15e7..000000000 --- a/testdata/baselines/reference/submodule/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.internalAliasClassInsideTopLevelModuleWithoutExport.js -+++ new.internalAliasClassInsideTopLevelModuleWithoutExport.js -@@= skipped -25, +25 lines =@@ - } - x.c = c; - })(x || (exports.x = x = {})); --var xc = x.c; - exports.cProp = new xc(); - var cReturnVal = exports.cProp.foo(10); diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js b/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js index 6c6bd17ba..d5168fd8a 100644 --- a/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js +++ b/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js @@ -23,6 +23,7 @@ var a; } a.foo = foo; })(a || (exports.a = a = {})); +var b = a.foo; exports.bVal = b(10); exports.bVal2 = b; diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js.diff b/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js.diff deleted file mode 100644 index 25d8ceb4a..000000000 --- a/testdata/baselines/reference/submodule/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.internalAliasFunctionInsideTopLevelModuleWithoutExport.js -+++ new.internalAliasFunctionInsideTopLevelModuleWithoutExport.js -@@= skipped -22, +22 lines =@@ - } - a.foo = foo; - })(a || (exports.a = a = {})); --var b = a.foo; - exports.bVal = b(10); - exports.bVal2 = b; diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js b/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js index 63656bc07..fd2c281e7 100644 --- a/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js +++ b/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js @@ -14,7 +14,7 @@ export var x: b.c = new b.c(); //// [internalAliasInitializedModuleInsideTopLevelModuleWithExport.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = exports.a = void 0; +exports.x = exports.b = exports.a = void 0; var a; (function (a) { let b; @@ -24,6 +24,7 @@ var a; b.c = c; })(b = a.b || (a.b = {})); })(a || (exports.a = a = {})); +exports.b = a.b; exports.x = new exports.b.c(); diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js.diff b/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js.diff deleted file mode 100644 index bc977f9b5..000000000 --- a/testdata/baselines/reference/submodule/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.internalAliasInitializedModuleInsideTopLevelModuleWithExport.js -+++ new.internalAliasInitializedModuleInsideTopLevelModuleWithExport.js -@@= skipped -13, +13 lines =@@ - //// [internalAliasInitializedModuleInsideTopLevelModuleWithExport.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = exports.b = exports.a = void 0; -+exports.x = exports.a = void 0; - var a; - (function (a) { - let b; -@@= skipped -10, +10 lines =@@ - b.c = c; - })(b = a.b || (a.b = {})); - })(a || (exports.a = a = {})); --exports.b = a.b; - exports.x = new exports.b.c(); - diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js b/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js index bf9a8626b..3076eff77 100644 --- a/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js +++ b/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js @@ -18,6 +18,7 @@ var a; (function (a) { a.x = 10; })(a || (exports.a = a = {})); +var b = a.x; exports.bVal = b; diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js.diff b/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js.diff deleted file mode 100644 index 1b083af66..000000000 --- a/testdata/baselines/reference/submodule/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.internalAliasVarInsideTopLevelModuleWithoutExport.js -+++ new.internalAliasVarInsideTopLevelModuleWithoutExport.js -@@= skipped -17, +17 lines =@@ - (function (a) { - a.x = 10; - })(a || (exports.a = a = {})); --var b = a.x; - exports.bVal = b; - diff --git a/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js b/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js index b4585c5b5..9a78ba462 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js +++ b/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js @@ -113,6 +113,8 @@ z.x = 1; // Error /** @template T */ function tem(t) { return {}; } let i; // Should succeed thanks to type parameter default +/** @typedef {string} N.Str */ +var M = N; // Error: @typedef does not create namespaces in TypeScript code. // Not legal JSDoc, but that shouldn't matter in TypeScript. /** * @type {{foo: (function(string, string): string)}} diff --git a/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js.diff b/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js.diff index fb618d433..20435e017 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsdocInTypeScript.js.diff @@ -7,13 +7,4 @@ + prop; } x.prop; - // @param type has no effect. -@@= skipped -18, +19 lines =@@ - /** @template T */ - function tem(t) { return {}; } - let i; // Should succeed thanks to type parameter default --/** @typedef {string} N.Str */ --var M = N; // Error: @typedef does not create namespaces in TypeScript code. - // Not legal JSDoc, but that shouldn't matter in TypeScript. - /** - * @type {{foo: (function(string, string): string)}} \ No newline at end of file + // @param type has no effect. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js b/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js index 7e71a724b..e627e0c17 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js +++ b/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js @@ -76,6 +76,7 @@ var editor; } } })(editor || (editor = {})); +var modesOuter = _modes; var editor2; (function (editor2) { var i; diff --git a/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js.diff b/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js.diff index 4d99de66c..453e45faf 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js.diff +++ b/testdata/baselines/reference/submodule/compiler/moduleAliasInterface.js.diff @@ -8,15 +8,7 @@ var i; // If you just use p1:modes, the compiler accepts it - should be an error class Bug { -@@= skipped -8, +9 lines =@@ - } - } - })(editor || (editor = {})); --var modesOuter = _modes; - var editor2; - (function (editor2) { - var i; -@@= skipped -25, +24 lines =@@ +@@= skipped -33, +34 lines =@@ })(A1 || (A1 = {})); var B1; (function (B1) { diff --git a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js index 8eb402bcb..36a737cd8 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js +++ b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js @@ -78,6 +78,7 @@ var OuterMod; OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; })(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); })(OuterMod || (OuterMod = {})); +var OuterInnerAlias = OuterMod.OuterInnerMod; var M; (function (M) { let InnerMod; diff --git a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js.diff b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js.diff index 3f3a1c7e6..1a012d9c0 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest1.js.diff @@ -1,14 +1,6 @@ --- old.moduleVisibilityTest1.js +++ new.moduleVisibilityTest1.js -@@= skipped -77, +77 lines =@@ - OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; - })(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); - })(OuterMod || (OuterMod = {})); --var OuterInnerAlias = OuterMod.OuterInnerMod; - var M; - (function (M) { - let InnerMod; -@@= skipped -17, +16 lines =@@ +@@= skipped -94, +94 lines =@@ M.x = 5; var y = M.x + M.x; class B { diff --git a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js index ff2fa226a..c869be68c 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js +++ b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js @@ -79,6 +79,7 @@ var OuterMod; OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; })(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); })(OuterMod || (OuterMod = {})); +var OuterInnerAlias = OuterMod.OuterInnerMod; var M; (function (M) { let InnerMod; diff --git a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js.diff b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js.diff index 5f0dbf81a..a08faf042 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js.diff +++ b/testdata/baselines/reference/submodule/compiler/moduleVisibilityTest2.js.diff @@ -1,14 +1,6 @@ --- old.moduleVisibilityTest2.js +++ new.moduleVisibilityTest2.js -@@= skipped -78, +78 lines =@@ - OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; - })(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); - })(OuterMod || (OuterMod = {})); --var OuterInnerAlias = OuterMod.OuterInnerMod; - var M; - (function (M) { - let InnerMod; -@@= skipped -17, +16 lines =@@ +@@= skipped -95, +95 lines =@@ var x = 5; var y = x + x; class B { diff --git a/testdata/baselines/reference/submodule/compiler/privacyImport.js b/testdata/baselines/reference/submodule/compiler/privacyImport.js index 4bd0dc15d..040fd4755 100644 --- a/testdata/baselines/reference/submodule/compiler/privacyImport.js +++ b/testdata/baselines/reference/submodule/compiler/privacyImport.js @@ -361,7 +361,7 @@ export module m3 { //// [privacyImport.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.m3 = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; +exports.m3 = exports.glo_im2_public = exports.glo_im1_public = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; var m1; (function (m1) { let m1_M1_public; @@ -513,6 +513,14 @@ var glo_M3_private; glo_M3_private.f1 = f1; glo_M3_private.v1 = c1; })(glo_M3_private || (exports.glo_M3_private = glo_M3_private = {})); +//export declare module "glo_M4_private" { +// export function f1(); +// export class c1 { +// } +// export var v1: { new (): c1; }; +// export var v2: c1; +//} +var glo_im1_private = glo_M1_public; exports.glo_im1_private_v1_public = glo_im1_private.c1; exports.glo_im1_private_v2_public = new glo_im1_private.c1(); exports.glo_im1_private_v3_public = glo_im1_private.f1; @@ -521,6 +529,16 @@ var glo_im1_private_v1_private = glo_im1_private.c1; var glo_im1_private_v2_private = new glo_im1_private.c1(); var glo_im1_private_v3_private = glo_im1_private.f1; var glo_im1_private_v4_private = glo_im1_private.f1(); +//import glo_im2_private = require("glo_M2_public"); +//export var glo_im2_private_v1_public = glo_im2_private.c1; +//export var glo_im2_private_v2_public = new glo_im2_private.c1(); +//export var glo_im2_private_v3_public = glo_im2_private.f1; +//export var glo_im2_private_v4_public = glo_im2_private.f1(); +//var glo_im2_private_v1_private = glo_im2_private.c1; +//var glo_im2_private_v2_private = new glo_im2_private.c1(); +//var glo_im2_private_v3_private = glo_im2_private.f1; +//var glo_im2_private_v4_private = glo_im2_private.f1(); +var glo_im3_private = glo_M3_private; exports.glo_im3_private_v1_public = glo_im3_private.c1; exports.glo_im3_private_v2_public = new glo_im3_private.c1(); exports.glo_im3_private_v3_public = glo_im3_private.f1; @@ -529,6 +547,18 @@ var glo_im3_private_v1_private = glo_im3_private.c1; var glo_im3_private_v2_private = new glo_im3_private.c1(); var glo_im3_private_v3_private = glo_im3_private.f1; var glo_im3_private_v4_private = glo_im3_private.f1(); +//import glo_im4_private = require("glo_M4_private"); +//export var glo_im4_private_v1_public = glo_im4_private.c1; +//export var glo_im4_private_v2_public = new glo_im4_private.c1(); +//export var glo_im4_private_v3_public = glo_im4_private.f1; +//export var glo_im4_private_v4_public = glo_im4_private.f1(); +//var glo_im4_private_v1_private = glo_im4_private.c1; +//var glo_im4_private_v2_private = new glo_im4_private.c1(); +//var glo_im4_private_v3_private = glo_im4_private.f1; +//var glo_im4_private_v4_private = glo_im4_private.f1(); +// Parse error to export module +exports.glo_im1_public = glo_M1_public; +exports.glo_im2_public = glo_M3_private; //export import glo_im3_public = require("glo_M2_public"); //export import glo_im4_public = require("glo_M4_private"); //export declare module "use_glo_M1_public" { diff --git a/testdata/baselines/reference/submodule/compiler/privacyImport.js.diff b/testdata/baselines/reference/submodule/compiler/privacyImport.js.diff index e324fbd38..0063052b3 100644 --- a/testdata/baselines/reference/submodule/compiler/privacyImport.js.diff +++ b/testdata/baselines/reference/submodule/compiler/privacyImport.js.diff @@ -1,15 +1,6 @@ --- old.privacyImport.js +++ new.privacyImport.js -@@= skipped -360, +360 lines =@@ - //// [privacyImport.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.m3 = exports.glo_im2_public = exports.glo_im1_public = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; -+exports.m3 = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; - var m1; - (function (m1) { - let m1_M1_public; -@@= skipped -57, +57 lines =@@ +@@= skipped -417, +417 lines =@@ var m1_im2_private_v2_private = new m1_im2_private.c1(); var m1_im2_private_v3_private = m1_im2_private.f1; var m1_im2_private_v4_private = m1_im2_private.f1(); @@ -59,55 +50,4 @@ - // Parse error to export module m2.m1_im1_public = m2_M1_public; m2.m1_im2_public = m2_M2_private; - //export import m1_im3_public = require("m2_M3_public"); -@@= skipped -53, +34 lines =@@ - glo_M3_private.f1 = f1; - glo_M3_private.v1 = c1; - })(glo_M3_private || (exports.glo_M3_private = glo_M3_private = {})); --//export declare module "glo_M4_private" { --// export function f1(); --// export class c1 { --// } --// export var v1: { new (): c1; }; --// export var v2: c1; --//} --var glo_im1_private = glo_M1_public; - exports.glo_im1_private_v1_public = glo_im1_private.c1; - exports.glo_im1_private_v2_public = new glo_im1_private.c1(); - exports.glo_im1_private_v3_public = glo_im1_private.f1; -@@= skipped -16, +8 lines =@@ - var glo_im1_private_v2_private = new glo_im1_private.c1(); - var glo_im1_private_v3_private = glo_im1_private.f1; - var glo_im1_private_v4_private = glo_im1_private.f1(); --//import glo_im2_private = require("glo_M2_public"); --//export var glo_im2_private_v1_public = glo_im2_private.c1; --//export var glo_im2_private_v2_public = new glo_im2_private.c1(); --//export var glo_im2_private_v3_public = glo_im2_private.f1; --//export var glo_im2_private_v4_public = glo_im2_private.f1(); --//var glo_im2_private_v1_private = glo_im2_private.c1; --//var glo_im2_private_v2_private = new glo_im2_private.c1(); --//var glo_im2_private_v3_private = glo_im2_private.f1; --//var glo_im2_private_v4_private = glo_im2_private.f1(); --var glo_im3_private = glo_M3_private; - exports.glo_im3_private_v1_public = glo_im3_private.c1; - exports.glo_im3_private_v2_public = new glo_im3_private.c1(); - exports.glo_im3_private_v3_public = glo_im3_private.f1; -@@= skipped -18, +8 lines =@@ - var glo_im3_private_v2_private = new glo_im3_private.c1(); - var glo_im3_private_v3_private = glo_im3_private.f1; - var glo_im3_private_v4_private = glo_im3_private.f1(); --//import glo_im4_private = require("glo_M4_private"); --//export var glo_im4_private_v1_public = glo_im4_private.c1; --//export var glo_im4_private_v2_public = new glo_im4_private.c1(); --//export var glo_im4_private_v3_public = glo_im4_private.f1; --//export var glo_im4_private_v4_public = glo_im4_private.f1(); --//var glo_im4_private_v1_private = glo_im4_private.c1; --//var glo_im4_private_v2_private = new glo_im4_private.c1(); --//var glo_im4_private_v3_private = glo_im4_private.f1; --//var glo_im4_private_v4_private = glo_im4_private.f1(); --// Parse error to export module --exports.glo_im1_public = glo_M1_public; --exports.glo_im2_public = glo_M3_private; - //export import glo_im3_public = require("glo_M2_public"); - //export import glo_im4_public = require("glo_M4_private"); - //export declare module "use_glo_M1_public" { \ No newline at end of file + //export import m1_im3_public = require("m2_M3_public"); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js b/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js index e5241eada..5f801e2f9 100644 --- a/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js +++ b/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js @@ -361,7 +361,7 @@ export module m3 { //// [privacyImportParseErrors.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.m3 = exports.glo_im4_private_v4_public = exports.glo_im4_private_v3_public = exports.glo_im4_private_v2_public = exports.glo_im4_private_v1_public = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im2_private_v4_public = exports.glo_im2_private_v3_public = exports.glo_im2_private_v2_public = exports.glo_im2_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; +exports.m3 = exports.glo_im2_public = exports.glo_im1_public = exports.glo_im4_private_v4_public = exports.glo_im4_private_v3_public = exports.glo_im4_private_v2_public = exports.glo_im4_private_v1_public = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im2_private_v4_public = exports.glo_im2_private_v3_public = exports.glo_im2_private_v2_public = exports.glo_im2_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; var m1; (function (m1) { let m1_M1_public; @@ -514,6 +514,7 @@ var glo_M3_private; glo_M3_private.f1 = f1; glo_M3_private.v1 = c1; })(glo_M3_private || (exports.glo_M3_private = glo_M3_private = {})); +var glo_im1_private = glo_M1_public; exports.glo_im1_private_v1_public = glo_im1_private.c1; exports.glo_im1_private_v2_public = new glo_im1_private.c1(); exports.glo_im1_private_v3_public = glo_im1_private.f1; @@ -531,6 +532,7 @@ var glo_im2_private_v1_private = glo_im2_private.c1; var glo_im2_private_v2_private = new glo_im2_private.c1(); var glo_im2_private_v3_private = glo_im2_private.f1; var glo_im2_private_v4_private = glo_im2_private.f1(); +var glo_im3_private = glo_M3_private; exports.glo_im3_private_v1_public = glo_im3_private.c1; exports.glo_im3_private_v2_public = new glo_im3_private.c1(); exports.glo_im3_private_v3_public = glo_im3_private.f1; @@ -548,6 +550,9 @@ var glo_im4_private_v1_private = glo_im4_private.c1; var glo_im4_private_v2_private = new glo_im4_private.c1(); var glo_im4_private_v3_private = glo_im4_private.f1; var glo_im4_private_v4_private = glo_im4_private.f1(); +// Parse error to export module +exports.glo_im1_public = glo_M1_public; +exports.glo_im2_public = glo_M3_private; exports.glo_im3_public = require("glo_M2_public"); exports.glo_im4_public = require("glo_M4_private"); (function (m2_1) { diff --git a/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js.diff b/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js.diff index 9d398d9c4..6a45abcb8 100644 --- a/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js.diff +++ b/testdata/baselines/reference/submodule/compiler/privacyImportParseErrors.js.diff @@ -1,15 +1,6 @@ --- old.privacyImportParseErrors.js +++ new.privacyImportParseErrors.js -@@= skipped -360, +360 lines =@@ - //// [privacyImportParseErrors.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.m3 = exports.glo_im2_public = exports.glo_im1_public = exports.glo_im4_private_v4_public = exports.glo_im4_private_v3_public = exports.glo_im4_private_v2_public = exports.glo_im4_private_v1_public = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im2_private_v4_public = exports.glo_im2_private_v3_public = exports.glo_im2_private_v2_public = exports.glo_im2_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; -+exports.m3 = exports.glo_im4_private_v4_public = exports.glo_im4_private_v3_public = exports.glo_im4_private_v2_public = exports.glo_im4_private_v1_public = exports.glo_im3_private_v4_public = exports.glo_im3_private_v3_public = exports.glo_im3_private_v2_public = exports.glo_im3_private_v1_public = exports.glo_im2_private_v4_public = exports.glo_im2_private_v3_public = exports.glo_im2_private_v2_public = exports.glo_im2_private_v1_public = exports.glo_im1_private_v4_public = exports.glo_im1_private_v3_public = exports.glo_im1_private_v2_public = exports.glo_im1_private_v1_public = exports.glo_M3_private = exports.glo_M1_public = exports.m1 = void 0; - var m1; - (function (m1) { - let m1_M1_public; -@@= skipped -43, +43 lines =@@ +@@= skipped -403, +403 lines =@@ var m1_im2_private_v2_private = new m1_im2_private.c1(); var m1_im2_private_v3_private = m1_im2_private.f1; var m1_im2_private_v4_private = m1_im2_private.f1(); @@ -62,29 +53,7 @@ })(m2 || (m2 = {})); var glo_M1_public; (function (glo_M1_public) { -@@= skipped -26, +27 lines =@@ - glo_M3_private.f1 = f1; - glo_M3_private.v1 = c1; - })(glo_M3_private || (exports.glo_M3_private = glo_M3_private = {})); --var glo_im1_private = glo_M1_public; - exports.glo_im1_private_v1_public = glo_im1_private.c1; - exports.glo_im1_private_v2_public = new glo_im1_private.c1(); - exports.glo_im1_private_v3_public = glo_im1_private.f1; -@@= skipped -18, +17 lines =@@ - var glo_im2_private_v2_private = new glo_im2_private.c1(); - var glo_im2_private_v3_private = glo_im2_private.f1; - var glo_im2_private_v4_private = glo_im2_private.f1(); --var glo_im3_private = glo_M3_private; - exports.glo_im3_private_v1_public = glo_im3_private.c1; - exports.glo_im3_private_v2_public = new glo_im3_private.c1(); - exports.glo_im3_private_v3_public = glo_im3_private.f1; -@@= skipped -18, +17 lines =@@ - var glo_im4_private_v2_private = new glo_im4_private.c1(); - var glo_im4_private_v3_private = glo_im4_private.f1; - var glo_im4_private_v4_private = glo_im4_private.f1(); --// Parse error to export module --exports.glo_im1_public = glo_M1_public; --exports.glo_im2_public = glo_M3_private; +@@= skipped -68, +69 lines =@@ exports.glo_im3_public = require("glo_M2_public"); exports.glo_im4_public = require("glo_M4_private"); (function (m2_1) { diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js index 909c8dd6d..f06cca000 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js @@ -13,13 +13,15 @@ var y = new b(); //// [sourceMapValidationImport.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.m = void 0; +exports.b = exports.m = void 0; var m; (function (m) { class c { } m.c = c; })(m || (exports.m = m = {})); +var a = m.c; +exports.b = m.c; var x = new a(); var y = new exports.b(); //# sourceMappingURL=sourceMapValidationImport.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.diff b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.diff deleted file mode 100644 index ae66379d1..000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.sourceMapValidationImport.js -+++ new.sourceMapValidationImport.js -@@= skipped -12, +12 lines =@@ - //// [sourceMapValidationImport.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.b = exports.m = void 0; -+exports.m = void 0; - var m; - (function (m) { - class c { - } - m.c = c; - })(m || (exports.m = m = {})); --var a = m.c; --exports.b = m.c; - var x = new a(); - var y = new exports.b(); - //# sourceMappingURL=sourceMapValidationImport.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map index 7be6e8373..b0e4f7865 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map @@ -1,3 +1,3 @@ //// [sourceMapValidationImport.js.map] -{"version":3,"file":"sourceMapValidationImport.js","sourceRoot":"","sources":["sourceMapValidationImport.ts"],"names":[],"mappings":";;;AAAA,IAAc,CAGb;AAHD,WAAc,CAAC,EAAC;IACZ,MAAa,CAAC;KACb;IADY,EAAA,CAAC,IACb,CAAA;AAAA,CACJ,EAHa,CAAC,aAAD,CAAC,GAAD,CAAC,QAGd;AAGD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,IAAI,CAAC,GAAG,IAAI,QAAA,CAAC,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMubSA9IHZvaWQgMDsNCnZhciBtOw0KKGZ1bmN0aW9uIChtKSB7DQogICAgY2xhc3MgYyB7DQogICAgfQ0KICAgIG0uYyA9IGM7DQp9KShtIHx8IChleHBvcnRzLm0gPSBtID0ge30pKTsNCnZhciB4ID0gbmV3IGEoKTsNCnZhciB5ID0gbmV3IGV4cG9ydHMuYigpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9c291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNvdXJjZU1hcFZhbGlkYXRpb25JbXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsSUFBYyxDQUdiO0FBSEQsV0FBYyxDQUFDLEVBQUM7SUFDWixNQUFhLENBQUM7S0FDYjtJQURZLEVBQUEsQ0FBQyxJQUNiLENBQUE7QUFBQSxDQUNKLEVBSGEsQ0FBQyxhQUFELENBQUMsR0FBRCxDQUFDLFFBR2Q7QUFHRCxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsRUFBRSxDQUFDO0FBQ2hCLElBQUksQ0FBQyxHQUFHLElBQUksUUFBQSxDQUFDLEVBQUUsQ0FBQyJ9,ZXhwb3J0IG1vZHVsZSBtIHsKICAgIGV4cG9ydCBjbGFzcyBjIHsKICAgIH0KfQppbXBvcnQgYSA9IG0uYzsKZXhwb3J0IGltcG9ydCBiID0gbS5jOwp2YXIgeCA9IG5ldyBhKCk7CnZhciB5ID0gbmV3IGIoKTs= +{"version":3,"file":"sourceMapValidationImport.js","sourceRoot":"","sources":["sourceMapValidationImport.ts"],"names":[],"mappings":";;;AAAA,IAAc,CAGb;AAHD,WAAc,CAAC,EAAC;IACZ,MAAa,CAAC;KACb;IADY,EAAA,CAAC,IACb,CAAA;AAAA,CACJ,EAHa,CAAC,aAAD,CAAC,GAAD,CAAC,QAGd;AACD,IAAO,CAAC,GAAG,GAAG,CAAC;AACD,QAAA,CAAC,GAAG,GAAG,CAAC;AACtB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,IAAI,CAAC,GAAG,IAAI,QAAA,CAAC,EAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuYiA9IGV4cG9ydHMubSA9IHZvaWQgMDsNCnZhciBtOw0KKGZ1bmN0aW9uIChtKSB7DQogICAgY2xhc3MgYyB7DQogICAgfQ0KICAgIG0uYyA9IGM7DQp9KShtIHx8IChleHBvcnRzLm0gPSBtID0ge30pKTsNCnZhciBhID0gbS5jOw0KZXhwb3J0cy5iID0gbS5jOw0KdmFyIHggPSBuZXcgYSgpOw0KdmFyIHkgPSBuZXcgZXhwb3J0cy5iKCk7DQovLyMgc291cmNlTWFwcGluZ1VSTD1zb3VyY2VNYXBWYWxpZGF0aW9uSW1wb3J0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNvdXJjZU1hcFZhbGlkYXRpb25JbXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsSUFBYyxDQUdiO0FBSEQsV0FBYyxDQUFDLEVBQUM7SUFDWixNQUFhLENBQUM7S0FDYjtJQURZLEVBQUEsQ0FBQyxJQUNiLENBQUE7QUFBQSxDQUNKLEVBSGEsQ0FBQyxhQUFELENBQUMsR0FBRCxDQUFDLFFBR2Q7QUFDRCxJQUFPLENBQUMsR0FBRyxHQUFHLENBQUM7QUFDRCxRQUFBLENBQUMsR0FBRyxHQUFHLENBQUM7QUFDdEIsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQztBQUNoQixJQUFJLENBQUMsR0FBRyxJQUFJLFFBQUEsQ0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IG1vZHVsZSBtIHsKICAgIGV4cG9ydCBjbGFzcyBjIHsKICAgIH0KfQppbXBvcnQgYSA9IG0uYzsKZXhwb3J0IGltcG9ydCBiID0gbS5jOwp2YXIgeCA9IG5ldyBhKCk7CnZhciB5ID0gbmV3IGIoKTs= diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map.diff b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map.diff index b08e97cb8..9d9110e21 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map.diff @@ -4,5 +4,5 @@ //// [sourceMapValidationImport.js.map] -{"version":3,"file":"sourceMapValidationImport.js","sourceRoot":"","sources":["sourceMapValidationImport.ts"],"names":[],"mappings":";;;AAAA,IAAc,CAAC,CAGd;AAHD,WAAc,CAAC;IACX,MAAa,CAAC;KACb;IADY,GAAC,IACb,CAAA;AACL,CAAC,EAHa,CAAC,iBAAD,CAAC,QAGd;AACD,IAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACD,QAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,IAAI,CAAC,GAAG,IAAI,SAAC,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuYiA9IGV4cG9ydHMubSA9IHZvaWQgMDsNCnZhciBtOw0KKGZ1bmN0aW9uIChtKSB7DQogICAgY2xhc3MgYyB7DQogICAgfQ0KICAgIG0uYyA9IGM7DQp9KShtIHx8IChleHBvcnRzLm0gPSBtID0ge30pKTsNCnZhciBhID0gbS5jOw0KZXhwb3J0cy5iID0gbS5jOw0KdmFyIHggPSBuZXcgYSgpOw0KdmFyIHkgPSBuZXcgZXhwb3J0cy5iKCk7DQovLyMgc291cmNlTWFwcGluZ1VSTD1zb3VyY2VNYXBWYWxpZGF0aW9uSW1wb3J0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNvdXJjZU1hcFZhbGlkYXRpb25JbXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsSUFBYyxDQUFDLENBR2Q7QUFIRCxXQUFjLENBQUM7SUFDWCxNQUFhLENBQUM7S0FDYjtJQURZLEdBQUMsSUFDYixDQUFBO0FBQ0wsQ0FBQyxFQUhhLENBQUMsaUJBQUQsQ0FBQyxRQUdkO0FBQ0QsSUFBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNELFFBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDdEIsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQztBQUNoQixJQUFJLENBQUMsR0FBRyxJQUFJLFNBQUMsRUFBRSxDQUFDIn0=,ZXhwb3J0IG1vZHVsZSBtIHsKICAgIGV4cG9ydCBjbGFzcyBjIHsKICAgIH0KfQppbXBvcnQgYSA9IG0uYzsKZXhwb3J0IGltcG9ydCBiID0gbS5jOwp2YXIgeCA9IG5ldyBhKCk7CnZhciB5ID0gbmV3IGIoKTs= -+{"version":3,"file":"sourceMapValidationImport.js","sourceRoot":"","sources":["sourceMapValidationImport.ts"],"names":[],"mappings":";;;AAAA,IAAc,CAGb;AAHD,WAAc,CAAC,EAAC;IACZ,MAAa,CAAC;KACb;IADY,EAAA,CAAC,IACb,CAAA;AAAA,CACJ,EAHa,CAAC,aAAD,CAAC,GAAD,CAAC,QAGd;AAGD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,IAAI,CAAC,GAAG,IAAI,QAAA,CAAC,EAAE,CAAC"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMubSA9IHZvaWQgMDsNCnZhciBtOw0KKGZ1bmN0aW9uIChtKSB7DQogICAgY2xhc3MgYyB7DQogICAgfQ0KICAgIG0uYyA9IGM7DQp9KShtIHx8IChleHBvcnRzLm0gPSBtID0ge30pKTsNCnZhciB4ID0gbmV3IGEoKTsNCnZhciB5ID0gbmV3IGV4cG9ydHMuYigpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9c291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNvdXJjZU1hcFZhbGlkYXRpb25JbXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsSUFBYyxDQUdiO0FBSEQsV0FBYyxDQUFDLEVBQUM7SUFDWixNQUFhLENBQUM7S0FDYjtJQURZLEVBQUEsQ0FBQyxJQUNiLENBQUE7QUFBQSxDQUNKLEVBSGEsQ0FBQyxhQUFELENBQUMsR0FBRCxDQUFDLFFBR2Q7QUFHRCxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsRUFBRSxDQUFDO0FBQ2hCLElBQUksQ0FBQyxHQUFHLElBQUksUUFBQSxDQUFDLEVBQUUsQ0FBQyJ9,ZXhwb3J0IG1vZHVsZSBtIHsKICAgIGV4cG9ydCBjbGFzcyBjIHsKICAgIH0KfQppbXBvcnQgYSA9IG0uYzsKZXhwb3J0IGltcG9ydCBiID0gbS5jOwp2YXIgeCA9IG5ldyBhKCk7CnZhciB5ID0gbmV3IGIoKTs= \ No newline at end of file ++{"version":3,"file":"sourceMapValidationImport.js","sourceRoot":"","sources":["sourceMapValidationImport.ts"],"names":[],"mappings":";;;AAAA,IAAc,CAGb;AAHD,WAAc,CAAC,EAAC;IACZ,MAAa,CAAC;KACb;IADY,EAAA,CAAC,IACb,CAAA;AAAA,CACJ,EAHa,CAAC,aAAD,CAAC,GAAD,CAAC,QAGd;AACD,IAAO,CAAC,GAAG,GAAG,CAAC;AACD,QAAA,CAAC,GAAG,GAAG,CAAC;AACtB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,IAAI,CAAC,GAAG,IAAI,QAAA,CAAC,EAAE,CAAC"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMuYiA9IGV4cG9ydHMubSA9IHZvaWQgMDsNCnZhciBtOw0KKGZ1bmN0aW9uIChtKSB7DQogICAgY2xhc3MgYyB7DQogICAgfQ0KICAgIG0uYyA9IGM7DQp9KShtIHx8IChleHBvcnRzLm0gPSBtID0ge30pKTsNCnZhciBhID0gbS5jOw0KZXhwb3J0cy5iID0gbS5jOw0KdmFyIHggPSBuZXcgYSgpOw0KdmFyIHkgPSBuZXcgZXhwb3J0cy5iKCk7DQovLyMgc291cmNlTWFwcGluZ1VSTD1zb3VyY2VNYXBWYWxpZGF0aW9uSW1wb3J0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvbkltcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNvdXJjZU1hcFZhbGlkYXRpb25JbXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsSUFBYyxDQUdiO0FBSEQsV0FBYyxDQUFDLEVBQUM7SUFDWixNQUFhLENBQUM7S0FDYjtJQURZLEVBQUEsQ0FBQyxJQUNiLENBQUE7QUFBQSxDQUNKLEVBSGEsQ0FBQyxhQUFELENBQUMsR0FBRCxDQUFDLFFBR2Q7QUFDRCxJQUFPLENBQUMsR0FBRyxHQUFHLENBQUM7QUFDRCxRQUFBLENBQUMsR0FBRyxHQUFHLENBQUM7QUFDdEIsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQztBQUNoQixJQUFJLENBQUMsR0FBRyxJQUFJLFFBQUEsQ0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IG1vZHVsZSBtIHsKICAgIGV4cG9ydCBjbGFzcyBjIHsKICAgIH0KfQppbXBvcnQgYSA9IG0uYzsKZXhwb3J0IGltcG9ydCBiID0gbS5jOwp2YXIgeCA9IG5ldyBhKCk7CnZhciB5ID0gbmV3IGIoKTs= \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt index bbb67c4c7..a3a57e53b 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt @@ -10,7 +10,7 @@ sourceFile:sourceMapValidationImport.ts ------------------------------------------------------------------- >>>"use strict"; >>>Object.defineProperty(exports, "__esModule", { value: true }); ->>>exports.m = void 0; +>>>exports.b = exports.m = void 0; >>>var m; 1 > 2 >^^^^ @@ -111,19 +111,61 @@ sourceFile:sourceMapValidationImport.ts 8 >Emitted(9, 23) Source(1, 16) + SourceIndex(0) 9 >Emitted(9, 31) Source(4, 2) + SourceIndex(0) --- ->>>var x = new a(); +>>>var a = m.c; 1 > 2 >^^^^ 3 > ^ 4 > ^^^ +5 > ^^^ +6 > ^ +7 > ^^^^^-> +1 > + > +2 >import +3 > a +4 > = +5 > m.c +6 > ; +1 >Emitted(10, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(5, 8) + SourceIndex(0) +3 >Emitted(10, 6) Source(5, 9) + SourceIndex(0) +4 >Emitted(10, 9) Source(5, 12) + SourceIndex(0) +5 >Emitted(10, 12) Source(5, 15) + SourceIndex(0) +6 >Emitted(10, 13) Source(5, 16) + SourceIndex(0) +--- +>>>exports.b = m.c; +1-> +2 >^^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^ +7 > ^-> +1-> + >export import +2 > +3 > b +4 > = +5 > m.c +6 > ; +1->Emitted(11, 1) Source(6, 15) + SourceIndex(0) +2 >Emitted(11, 9) Source(6, 15) + SourceIndex(0) +3 >Emitted(11, 10) Source(6, 16) + SourceIndex(0) +4 >Emitted(11, 13) Source(6, 19) + SourceIndex(0) +5 >Emitted(11, 16) Source(6, 22) + SourceIndex(0) +6 >Emitted(11, 17) Source(6, 23) + SourceIndex(0) +--- +>>>var x = new a(); +1-> +2 >^^^^ +3 > ^ +4 > ^^^ 5 > ^^^^ 6 > ^ 7 > ^^ 8 > ^ 9 > ^^^^^^^^^-> -1 > - >import a = m.c; - >export import b = m.c; +1-> > 2 >var 3 > x @@ -132,14 +174,14 @@ sourceFile:sourceMapValidationImport.ts 6 > a 7 > () 8 > ; -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(10, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(10, 6) Source(7, 6) + SourceIndex(0) -4 >Emitted(10, 9) Source(7, 9) + SourceIndex(0) -5 >Emitted(10, 13) Source(7, 13) + SourceIndex(0) -6 >Emitted(10, 14) Source(7, 14) + SourceIndex(0) -7 >Emitted(10, 16) Source(7, 16) + SourceIndex(0) -8 >Emitted(10, 17) Source(7, 17) + SourceIndex(0) +1->Emitted(12, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(12, 6) Source(7, 6) + SourceIndex(0) +4 >Emitted(12, 9) Source(7, 9) + SourceIndex(0) +5 >Emitted(12, 13) Source(7, 13) + SourceIndex(0) +6 >Emitted(12, 14) Source(7, 14) + SourceIndex(0) +7 >Emitted(12, 16) Source(7, 16) + SourceIndex(0) +8 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) --- >>>var y = new exports.b(); 1-> @@ -162,14 +204,14 @@ sourceFile:sourceMapValidationImport.ts 7 > b 8 > () 9 > ; -1->Emitted(11, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(11, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(11, 6) Source(8, 6) + SourceIndex(0) -4 >Emitted(11, 9) Source(8, 9) + SourceIndex(0) -5 >Emitted(11, 13) Source(8, 13) + SourceIndex(0) -6 >Emitted(11, 21) Source(8, 13) + SourceIndex(0) -7 >Emitted(11, 22) Source(8, 14) + SourceIndex(0) -8 >Emitted(11, 24) Source(8, 16) + SourceIndex(0) -9 >Emitted(11, 25) Source(8, 17) + SourceIndex(0) +1->Emitted(13, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(13, 6) Source(8, 6) + SourceIndex(0) +4 >Emitted(13, 9) Source(8, 9) + SourceIndex(0) +5 >Emitted(13, 13) Source(8, 13) + SourceIndex(0) +6 >Emitted(13, 21) Source(8, 13) + SourceIndex(0) +7 >Emitted(13, 22) Source(8, 14) + SourceIndex(0) +8 >Emitted(13, 24) Source(8, 16) + SourceIndex(0) +9 >Emitted(13, 25) Source(8, 17) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationImport.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt.diff index ba4b67315..06cab12e0 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt.diff @@ -1,12 +1,6 @@ --- old.sourceMapValidationImport.sourcemap.txt +++ new.sourceMapValidationImport.sourcemap.txt -@@= skipped -9, +9 lines =@@ - ------------------------------------------------------------------- - >>>"use strict"; - >>>Object.defineProperty(exports, "__esModule", { value: true }); -->>>exports.b = exports.m = void 0; -+>>>exports.m = void 0; - >>>var m; +@@= skipped -14, +14 lines =@@ 1 > 2 >^^^^ 3 > ^ @@ -60,7 +54,7 @@ 2 >Emitted(6, 11) Source(2, 18) + SourceIndex(0) 3 >Emitted(6, 12) Source(2, 19) + SourceIndex(0) --- -@@= skipped -52, +51 lines =@@ +@@= skipped -47, +46 lines =@@ --- >>> m.c = c; 1->^^^^ @@ -129,109 +123,85 @@ -5 >Emitted(9, 22) Source(1, 15) + SourceIndex(0) -6 >Emitted(9, 23) Source(1, 16) + SourceIndex(0) -7 >Emitted(9, 31) Source(4, 2) + SourceIndex(0) ----- -->>>var a = m.c; --1 > --2 >^^^^ --3 > ^ --4 > ^^^ ++5 >Emitted(9, 18) Source(1, 15) + SourceIndex(0) ++6 >Emitted(9, 19) Source(1, 16) + SourceIndex(0) ++7 >Emitted(9, 22) Source(1, 15) + SourceIndex(0) ++8 >Emitted(9, 23) Source(1, 16) + SourceIndex(0) ++9 >Emitted(9, 31) Source(4, 2) + SourceIndex(0) + --- + >>>var a = m.c; + 1 > + 2 >^^^^ + 3 > ^ + 4 > ^^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^^-> --1 > -- > --2 >import --3 > a --4 > = ++5 > ^^^ ++6 > ^ ++7 > ^^^^^-> + 1 > + > + 2 >import + 3 > a + 4 > = -5 > m -6 > . -7 > c -8 > ; --1 >Emitted(10, 1) Source(5, 1) + SourceIndex(0) --2 >Emitted(10, 5) Source(5, 8) + SourceIndex(0) --3 >Emitted(10, 6) Source(5, 9) + SourceIndex(0) --4 >Emitted(10, 9) Source(5, 12) + SourceIndex(0) ++5 > m.c ++6 > ; + 1 >Emitted(10, 1) Source(5, 1) + SourceIndex(0) + 2 >Emitted(10, 5) Source(5, 8) + SourceIndex(0) + 3 >Emitted(10, 6) Source(5, 9) + SourceIndex(0) + 4 >Emitted(10, 9) Source(5, 12) + SourceIndex(0) -5 >Emitted(10, 10) Source(5, 13) + SourceIndex(0) -6 >Emitted(10, 11) Source(5, 14) + SourceIndex(0) -7 >Emitted(10, 12) Source(5, 15) + SourceIndex(0) -8 >Emitted(10, 13) Source(5, 16) + SourceIndex(0) ----- -->>>exports.b = m.c; --1-> --2 >^^^^^^^^ --3 > ^ --4 > ^^^ ++5 >Emitted(10, 12) Source(5, 15) + SourceIndex(0) ++6 >Emitted(10, 13) Source(5, 16) + SourceIndex(0) + --- + >>>exports.b = m.c; + 1-> + 2 >^^^^^^^^ + 3 > ^ + 4 > ^^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^-> --1-> -- >export import --2 > --3 > b --4 > = ++5 > ^^^ ++6 > ^ ++7 > ^-> + 1-> + >export import + 2 > + 3 > b + 4 > = -5 > m -6 > . -7 > c -8 > ; --1->Emitted(11, 1) Source(6, 15) + SourceIndex(0) --2 >Emitted(11, 9) Source(6, 15) + SourceIndex(0) --3 >Emitted(11, 10) Source(6, 16) + SourceIndex(0) --4 >Emitted(11, 13) Source(6, 19) + SourceIndex(0) ++5 > m.c ++6 > ; + 1->Emitted(11, 1) Source(6, 15) + SourceIndex(0) + 2 >Emitted(11, 9) Source(6, 15) + SourceIndex(0) + 3 >Emitted(11, 10) Source(6, 16) + SourceIndex(0) + 4 >Emitted(11, 13) Source(6, 19) + SourceIndex(0) -5 >Emitted(11, 14) Source(6, 20) + SourceIndex(0) -6 >Emitted(11, 15) Source(6, 21) + SourceIndex(0) -7 >Emitted(11, 16) Source(6, 22) + SourceIndex(0) -8 >Emitted(11, 17) Source(6, 23) + SourceIndex(0) -+5 >Emitted(9, 18) Source(1, 15) + SourceIndex(0) -+6 >Emitted(9, 19) Source(1, 16) + SourceIndex(0) -+7 >Emitted(9, 22) Source(1, 15) + SourceIndex(0) -+8 >Emitted(9, 23) Source(1, 16) + SourceIndex(0) -+9 >Emitted(9, 31) Source(4, 2) + SourceIndex(0) ++5 >Emitted(11, 16) Source(6, 22) + SourceIndex(0) ++6 >Emitted(11, 17) Source(6, 23) + SourceIndex(0) --- >>>var x = new a(); --1-> -+1 > - 2 >^^^^ - 3 > ^ - 4 > ^^^ -@@= skipped -107, +60 lines =@@ - 7 > ^^ - 8 > ^ - 9 > ^^^^^^^^^-> --1-> -+1 > -+ >import a = m.c; -+ >export import b = m.c; - > - 2 >var - 3 > x -@@= skipped -9, +11 lines =@@ - 6 > a - 7 > () - 8 > ; --1->Emitted(12, 1) Source(7, 1) + SourceIndex(0) --2 >Emitted(12, 5) Source(7, 5) + SourceIndex(0) --3 >Emitted(12, 6) Source(7, 6) + SourceIndex(0) --4 >Emitted(12, 9) Source(7, 9) + SourceIndex(0) --5 >Emitted(12, 13) Source(7, 13) + SourceIndex(0) --6 >Emitted(12, 14) Source(7, 14) + SourceIndex(0) --7 >Emitted(12, 16) Source(7, 16) + SourceIndex(0) --8 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) -+1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) -+2 >Emitted(10, 5) Source(7, 5) + SourceIndex(0) -+3 >Emitted(10, 6) Source(7, 6) + SourceIndex(0) -+4 >Emitted(10, 9) Source(7, 9) + SourceIndex(0) -+5 >Emitted(10, 13) Source(7, 13) + SourceIndex(0) -+6 >Emitted(10, 14) Source(7, 14) + SourceIndex(0) -+7 >Emitted(10, 16) Source(7, 16) + SourceIndex(0) -+8 >Emitted(10, 17) Source(7, 17) + SourceIndex(0) - --- - >>>var y = new exports.b(); 1-> -@@= skipped -15, +15 lines =@@ +@@= skipped -131, +128 lines =@@ 3 > ^ 4 > ^^^ 5 > ^^^^ @@ -253,26 +223,21 @@ -6 > b -7 > () -8 > ; --1->Emitted(13, 1) Source(8, 1) + SourceIndex(0) --2 >Emitted(13, 5) Source(8, 5) + SourceIndex(0) --3 >Emitted(13, 6) Source(8, 6) + SourceIndex(0) --4 >Emitted(13, 9) Source(8, 9) + SourceIndex(0) --5 >Emitted(13, 13) Source(8, 13) + SourceIndex(0) --6 >Emitted(13, 22) Source(8, 14) + SourceIndex(0) --7 >Emitted(13, 24) Source(8, 16) + SourceIndex(0) --8 >Emitted(13, 25) Source(8, 17) + SourceIndex(0) +6 > +7 > b +8 > () +9 > ; -+1->Emitted(11, 1) Source(8, 1) + SourceIndex(0) -+2 >Emitted(11, 5) Source(8, 5) + SourceIndex(0) -+3 >Emitted(11, 6) Source(8, 6) + SourceIndex(0) -+4 >Emitted(11, 9) Source(8, 9) + SourceIndex(0) -+5 >Emitted(11, 13) Source(8, 13) + SourceIndex(0) -+6 >Emitted(11, 21) Source(8, 13) + SourceIndex(0) -+7 >Emitted(11, 22) Source(8, 14) + SourceIndex(0) -+8 >Emitted(11, 24) Source(8, 16) + SourceIndex(0) -+9 >Emitted(11, 25) Source(8, 17) + SourceIndex(0) + 1->Emitted(13, 1) Source(8, 1) + SourceIndex(0) + 2 >Emitted(13, 5) Source(8, 5) + SourceIndex(0) + 3 >Emitted(13, 6) Source(8, 6) + SourceIndex(0) + 4 >Emitted(13, 9) Source(8, 9) + SourceIndex(0) + 5 >Emitted(13, 13) Source(8, 13) + SourceIndex(0) +-6 >Emitted(13, 22) Source(8, 14) + SourceIndex(0) +-7 >Emitted(13, 24) Source(8, 16) + SourceIndex(0) +-8 >Emitted(13, 25) Source(8, 17) + SourceIndex(0) ++6 >Emitted(13, 21) Source(8, 13) + SourceIndex(0) ++7 >Emitted(13, 22) Source(8, 14) + SourceIndex(0) ++8 >Emitted(13, 24) Source(8, 16) + SourceIndex(0) ++9 >Emitted(13, 25) Source(8, 17) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationImport.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js b/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js index 69091be18..ed0944bb5 100644 --- a/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js +++ b/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js @@ -36,6 +36,7 @@ var Outer; instantiated.C = C; })(instantiated = Outer.instantiated || (Outer.instantiated = {})); })(Outer || (Outer = {})); +var importInst = Outer.instantiated; var x1 = importInst.C; var x2 = new x1(); var x3; // Error again diff --git a/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js.diff b/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js.diff deleted file mode 100644 index d8bec69ec..000000000 --- a/testdata/baselines/reference/submodule/compiler/typeofInternalModules.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.typeofInternalModules.js -+++ new.typeofInternalModules.js -@@= skipped -35, +35 lines =@@ - instantiated.C = C; - })(instantiated = Outer.instantiated || (Outer.instantiated = {})); - })(Outer || (Outer = {})); --var importInst = Outer.instantiated; - var x1 = importInst.C; - var x2 = new x1(); - var x3; // Error again \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js index 04a7ca363..1c721f69c 100644 --- a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js +++ b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js @@ -125,28 +125,28 @@ export class PrivateIdentifierWithExtendedEscape2 { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; -exports.x = 10; +exports.\u0078 = 10; exports.x++; //# sourceMappingURL=identifierVariableWithEscape1.js.map //// [identifierVariableWithEscape2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.xx = void 0; -exports.xx = 10; +exports.x\u0078 = 10; exports.xx++; //# sourceMappingURL=identifierVariableWithEscape2.js.map //// [identifierVariableWithExtendedEscape1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; -exports.x = 10; +exports.\u{78} = 10; exports.x++; //# sourceMappingURL=identifierVariableWithExtendedEscape1.js.map //// [identifierVariableWithExtendedEscape2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.xx = void 0; -exports.xx = 10; +exports.x\u{78} = 10; exports.xx++; //# sourceMappingURL=identifierVariableWithExtendedEscape2.js.map //// [IdentifierNameWithEscape1.js] diff --git a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.diff b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.diff index 036e7ffc1..6042951c2 100644 --- a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.diff +++ b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.diff @@ -1,39 +1,6 @@ --- old.unicodeEscapesInNames01(target=es5).js +++ new.unicodeEscapesInNames01(target=es5).js -@@= skipped -124, +124 lines =@@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.x = void 0; --exports.\u0078 = 10; -+exports.x = 10; - exports.x++; - //# sourceMappingURL=identifierVariableWithEscape1.js.map - //// [identifierVariableWithEscape2.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.xx = void 0; --exports.x\u0078 = 10; -+exports.xx = 10; - exports.xx++; - //# sourceMappingURL=identifierVariableWithEscape2.js.map - //// [identifierVariableWithExtendedEscape1.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.x = void 0; --exports.\u{78} = 10; -+exports.x = 10; - exports.x++; - //# sourceMappingURL=identifierVariableWithExtendedEscape1.js.map - //// [identifierVariableWithExtendedEscape2.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.xx = void 0; --exports.x\u{78} = 10; -+exports.xx = 10; - exports.xx++; - //# sourceMappingURL=identifierVariableWithExtendedEscape2.js.map - //// [IdentifierNameWithEscape1.js] -@@= skipped -29, +29 lines =@@ +@@= skipped -153, +153 lines =@@ Object.defineProperty(exports, "__esModule", { value: true }); exports.IdentifierNameWithEscape1 = void 0; class IdentifierNameWithEscape1 { diff --git a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map index 0e13abbe7..42f428c2a 100644 --- a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map +++ b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map @@ -1,18 +1,18 @@ //// [identifierVariableWithEscape1.js.map] -{"version":3,"file":"identifierVariableWithEscape1.js","sourceRoot":"","sources":["identifierVariableWithEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,CAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMueCA9IDEwOw0KZXhwb3J0cy54Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLENBQU0sR0FBRyxFQUFFLENBQUM7QUFDdkIsUUFBQSxDQUFDLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCBcdTAwNzggPSAxMDsKeCsrOwo= +{"version":3,"file":"identifierVariableWithEscape1.js","sourceRoot":"","sources":["identifierVariableWithEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,MAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMuXHUwMDc4ID0gMTA7DQpleHBvcnRzLngrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFc2NhcGUxLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLE1BQU0sR0FBRyxFQUFFLENBQUM7QUFDdkIsUUFBQSxDQUFDLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCBcdTAwNzggPSAxMDsKeCsrOwo= //// [identifierVariableWithEscape2.js.map] -{"version":3,"file":"identifierVariableWithEscape2.js","sourceRoot":"","sources":["identifierVariableWithEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,EAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnh4ID0gMTA7DQpleHBvcnRzLnh4Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLEVBQU8sR0FBRyxFQUFFLENBQUM7QUFDeEIsUUFBQSxFQUFFLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCB4XHUwMDc4ID0gMTA7Cnh4Kys7Cg== +{"version":3,"file":"identifierVariableWithEscape2.js","sourceRoot":"","sources":["identifierVariableWithEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,OAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnhcdTAwNzggPSAxMDsNCmV4cG9ydHMueHgrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFc2NhcGUyLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLE9BQU8sR0FBRyxFQUFFLENBQUM7QUFDeEIsUUFBQSxFQUFFLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCB4XHUwMDc4ID0gMTA7Cnh4Kys7Cg== //// [identifierVariableWithExtendedEscape1.js.map] -{"version":3,"file":"identifierVariableWithExtendedEscape1.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,CAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMueCA9IDEwOw0KZXhwb3J0cy54Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXh0ZW5kZWRFc2NhcGUxLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxDQUFNLEdBQUcsRUFBRSxDQUFDO0FBQ3ZCLFFBQUEsQ0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCBcdXs3OH0gPSAxMDsKeCsrOwo= +{"version":3,"file":"identifierVariableWithExtendedEscape1.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,MAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMuXHV7Nzh9ID0gMTA7DQpleHBvcnRzLngrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxNQUFNLEdBQUcsRUFBRSxDQUFDO0FBQ3ZCLFFBQUEsQ0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCBcdXs3OH0gPSAxMDsKeCsrOwo= //// [identifierVariableWithExtendedEscape2.js.map] -{"version":3,"file":"identifierVariableWithExtendedEscape2.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,EAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnh4ID0gMTA7DQpleHBvcnRzLnh4Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXh0ZW5kZWRFc2NhcGUyLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxFQUFPLEdBQUcsRUFBRSxDQUFDO0FBQ3hCLFFBQUEsRUFBRSxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCB4XHV7Nzh9ID0gMTA7Cnh4Kys7Cg== +{"version":3,"file":"identifierVariableWithExtendedEscape2.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,OAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnhcdXs3OH0gPSAxMDsNCmV4cG9ydHMueHgrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxPQUFPLEdBQUcsRUFBRSxDQUFDO0FBQ3hCLFFBQUEsRUFBRSxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCB4XHV7Nzh9ID0gMTA7Cnh4Kys7Cg== //// [IdentifierNameWithEscape1.js.map] {"version":3,"file":"IdentifierNameWithEscape1.js","sourceRoot":"","sources":["IdentifierNameWithEscape1.ts"],"names":[],"mappings":";;;AAAA;IACI,MAAM,CAAS;IAEf,cAAc;QACV,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAAA,CACnB;IAED,OAAO,GAAG;QACN,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;IAAA,CACf;CACJ"} diff --git a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map.diff b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map.diff index 65704c2b3..0121cfc82 100644 --- a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map.diff +++ b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).js.map.diff @@ -4,26 +4,26 @@ //// [identifierVariableWithEscape1.js.map] -{"version":3,"file":"identifierVariableWithEscape1.js","sourceRoot":"","sources":["identifierVariableWithEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,MAAM,GAAG,EAAE,CAAC;AACvB,SAAC,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMuXHUwMDc4ID0gMTA7DQpleHBvcnRzLngrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFc2NhcGUxLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLE1BQU0sR0FBRyxFQUFFLENBQUM7QUFDdkIsU0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCBcdTAwNzggPSAxMDsKeCsrOwo= -+{"version":3,"file":"identifierVariableWithEscape1.js","sourceRoot":"","sources":["identifierVariableWithEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,CAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMueCA9IDEwOw0KZXhwb3J0cy54Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLENBQU0sR0FBRyxFQUFFLENBQUM7QUFDdkIsUUFBQSxDQUFDLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCBcdTAwNzggPSAxMDsKeCsrOwo= ++{"version":3,"file":"identifierVariableWithEscape1.js","sourceRoot":"","sources":["identifierVariableWithEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,MAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMuXHUwMDc4ID0gMTA7DQpleHBvcnRzLngrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFc2NhcGUxLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLE1BQU0sR0FBRyxFQUFFLENBQUM7QUFDdkIsUUFBQSxDQUFDLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCBcdTAwNzggPSAxMDsKeCsrOwo= //// [identifierVariableWithEscape2.js.map] -{"version":3,"file":"identifierVariableWithEscape2.js","sourceRoot":"","sources":["identifierVariableWithEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,OAAO,GAAG,EAAE,CAAC;AACxB,UAAE,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnhcdTAwNzggPSAxMDsNCmV4cG9ydHMueHgrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFc2NhcGUyLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLE9BQU8sR0FBRyxFQUFFLENBQUM7QUFDeEIsVUFBRSxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCB4XHUwMDc4ID0gMTA7Cnh4Kys7Cg== -+{"version":3,"file":"identifierVariableWithEscape2.js","sourceRoot":"","sources":["identifierVariableWithEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,EAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnh4ID0gMTA7DQpleHBvcnRzLnh4Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLEVBQU8sR0FBRyxFQUFFLENBQUM7QUFDeEIsUUFBQSxFQUFFLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCB4XHUwMDc4ID0gMTA7Cnh4Kys7Cg== ++{"version":3,"file":"identifierVariableWithEscape2.js","sourceRoot":"","sources":["identifierVariableWithEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,OAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnhcdTAwNzggPSAxMDsNCmV4cG9ydHMueHgrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFc2NhcGUyLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEVzY2FwZTIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpZGVudGlmaWVyVmFyaWFibGVXaXRoRXNjYXBlMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBVyxRQUFBLE9BQU8sR0FBRyxFQUFFLENBQUM7QUFDeEIsUUFBQSxFQUFFLEVBQUUsQ0FBQyJ9,ZXhwb3J0IGxldCB4XHUwMDc4ID0gMTA7Cnh4Kys7Cg== //// [identifierVariableWithExtendedEscape1.js.map] -{"version":3,"file":"identifierVariableWithExtendedEscape1.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,MAAM,GAAG,EAAE,CAAC;AACvB,SAAC,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMuXHV7Nzh9ID0gMTA7DQpleHBvcnRzLngrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxNQUFNLEdBQUcsRUFBRSxDQUFDO0FBQ3ZCLFNBQUMsRUFBRSxDQUFDIn0=,ZXhwb3J0IGxldCBcdXs3OH0gPSAxMDsKeCsrOwo= -+{"version":3,"file":"identifierVariableWithExtendedEscape1.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,CAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMueCA9IDEwOw0KZXhwb3J0cy54Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXh0ZW5kZWRFc2NhcGUxLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxDQUFNLEdBQUcsRUFBRSxDQUFDO0FBQ3ZCLFFBQUEsQ0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCBcdXs3OH0gPSAxMDsKeCsrOwo= ++{"version":3,"file":"identifierVariableWithExtendedEscape1.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape1.ts"],"names":[],"mappings":";;;AAAW,QAAA,MAAM,GAAG,EAAE,CAAC;AACvB,QAAA,CAAC,EAAE,CAAC"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueCA9IHZvaWQgMDsNCmV4cG9ydHMuXHV7Nzh9ID0gMTA7DQpleHBvcnRzLngrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxNQUFNLEdBQUcsRUFBRSxDQUFDO0FBQ3ZCLFFBQUEsQ0FBQyxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCBcdXs3OH0gPSAxMDsKeCsrOwo= //// [identifierVariableWithExtendedEscape2.js.map] -{"version":3,"file":"identifierVariableWithExtendedEscape2.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,OAAO,GAAG,EAAE,CAAC;AACxB,UAAE,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnhcdXs3OH0gPSAxMDsNCmV4cG9ydHMueHgrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxPQUFPLEdBQUcsRUFBRSxDQUFDO0FBQ3hCLFVBQUUsRUFBRSxDQUFDIn0=,ZXhwb3J0IGxldCB4XHV7Nzh9ID0gMTA7Cnh4Kys7Cg== -+{"version":3,"file":"identifierVariableWithExtendedEscape2.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,EAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnh4ID0gMTA7DQpleHBvcnRzLnh4Kys7DQovLyMgc291cmNlTWFwcGluZ1VSTD1pZGVudGlmaWVyVmFyaWFibGVXaXRoRXh0ZW5kZWRFc2NhcGUyLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxFQUFPLEdBQUcsRUFBRSxDQUFDO0FBQ3hCLFFBQUEsRUFBRSxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCB4XHV7Nzh9ID0gMTA7Cnh4Kys7Cg== ++{"version":3,"file":"identifierVariableWithExtendedEscape2.js","sourceRoot":"","sources":["identifierVariableWithExtendedEscape2.ts"],"names":[],"mappings":";;;AAAW,QAAA,OAAO,GAAG,EAAE,CAAC;AACxB,QAAA,EAAE,EAAE,CAAC"} ++//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCmV4cG9ydHMueHggPSB2b2lkIDA7DQpleHBvcnRzLnhcdXs3OH0gPSAxMDsNCmV4cG9ydHMueHgrKzsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlbnRpZmllclZhcmlhYmxlV2l0aEV4dGVuZGVkRXNjYXBlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImlkZW50aWZpZXJWYXJpYWJsZVdpdGhFeHRlbmRlZEVzY2FwZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQVcsUUFBQSxPQUFPLEdBQUcsRUFBRSxDQUFDO0FBQ3hCLFFBQUEsRUFBRSxFQUFFLENBQUMifQ==,ZXhwb3J0IGxldCB4XHV7Nzh9ID0gMTA7Cnh4Kys7Cg== //// [IdentifierNameWithEscape1.js.map] -{"version":3,"file":"IdentifierNameWithEscape1.js","sourceRoot":"","sources":["IdentifierNameWithEscape1.ts"],"names":[],"mappings":";;;AAAA,MAAa,yBAAyB;IAGlC;QACI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;CACJ;AAVD,8DAUC"} diff --git a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt index 8f187ec2b..958cef099 100644 --- a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt +++ b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt @@ -11,25 +11,25 @@ sourceFile:identifierVariableWithEscape1.ts >>>"use strict"; >>>Object.defineProperty(exports, "__esModule", { value: true }); >>>exports.x = void 0; ->>>exports.x = 10; +>>>exports.\u0078 = 10; 1 > 2 >^^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^^ -6 > ^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ 1 >export let 2 > 3 > \u0078 -4 > = -5 > 10 -6 > ; +4 > = +5 > 10 +6 > ; 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(4, 10) Source(1, 18) + SourceIndex(0) -4 >Emitted(4, 13) Source(1, 21) + SourceIndex(0) -5 >Emitted(4, 15) Source(1, 23) + SourceIndex(0) -6 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) +3 >Emitted(4, 15) Source(1, 18) + SourceIndex(0) +4 >Emitted(4, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(4, 20) Source(1, 23) + SourceIndex(0) +6 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) --- >>>exports.x++; 1 > @@ -63,25 +63,25 @@ sourceFile:identifierVariableWithEscape2.ts >>>"use strict"; >>>Object.defineProperty(exports, "__esModule", { value: true }); >>>exports.xx = void 0; ->>>exports.xx = 10; +>>>exports.x\u0078 = 10; 1 > 2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ +3 > ^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ 1 >export let 2 > 3 > x\u0078 -4 > = -5 > 10 -6 > ; +4 > = +5 > 10 +6 > ; 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(4, 11) Source(1, 19) + SourceIndex(0) -4 >Emitted(4, 14) Source(1, 22) + SourceIndex(0) -5 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) -6 >Emitted(4, 17) Source(1, 25) + SourceIndex(0) +3 >Emitted(4, 16) Source(1, 19) + SourceIndex(0) +4 >Emitted(4, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) +6 >Emitted(4, 22) Source(1, 25) + SourceIndex(0) --- >>>exports.xx++; 1 > @@ -115,25 +115,25 @@ sourceFile:identifierVariableWithExtendedEscape1.ts >>>"use strict"; >>>Object.defineProperty(exports, "__esModule", { value: true }); >>>exports.x = void 0; ->>>exports.x = 10; +>>>exports.\u{78} = 10; 1 > 2 >^^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^^ -6 > ^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ 1 >export let 2 > 3 > \u{78} -4 > = -5 > 10 -6 > ; +4 > = +5 > 10 +6 > ; 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(4, 10) Source(1, 18) + SourceIndex(0) -4 >Emitted(4, 13) Source(1, 21) + SourceIndex(0) -5 >Emitted(4, 15) Source(1, 23) + SourceIndex(0) -6 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) +3 >Emitted(4, 15) Source(1, 18) + SourceIndex(0) +4 >Emitted(4, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(4, 20) Source(1, 23) + SourceIndex(0) +6 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) --- >>>exports.x++; 1 > @@ -167,25 +167,25 @@ sourceFile:identifierVariableWithExtendedEscape2.ts >>>"use strict"; >>>Object.defineProperty(exports, "__esModule", { value: true }); >>>exports.xx = void 0; ->>>exports.xx = 10; +>>>exports.x\u{78} = 10; 1 > 2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ +3 > ^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ 1 >export let 2 > 3 > x\u{78} -4 > = -5 > 10 -6 > ; +4 > = +5 > 10 +6 > ; 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(4, 11) Source(1, 19) + SourceIndex(0) -4 >Emitted(4, 14) Source(1, 22) + SourceIndex(0) -5 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) -6 >Emitted(4, 17) Source(1, 25) + SourceIndex(0) +3 >Emitted(4, 16) Source(1, 19) + SourceIndex(0) +4 >Emitted(4, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) +6 >Emitted(4, 22) Source(1, 25) + SourceIndex(0) --- >>>exports.xx++; 1 > diff --git a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt.diff index 5e2fc5917..87d1e60bb 100644 --- a/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/unicodeEscapesInNames01(target=es5).sourcemap.txt.diff @@ -1,40 +1,6 @@ --- old.unicodeEscapesInNames01(target=es5).sourcemap.txt +++ new.unicodeEscapesInNames01(target=es5).sourcemap.txt -@@= skipped -10, +10 lines =@@ - >>>"use strict"; - >>>Object.defineProperty(exports, "__esModule", { value: true }); - >>>exports.x = void 0; -->>>exports.\u0078 = 10; -+>>>exports.x = 10; - 1 > - 2 >^^^^^^^^ --3 > ^^^^^^ --4 > ^^^ --5 > ^^ --6 > ^ -+3 > ^ -+4 > ^^^ -+5 > ^^ -+6 > ^ - 1 >export let - 2 > - 3 > \u0078 --4 > = --5 > 10 --6 > ; -+4 > = -+5 > 10 -+6 > ; - 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) - 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) --3 >Emitted(4, 15) Source(1, 18) + SourceIndex(0) --4 >Emitted(4, 18) Source(1, 21) + SourceIndex(0) --5 >Emitted(4, 20) Source(1, 23) + SourceIndex(0) --6 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) -+3 >Emitted(4, 10) Source(1, 18) + SourceIndex(0) -+4 >Emitted(4, 13) Source(1, 21) + SourceIndex(0) -+5 >Emitted(4, 15) Source(1, 23) + SourceIndex(0) -+6 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) +@@= skipped -32, +32 lines =@@ --- >>>exports.x++; 1 > @@ -68,40 +34,6 @@ >>>//# sourceMappingURL=identifierVariableWithEscape1.js.map=================================================================== JsFile: identifierVariableWithEscape2.js @@= skipped -49, +52 lines =@@ - >>>"use strict"; - >>>Object.defineProperty(exports, "__esModule", { value: true }); - >>>exports.xx = void 0; -->>>exports.x\u0078 = 10; -+>>>exports.xx = 10; - 1 > - 2 >^^^^^^^^ --3 > ^^^^^^^ --4 > ^^^ --5 > ^^ --6 > ^ -+3 > ^^ -+4 > ^^^ -+5 > ^^ -+6 > ^ - 1 >export let - 2 > - 3 > x\u0078 --4 > = --5 > 10 --6 > ; -+4 > = -+5 > 10 -+6 > ; - 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) - 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) --3 >Emitted(4, 16) Source(1, 19) + SourceIndex(0) --4 >Emitted(4, 19) Source(1, 22) + SourceIndex(0) --5 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) --6 >Emitted(4, 22) Source(1, 25) + SourceIndex(0) -+3 >Emitted(4, 11) Source(1, 19) + SourceIndex(0) -+4 >Emitted(4, 14) Source(1, 22) + SourceIndex(0) -+5 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) -+6 >Emitted(4, 17) Source(1, 25) + SourceIndex(0) --- >>>exports.xx++; 1 > @@ -135,40 +67,6 @@ >>>//# sourceMappingURL=identifierVariableWithEscape2.js.map=================================================================== JsFile: identifierVariableWithExtendedEscape1.js @@= skipped -49, +52 lines =@@ - >>>"use strict"; - >>>Object.defineProperty(exports, "__esModule", { value: true }); - >>>exports.x = void 0; -->>>exports.\u{78} = 10; -+>>>exports.x = 10; - 1 > - 2 >^^^^^^^^ --3 > ^^^^^^ --4 > ^^^ --5 > ^^ --6 > ^ -+3 > ^ -+4 > ^^^ -+5 > ^^ -+6 > ^ - 1 >export let - 2 > - 3 > \u{78} --4 > = --5 > 10 --6 > ; -+4 > = -+5 > 10 -+6 > ; - 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) - 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) --3 >Emitted(4, 15) Source(1, 18) + SourceIndex(0) --4 >Emitted(4, 18) Source(1, 21) + SourceIndex(0) --5 >Emitted(4, 20) Source(1, 23) + SourceIndex(0) --6 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) -+3 >Emitted(4, 10) Source(1, 18) + SourceIndex(0) -+4 >Emitted(4, 13) Source(1, 21) + SourceIndex(0) -+5 >Emitted(4, 15) Source(1, 23) + SourceIndex(0) -+6 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) --- >>>exports.x++; 1 > @@ -202,40 +100,6 @@ >>>//# sourceMappingURL=identifierVariableWithExtendedEscape1.js.map=================================================================== JsFile: identifierVariableWithExtendedEscape2.js @@= skipped -49, +52 lines =@@ - >>>"use strict"; - >>>Object.defineProperty(exports, "__esModule", { value: true }); - >>>exports.xx = void 0; -->>>exports.x\u{78} = 10; -+>>>exports.xx = 10; - 1 > - 2 >^^^^^^^^ --3 > ^^^^^^^ --4 > ^^^ --5 > ^^ --6 > ^ -+3 > ^^ -+4 > ^^^ -+5 > ^^ -+6 > ^ - 1 >export let - 2 > - 3 > x\u{78} --4 > = --5 > 10 --6 > ; -+4 > = -+5 > 10 -+6 > ; - 1 >Emitted(4, 1) Source(1, 12) + SourceIndex(0) - 2 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) --3 >Emitted(4, 16) Source(1, 19) + SourceIndex(0) --4 >Emitted(4, 19) Source(1, 22) + SourceIndex(0) --5 >Emitted(4, 21) Source(1, 24) + SourceIndex(0) --6 >Emitted(4, 22) Source(1, 25) + SourceIndex(0) -+3 >Emitted(4, 11) Source(1, 19) + SourceIndex(0) -+4 >Emitted(4, 14) Source(1, 22) + SourceIndex(0) -+5 >Emitted(4, 16) Source(1, 24) + SourceIndex(0) -+6 >Emitted(4, 17) Source(1, 25) + SourceIndex(0) --- >>>exports.xx++; 1 > @@ -268,7 +132,7 @@ --- >>>//# sourceMappingURL=identifierVariableWithExtendedEscape2.js.map=================================================================== JsFile: IdentifierNameWithEscape1.js -@@= skipped -51, +54 lines =@@ +@@= skipped -29, +32 lines =@@ >>>exports.IdentifierNameWithEscape1 = void 0; >>>class IdentifierNameWithEscape1 { 1 > diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js index ddc350515..1d7da5610 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js +++ b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js @@ -20,4 +20,5 @@ var M; M.A = A; new A; })(M || (M = {})); +var myA = M.A; new myA; diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js.diff b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js.diff deleted file mode 100644 index 00f41cf05..000000000 --- a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.classAbstractImportInstantiation.js -+++ new.classAbstractImportInstantiation.js -@@= skipped -19, +19 lines =@@ - M.A = A; - new A; - })(M || (M = {})); --var myA = M.A; - new myA; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js b/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js index 822167912..d9ceca5c1 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js @@ -53,6 +53,8 @@ var E; var M; (function (M) { })(M || (exports.M = M = {})); +var a = M.x; +exports.a = a; //// [t2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js.diff b/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js.diff index 1e67688ee..821becd32 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js.diff +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports1-es6.js.diff @@ -1,12 +1,6 @@ --- old.exportsAndImports1-es6.js +++ new.exportsAndImports1-es6.js -@@= skipped -52, +52 lines =@@ - var M; - (function (M) { - })(M || (exports.M = M = {})); --var a = M.x; --exports.a = a; - //// [t2.js] +@@= skipped -58, +58 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = exports.M = exports.E = exports.C = exports.f = exports.v = void 0; diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js b/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js index 0541b6f05..16869084a 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js @@ -53,6 +53,8 @@ var E; var M; (function (M) { })(M || (exports.M = M = {})); +var a = M.x; +exports.a = a; //// [t2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js.diff b/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js.diff index df765a46a..b6316c931 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js.diff +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports1.js.diff @@ -1,12 +1,6 @@ --- old.exportsAndImports1.js +++ new.exportsAndImports1.js -@@= skipped -52, +52 lines =@@ - var M; - (function (M) { - })(M || (exports.M = M = {})); --var a = M.x; --exports.a = a; - //// [t2.js] +@@= skipped -58, +58 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = exports.M = exports.E = exports.C = exports.f = exports.v = void 0; diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js b/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js index 7dcf7b6fe..4eacdc98e 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js @@ -36,10 +36,10 @@ export { v, f, C, I, E, D, M, N, T, a }; //// [t1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.M = exports.E = exports.C = exports.v = void 0; +exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.a = exports.M = exports.E = exports.C = exports.v = void 0; exports.f = f; exports.f1 = f; -exports.v1 = exports.v = 1; +exports.v = 1; exports.v1 = exports.v; function f() { } class C { @@ -55,6 +55,8 @@ var E; var M; (function (M) { })(M || (exports.M1 = exports.M = M = {})); +exports.a = M.x; +exports.a1 = exports.a; //// [t2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js.diff b/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js.diff index 9c579adee..deb208857 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js.diff +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports3-es6.js.diff @@ -1,25 +1,6 @@ --- old.exportsAndImports3-es6.js +++ new.exportsAndImports3-es6.js -@@= skipped -35, +35 lines =@@ - //// [t1.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.a = exports.M = exports.E = exports.C = exports.v = void 0; -+exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.M = exports.E = exports.C = exports.v = void 0; - exports.f = f; - exports.f1 = f; --exports.v = 1; -+exports.v1 = exports.v = 1; - exports.v1 = exports.v; - function f() { } - class C { -@@= skipped -19, +19 lines =@@ - var M; - (function (M) { - })(M || (exports.M1 = exports.M = M = {})); --exports.a = M.x; --exports.a1 = exports.a; - //// [t2.js] +@@= skipped -60, +60 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = exports.M = exports.E = exports.C = exports.f = exports.v = void 0; diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js b/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js index e60d57877..ef5aed09c 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js @@ -36,10 +36,10 @@ export { v, f, C, I, E, D, M, N, T, a }; //// [t1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.M = exports.E = exports.C = exports.v = void 0; +exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.a = exports.M = exports.E = exports.C = exports.v = void 0; exports.f = f; exports.f1 = f; -exports.v1 = exports.v = 1; +exports.v = 1; exports.v1 = exports.v; function f() { } class C { @@ -55,6 +55,8 @@ var E; var M; (function (M) { })(M || (exports.M1 = exports.M = M = {})); +exports.a = M.x; +exports.a1 = exports.a; //// [t2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js.diff b/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js.diff index 47306e74b..94f6dcd18 100644 --- a/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js.diff +++ b/testdata/baselines/reference/submodule/conformance/exportsAndImports3.js.diff @@ -1,25 +1,6 @@ --- old.exportsAndImports3.js +++ new.exportsAndImports3.js -@@= skipped -35, +35 lines =@@ - //// [t1.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.a = exports.M = exports.E = exports.C = exports.v = void 0; -+exports.a1 = exports.M1 = exports.E1 = exports.C1 = exports.v1 = exports.M = exports.E = exports.C = exports.v = void 0; - exports.f = f; - exports.f1 = f; --exports.v = 1; -+exports.v1 = exports.v = 1; - exports.v1 = exports.v; - function f() { } - class C { -@@= skipped -19, +19 lines =@@ - var M; - (function (M) { - })(M || (exports.M1 = exports.M = M = {})); --exports.a = M.x; --exports.a1 = exports.a; - //// [t2.js] +@@= skipped -60, +60 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = exports.M = exports.E = exports.C = exports.f = exports.v = void 0; diff --git a/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js b/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js index 29484f769..92836ad63 100644 --- a/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js +++ b/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js @@ -61,6 +61,7 @@ var moduleA; } moduleA.Point = Point; })(moduleA || (moduleA = {})); +var alias = moduleA; var p; var p; var p; @@ -70,6 +71,7 @@ class clodule { (function (clodule) { var Point = { x: 0, y: 0 }; })(clodule || (clodule = {})); +var clolias = clodule; var p; var p; var p; @@ -79,6 +81,7 @@ function fundule() { (function (fundule) { var Point = { x: 0, y: 0 }; })(fundule || (fundule = {})); +var funlias = fundule; var p; var p; var p; diff --git a/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js.diff b/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js.diff index 62c5dff1a..9ecce9062 100644 --- a/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js.diff +++ b/testdata/baselines/reference/submodule/conformance/importAliasIdentifiers.js.diff @@ -9,29 +9,11 @@ constructor(x, y) { this.x = x; this.y = y; -@@= skipped -7, +9 lines =@@ - } - moduleA.Point = Point; - })(moduleA || (moduleA = {})); --var alias = moduleA; - var p; +@@= skipped -12, +14 lines =@@ var p; var p; class clodule { + name; } (function (clodule) { - var Point = { x: 0, y: 0 }; - })(clodule || (clodule = {})); --var clolias = clodule; - var p; - var p; - var p; -@@= skipped -19, +18 lines =@@ - (function (fundule) { - var Point = { x: 0, y: 0 }; - })(fundule || (fundule = {})); --var funlias = fundule; - var p; - var p; - var p; \ No newline at end of file + var Point = { x: 0, y: 0 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/importEquals3.js b/testdata/baselines/reference/submodule/conformance/importEquals3.js index 2ade6b267..730b313ba 100644 --- a/testdata/baselines/reference/submodule/conformance/importEquals3.js +++ b/testdata/baselines/reference/submodule/conformance/importEquals3.js @@ -31,6 +31,8 @@ exports.A = A; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = exports.A = void 0; +var A = a.A; // Error +exports.A = A; const x = 0; exports.x = x; //// [c.js] @@ -70,4 +72,5 @@ var __importStar = (this && this.__importStar) || (function () { })(); Object.defineProperty(exports, "__esModule", { value: true }); const b = __importStar(require("./b")); +var x = b.x; console.log(x); diff --git a/testdata/baselines/reference/submodule/conformance/importEquals3.js.diff b/testdata/baselines/reference/submodule/conformance/importEquals3.js.diff deleted file mode 100644 index b1a31fe25..000000000 --- a/testdata/baselines/reference/submodule/conformance/importEquals3.js.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.importEquals3.js -+++ new.importEquals3.js -@@= skipped -30, +30 lines =@@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.x = exports.A = void 0; --var A = a.A; // Error --exports.A = A; - const x = 0; - exports.x = x; - //// [c.js] -@@= skipped -41, +39 lines =@@ - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - const b = __importStar(require("./b")); --var x = b.x; - console.log(x); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js b/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js index 98455572c..4f5add96e 100644 --- a/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js +++ b/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js @@ -29,11 +29,15 @@ import i = I; //// [invalidImportAliasIdentifiers.js] // none of these should work, since non are actually modules var V = 12; +var v = V; class C { name; } +var c = C; var E; (function (E) { E[E["Red"] = 0] = "Red"; E[E["Blue"] = 1] = "Blue"; })(E || (E = {})); +var e = E; +var i = I; diff --git a/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js.diff b/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js.diff index e791c378d..fcc5c5399 100644 --- a/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js.diff +++ b/testdata/baselines/reference/submodule/conformance/invalidImportAliasIdentifiers.js.diff @@ -1,18 +1,10 @@ --- old.invalidImportAliasIdentifiers.js +++ new.invalidImportAliasIdentifiers.js -@@= skipped -28, +28 lines =@@ - //// [invalidImportAliasIdentifiers.js] - // none of these should work, since non are actually modules +@@= skipped -30, +30 lines =@@ var V = 12; --var v = V; + var v = V; class C { + name; } --var c = C; - var E; - (function (E) { - E[E["Red"] = 0] = "Red"; - E[E["Blue"] = 1] = "Blue"; - })(E || (E = {})); --var e = E; --var i = I; \ No newline at end of file + var c = C; + var E; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parser519458.js b/testdata/baselines/reference/submodule/conformance/parser519458.js index 4b936b916..294cb8c5c 100644 --- a/testdata/baselines/reference/submodule/conformance/parser519458.js +++ b/testdata/baselines/reference/submodule/conformance/parser519458.js @@ -5,5 +5,6 @@ import rect = module("rect"); var bar = new rect.Rect(); //// [parser519458.js] +var rect = module; ("rect"); var bar = new rect.Rect(); diff --git a/testdata/baselines/reference/submodule/conformance/parser519458.js.diff b/testdata/baselines/reference/submodule/conformance/parser519458.js.diff deleted file mode 100644 index be617b782..000000000 --- a/testdata/baselines/reference/submodule/conformance/parser519458.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.parser519458.js -+++ new.parser519458.js -@@= skipped -4, +4 lines =@@ - - - //// [parser519458.js] --var rect = module; - ("rect"); - var bar = new rect.Rect(); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js b/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js index 850c8fea6..e4049e6e4 100644 --- a/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js +++ b/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js @@ -4,3 +4,4 @@ import TypeScript = TypeScriptServices.TypeScript; //// [parserImportDeclaration1.js] +var TypeScript = TypeScriptServices.TypeScript; diff --git a/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js.diff b/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js.diff deleted file mode 100644 index 53108558f..000000000 --- a/testdata/baselines/reference/submodule/conformance/parserImportDeclaration1.js.diff +++ /dev/null @@ -1,7 +0,0 @@ ---- old.parserImportDeclaration1.js -+++ new.parserImportDeclaration1.js -@@= skipped -3, +3 lines =@@ - import TypeScript = TypeScriptServices.TypeScript; - - //// [parserImportDeclaration1.js] --var TypeScript = TypeScriptServices.TypeScript; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js b/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js index bfd7e770c..96cd02fc1 100644 --- a/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js +++ b/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js @@ -25,4 +25,6 @@ const test2 = mod2; // Possible false positive instantiation, but ok //// [reExportAliasMakesInstantiated.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.test1 = void 0; +exports.test1 = pack2.test1; const test2 = mod2; // Possible false positive instantiation, but ok diff --git a/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js.diff b/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js.diff deleted file mode 100644 index 8edac4860..000000000 --- a/testdata/baselines/reference/submodule/conformance/reExportAliasMakesInstantiated.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.reExportAliasMakesInstantiated.js -+++ new.reExportAliasMakesInstantiated.js -@@= skipped -24, +24 lines =@@ - //// [reExportAliasMakesInstantiated.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.test1 = void 0; --exports.test1 = pack2.test1; - const test2 = mod2; // Possible false positive instantiation, but ok \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js b/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js index 66470463d..dbd642df9 100644 --- a/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js +++ b/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js @@ -4,3 +4,4 @@ import TypeScript = TypeScriptServices.TypeScript; //// [scannerImportDeclaration1.js] +var TypeScript = TypeScriptServices.TypeScript; diff --git a/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js.diff b/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js.diff deleted file mode 100644 index 35e56c19a..000000000 --- a/testdata/baselines/reference/submodule/conformance/scannerImportDeclaration1.js.diff +++ /dev/null @@ -1,7 +0,0 @@ ---- old.scannerImportDeclaration1.js -+++ new.scannerImportDeclaration1.js -@@= skipped -3, +3 lines =@@ - import TypeScript = TypeScriptServices.TypeScript; - - //// [scannerImportDeclaration1.js] --var TypeScript = TypeScriptServices.TypeScript; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js b/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js index fc50a609c..1911b7826 100644 --- a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js +++ b/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js @@ -8,3 +8,5 @@ import await = foo.await; //// [topLevelAwait.2.js] +// await allowed in import=namespace when not a module +var await = foo.await; diff --git a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js.diff b/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js.diff deleted file mode 100644 index 8347736b3..000000000 --- a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=es2022).js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.topLevelAwait.2(module=es2022).js -+++ new.topLevelAwait.2(module=es2022).js -@@= skipped -7, +7 lines =@@ - - - //// [topLevelAwait.2.js] --// await allowed in import=namespace when not a module --var await = foo.await; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js b/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js index fc50a609c..1911b7826 100644 --- a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js +++ b/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js @@ -8,3 +8,5 @@ import await = foo.await; //// [topLevelAwait.2.js] +// await allowed in import=namespace when not a module +var await = foo.await; diff --git a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js.diff b/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js.diff deleted file mode 100644 index 4c9e1514f..000000000 --- a/testdata/baselines/reference/submodule/conformance/topLevelAwait.2(module=esnext).js.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.topLevelAwait.2(module=esnext).js -+++ new.topLevelAwait.2(module=esnext).js -@@= skipped -7, +7 lines =@@ - - - //// [topLevelAwait.2.js] --// await allowed in import=namespace when not a module --var await = foo.await; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js b/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js index 8e1e0687a..182714041 100644 --- a/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js +++ b/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js @@ -56,7 +56,7 @@ export var r13: typeof foo; //// [typeofAnExportedType.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.r13 = exports.r12 = exports.r11 = exports.r10 = exports.E = exports.r9 = exports.r8 = exports.r7 = exports.r6 = exports.M = exports.r5 = exports.i = exports.r4b = exports.r4 = exports.r3 = exports.c = exports.C = exports.r2 = exports.y = exports.r1 = exports.x = void 0; +exports.r13 = exports.r12 = exports.r11 = exports.r10 = exports.E = exports.r9 = exports.r8 = exports.Z = exports.r7 = exports.r6 = exports.M = exports.r5 = exports.i = exports.r4b = exports.r4 = exports.r3 = exports.c = exports.C = exports.r2 = exports.y = exports.r1 = exports.x = void 0; exports.foo = foo; exports.x = 1; exports.y = { foo: '' }; @@ -74,6 +74,7 @@ var M; } M.C = C; })(M || (exports.M = M = {})); +exports.Z = M; var E; (function (E) { E[E["A"] = 0] = "A"; diff --git a/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js.diff b/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js.diff index 73a5210d6..44a249f58 100644 --- a/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js.diff +++ b/testdata/baselines/reference/submodule/conformance/typeofAnExportedType.js.diff @@ -1,12 +1,6 @@ --- old.typeofAnExportedType.js +++ new.typeofAnExportedType.js -@@= skipped -55, +55 lines =@@ - //// [typeofAnExportedType.js] - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.r13 = exports.r12 = exports.r11 = exports.r10 = exports.E = exports.r9 = exports.r8 = exports.Z = exports.r7 = exports.r6 = exports.M = exports.r5 = exports.i = exports.r4b = exports.r4 = exports.r3 = exports.c = exports.C = exports.r2 = exports.y = exports.r1 = exports.x = void 0; -+exports.r13 = exports.r12 = exports.r11 = exports.r10 = exports.E = exports.r9 = exports.r8 = exports.r7 = exports.r6 = exports.M = exports.r5 = exports.i = exports.r4b = exports.r4 = exports.r3 = exports.c = exports.C = exports.r2 = exports.y = exports.r1 = exports.x = void 0; - exports.foo = foo; +@@= skipped -60, +60 lines =@@ exports.x = 1; exports.y = { foo: '' }; class C { @@ -14,7 +8,7 @@ } exports.C = C; var c2; -@@= skipped -13, +14 lines =@@ +@@= skipped -8, +9 lines =@@ (function (M) { M.foo = ''; class C { @@ -22,11 +16,7 @@ } M.C = C; })(M || (exports.M = M = {})); --exports.Z = M; - var E; - (function (E) { - E[E["A"] = 0] = "A"; -@@= skipped -12, +12 lines =@@ +@@= skipped -12, +13 lines =@@ (function (foo) { foo.y = 1; class C { diff --git a/testdata/tests/cases/compiler/exportDestructuring.ts b/testdata/tests/cases/compiler/exportDestructuring.ts new file mode 100644 index 000000000..ec1430462 --- /dev/null +++ b/testdata/tests/cases/compiler/exportDestructuring.ts @@ -0,0 +1,6 @@ +// @target: esnext +// @module: commonjs +// @strict: true + +const arr = [1, 2]; +export const [a, b] = arr;