Open ekkis opened 5 years ago
this issue is correlated to https://github.com/Bitcoin-com/slp-sdk/issues/32 which describes a similar bug in lodash. the issue was closed because lodash is not a direct dependency of slp-sdk. however that issue, and this one will be solved once slp-sdk upgrades to Babel 6. the version in current use is no longer supported
I have verified that the problems in Babel were fixed as of:
and for anyone interested, until slp-sdk upgrades, the patch below fixes the problem with babel:
diff --git a/node_modules/babel-traverse/lib/visitors.js b/node_modules/babel-traverse/lib/visitors.js
index dadf5d0..708d825 100644
--- a/node_modules/babel-traverse/lib/visitors.js
+++ b/node_modules/babel-traverse/lib/visitors.js
@@ -131,12 +131,18 @@ function explode(visitor) {
for (var _nodeType in visitor) {
if (shouldIgnoreKey(_nodeType)) continue;
+ if (!visitor.hasOwnProperty(_nodeType)) continue;
var _fns = visitor[_nodeType];
- var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType];
+ var aliases = t.FLIPPED_ALIAS_KEYS.hasOwnProperty(_nodeType)
+ ? t.FLIPPED_ALIAS_KEYS[_nodeType]
+ : null;
+
+ var deprecratedKey = t.DEPRECATED_KEYS.hasOwnProperty(_nodeType)
+ ? t.DEPRECATED_KEYS[_nodeType]
+ : null;
- var deprecratedKey = t.DEPRECATED_KEYS[_nodeType];
if (deprecratedKey) {
console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey);
aliases = [deprecratedKey];
@@ -199,6 +205,7 @@ function verify(visitor) {
var visitors = visitor[nodeType];
if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") {
for (var visitorKey in visitors) {
+ if (!visitors.hasOwnProperty(visitorKey)) continue;
if (visitorKey === "enter" || visitorKey === "exit") {
validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]);
} else {
also, the patch for the lodash problem:
diff --git a/node_modules/lodash/lodash.js b/node_modules/lodash/lodash.js
index cb139dd..9730f52 100644
--- a/node_modules/lodash/lodash.js
+++ b/node_modules/lodash/lodash.js
@@ -17039,8 +17039,11 @@
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var lodashFunc = lodash[methodName];
if (lodashFunc) {
- var key = (lodashFunc.name + ''),
- names = realNames[key] || (realNames[key] = []);
+ var key = (lodashFunc.name + ''), names;
+ if (realNames.hasOwnProperty(key))
+ names = realNames[key];
+ else
+ names = realNames[key] = [];
names.push({ 'name': methodName, 'func': lodashFunc });
}
this module relies on Babel 6, which is broken:
yields:
I reached out to the Babel guys and they said v6 is no longer maintained and your package should upgrade. please see: https://github.com/babel/babel/issues/9786
please upgrade and let me know when I can refresh