@babel/traverse 7.0.0-beta.43 → 7.0.0-beta.44
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.
- package/lib/cache.js +2 -2
- package/lib/context.js +75 -35
- package/lib/hub.js +3 -6
- package/lib/index.js +24 -12
- package/lib/path/ancestry.js +40 -26
- package/lib/path/comments.js +9 -9
- package/lib/path/context.js +45 -17
- package/lib/path/conversion.js +132 -124
- package/lib/path/evaluation.js +136 -97
- package/lib/path/family.js +40 -27
- package/lib/path/index.js +80 -60
- package/lib/path/inference/index.js +16 -12
- package/lib/path/inference/inferer-reference.js +41 -37
- package/lib/path/inference/inferers.js +16 -18
- package/lib/path/introspection.js +82 -49
- package/lib/path/lib/hoister.js +56 -48
- package/lib/path/lib/removal-hooks.js +2 -2
- package/lib/path/lib/virtual-types.js +46 -76
- package/lib/path/modification.js +53 -31
- package/lib/path/removal.js +10 -3
- package/lib/path/replacement.js +50 -32
- package/lib/scope/binding.js +22 -20
- package/lib/scope/index.js +400 -280
- package/lib/scope/lib/renamer.js +35 -37
- package/lib/visitors.js +120 -62
- package/package.json +8 -8
package/lib/scope/binding.js
CHANGED
@@ -5,13 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
identifier,
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}) {
|
8
|
+
var Binding = function () {
|
9
|
+
function Binding(_ref) {
|
10
|
+
var identifier = _ref.identifier,
|
11
|
+
scope = _ref.scope,
|
12
|
+
path = _ref.path,
|
13
|
+
kind = _ref.kind;
|
15
14
|
this.identifier = identifier;
|
16
15
|
this.scope = scope;
|
17
16
|
this.path = path;
|
@@ -24,24 +23,26 @@ class Binding {
|
|
24
23
|
this.clearValue();
|
25
24
|
}
|
26
25
|
|
27
|
-
|
26
|
+
var _proto = Binding.prototype;
|
27
|
+
|
28
|
+
_proto.deoptValue = function deoptValue() {
|
28
29
|
this.clearValue();
|
29
30
|
this.hasDeoptedValue = true;
|
30
|
-
}
|
31
|
+
};
|
31
32
|
|
32
|
-
setValue(value) {
|
33
|
+
_proto.setValue = function setValue(value) {
|
33
34
|
if (this.hasDeoptedValue) return;
|
34
35
|
this.hasValue = true;
|
35
36
|
this.value = value;
|
36
|
-
}
|
37
|
+
};
|
37
38
|
|
38
|
-
clearValue() {
|
39
|
+
_proto.clearValue = function clearValue() {
|
39
40
|
this.hasDeoptedValue = false;
|
40
41
|
this.hasValue = false;
|
41
42
|
this.value = null;
|
42
|
-
}
|
43
|
+
};
|
43
44
|
|
44
|
-
reassign(path) {
|
45
|
+
_proto.reassign = function reassign(path) {
|
45
46
|
this.constant = false;
|
46
47
|
|
47
48
|
if (this.constantViolations.indexOf(path) !== -1) {
|
@@ -49,9 +50,9 @@ class Binding {
|
|
49
50
|
}
|
50
51
|
|
51
52
|
this.constantViolations.push(path);
|
52
|
-
}
|
53
|
+
};
|
53
54
|
|
54
|
-
reference(path) {
|
55
|
+
_proto.reference = function reference(path) {
|
55
56
|
if (this.referencePaths.indexOf(path) !== -1) {
|
56
57
|
return;
|
57
58
|
}
|
@@ -59,13 +60,14 @@ class Binding {
|
|
59
60
|
this.referenced = true;
|
60
61
|
this.references++;
|
61
62
|
this.referencePaths.push(path);
|
62
|
-
}
|
63
|
+
};
|
63
64
|
|
64
|
-
dereference() {
|
65
|
+
_proto.dereference = function dereference() {
|
65
66
|
this.references--;
|
66
67
|
this.referenced = !!this.references;
|
67
|
-
}
|
68
|
+
};
|
68
69
|
|
69
|
-
|
70
|
+
return Binding;
|
71
|
+
}();
|
70
72
|
|
71
73
|
exports.default = Binding;
|