From 53d3e92351303b6c82c7291db59fbb3b38d3d923 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 19 Apr 2016 17:45:22 -0700 Subject: [PATCH] Fixes various source map emit issues --- src/compiler/printer.ts | 79 ++++++++++++++++--- src/compiler/transformers/ts.ts | 15 +++- src/compiler/types.ts | 24 ++++-- tests/baselines/reference/ES5For-of8.js.map | 2 +- .../reference/ES5For-of8.sourcemap.txt | 10 +-- ...computedPropertyNamesSourceMap1_ES6.js.map | 2 +- ...dPropertyNamesSourceMap1_ES6.sourcemap.txt | 10 +-- .../reference/es6-sourcemap-amd.js.map | 2 +- .../reference/es6-sourcemap-amd.sourcemap.txt | 10 +-- .../recursiveClassReferenceTest.js.map | 2 +- .../recursiveClassReferenceTest.sourcemap.txt | 30 +++++-- .../sourceMap-FileWithComments.js.map | 2 +- .../sourceMap-FileWithComments.sourcemap.txt | 5 +- .../sourceMapValidationClasses.js.map | 2 +- .../sourceMapValidationClasses.sourcemap.txt | 50 ++++++------ 15 files changed, 155 insertions(+), 90 deletions(-) diff --git a/src/compiler/printer.ts b/src/compiler/printer.ts index d39955e6968..2f80d2ffceb 100644 --- a/src/compiler/printer.ts +++ b/src/compiler/printer.ts @@ -257,6 +257,26 @@ const _super = (function (geti, seti) { emitNodeWithNotificationOption(node, emitWithoutNotificationOption); } + /** + * Emits a node with specialized emit flags. + */ + // TODO(rbuckton): This should be removed once source maps are aligned with the old + // emitter and new baselines are taken. This exists solely to + // align with the old emitter. + function emitSpecialized(node: Node, flags: NodeEmitFlags) { + if (node) { + const flagsToAdd = flags & ~getNodeEmitFlags(node); + if (flagsToAdd) { + setNodeEmitFlags(node, flagsToAdd); + emit(node); + setNodeEmitFlags(node, getNodeEmitFlags(node) & ~flagsToAdd); + return; + } + + emit(node); + } + } + /** * Emits a node without calling onEmitNode. * NOTE: Do not call this method directly. @@ -299,9 +319,9 @@ const _super = (function (geti, seti) { const leadingComments = getLeadingComments(node, shouldSkipLeadingCommentsForNode); const trailingComments = getTrailingComments(node, shouldSkipTrailingCommentsForNode); emitLeadingComments(node, leadingComments); - emitStart(node, shouldSkipSourceMapForNode, shouldSkipSourceMapForChildren); + emitStart(node, shouldSkipLeadingSourceMapForNode, shouldSkipSourceMapForChildren); emitWorker(node); - emitEnd(node, shouldSkipSourceMapForNode, shouldSkipSourceMapForChildren); + emitEnd(node, shouldSkipTrailingSourceMapForNode, shouldSkipSourceMapForChildren); emitTrailingComments(node, trailingComments); } } @@ -333,16 +353,30 @@ const _super = (function (geti, seti) { } /** - * Determines whether to skip source map emit for a node. + * Determines whether to skip source map emit for the start position of a node. * * We do not emit source maps for NotEmittedStatement nodes or any node that - * has NodeEmitFlags.NoSourceMap. + * has NodeEmitFlags.NoLeadingSourceMap. * * @param node A Node. */ - function shouldSkipSourceMapForNode(node: Node) { + function shouldSkipLeadingSourceMapForNode(node: Node) { return isNotEmittedStatement(node) - || (getNodeEmitFlags(node) & NodeEmitFlags.NoSourceMap) !== 0; + || (getNodeEmitFlags(node) & NodeEmitFlags.NoLeadingSourceMap) !== 0; + } + + + /** + * Determines whether to skip source map emit for the end position of a node. + * + * We do not emit source maps for NotEmittedStatement nodes or any node that + * has NodeEmitFlags.NoTrailingSourceMap. + * + * @param node A Node. + */ + function shouldSkipTrailingSourceMapForNode(node: Node) { + return isNotEmittedStatement(node) + || (getNodeEmitFlags(node) & NodeEmitFlags.NoTrailingSourceMap) !== 0; } /** @@ -1448,7 +1482,7 @@ const _super = (function (geti, seti) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); write(node.asteriskToken ? "function* " : "function "); - emit(node.name); + emitSpecialized(node.name, NodeEmitFlags.NoSourceMap); emitSignatureAndBody(node, emitSignatureHead); } @@ -1530,7 +1564,16 @@ const _super = (function (geti, seti) { } function emitBlockFunctionBodyAndEndLexicalEnvironment(parentNode: Node, body: Block) { - write(" {"); + // TODO(rbuckton): This should be removed once source maps are aligned with the old + // emitter and new baselines are taken. This exists solely to + // align with the old emitter. + if (getNodeEmitFlags(body) & NodeEmitFlags.SourceMapEmitOpenBraceAsToken) { + write(" "); + writeToken(SyntaxKind.OpenBraceToken, body.pos); + } + else { + write(" {"); + } const startingLine = writer.getLine(); increaseIndent(); @@ -1564,7 +1607,7 @@ const _super = (function (geti, seti) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); write("class"); - emitWithPrefix(" ", node.name); + emitSpecializedWithPrefix(" ", node.name, NodeEmitFlags.NoSourceMap); const indentedFlag = getNodeEmitFlags(node) & NodeEmitFlags.Indented; if (indentedFlag) { @@ -1663,9 +1706,9 @@ const _super = (function (geti, seti) { } function emitCaseBlock(node: CaseBlock) { - write("{"); + writeToken(SyntaxKind.OpenBraceToken, node.pos); emitList(node, node.clauses, ListFormat.CaseBlockClauses); - write("}"); + writeToken(SyntaxKind.CloseBraceToken, node.clauses.end); } function emitImportEqualsDeclaration(node: ImportEqualsDeclaration) { @@ -2106,6 +2149,16 @@ const _super = (function (geti, seti) { emitNodeWithPrefix(prefix, node, emit); } + // TODO(rbuckton): This should be removed once source maps are aligned with the old + // emitter and new baselines are taken. This exists solely to + // align with the old emitter. + function emitSpecializedWithPrefix(prefix: string, node: Node, flags: NodeEmitFlags) { + if (node) { + write(prefix); + emitSpecialized(node, flags); + } + } + function emitExpressionWithPrefix(prefix: string, node: Node) { emitNodeWithPrefix(prefix, node, emitExpression); } @@ -2352,9 +2405,9 @@ const _super = (function (geti, seti) { function writeTokenNode(node: Node) { if (node) { - emitStart(node, shouldSkipSourceMapForNode, shouldSkipSourceMapForChildren); + emitStart(node, shouldSkipLeadingSourceMapForNode, shouldSkipSourceMapForChildren); writeTokenText(node.kind); - emitEnd(node, shouldSkipSourceMapForNode, shouldSkipSourceMapForChildren); + emitEnd(node, shouldSkipTrailingSourceMapForNode, shouldSkipSourceMapForChildren); } } diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 80f07a4782b..913d0ed8436 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -465,7 +465,9 @@ namespace ts { // From ES6 specification: // HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using // a lexical declaration such as a LexicalDeclaration or a ClassDeclaration. - addInitializedPropertyStatements(statements, node, staticProperties, name); + if (staticProperties.length) { + addInitializedPropertyStatements(statements, node, staticProperties, getLocalName(node, /*noSourceMaps*/ true)); + } // Write any decorators of the node. addClassElementDecorationStatements(statements, node, /*isStatic*/ false); @@ -2541,7 +2543,7 @@ namespace ts { currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; - return createBlock( + const block = createBlock( createNodeArray( statements, /*location*/ statementsLocation @@ -2549,6 +2551,15 @@ namespace ts { /*location*/ blockLocation, /*multiLine*/ true ); + + // TODO(rbuckton): This should be removed once source maps are aligned with the old + // emitter and new baselines are taken. This exists solely to + // align with the old emitter. + if (body.kind === SyntaxKind.ModuleBlock) { + setNodeEmitFlags(block, NodeEmitFlags.SourceMapEmitOpenBraceAsToken); + } + + return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration: ModuleDeclaration): ModuleDeclaration { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index bbbe92df036..8852b49379c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2873,15 +2873,23 @@ namespace ts { AdviseOnEmitNode = 1 << 7, // The printer should invoke the onEmitNode callback when printing this node. NoSubstitution = 1 << 8, // Disables further substitution of an expression. CapturesThis = 1 << 9, // The function captures a lexical `this` - NoSourceMap = 1 << 10, // Do not emit a source map location for this node. - NoNestedSourceMaps = 1 << 11, // Do not emit source map locations for children of this node. - NoTokenSourceMaps = 1 << 12, // Do not emit source map locations for tokens of this node. - NoLeadingComments = 1 << 13, // Do not emit leading comments for this node. - NoTrailingComments = 1 << 14, // Do not emit trailing comments for this node. + NoLeadingSourceMap = 1 << 10, // Do not emit a leading source map location for this node. + NoTrailingSourceMap = 1 << 11, // Do not emit a trailing source map location for this node. + NoSourceMap = NoLeadingSourceMap | NoTrailingSourceMap, // Do not emit a source map location for this node. + NoNestedSourceMaps = 1 << 12, // Do not emit source map locations for children of this node. + NoTokenSourceMaps = 1 << 13, // Do not emit source map locations for tokens of this node. + NoLeadingComments = 1 << 14, // Do not emit leading comments for this node. + NoTrailingComments = 1 << 15, // Do not emit trailing comments for this node. NoComments = NoLeadingComments | NoTrailingComments, // Do not emit comments for this node. - ExportName = 1 << 15, // Ensure an export prefix is added for an identifier that points to an exported declaration with a local name (see SymbolFlags.ExportHasLocal). - LocalName = 1 << 16, // Ensure an export prefix is not added for an identifier that points to an exported declaration. - Indented = 1 << 17, // Adds an explicit extra indentation level for class and function bodies when printing (used to match old emitter). + ExportName = 1 << 16, // Ensure an export prefix is added for an identifier that points to an exported declaration with a local name (see SymbolFlags.ExportHasLocal). + LocalName = 1 << 17, // Ensure an export prefix is not added for an identifier that points to an exported declaration. + Indented = 1 << 18, // Adds an explicit extra indentation level for class and function bodies when printing (used to match old emitter). + + // SourceMap Specialization. + // TODO(rbuckton): This should be removed once source maps are aligned with the old + // emitter and new baselines are taken. This exists solely to + // align with the old emitter. + SourceMapEmitOpenBraceAsToken = 1 << 19, } /** Additional context provided to `visitEachChild` */ diff --git a/tests/baselines/reference/ES5For-of8.js.map b/tests/baselines/reference/ES5For-of8.js.map index 575c8f47680..1f6cf096412 100644 --- a/tests/baselines/reference/ES5For-of8.js.map +++ b/tests/baselines/reference/ES5For-of8.js.map @@ -1,2 +1,2 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA,SAAS,GAAG;IACR,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAA1B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAA1B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.sourcemap.txt b/tests/baselines/reference/ES5For-of8.sourcemap.txt index 5ba96a867dd..1a58d5f107b 100644 --- a/tests/baselines/reference/ES5For-of8.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8.sourcemap.txt @@ -10,15 +10,9 @@ sourceFile:ES5For-of8.ts ------------------------------------------------------------------- >>>function foo() { 1 > -2 >^^^^^^^^^ -3 > ^^^ -4 > ^^^^^^^^^-> +2 >^^^^^^^^^^^^^^^^^^^^^-> 1 > -2 >function -3 > foo 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -3 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) --- >>> return { x: 0 }; 1->^^^^ @@ -30,7 +24,7 @@ sourceFile:ES5For-of8.ts 7 > ^ 8 > ^^ 9 > ^ -1->() { +1->function foo() { > 2 > return 3 > diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map index 875fe1622ba..8f7eed4fa9b 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC;IACH,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IACb,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IACb,CAAC;CACJ"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt index afcafcb91a3..56fa39ceaac 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt @@ -10,15 +10,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts ------------------------------------------------------------------- >>>class C { 1 > -2 >^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^-> +2 >^^^^^^^^^^^^^^^^^^-> 1 > -2 >class -3 > C 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(1, 8) + SourceIndex(0) --- >>> ["hello"]() { 1->^^^^ @@ -26,7 +20,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 3 > ^^^^^^^ 4 > ^ 5 > ^^^^^-> -1-> { +1->class C { > 2 > [ 3 > "hello" diff --git a/tests/baselines/reference/es6-sourcemap-amd.js.map b/tests/baselines/reference/es6-sourcemap-amd.js.map index ef4319fadf6..d5229e3a28c 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.js.map +++ b/tests/baselines/reference/es6-sourcemap-amd.js.map @@ -1,2 +1,2 @@ //// [es6-sourcemap-amd.js.map] -{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":[],"mappings":"AACA,MAAM,CAAC;IAEH;IAGA,CAAC;IAEM,CAAC;QAEJ,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":[],"mappings":"AACA;IAEI;IAGA,CAAC;IAEM,CAAC;QAEJ,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;CACJ"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt b/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt index b99b41b4e97..a01507e964b 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt +++ b/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt @@ -10,21 +10,15 @@ sourceFile:es6-sourcemap-amd.ts ------------------------------------------------------------------- >>>class A { 1 > -2 >^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^-> +2 >^^^^^^^^^^^^^^^^^^^^-> 1 > > -2 >class -3 > A 1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(2, 8) + SourceIndex(0) --- >>> constructor() { 1->^^^^ 2 > ^^-> -1-> +1->class A >{ > 1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 7e0b27b82b4..40f720effce 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js.map +++ b/tests/baselines/reference/recursiveClassReferenceTest.js.map @@ -1,2 +1,2 @@ //// [recursiveClassReferenceTest.js.map] -{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":[],"mappings":"AAAA,iEA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e,GAAtB;wBACC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 7e9da7dddf3..25dc6a1900d 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -198,18 +198,24 @@ sourceFile:recursiveClassReferenceTest.ts 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > 3 > Find +4 > +5 > { 1->Emitted(15, 13) Source(32, 29) + SourceIndex(0) 2 >Emitted(15, 24) Source(32, 29) + SourceIndex(0) 3 >Emitted(15, 28) Source(32, 33) + SourceIndex(0) +4 >Emitted(15, 30) Source(32, 34) + SourceIndex(0) +5 >Emitted(15, 31) Source(32, 35) + SourceIndex(0) --- >>> var StartFindAction = (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> { +1-> > 1->Emitted(16, 17) Source(33, 2) + SourceIndex(0) --- @@ -657,18 +663,24 @@ sourceFile:recursiveClassReferenceTest.ts 1->^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^ -4 > ^^^^^^^^^^^^^^^^^^-> +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^-> 1-> 2 > 3 > Widgets +4 > +5 > { 1->Emitted(35, 9) Source(44, 21) + SourceIndex(0) 2 >Emitted(35, 20) Source(44, 21) + SourceIndex(0) 3 >Emitted(35, 27) Source(44, 28) + SourceIndex(0) +4 >Emitted(35, 29) Source(44, 29) + SourceIndex(0) +5 >Emitted(35, 30) Source(44, 30) + SourceIndex(0) --- >>> var FindWidget = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> { +1-> > 1->Emitted(36, 13) Source(45, 2) + SourceIndex(0) --- @@ -1431,18 +1443,24 @@ sourceFile:recursiveClassReferenceTest.ts 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^^^ -4 > ^^^^^^^^^^^-> +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> 1-> 2 > 3 > PlainText +4 > +5 > { 1->Emitted(70, 13) Source(76, 31) + SourceIndex(0) 2 >Emitted(70, 24) Source(76, 31) + SourceIndex(0) 3 >Emitted(70, 33) Source(76, 40) + SourceIndex(0) +4 >Emitted(70, 35) Source(76, 41) + SourceIndex(0) +5 >Emitted(70, 36) Source(76, 42) + SourceIndex(0) --- >>> var State = (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> { +1-> > > 1->Emitted(71, 17) Source(78, 2) + SourceIndex(0) diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js.map b/tests/baselines/reference/sourceMap-FileWithComments.js.map index 80437501d33..0cffa405b40 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.js.map +++ b/tests/baselines/reference/sourceMap-FileWithComments.js.map @@ -1,2 +1,2 @@ //// [sourceMap-FileWithComments.js.map] -{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":[],"mappings":"AAMA,SAAS;AACT,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM,EAAC,CAAC;IAEX,QAAQ;IACR;QACI,cAAc;QACd,eAAmB,CAAS,EAAS,CAAS;YAA3B,MAAC,GAAD,CAAC,CAAQ;YAAS,MAAC,GAAD,CAAC,CAAQ;QAAI,CAAC;QAEnD,kBAAkB;QAClB,uBAAO,GAAP,cAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAItE,YAAC;IAAD,CAAC,AATD;IAOI,gBAAgB;IACT,YAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAClC;IATY,YAAK,QASjB,CAAA;IAED,+BAA+B;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX;IACA,CAAC;IADe,UAAG,MAClB,CAAA;IAED;;MAEE;IACF,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAED,qBAAqB;AACrB,IAAI,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":[],"mappings":"AAMA,SAAS;AACT,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM,EAAC,CAAC;IAEX,QAAQ;IACR;QACI,cAAc;QACd,eAAmB,CAAS,EAAS,CAAS;YAA3B,MAAC,GAAD,CAAC,CAAQ;YAAS,MAAC,GAAD,CAAC,CAAQ;QAAI,CAAC;QAEnD,kBAAkB;QAClB,uBAAO,GAAP,cAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAItE,YAAC;IAAD,CAAC,AATD;IAOI,gBAAgB;IACT,YAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IARvB,YAAK,QASjB,CAAA;IAED,+BAA+B;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX;IACA,CAAC;IADe,UAAG,MAClB,CAAA;IAED;;MAEE;IACF,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAED,qBAAqB;AACrB,IAAI,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt index 2abfabff566..922e8ae1b83 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt @@ -334,8 +334,7 @@ sourceFile:sourceMap-FileWithComments.ts 8 > , 9 > 0 10> ) -11> ; - > } +11> ; 1->Emitted(16, 5) Source(19, 16) + SourceIndex(0) 2 >Emitted(16, 17) Source(19, 22) + SourceIndex(0) 3 >Emitted(16, 20) Source(19, 25) + SourceIndex(0) @@ -346,7 +345,7 @@ sourceFile:sourceMap-FileWithComments.ts 8 >Emitted(16, 33) Source(19, 38) + SourceIndex(0) 9 >Emitted(16, 34) Source(19, 39) + SourceIndex(0) 10>Emitted(16, 35) Source(19, 40) + SourceIndex(0) -11>Emitted(16, 36) Source(20, 6) + SourceIndex(0) +11>Emitted(16, 36) Source(19, 41) + SourceIndex(0) --- >>> Shapes.Point = Point; 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map index 205d5d55b78..7492caee701 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js.map +++ b/tests/baselines/reference/sourceMapValidationClasses.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClasses.js.map] -{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG;QACV,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,SAAS,GAAG,CAAC,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,SAAS,IAAI,CAAC,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,UAA8C,EAA9C,qBAA8C,EAA9C,IAA8C;gBAA9C,sCAA8C;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAA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,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt index 4120aa91b12..b3412736762 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -123,20 +123,26 @@ sourceFile:sourceMapValidationClasses.ts 1->^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^ -4 > ^^^^-> +4 > ^^ +5 > ^ +6 > ^-> 1-> 2 > 3 > Bar +4 > +5 > { 1->Emitted(4, 5) Source(1, 12) + SourceIndex(0) 2 >Emitted(4, 16) Source(1, 12) + SourceIndex(0) 3 >Emitted(4, 19) Source(1, 15) + SourceIndex(0) +4 >Emitted(4, 21) Source(1, 16) + SourceIndex(0) +5 >Emitted(4, 22) Source(1, 17) + SourceIndex(0) --- >>> "use strict"; 1->^^^^^^^^ 2 > ^^^^^^^^^^^^ 3 > ^ 4 > ^^^^^^^^^^^^^^^^-> -1-> { +1-> > 2 > "use strict" 3 > ; @@ -285,24 +291,18 @@ sourceFile:sourceMapValidationClasses.ts --- >>> function foo(greeting) { 1->^^^^^^^^ -2 > ^^^^^^^^^ -3 > ^^^ -4 > ^ -5 > ^^^^^^^^ -6 > ^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^^^^^^^^^^^^^-> 1-> > > > -2 > function -3 > foo -4 > ( -5 > greeting: string +2 > function foo( +3 > greeting: string 1->Emitted(15, 9) Source(14, 5) + SourceIndex(0) -2 >Emitted(15, 18) Source(14, 14) + SourceIndex(0) -3 >Emitted(15, 21) Source(14, 17) + SourceIndex(0) -4 >Emitted(15, 22) Source(14, 18) + SourceIndex(0) -5 >Emitted(15, 30) Source(14, 34) + SourceIndex(0) +2 >Emitted(15, 22) Source(14, 18) + SourceIndex(0) +3 >Emitted(15, 30) Source(14, 34) + SourceIndex(0) --- >>> return new Greeter(greeting); 1->^^^^^^^^^^^^ @@ -410,23 +410,17 @@ sourceFile:sourceMapValidationClasses.ts --- >>> function foo2(greeting) { 1 >^^^^^^^^ -2 > ^^^^^^^^^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > > -2 > function -3 > foo2 -4 > ( -5 > greeting: string +2 > function foo2( +3 > greeting: string 1 >Emitted(20, 9) Source(21, 5) + SourceIndex(0) -2 >Emitted(20, 18) Source(21, 14) + SourceIndex(0) -3 >Emitted(20, 22) Source(21, 18) + SourceIndex(0) -4 >Emitted(20, 23) Source(21, 19) + SourceIndex(0) -5 >Emitted(20, 31) Source(21, 35) + SourceIndex(0) +2 >Emitted(20, 23) Source(21, 19) + SourceIndex(0) +3 >Emitted(20, 31) Source(21, 35) + SourceIndex(0) --- >>> var restGreetings /* more greeting */ = []; 1->^^^^^^^^^^^^