flow: create var declaration for flow declarations
This commit is contained in:
parent
d16f726b15
commit
0de733b66a
@ -309,6 +309,10 @@ function monkeypatch() {
|
||||
referencer.prototype.DeclareFunction =
|
||||
referencer.prototype.DeclareVariable =
|
||||
referencer.prototype.DeclareClass = function(node) {
|
||||
if (node.id) {
|
||||
createScopeVariable.call(this, node, node.id);
|
||||
}
|
||||
|
||||
var typeParamScope;
|
||||
if (node.typeParameters) {
|
||||
typeParamScope = nestTypeParamScope(this.scopeManager, node);
|
||||
|
||||
@ -376,7 +376,8 @@ describe("verify", function () {
|
||||
"declare class A { static () : number }",
|
||||
"declare module B { declare var x: number; }",
|
||||
"declare function foo<T>(): void;",
|
||||
"declare var bar"
|
||||
"declare var bar",
|
||||
"A; B; foo(); bar;"
|
||||
].join("\n"),
|
||||
{ "no-undef": 1, "no-unused-vars": 1 },
|
||||
[]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user