mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
[Transforms] Update baselines from merging with master round 2 (#8926)
* update baselines from merging with master
* Correctly fix#8786
* Fix up linting errors
* Fix spelling error in comment
* Remove usage of null
* Revert "Remove usage of null"
This reverts commit d9102d1e3f.
* Disable using null in unittest as we use null to signal to not generate baselines
* Remove setting disable comment as we already done so in createCommentWriter
* Address linting
* Fix travis failure
* Fix travis failure
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
//// [computedPropertyNamesContextualType7_ES5.ts]
|
||||
interface I<T> {
|
||||
[n: number]: T;
|
||||
}
|
||||
interface J<T> {
|
||||
[s: string]: T;
|
||||
}
|
||||
|
||||
declare function foo<T>(obj: I<T>): T;
|
||||
declare function g<T>(obj: J<T>): T;
|
||||
|
||||
foo({
|
||||
0: () => { },
|
||||
["hi" + "bye"]: true,
|
||||
[0 + 1]: 0,
|
||||
[+"hi"]: [0]
|
||||
});
|
||||
|
||||
g({ p: "" });
|
||||
interface I<T> {
|
||||
[n: number]: T;
|
||||
}
|
||||
interface J<T> {
|
||||
[s: string]: T;
|
||||
}
|
||||
|
||||
declare function foo<T>(obj: I<T>): T;
|
||||
declare function g<T>(obj: J<T>): T;
|
||||
|
||||
foo({
|
||||
0: () => { },
|
||||
["hi" + "bye"]: true,
|
||||
[0 + 1]: 0,
|
||||
[+"hi"]: [0]
|
||||
});
|
||||
|
||||
g({ p: "" });
|
||||
|
||||
|
||||
//// [computedPropertyNamesContextualType7_ES5.js]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//// [decoratorOnClass6.es6.ts]
|
||||
declare function dec<T>(target: T): T;
|
||||
|
||||
@dec
|
||||
export class C {
|
||||
static x() { return C.y; }
|
||||
static y = 1;
|
||||
}
|
||||
|
||||
declare function dec<T>(target: T): T;
|
||||
|
||||
@dec
|
||||
export class C {
|
||||
static x() { return C.y; }
|
||||
static y = 1;
|
||||
}
|
||||
|
||||
let c = new C();
|
||||
|
||||
//// [decoratorOnClass6.es6.js]
|
||||
|
||||
@@ -19,8 +19,8 @@ function fn(y, set) {
|
||||
var C = (function () {
|
||||
function C(y, x // expected to work, but actually doesn't
|
||||
) {
|
||||
if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); }
|
||||
this.x = x;
|
||||
if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); } // expected to work, but actually doesn't
|
||||
this.x = x; // expected to work, but actually doesn't
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/// <reference path="..\..\..\src\compiler\parser.ts" />
|
||||
/// <reference path="..\..\..\src\harness\harness.ts" />
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
describe("JSDocParsing", () => {
|
||||
describe("TypeExpressions", () => {
|
||||
function parsesCorrectly(name: string, content: string) {
|
||||
@@ -95,10 +95,10 @@ module ts {
|
||||
it(name, () => {
|
||||
const comment = parseIsolatedJSDocComment(content);
|
||||
if (!comment) {
|
||||
Debug.fail('Comment failed to parse entirely');
|
||||
Debug.fail("Comment failed to parse entirely");
|
||||
}
|
||||
if (comment.diagnostics.length > 0) {
|
||||
Debug.fail('Comment has at least one diagnostic: ' + comment.diagnostics[0].messageText);
|
||||
Debug.fail("Comment has at least one diagnostic: " + comment.diagnostics[0].messageText);
|
||||
}
|
||||
|
||||
Harness.Baseline.runBaseline("parseCorrectly", "JSDocParsing/DocComments.parsesCorrectly." + name + ".json",
|
||||
@@ -118,29 +118,29 @@ module ts {
|
||||
parsesIncorrectly("emptyComment", "/***/");
|
||||
parsesIncorrectly("threeAsterisks", "/*** */");
|
||||
parsesIncorrectly("asteriskAfterPreamble", "/** * @type {number} */");
|
||||
parsesIncorrectly("multipleTypes",
|
||||
parsesIncorrectly("multipleTypes",
|
||||
`/**
|
||||
* @type {number}
|
||||
* @type {string}
|
||||
*/`);
|
||||
parsesIncorrectly("multipleReturnTypes",
|
||||
parsesIncorrectly("multipleReturnTypes",
|
||||
`/**
|
||||
* @return {number}
|
||||
* @return {string}
|
||||
*/`);
|
||||
parsesIncorrectly("noTypeParameters",
|
||||
parsesIncorrectly("noTypeParameters",
|
||||
`/**
|
||||
* @template
|
||||
*/`);
|
||||
parsesIncorrectly("trailingTypeParameterComma",
|
||||
parsesIncorrectly("trailingTypeParameterComma",
|
||||
`/**
|
||||
* @template T,
|
||||
*/`);
|
||||
parsesIncorrectly("paramWithoutName",
|
||||
parsesIncorrectly("paramWithoutName",
|
||||
`/**
|
||||
* @param {number}
|
||||
*/`);
|
||||
parsesIncorrectly("paramWithoutTypeOrName",
|
||||
parsesIncorrectly("paramWithoutTypeOrName",
|
||||
`/**
|
||||
* @param
|
||||
*/`);
|
||||
|
||||
@@ -64,7 +64,9 @@ namespace ts {
|
||||
it("Correct errors for " + justName, () => {
|
||||
Harness.Baseline.runBaseline("Correct errors", justName.replace(/\.tsx?$/, ".errors.txt"), () => {
|
||||
if (transpileResult.diagnostics.length === 0) {
|
||||
/* tslint:disable:no-null-keyword */
|
||||
return null;
|
||||
/* tslint:enable:no-null-keyword */
|
||||
}
|
||||
|
||||
return Harness.Compiler.getErrorBaseline(toBeCompiled, transpileResult.diagnostics);
|
||||
@@ -75,7 +77,9 @@ namespace ts {
|
||||
it("Correct errors (old transpile) for " + justName, () => {
|
||||
Harness.Baseline.runBaseline("Correct errors", justName.replace(/\.tsx?$/, ".oldTranspile.errors.txt"), () => {
|
||||
if (oldTranspileDiagnostics.length === 0) {
|
||||
/* tslint:disable:no-null-keyword */
|
||||
return null;
|
||||
/* tslint:enable:no-null-keyword */
|
||||
}
|
||||
|
||||
return Harness.Compiler.getErrorBaseline(toBeCompiled, oldTranspileDiagnostics);
|
||||
|
||||
Reference in New Issue
Block a user