Skip to content

Commit c832444

Browse files
committed
Accept baselines plus new linter warnings.
1 parent 252cc25 commit c832444

File tree

3 files changed

+47
-10
lines changed

3 files changed

+47
-10
lines changed

tests/baselines/reference/asyncFunctionNoReturnType.errors.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
error TS2318: Cannot find global type 'Promise'.
2-
tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS1311: Async functions are only available when targeting ECMAScript 2015 or higher.
32
tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS1057: An async function or method must have a valid awaitable return type.
43
tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS7030: Not all code paths return a value.
54
tests/cases/compiler/asyncFunctionNoReturnType.ts(2,9): error TS2304: Cannot find name 'window'.
65
tests/cases/compiler/asyncFunctionNoReturnType.ts(3,9): error TS7030: Not all code paths return a value.
76

87

98
!!! error TS2318: Cannot find global type 'Promise'.
10-
==== tests/cases/compiler/asyncFunctionNoReturnType.ts (5 errors) ====
9+
==== tests/cases/compiler/asyncFunctionNoReturnType.ts (4 errors) ====
1110
async () => {
12-
~~~~~
13-
!!! error TS1311: Async functions are only available when targeting ECMAScript 2015 or higher.
1411
~~~~~~~~~~~~~
1512
!!! error TS1057: An async function or method must have a valid awaitable return type.
1613
~~~~~~~~~~~~~

tests/baselines/reference/asyncFunctionNoReturnType.js

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,48 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1414
step((generator = generator.apply(thisArg, _arguments)).next());
1515
});
1616
};
17+
var __generator = (this && this.__generator) || function (thisArg, body) {
18+
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
19+
function step(op) {
20+
if (f) throw new TypeError("Generator is already executing.");
21+
while (1) {
22+
if (_.done) switch (op[0]) {
23+
case 0: return { value: void 0, done: true };
24+
case 1: case 6: throw op[1];
25+
case 2: return { value: op[1], done: true };
26+
}
27+
try {
28+
switch (f = 1, op[0]) {
29+
case 0: case 1: sent = op; break;
30+
case 4: return _.label++, { value: op[1], done: false };
31+
case 7: op = _.stack.pop(), _.trys.pop(); continue;
32+
default:
33+
var r = _.trys.length > 0 && _.trys[_.trys.length - 1];
34+
if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; }
35+
if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; }
36+
if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; }
37+
if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; }
38+
if (r[2]) { _.stack.pop(); }
39+
_.trys.pop();
40+
continue;
41+
}
42+
op = body.call(thisArg, _);
43+
}
44+
catch (e) { op = [6, e]; }
45+
finally { f = 0, sent = void 0; }
46+
}
47+
}
48+
return {
49+
next: function (v) { return step([0, v]); },
50+
"throw": function (v) { return step([1, v]); },
51+
"return": function (v) { return step([2, v]); }
52+
};
53+
};
1754
var _this = this;
18-
(function () { return __awaiter(_this, void 0, void 0, function* () {
19-
if (window)
20-
return;
55+
(function () { return __awaiter(_this, void 0, void 0, function () {
56+
return __generator(this, function (_a) {
57+
if (window)
58+
return [2 /*return*/];
59+
return [2 /*return*/];
60+
});
2161
}); });

tests/cases/unittests/transpile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ var x = 0;`, {
231231
});
232232

233233
transpilesCorrectly("Report an error when compiler-options input is empty object", "", {
234-
options: { compilerOptions: { module: <ModuleKind><any>{} }}
234+
options: { compilerOptions: { module: <ModuleKind><any>{ } } }
235235
});
236236

237237
transpilesCorrectly("Report an error when compiler-options input is empty string", "", {
238-
options: { compilerOptions: { module: <ModuleKind><any>"" }}
238+
options: { compilerOptions: { module: <ModuleKind><any>"" } }
239239
});
240240

241241
transpilesCorrectly("Support options with lib values", "const a = 10;", {
@@ -475,5 +475,5 @@ var x = 0;`, {
475475
}
476476
}
477477
});
478-
})
478+
});
479479
}

0 commit comments

Comments
 (0)