@babel/traverse 7.0.0-beta.5 → 7.0.0-beta.53
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/README.md +9 -23
- package/lib/cache.js +5 -3
- package/lib/context.js +55 -91
- package/lib/hub.js +9 -4
- package/lib/index.js +36 -33
- package/lib/path/ancestry.js +37 -41
- package/lib/path/comments.js +22 -12
- package/lib/path/context.js +24 -48
- package/lib/path/conversion.js +170 -150
- package/lib/path/evaluation.js +108 -150
- package/lib/path/family.js +40 -43
- package/lib/path/index.js +99 -80
- package/lib/path/inference/index.js +39 -33
- package/lib/path/inference/inferer-reference.js +55 -49
- package/lib/path/inference/inferers.js +61 -49
- package/lib/path/introspection.js +105 -96
- package/lib/path/lib/hoister.js +63 -61
- package/lib/path/lib/removal-hooks.js +5 -3
- package/lib/path/lib/virtual-types.js +106 -66
- package/lib/path/modification.js +70 -68
- package/lib/path/removal.js +12 -5
- package/lib/path/replacement.js +76 -69
- package/lib/scope/binding.js +23 -23
- package/lib/scope/index.js +389 -487
- package/lib/scope/lib/renamer.js +71 -61
- package/lib/visitors.js +84 -124
- package/package.json +11 -10
package/lib/scope/lib/renamer.js
CHANGED
@@ -1,109 +1,120 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
exports
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
4
6
|
exports.default = void 0;
|
5
7
|
|
6
8
|
var _binding = _interopRequireDefault(require("../binding"));
|
7
9
|
|
8
|
-
|
10
|
+
function _helperSplitExportDeclaration() {
|
11
|
+
const data = _interopRequireDefault(require("@babel/helper-split-export-declaration"));
|
9
12
|
|
10
|
-
|
13
|
+
_helperSplitExportDeclaration = function () {
|
14
|
+
return data;
|
15
|
+
};
|
11
16
|
|
12
|
-
|
17
|
+
return data;
|
18
|
+
}
|
19
|
+
|
20
|
+
function t() {
|
21
|
+
const data = _interopRequireWildcard(require("@babel/types"));
|
22
|
+
|
23
|
+
t = function () {
|
24
|
+
return data;
|
25
|
+
};
|
26
|
+
|
27
|
+
return data;
|
28
|
+
}
|
29
|
+
|
30
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
13
31
|
|
14
|
-
|
15
|
-
ReferencedIdentifier: function ReferencedIdentifier(_ref, state) {
|
16
|
-
var node = _ref.node;
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
33
|
|
34
|
+
const renameVisitor = {
|
35
|
+
ReferencedIdentifier({
|
36
|
+
node
|
37
|
+
}, state) {
|
18
38
|
if (node.name === state.oldName) {
|
19
39
|
node.name = state.newName;
|
20
40
|
}
|
21
41
|
},
|
22
|
-
|
42
|
+
|
43
|
+
Scope(path, state) {
|
23
44
|
if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {
|
24
45
|
path.skip();
|
25
46
|
}
|
26
47
|
},
|
27
|
-
"AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) {
|
28
|
-
var ids = path.getOuterBindingIdentifiers();
|
29
48
|
|
30
|
-
|
49
|
+
"AssignmentExpression|Declaration"(path, state) {
|
50
|
+
const ids = path.getOuterBindingIdentifiers();
|
51
|
+
|
52
|
+
for (const name in ids) {
|
31
53
|
if (name === state.oldName) ids[name].name = state.newName;
|
32
54
|
}
|
33
55
|
}
|
56
|
+
|
34
57
|
};
|
35
58
|
|
36
|
-
|
37
|
-
|
59
|
+
class Renamer {
|
60
|
+
constructor(binding, oldName, newName) {
|
38
61
|
this.newName = newName;
|
39
62
|
this.oldName = oldName;
|
40
63
|
this.binding = binding;
|
41
64
|
}
|
42
65
|
|
43
|
-
|
66
|
+
maybeConvertFromExportDeclaration(parentDeclar) {
|
67
|
+
const maybeExportDeclar = parentDeclar.parentPath;
|
44
68
|
|
45
|
-
|
46
|
-
|
47
|
-
if (!exportDeclar) return;
|
48
|
-
var isDefault = exportDeclar.isExportDefaultDeclaration();
|
49
|
-
|
50
|
-
if (isDefault && (parentDeclar.isFunctionDeclaration() || parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) {
|
51
|
-
parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default");
|
69
|
+
if (!maybeExportDeclar.isExportDeclaration()) {
|
70
|
+
return;
|
52
71
|
}
|
53
72
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
for (var name in bindingIdentifiers) {
|
58
|
-
var localName = name === this.oldName ? this.newName : name;
|
59
|
-
var exportedName = isDefault ? "default" : name;
|
60
|
-
specifiers.push(t.exportSpecifier(t.identifier(localName), t.identifier(exportedName)));
|
73
|
+
if (maybeExportDeclar.isExportDefaultDeclaration() && !maybeExportDeclar.get("declaration").node.id) {
|
74
|
+
return;
|
61
75
|
}
|
62
76
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
if (parentDeclar.isFunctionDeclaration()) {
|
67
|
-
aliasDeclar._blockHoist = 3;
|
68
|
-
}
|
69
|
-
|
70
|
-
exportDeclar.insertAfter(aliasDeclar);
|
71
|
-
exportDeclar.replaceWith(parentDeclar.node);
|
72
|
-
}
|
73
|
-
};
|
77
|
+
(0, _helperSplitExportDeclaration().default)(maybeExportDeclar);
|
78
|
+
}
|
74
79
|
|
75
|
-
|
80
|
+
maybeConvertFromClassFunctionDeclaration(path) {
|
76
81
|
return;
|
77
82
|
if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;
|
78
83
|
if (this.binding.kind !== "hoisted") return;
|
79
|
-
path.node.id = t.identifier(this.oldName);
|
84
|
+
path.node.id = t().identifier(this.oldName);
|
80
85
|
path.node._blockHoist = 3;
|
81
|
-
path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))]));
|
82
|
-
}
|
86
|
+
path.replaceWith(t().variableDeclaration("let", [t().variableDeclarator(t().identifier(this.newName), t().toExpression(path.node))]));
|
87
|
+
}
|
83
88
|
|
84
|
-
|
89
|
+
maybeConvertFromClassFunctionExpression(path) {
|
85
90
|
return;
|
86
91
|
if (!path.isFunctionExpression() && !path.isClassExpression()) return;
|
87
92
|
if (this.binding.kind !== "local") return;
|
88
|
-
path.node.id = t.identifier(this.oldName);
|
93
|
+
path.node.id = t().identifier(this.oldName);
|
89
94
|
this.binding.scope.parent.push({
|
90
|
-
id: t.identifier(this.newName)
|
95
|
+
id: t().identifier(this.newName)
|
91
96
|
});
|
92
|
-
path.replaceWith(t.assignmentExpression("=", t.identifier(this.newName), path.node));
|
93
|
-
}
|
97
|
+
path.replaceWith(t().assignmentExpression("=", t().identifier(this.newName), path.node));
|
98
|
+
}
|
94
99
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
100
|
+
rename(block) {
|
101
|
+
const {
|
102
|
+
binding,
|
103
|
+
oldName,
|
104
|
+
newName
|
105
|
+
} = this;
|
106
|
+
const {
|
107
|
+
scope,
|
108
|
+
path
|
109
|
+
} = binding;
|
110
|
+
const parentDeclar = path.find(path => path.isDeclaration() || path.isFunctionExpression() || path.isClassExpression());
|
104
111
|
|
105
112
|
if (parentDeclar) {
|
106
|
-
|
113
|
+
const bindingIds = parentDeclar.getBindingIdentifiers();
|
114
|
+
|
115
|
+
if (bindingIds[oldName] === binding.identifier) {
|
116
|
+
this.maybeConvertFromExportDeclaration(parentDeclar);
|
117
|
+
}
|
107
118
|
}
|
108
119
|
|
109
120
|
scope.traverse(block || scope.block, renameVisitor, this);
|
@@ -120,9 +131,8 @@ var Renamer = function () {
|
|
120
131
|
this.maybeConvertFromClassFunctionDeclaration(parentDeclar);
|
121
132
|
this.maybeConvertFromClassFunctionExpression(parentDeclar);
|
122
133
|
}
|
123
|
-
}
|
134
|
+
}
|
124
135
|
|
125
|
-
|
126
|
-
}();
|
136
|
+
}
|
127
137
|
|
128
138
|
exports.default = Renamer;
|
package/lib/visitors.js
CHANGED
@@ -1,47 +1,51 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
exports
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
4
6
|
exports.explode = explode;
|
5
7
|
exports.verify = verify;
|
6
8
|
exports.merge = merge;
|
7
9
|
|
8
10
|
var virtualTypes = _interopRequireWildcard(require("./path/lib/virtual-types"));
|
9
11
|
|
10
|
-
|
12
|
+
function t() {
|
13
|
+
const data = _interopRequireWildcard(require("@babel/types"));
|
11
14
|
|
12
|
-
|
15
|
+
t = function () {
|
16
|
+
return data;
|
17
|
+
};
|
13
18
|
|
14
|
-
|
19
|
+
return data;
|
20
|
+
}
|
15
21
|
|
16
|
-
function
|
22
|
+
function _clone() {
|
23
|
+
const data = _interopRequireDefault(require("lodash/clone"));
|
24
|
+
|
25
|
+
_clone = function () {
|
26
|
+
return data;
|
27
|
+
};
|
28
|
+
|
29
|
+
return data;
|
30
|
+
}
|
31
|
+
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
33
|
|
18
|
-
function
|
34
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
19
35
|
|
20
36
|
function explode(visitor) {
|
21
37
|
if (visitor._exploded) return visitor;
|
22
38
|
visitor._exploded = true;
|
23
39
|
|
24
|
-
for (
|
40
|
+
for (const nodeType in visitor) {
|
25
41
|
if (shouldIgnoreKey(nodeType)) continue;
|
26
|
-
|
42
|
+
const parts = nodeType.split("|");
|
27
43
|
if (parts.length === 1) continue;
|
28
|
-
|
44
|
+
const fns = visitor[nodeType];
|
29
45
|
delete visitor[nodeType];
|
30
46
|
|
31
|
-
for (
|
32
|
-
|
33
|
-
|
34
|
-
if (_isArray) {
|
35
|
-
if (_i >= _iterator.length) break;
|
36
|
-
_ref = _iterator[_i++];
|
37
|
-
} else {
|
38
|
-
_i = _iterator.next();
|
39
|
-
if (_i.done) break;
|
40
|
-
_ref = _i.value;
|
41
|
-
}
|
42
|
-
|
43
|
-
var _part = _ref;
|
44
|
-
visitor[_part] = fns;
|
47
|
+
for (const part of parts) {
|
48
|
+
visitor[part] = fns;
|
45
49
|
}
|
46
50
|
}
|
47
51
|
|
@@ -50,78 +54,59 @@ function explode(visitor) {
|
|
50
54
|
ensureEntranceObjects(visitor);
|
51
55
|
ensureCallbackArrays(visitor);
|
52
56
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
var _nodeType = _arr[_i2];
|
57
|
-
if (shouldIgnoreKey(_nodeType)) continue;
|
58
|
-
var wrapper = virtualTypes[_nodeType];
|
57
|
+
for (const nodeType of Object.keys(visitor)) {
|
58
|
+
if (shouldIgnoreKey(nodeType)) continue;
|
59
|
+
const wrapper = virtualTypes[nodeType];
|
59
60
|
if (!wrapper) continue;
|
60
|
-
|
61
|
+
const fns = visitor[nodeType];
|
61
62
|
|
62
|
-
for (
|
63
|
-
|
63
|
+
for (const type in fns) {
|
64
|
+
fns[type] = wrapCheck(wrapper, fns[type]);
|
64
65
|
}
|
65
66
|
|
66
|
-
delete visitor[
|
67
|
+
delete visitor[nodeType];
|
67
68
|
|
68
69
|
if (wrapper.types) {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
var _type = _arr2[_i4];
|
73
|
-
|
74
|
-
if (visitor[_type]) {
|
75
|
-
mergePair(visitor[_type], _fns);
|
70
|
+
for (const type of wrapper.types) {
|
71
|
+
if (visitor[type]) {
|
72
|
+
mergePair(visitor[type], fns);
|
76
73
|
} else {
|
77
|
-
visitor[
|
74
|
+
visitor[type] = fns;
|
78
75
|
}
|
79
76
|
}
|
80
77
|
} else {
|
81
|
-
mergePair(visitor,
|
78
|
+
mergePair(visitor, fns);
|
82
79
|
}
|
83
80
|
}
|
84
81
|
|
85
|
-
for (
|
86
|
-
if (shouldIgnoreKey(
|
87
|
-
|
88
|
-
|
89
|
-
|
82
|
+
for (const nodeType in visitor) {
|
83
|
+
if (shouldIgnoreKey(nodeType)) continue;
|
84
|
+
const fns = visitor[nodeType];
|
85
|
+
let aliases = t().FLIPPED_ALIAS_KEYS[nodeType];
|
86
|
+
const deprecratedKey = t().DEPRECATED_KEYS[nodeType];
|
90
87
|
|
91
88
|
if (deprecratedKey) {
|
92
|
-
console.trace(
|
89
|
+
console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`);
|
93
90
|
aliases = [deprecratedKey];
|
94
91
|
}
|
95
92
|
|
96
93
|
if (!aliases) continue;
|
97
|
-
delete visitor[
|
98
|
-
|
99
|
-
for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
|
100
|
-
var _ref2;
|
101
|
-
|
102
|
-
if (_isArray2) {
|
103
|
-
if (_i3 >= _iterator2.length) break;
|
104
|
-
_ref2 = _iterator2[_i3++];
|
105
|
-
} else {
|
106
|
-
_i3 = _iterator2.next();
|
107
|
-
if (_i3.done) break;
|
108
|
-
_ref2 = _i3.value;
|
109
|
-
}
|
94
|
+
delete visitor[nodeType];
|
110
95
|
|
111
|
-
|
112
|
-
|
96
|
+
for (const alias of aliases) {
|
97
|
+
const existing = visitor[alias];
|
113
98
|
|
114
99
|
if (existing) {
|
115
|
-
mergePair(existing,
|
100
|
+
mergePair(existing, fns);
|
116
101
|
} else {
|
117
|
-
visitor[
|
102
|
+
visitor[alias] = (0, _clone().default)(fns);
|
118
103
|
}
|
119
104
|
}
|
120
105
|
}
|
121
106
|
|
122
|
-
for (
|
123
|
-
if (shouldIgnoreKey(
|
124
|
-
ensureCallbackArrays(visitor[
|
107
|
+
for (const nodeType in visitor) {
|
108
|
+
if (shouldIgnoreKey(nodeType)) continue;
|
109
|
+
ensureCallbackArrays(visitor[nodeType]);
|
125
110
|
}
|
126
111
|
|
127
112
|
return visitor;
|
@@ -134,25 +119,25 @@ function verify(visitor) {
|
|
134
119
|
throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?");
|
135
120
|
}
|
136
121
|
|
137
|
-
for (
|
122
|
+
for (const nodeType in visitor) {
|
138
123
|
if (nodeType === "enter" || nodeType === "exit") {
|
139
124
|
validateVisitorMethods(nodeType, visitor[nodeType]);
|
140
125
|
}
|
141
126
|
|
142
127
|
if (shouldIgnoreKey(nodeType)) continue;
|
143
128
|
|
144
|
-
if (t.TYPES.indexOf(nodeType) < 0) {
|
145
|
-
throw new Error(
|
129
|
+
if (t().TYPES.indexOf(nodeType) < 0) {
|
130
|
+
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`);
|
146
131
|
}
|
147
132
|
|
148
|
-
|
133
|
+
const visitors = visitor[nodeType];
|
149
134
|
|
150
|
-
if (
|
151
|
-
for (
|
135
|
+
if (typeof visitors === "object") {
|
136
|
+
for (const visitorKey in visitors) {
|
152
137
|
if (visitorKey === "enter" || visitorKey === "exit") {
|
153
|
-
validateVisitorMethods(nodeType
|
138
|
+
validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
|
154
139
|
} else {
|
155
|
-
throw new Error("You passed `traverse()` a visitor object with the property " +
|
140
|
+
throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`);
|
156
141
|
}
|
157
142
|
}
|
158
143
|
}
|
@@ -162,48 +147,31 @@ function verify(visitor) {
|
|
162
147
|
}
|
163
148
|
|
164
149
|
function validateVisitorMethods(path, val) {
|
165
|
-
|
166
|
-
|
167
|
-
for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i5 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
|
168
|
-
var _ref3;
|
169
|
-
|
170
|
-
if (_isArray3) {
|
171
|
-
if (_i5 >= _iterator3.length) break;
|
172
|
-
_ref3 = _iterator3[_i5++];
|
173
|
-
} else {
|
174
|
-
_i5 = _iterator3.next();
|
175
|
-
if (_i5.done) break;
|
176
|
-
_ref3 = _i5.value;
|
177
|
-
}
|
178
|
-
|
179
|
-
var _fn = _ref3;
|
150
|
+
const fns = [].concat(val);
|
180
151
|
|
181
|
-
|
182
|
-
|
152
|
+
for (const fn of fns) {
|
153
|
+
if (typeof fn !== "function") {
|
154
|
+
throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);
|
183
155
|
}
|
184
156
|
}
|
185
157
|
}
|
186
158
|
|
187
|
-
function merge(visitors, states, wrapper) {
|
188
|
-
|
189
|
-
states = [];
|
190
|
-
}
|
191
|
-
|
192
|
-
var rootVisitor = {};
|
159
|
+
function merge(visitors, states = [], wrapper) {
|
160
|
+
const rootVisitor = {};
|
193
161
|
|
194
|
-
for (
|
195
|
-
|
196
|
-
|
162
|
+
for (let i = 0; i < visitors.length; i++) {
|
163
|
+
const visitor = visitors[i];
|
164
|
+
const state = states[i];
|
197
165
|
explode(visitor);
|
198
166
|
|
199
|
-
for (
|
200
|
-
|
167
|
+
for (const type in visitor) {
|
168
|
+
let visitorType = visitor[type];
|
201
169
|
|
202
170
|
if (state || wrapper) {
|
203
171
|
visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);
|
204
172
|
}
|
205
173
|
|
206
|
-
|
174
|
+
const nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};
|
207
175
|
mergePair(nodeVisitor, visitorType);
|
208
176
|
}
|
209
177
|
}
|
@@ -212,16 +180,16 @@ function merge(visitors, states, wrapper) {
|
|
212
180
|
}
|
213
181
|
|
214
182
|
function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
|
215
|
-
|
183
|
+
const newVisitor = {};
|
216
184
|
|
217
|
-
|
218
|
-
|
219
|
-
if (!Array.isArray(fns))
|
185
|
+
for (const key in oldVisitor) {
|
186
|
+
let fns = oldVisitor[key];
|
187
|
+
if (!Array.isArray(fns)) continue;
|
220
188
|
fns = fns.map(function (fn) {
|
221
|
-
|
189
|
+
let newFn = fn;
|
222
190
|
|
223
191
|
if (state) {
|
224
|
-
newFn = function
|
192
|
+
newFn = function (path) {
|
225
193
|
return fn.call(state, path, state);
|
226
194
|
};
|
227
195
|
}
|
@@ -233,21 +201,15 @@ function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
|
|
233
201
|
return newFn;
|
234
202
|
});
|
235
203
|
newVisitor[key] = fns;
|
236
|
-
};
|
237
|
-
|
238
|
-
for (var key in oldVisitor) {
|
239
|
-
var _ret = _loop(key);
|
240
|
-
|
241
|
-
if (_ret === "continue") continue;
|
242
204
|
}
|
243
205
|
|
244
206
|
return newVisitor;
|
245
207
|
}
|
246
208
|
|
247
209
|
function ensureEntranceObjects(obj) {
|
248
|
-
for (
|
210
|
+
for (const key in obj) {
|
249
211
|
if (shouldIgnoreKey(key)) continue;
|
250
|
-
|
212
|
+
const fns = obj[key];
|
251
213
|
|
252
214
|
if (typeof fns === "function") {
|
253
215
|
obj[key] = {
|
@@ -263,15 +225,13 @@ function ensureCallbackArrays(obj) {
|
|
263
225
|
}
|
264
226
|
|
265
227
|
function wrapCheck(wrapper, fn) {
|
266
|
-
|
228
|
+
const newFn = function (path) {
|
267
229
|
if (wrapper.checkPath(path)) {
|
268
230
|
return fn.apply(this, arguments);
|
269
231
|
}
|
270
232
|
};
|
271
233
|
|
272
|
-
newFn.toString =
|
273
|
-
return fn.toString();
|
274
|
-
};
|
234
|
+
newFn.toString = () => fn.toString();
|
275
235
|
|
276
236
|
return newFn;
|
277
237
|
}
|
@@ -288,7 +248,7 @@ function shouldIgnoreKey(key) {
|
|
288
248
|
}
|
289
249
|
|
290
250
|
function mergePair(dest, src) {
|
291
|
-
for (
|
251
|
+
for (const key in src) {
|
292
252
|
dest[key] = [].concat(dest[key] || [], src[key]);
|
293
253
|
}
|
294
254
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@babel/traverse",
|
3
|
-
"version": "7.0.0-beta.
|
3
|
+
"version": "7.0.0-beta.53",
|
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/",
|
@@ -8,17 +8,18 @@
|
|
8
8
|
"repository": "https://github.com/babel/babel/tree/master/packages/babel-traverse",
|
9
9
|
"main": "lib/index.js",
|
10
10
|
"dependencies": {
|
11
|
-
"@babel/code-frame": "7.0.0-beta.
|
12
|
-
"@babel/
|
13
|
-
"@babel/
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
11
|
+
"@babel/code-frame": "7.0.0-beta.53",
|
12
|
+
"@babel/generator": "7.0.0-beta.53",
|
13
|
+
"@babel/helper-function-name": "7.0.0-beta.53",
|
14
|
+
"@babel/helper-split-export-declaration": "7.0.0-beta.53",
|
15
|
+
"@babel/parser": "7.0.0-beta.53",
|
16
|
+
"@babel/types": "7.0.0-beta.53",
|
17
|
+
"debug": "^3.1.0",
|
18
|
+
"globals": "^11.1.0",
|
17
19
|
"invariant": "^2.2.0",
|
18
|
-
"lodash": "^4.
|
20
|
+
"lodash": "^4.17.5"
|
19
21
|
},
|
20
22
|
"devDependencies": {
|
21
|
-
"@babel/
|
22
|
-
"@babel/helper-plugin-test-runner": "7.0.0-beta.5"
|
23
|
+
"@babel/helper-plugin-test-runner": "7.0.0-beta.53"
|
23
24
|
}
|
24
25
|
}
|