Socket
Socket
Sign inDemoInstall

babel-traverse

Package Overview
Dependencies
Maintainers
6
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-traverse - npm Package Compare versions

Comparing version 7.0.0-alpha.3 to 7.0.0-alpha.7

1

lib/context.js
"use strict";
exports.__esModule = true;
exports.default = undefined;

@@ -5,0 +6,0 @@ var _path2 = require("./path");

33

lib/path/index.js
"use strict";
exports.__esModule = true;
exports.default = undefined;

@@ -218,14 +219,3 @@ var _virtualTypes = require("./lib/virtual-types");

var _loop2 = function _loop2() {
if (_isArray) {
if (_i >= _iterator.length) return "break";
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) return "break";
_ref2 = _i.value;
}
var type = _ref2;
var _loop = function _loop(type) {
var typeKey = "is" + type;

@@ -246,8 +236,17 @@ NodePath.prototype[typeKey] = function (opts) {

var _ret2 = _loop2();
if (_isArray) {
if (_i >= _iterator.length) break;
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref2 = _i.value;
}
if (_ret2 === "break") break;
var type = _ref2;
_loop(type);
}
var _loop = function _loop(type) {
var _loop2 = function _loop2(type) {
if (type[0] === "_") return "continue";

@@ -264,5 +263,5 @@ if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);

for (var type in virtualTypes) {
var _ret = _loop(type);
var _ret2 = _loop2(type);
if (_ret === "continue") continue;
if (_ret2 === "continue") continue;
}

@@ -41,11 +41,9 @@ "use strict";

if (testType) {
(function () {
var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
constantViolations = constantViolations.filter(function (path) {
return testConstantViolations.indexOf(path) < 0;
});
constantViolations = constantViolations.filter(function (path) {
return testConstantViolations.indexOf(path) < 0;
});
types.push(testType.typeAnnotation);
})();
types.push(testType.typeAnnotation);
}

@@ -52,0 +50,0 @@

@@ -5,5 +5,2 @@ "use strict";

exports.is = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.matchesPattern = matchesPattern;

@@ -317,4 +314,2 @@ exports.has = has;

function _resolve(dangerous, resolved) {
var _this = this;
if (resolved && resolved.indexOf(this) >= 0) return;

@@ -338,16 +333,8 @@

if (binding.path !== this) {
var _ret = function () {
var ret = binding.path.resolve(dangerous, resolved);
var ret = binding.path.resolve(dangerous, resolved);
if (_this.find(function (parent) {
return parent.node === ret.node;
})) return {
v: void 0
};
return {
v: ret
};
}();
if ((typeof _ret === "undefined" ? "undefined" : _typeof(_ret)) === "object") return _ret.v;
if (this.find(function (parent) {
return parent.node === ret.node;
})) return;
return ret;
}

@@ -354,0 +341,0 @@ } else if (this.isTypeCastExpression()) {

"use strict";
exports.__esModule = true;
exports.default = undefined;

@@ -5,0 +6,0 @@ var _babelTypes = require("babel-types");

"use strict";
exports.__esModule = true;
exports.default = undefined;
var _class, _temp;
var _includes = require("lodash/includes");

@@ -260,3 +263,3 @@

var Scope = function () {
var Scope = (_temp = _class = function () {
function Scope(path, parentScope) {

@@ -1072,6 +1075,3 @@ _classCallCheck(this, Scope);

return Scope;
}();
Scope.globals = Object.keys(_globals2.default.builtin);
Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
}(), _class.globals = Object.keys(_globals2.default.builtin), _class.contextVariables = ["arguments", "undefined", "Infinity", "NaN"], _temp);
exports.default = Scope;
"use strict";
exports.__esModule = true;
exports.default = undefined;

@@ -5,0 +6,0 @@ var _binding = require("../binding");

@@ -82,15 +82,15 @@ "use strict";

var _nodeType3 = _ref2;
var _nodeType = _ref2;
if (shouldIgnoreKey(_nodeType3)) continue;
if (shouldIgnoreKey(_nodeType)) continue;
var wrapper = virtualTypes[_nodeType3];
var wrapper = virtualTypes[_nodeType];
if (!wrapper) continue;
var _fns2 = visitor[_nodeType3];
for (var type in _fns2) {
_fns2[type] = wrapCheck(wrapper, _fns2[type]);
var _fns = visitor[_nodeType];
for (var type in _fns) {
_fns[type] = wrapCheck(wrapper, _fns[type]);
}
delete visitor[_nodeType3];
delete visitor[_nodeType];

@@ -113,22 +113,22 @@ if (wrapper.types) {

if (visitor[_type]) {
mergePair(visitor[_type], _fns2);
mergePair(visitor[_type], _fns);
} else {
visitor[_type] = _fns2;
visitor[_type] = _fns;
}
}
} else {
mergePair(visitor, _fns2);
mergePair(visitor, _fns);
}
}
for (var _nodeType in visitor) {
if (shouldIgnoreKey(_nodeType)) continue;
for (var _nodeType2 in visitor) {
if (shouldIgnoreKey(_nodeType2)) continue;
var _fns = visitor[_nodeType];
var _fns2 = visitor[_nodeType2];
var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType];
var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType2];
var deprecratedKey = t.DEPRECATED_KEYS[_nodeType];
var deprecratedKey = t.DEPRECATED_KEYS[_nodeType2];
if (deprecratedKey) {
console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey);
console.trace("Visitor defined for " + _nodeType2 + " but it has been renamed to " + deprecratedKey);
aliases = [deprecratedKey];

@@ -139,3 +139,3 @@ }

delete visitor[_nodeType];
delete visitor[_nodeType2];

@@ -158,5 +158,5 @@ for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {

if (existing) {
mergePair(existing, _fns);
mergePair(existing, _fns2);
} else {
visitor[alias] = (0, _clone2.default)(_fns);
visitor[alias] = (0, _clone2.default)(_fns2);
}

@@ -166,6 +166,6 @@ }

for (var _nodeType2 in visitor) {
if (shouldIgnoreKey(_nodeType2)) continue;
for (var _nodeType3 in visitor) {
if (shouldIgnoreKey(_nodeType3)) continue;
ensureCallbackArrays(visitor[_nodeType2]);
ensureCallbackArrays(visitor[_nodeType3]);
}

@@ -172,0 +172,0 @@

{
"name": "babel-traverse",
"version": "7.0.0-alpha.3",
"version": "7.0.0-alpha.7",
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",

@@ -13,4 +13,4 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"babel-messages": "7.0.0-alpha.3",
"babel-types": "7.0.0-alpha.3",
"babylon": "7.0.0-beta.7",
"babel-types": "7.0.0-alpha.7",
"babylon": "7.0.0-beta.8",
"debug": "^2.2.0",

@@ -22,5 +22,5 @@ "globals": "^9.0.0",

"devDependencies": {
"babel-generator": "7.0.0-alpha.3",
"babel-helper-plugin-test-runner": "7.0.0-alpha.3"
"babel-generator": "7.0.0-alpha.7",
"babel-helper-plugin-test-runner": "7.0.0-alpha.7"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc