mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Merge pull request #14506 from anilanar/babel-traverse/binding-kind-can-be-module
babel-traverse: add "module" as one of possible values for Binding.kind
This commit is contained in:
commit
421ea67c5a
@ -109,3 +109,16 @@ const v1: Visitor = {
|
||||
path.scope.rename("n");
|
||||
}
|
||||
};
|
||||
|
||||
// Binding.kind
|
||||
const BindingKindTest: Visitor = {
|
||||
Identifier(path) {
|
||||
const kind = path.scope.getBinding("str").kind;
|
||||
kind === 'module';
|
||||
kind === 'const';
|
||||
kind === 'let';
|
||||
kind === 'var';
|
||||
// The following should fail when uncommented
|
||||
// kind === 'anythingElse';
|
||||
},
|
||||
};
|
||||
|
||||
2
babel-traverse/index.d.ts
vendored
2
babel-traverse/index.d.ts
vendored
@ -126,7 +126,7 @@ export class Binding {
|
||||
identifier: t.Identifier;
|
||||
scope: Scope;
|
||||
path: NodePath<Node>;
|
||||
kind: 'var' | 'let' | 'const';
|
||||
kind: 'var' | 'let' | 'const' | 'module';
|
||||
referenced: boolean;
|
||||
references: number;
|
||||
referencePaths: NodePath<Node>[];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user