Skip to content

Commit

Permalink
Accept baselines plus new linter warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Jul 18, 2016
1 parent 252cc25 commit c832444
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
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'.
tests/cases/compiler/asyncFunctionNoReturnType.ts(3,9): error TS7030: Not all code paths return a value.


!!! 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.
~~~~~~~~~~~~~
Expand Down
46 changes: 43 additions & 3 deletions tests/baselines/reference/asyncFunctionNoReturnType.js
Original file line number Diff line number Diff line change
Expand Up @@ -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*/];
});
}); });
6 changes: 3 additions & 3 deletions tests/cases/unittests/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;", {
Expand Down Expand Up @@ -475,5 +475,5 @@ var x = 0;`, {
}
}
});
})
});
}

0 comments on commit c832444

Please sign in to comment.