Accept baselines plus new linter warnings.

This commit is contained in:
Ron Buckton 2016-07-18 15:54:32 -07:00
parent 252cc25223
commit c832444f1e
3 changed files with 47 additions and 10 deletions

View file

@ -1,5 +1,4 @@
error TS2318: Cannot find global type 'Promise'.
tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS1311: Async functions are only available when targeting ECMAScript 2015 or higher.
tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS1057: An async function or method must have a valid awaitable return type.
tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS7030: Not all code paths return a value.
tests/cases/compiler/asyncFunctionNoReturnType.ts(2,9): error TS2304: Cannot find name 'window'.
@ -7,10 +6,8 @@ tests/cases/compiler/asyncFunctionNoReturnType.ts(3,9): error TS7030: Not all co
!!! error TS2318: Cannot find global type 'Promise'.
==== tests/cases/compiler/asyncFunctionNoReturnType.ts (5 errors) ====
==== tests/cases/compiler/asyncFunctionNoReturnType.ts (4 errors) ====
async () => {
~~~~~
!!! error TS1311: Async functions are only available when targeting ECMAScript 2015 or higher.
~~~~~~~~~~~~~
!!! error TS1057: An async function or method must have a valid awaitable return type.
~~~~~~~~~~~~~

View file

@ -14,8 +14,48 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (1) {
if (_.done) switch (op[0]) {
case 0: return { value: void 0, done: true };
case 1: case 6: throw op[1];
case 2: return { value: op[1], done: true };
}
try {
switch (f = 1, op[0]) {
case 0: case 1: sent = op; break;
case 4: return _.label++, { value: op[1], done: false };
case 7: op = _.stack.pop(), _.trys.pop(); continue;
default:
var r = _.trys.length > 0 && _.trys[_.trys.length - 1];
if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; }
if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; }
if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; }
if (r[2]) { _.stack.pop(); }
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
}
}
return {
next: function (v) { return step([0, v]); },
"throw": function (v) { return step([1, v]); },
"return": function (v) { return step([2, v]); }
};
};
var _this = this;
(function () { return __awaiter(_this, void 0, void 0, function* () {
if (window)
return;
(function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (window)
return [2 /*return*/];
return [2 /*return*/];
});
}); });

View file

@ -231,11 +231,11 @@ var x = 0;`, {
});
transpilesCorrectly("Report an error when compiler-options input is empty object", "", {
options: { compilerOptions: { module: <ModuleKind><any>{} }}
options: { compilerOptions: { module: <ModuleKind><any>{ } } }
});
transpilesCorrectly("Report an error when compiler-options input is empty string", "", {
options: { compilerOptions: { module: <ModuleKind><any>"" }}
options: { compilerOptions: { module: <ModuleKind><any>"" } }
});
transpilesCorrectly("Support options with lib values", "const a = 10;", {
@ -475,5 +475,5 @@ var x = 0;`, {
}
}
});
})
});
}