Merge pull request #18348 from ubershmekel/no-space-after-comment

Remove trailing space from emitLeadingComment
This commit is contained in:
Ron Buckton
2017-11-08 18:34:51 -08:00
committed by GitHub
31 changed files with 33 additions and 33 deletions
+2 -2
View File
@@ -260,7 +260,7 @@ namespace ts {
}
}
function emitLeadingComment(commentPos: number, commentEnd: number, _kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) {
function emitLeadingComment(commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) {
if (!hasWrittenComment) {
emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos);
hasWrittenComment = true;
@@ -274,7 +274,7 @@ namespace ts {
if (hasTrailingNewLine) {
writer.writeLine();
}
else {
else if (kind === SyntaxKind.MultiLineCommentTrivia) {
writer.write(" ");
}
}
@@ -24,7 +24,7 @@ var n: number;
//// [decls.js]
// Ambient external import declaration referencing ambient external module using top level module name
// Ambient external import declaration referencing ambient external module using top level module name
//// [consumer.js]
"use strict";
exports.__esModule = true;
@@ -87,4 +87,4 @@ function foo(x, y, z) {
// x = a;
// y = a;
// z = a;
//}
//}
@@ -46,4 +46,4 @@ var c5c = /** @class */ (function () {
c5c.prototype.foo = function () { };
return c5c;
}());
//import c5c = require('');
//import c5c = require('');
@@ -100,4 +100,4 @@ var e6b;
})(e6b || (e6b = {})); // should be error
// enum then import, messes with error reporting
//enum e7 { One }
//import e7 = require(''); // should be error
//import e7 = require(''); // should be error
@@ -41,4 +41,4 @@ var e2 = /** @class */ (function () {
return e2;
}());
//enum then enum - covered
//enum then import - covered
//enum then import - covered
@@ -79,4 +79,4 @@ function y5b() { }
function y5c() { }
// function then import, messes with other errors
//function y6() { }
//import y6 = require('');
//import y6 = require('');
@@ -48,4 +48,4 @@ var i3;
i3[i3["One"] = 0] = "One";
})(i3 || (i3 = {}));
; // error
//import i4 = require(''); // error
//import i4 = require(''); // error
@@ -18,4 +18,4 @@ var foo;
(function (foo) {
function bar() { }
})(foo || (foo = {}));
// test #4
// test #4
@@ -505,4 +505,4 @@ var r8b8 = b8 !== a8;
var r8b9 = b9 !== a9;
var r8b10 = b10 !== a10;
var r8b11 = b11 !== a11;
//var r8b12 = b12 !== a12;
//var r8b12 = b12 !== a12;
@@ -431,4 +431,4 @@ var r8b6 = b6 !== a6;
var r8b7 = b7 !== a7;
var r8b8 = b8 !== a8;
var r8b9 = b9 !== a9;
//var r8b10 = b10 !== a10;
//var r8b10 = b10 !== a10;
@@ -320,4 +320,4 @@ var r8b3 = b3 !== a3;
var r8b4 = b4 !== a4;
var r8b5 = b5 !== a5;
var r8b6 = b6 !== a6;
//var r8b7 = b7 !== a7;
//var r8b7 = b7 !== a7;
@@ -320,4 +320,4 @@ var r8b3 = b3 !== a3;
var r8b4 = b4 !== a4;
var r8b5 = b5 !== a5;
var r8b6 = b6 !== a6;
//var r8b7 = b7 !== a7;
//var r8b7 = b7 !== a7;
@@ -17,4 +17,4 @@ var Foo = /** @class */ (function () {
var baz = Foo.b;
// Foo.b won't bind.
baz.concat("y");
// So we don't want an error on 'concat'.
// So we don't want an error on 'concat'.
@@ -117,4 +117,4 @@ function foo(x, y, z) {
// a = x;
// a = y;
// a = z;
//}
//}
@@ -108,4 +108,4 @@ function foo2(x, y) {
//function foo2<T extends { (): void }, U extends T>(x: T, y: U) {
// foo(x);
// foo(y);
//}
//}
@@ -63,4 +63,4 @@ function other3(arg) {
// var d = r2[1];
// // BUG 821629
// //var u: U = r2[1]; // ok
//}
//}
@@ -64,4 +64,4 @@ function other3(arg) {
// var d: Date = r2['hm']; // ok
// // BUG 821629
// //var u: U = r2['hm']; // ok
//}
//}
@@ -268,4 +268,4 @@ function foo4(t, u) {
// var i = [u, base]; // Base[]
// var j = [u, derived]; // Derived[]
// var k: Base[] = [t, u];
//}
//}
@@ -54,4 +54,4 @@ function f2() {
// }
// var x: U;
// x.getDate();
//}
//}
@@ -75,4 +75,4 @@ var C2 = /** @class */ (function () {
// var x: U;
// x.getDate();
// }
//}
//}
@@ -89,4 +89,4 @@ var X;
var a = X["foo"];
var a0 = X["bar"];
var _a;
// TODO: make sure that enum still disallow template literals as member names
// TODO: make sure that enum still disallow template literals as member names
@@ -19,4 +19,4 @@ var M;
//var m: M = M;
var x1 = M.a;
//var x2 = m.a;
//var q: m.P;
//var q: m.P;
@@ -28,11 +28,11 @@ import j from "./jquery.js"
"use strict";
exports.__esModule = true;
exports["default"] = 0;
// No extension: '.ts' added
// No extension: '.ts' added
//// [b.js]
"use strict";
exports.__esModule = true;
// '.js' extension: stripped and replaced with '.ts'
// '.js' extension: stripped and replaced with '.ts'
//// [d.js]
"use strict";
exports.__esModule = true;
@@ -84,4 +84,4 @@ function foo(x, y, z) {
// x = null;
// y = null;
// z = null;
//}
//}
@@ -2,5 +2,5 @@
// Comment
//// [sourceMap-Comment1.js]
// Comment
// Comment
//# sourceMappingURL=sourceMap-Comment1.js.map
@@ -8,7 +8,7 @@ sources: sourceMap-Comment1.ts
emittedFile:tests/cases/compiler/sourceMap-Comment1.js
sourceFile:sourceMap-Comment1.ts
-------------------------------------------------------------------
>>>// Comment
>>>// Comment
1 >
2 >^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
@@ -14,7 +14,7 @@ System.register([], function (exports_1, context_1) {
execute: function () {
Home = {};
exports_1("default", Home);
// There is intentionally no semicolon on the prior line, this comment should not break emit
// There is intentionally no semicolon on the prior line, this comment should not break emit
}
};
});
@@ -12,7 +12,7 @@ System.register([], function (exports_1, context_1) {
setters: [],
execute: function () {
exports_1("test", test = "TEST");
//some comment
//some comment
}
};
});
@@ -64,4 +64,4 @@ interface I2<V, T, U> {
// y: U;
// z: V;
// foo<W extends V>(x: W): T;
//}
//}
@@ -83,4 +83,4 @@ function foo(x, y, z) {
// x = undefined;
// y = undefined;
// z = undefined;
//}
//}