@babel/traverse 7.0.0-beta.45 → 7.0.0-beta.49

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.

@@ -5,12 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
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;
8
+ class Binding {
9
+ constructor({
10
+ identifier,
11
+ scope,
12
+ path,
13
+ kind
14
+ }) {
14
15
  this.identifier = identifier;
15
16
  this.scope = scope;
16
17
  this.path = path;
@@ -23,26 +24,24 @@ var Binding = function () {
23
24
  this.clearValue();
24
25
  }
25
26
 
26
- var _proto = Binding.prototype;
27
-
28
- _proto.deoptValue = function deoptValue() {
27
+ deoptValue() {
29
28
  this.clearValue();
30
29
  this.hasDeoptedValue = true;
31
- };
30
+ }
32
31
 
33
- _proto.setValue = function setValue(value) {
32
+ setValue(value) {
34
33
  if (this.hasDeoptedValue) return;
35
34
  this.hasValue = true;
36
35
  this.value = value;
37
- };
36
+ }
38
37
 
39
- _proto.clearValue = function clearValue() {
38
+ clearValue() {
40
39
  this.hasDeoptedValue = false;
41
40
  this.hasValue = false;
42
41
  this.value = null;
43
- };
42
+ }
44
43
 
45
- _proto.reassign = function reassign(path) {
44
+ reassign(path) {
46
45
  this.constant = false;
47
46
 
48
47
  if (this.constantViolations.indexOf(path) !== -1) {
@@ -50,9 +49,9 @@ var Binding = function () {
50
49
  }
51
50
 
52
51
  this.constantViolations.push(path);
53
- };
52
+ }
54
53
 
55
- _proto.reference = function reference(path) {
54
+ reference(path) {
56
55
  if (this.referencePaths.indexOf(path) !== -1) {
57
56
  return;
58
57
  }
@@ -60,14 +59,13 @@ var Binding = function () {
60
59
  this.referenced = true;
61
60
  this.references++;
62
61
  this.referencePaths.push(path);
63
- };
62
+ }
64
63
 
65
- _proto.dereference = function dereference() {
64
+ dereference() {
66
65
  this.references--;
67
66
  this.referenced = !!this.references;
68
- };
67
+ }
69
68
 
70
- return Binding;
71
- }();
69
+ }
72
70
 
73
71
  exports.default = Binding;