fix(ivy): allow FunctionExpression to indicate a method declaration (#25406)
In some code formats (e.g. ES5) methods can actually be function
expressions. For example:
```js
function MyClass() {}
// this static method is declared as a function expression
MyClass.staticMethod = function() { ... };
```
PR Close #25406
This commit is contained in:
committed by
Matias Niemelä
parent
f87b499dde
commit
a528636f56
@@ -671,7 +671,8 @@ class StaticInterpreter {
|
||||
|
||||
function isFunctionOrMethodReference(ref: Reference<ts.Node>):
|
||||
ref is Reference<ts.FunctionDeclaration|ts.MethodDeclaration|ts.FunctionExpression> {
|
||||
return ts.isFunctionDeclaration(ref.node) || ts.isMethodDeclaration(ref.node);
|
||||
return ts.isFunctionDeclaration(ref.node) || ts.isMethodDeclaration(ref.node) ||
|
||||
ts.isFunctionExpression(ref.node);
|
||||
}
|
||||
|
||||
function literal(value: ResolvedValue): any {
|
||||
|
||||
Reference in New Issue
Block a user