@babel/traverse 7.8.3 → 7.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @babel/traverse might be problematic. Click here for more details.

@@ -146,14 +146,14 @@ const collectorVisitor = {
146
146
  BlockScoped(path) {
147
147
  let scope = path.scope;
148
148
  if (scope.path === path) scope = scope.parent;
149
- scope.getBlockParent().registerDeclaration(path);
150
- },
149
+ const parent = scope.getBlockParent();
150
+ parent.registerDeclaration(path);
151
151
 
152
- ClassDeclaration(path) {
153
- const id = path.node.id;
154
- if (!id) return;
155
- const name = id.name;
156
- path.scope.bindings[name] = path.scope.getBinding(name);
152
+ if (path.isClassDeclaration() && path.node.id) {
153
+ const id = path.node.id;
154
+ const name = id.name;
155
+ path.scope.bindings[name] = path.scope.parent.getBinding(name);
156
+ }
157
157
  },
158
158
 
159
159
  Block(path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/traverse",
3
- "version": "7.8.3",
3
+ "version": "7.8.4",
4
4
  "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
5
5
  "author": "Sebastian McKenzie <sebmck@gmail.com>",
6
6
  "homepage": "https://babeljs.io/",
@@ -12,10 +12,10 @@
12
12
  "main": "lib/index.js",
13
13
  "dependencies": {
14
14
  "@babel/code-frame": "^7.8.3",
15
- "@babel/generator": "^7.8.3",
15
+ "@babel/generator": "^7.8.4",
16
16
  "@babel/helper-function-name": "^7.8.3",
17
17
  "@babel/helper-split-export-declaration": "^7.8.3",
18
- "@babel/parser": "^7.8.3",
18
+ "@babel/parser": "^7.8.4",
19
19
  "@babel/types": "^7.8.3",
20
20
  "debug": "^4.1.0",
21
21
  "globals": "^11.1.0",
@@ -24,5 +24,5 @@
24
24
  "devDependencies": {
25
25
  "@babel/helper-plugin-test-runner": "^7.8.3"
26
26
  },
27
- "gitHead": "a7620bd266ae1345975767bbc7abf09034437017"
27
+ "gitHead": "5c2e6bc07fed3d28801d93168622c99ae622653a"
28
28
  }