Fix function declaration without body to be checked as context sensitive
Fixes #29032
This commit is contained in:
parent
d35ea02cc6
commit
d8ee4116ef
|
@ -11040,8 +11040,7 @@ namespace ts {
|
|||
|
||||
function hasContextSensitiveReturnExpression(node: FunctionLikeDeclaration) {
|
||||
// TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.
|
||||
const body = node.body!;
|
||||
return body.kind === SyntaxKind.Block ? false : isContextSensitive(body);
|
||||
return !node.body || node.body.kind === SyntaxKind.Block ? false : isContextSensitive(node.body);
|
||||
}
|
||||
|
||||
function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////interface ProxyHandler<T extends object> {
|
||||
//// getPrototypeOf?(target: T): object | null;
|
||||
////}
|
||||
////interface ProxyConstructor {
|
||||
//// new <T extends object>(target: T, handler: ProxyHandler<T>): T;
|
||||
////}
|
||||
////declare var Proxy: ProxyConstructor;
|
||||
////let target = {}
|
||||
////let proxy = new /**/Proxy(target, {
|
||||
//// getPrototypeOf()
|
||||
////})
|
||||
|
||||
goTo.marker("");
|
||||
verify.quickInfoExists();
|
Loading…
Reference in a new issue