Implement a scope for class methods
parent
c13eafb9b3
commit
e8fdcccdea
|
@ -39,4 +39,3 @@ Output:
|
|||
|
||||
* Support `extends` and `implements`.
|
||||
* Generics.
|
||||
* Namespaces.
|
||||
|
|
|
@ -56,6 +56,8 @@ const extractors = {
|
|||
},
|
||||
|
||||
* ClassMethod(node) {
|
||||
yield node.body;
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
|
|
|
@ -21,6 +21,26 @@ type Y = {
|
|||
z: Z,
|
||||
};
|
||||
}
|
||||
|
||||
class Test {
|
||||
static bar() {
|
||||
type X = number;
|
||||
|
||||
type Y = {
|
||||
x: X,
|
||||
z: Z,
|
||||
};
|
||||
}
|
||||
|
||||
baz() {
|
||||
type X = string;
|
||||
|
||||
type Y = {
|
||||
x: X,
|
||||
z: Z,
|
||||
};
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
// ###
|
||||
|
@ -66,4 +86,38 @@ type Y = {
|
|||
{name: 'z', type: 'scopes._0.Z'},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'double',
|
||||
name: 'X',
|
||||
namespace: 'scopes._0._1',
|
||||
},
|
||||
{
|
||||
type: 'record',
|
||||
name: 'Y',
|
||||
namespace: 'scopes._0._1',
|
||||
fields: [
|
||||
{name: 'x', type: 'X'},
|
||||
{name: 'z', type: 'scopes._0.Z'},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'X',
|
||||
namespace: 'scopes._0._2',
|
||||
},
|
||||
{
|
||||
type: 'record',
|
||||
name: 'Y',
|
||||
namespace: 'scopes._0._2',
|
||||
fields: [
|
||||
{name: 'x', type: 'X'},
|
||||
{name: 'z', type: 'scopes._0.Z'},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'record',
|
||||
name: 'Test',
|
||||
namespace: 'scopes._0',
|
||||
fields: [],
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue