mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-17 10:31:20 -06:00
Update baselines and fix failure when merged with master (#9172)
This commit is contained in:
parent
beb72f4057
commit
03d273ea5c
@ -1575,10 +1575,10 @@ namespace ts {
|
||||
* @param node The type node.
|
||||
*/
|
||||
function getRestParameterElementType(node: TypeNode) {
|
||||
if (node.kind === SyntaxKind.ArrayType) {
|
||||
if (node && node.kind === SyntaxKind.ArrayType) {
|
||||
return (<ArrayTypeNode>node).elementType;
|
||||
}
|
||||
else if (node.kind === SyntaxKind.TypeReference) {
|
||||
else if (node && node.kind === SyntaxKind.TypeReference) {
|
||||
return singleOrUndefined((<TypeReferenceNode>node).typeArguments);
|
||||
}
|
||||
else {
|
||||
@ -1623,6 +1623,9 @@ namespace ts {
|
||||
if (isFunctionLike(node) && node.type) {
|
||||
return serializeTypeNode(node.type);
|
||||
}
|
||||
else if (isAsyncFunctionLike(node)) {
|
||||
return createIdentifier("Promise");
|
||||
}
|
||||
|
||||
return createVoidZero();
|
||||
}
|
||||
|
||||
@ -40,20 +40,20 @@ class A {
|
||||
baz(n) { return n; }
|
||||
}
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', Promise)
|
||||
decorator,
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", Promise)
|
||||
], A.prototype, "foo", null);
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', Promise)
|
||||
decorator,
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", Promise)
|
||||
], A.prototype, "bar", null);
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', [Promise]),
|
||||
__metadata('design:returntype', Promise)
|
||||
decorator,
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Promise]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], A.prototype, "baz", null);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//// [disallowAsyncModifierInES5.ts]
|
||||
|
||||
async function foo() { return 42; } // ERROR: Async functions are only available in ES6+
|
||||
let bar = async function () { return 42; } // OK, but should be an error
|
||||
|
||||
async function foo() { return 42; } // ERROR: Async functions are only available in ES6+
|
||||
let bar = async function () { return 42; } // OK, but should be an error
|
||||
let baz = async () => 42; // OK, but should be an error
|
||||
|
||||
//// [disallowAsyncModifierInES5.js]
|
||||
@ -20,4 +20,4 @@ function foo() {
|
||||
var bar = function () {
|
||||
return __awaiter(this, void 0, void 0, function* () { return 42; });
|
||||
}; // OK, but should be an error
|
||||
var baz = function () { return __awaiter(_this, void 0, void 0, function* () { return 42; }); }; // OK, but should be an error
|
||||
var baz = function () { return __awaiter(_this, void 0, void 0, function* () { return 42; }); }; // OK, but should be an error
|
||||
|
||||
@ -41,18 +41,18 @@ var A = (function () {
|
||||
args[_i - 0] = arguments[_i];
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
MyMethodDecorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', [Object]),
|
||||
__metadata('design:returntype', void 0)
|
||||
], A.prototype, "method", null);
|
||||
A = __decorate([
|
||||
MyClassDecorator,
|
||||
__metadata('design:paramtypes', [Object])
|
||||
], A);
|
||||
return A;
|
||||
}());
|
||||
__decorate([
|
||||
MyMethodDecorator,
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], A.prototype, "method", null);
|
||||
A = __decorate([
|
||||
MyClassDecorator,
|
||||
__metadata("design:paramtypes", [Object])
|
||||
], A);
|
||||
var B = (function () {
|
||||
function B() {
|
||||
var args = [];
|
||||
@ -66,15 +66,15 @@ var B = (function () {
|
||||
args[_i - 0] = arguments[_i];
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
MyMethodDecorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', [String]),
|
||||
__metadata('design:returntype', void 0)
|
||||
], B.prototype, "method", null);
|
||||
B = __decorate([
|
||||
MyClassDecorator,
|
||||
__metadata('design:paramtypes', [Number])
|
||||
], B);
|
||||
return B;
|
||||
}());
|
||||
__decorate([
|
||||
MyMethodDecorator,
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], B.prototype, "method", null);
|
||||
B = __decorate([
|
||||
MyClassDecorator,
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], B);
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
"======== Resolving module './mod1' from '/mod2.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'Classic'.",
|
||||
"File '/mod1.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/mod1.ts', result '/mod1.ts'",
|
||||
"======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'",
|
||||
|
||||
@ -2,12 +2,10 @@
|
||||
"======== Resolving module './main' from '/mod2.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'Classic'.",
|
||||
"File '/main.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/main.ts', result '/main.ts'",
|
||||
"======== Module name './main' was successfully resolved to '/main.ts'. ========",
|
||||
"======== Resolving module './mod1' from '/mod2.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'Classic'.",
|
||||
"File '/mod1.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/mod1.ts', result '/mod1.ts'",
|
||||
"======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/mod1.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'",
|
||||
@ -17,7 +15,6 @@
|
||||
"======== Resolving module './main' from '/mod1.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'Classic'.",
|
||||
"File '/main.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/main.ts', result '/main.ts'",
|
||||
"======== Module name './main' was successfully resolved to '/main.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user