Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-generator

Package Overview
Dependencies
Maintainers
6
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-generator - npm Package Compare versions

Comparing version 6.4.3 to 6.4.5

1

lib/generators/expressions.js

@@ -129,2 +129,3 @@ /* @flow */

this.print(node.callee, node);
if (node.loc) this.printAuxAfterComment();

@@ -131,0 +132,0 @@ this.push("(");

8

lib/printer.js

@@ -89,3 +89,3 @@ "use strict";

this.map.mark(node, "start");
this.map.mark(node);

@@ -103,3 +103,3 @@ this._print(node, parent);

this._printStack.pop();
this.map.mark(node, "end");
if (parent) this.map.mark(parent);
if (opts.after) opts.after();

@@ -183,2 +183,6 @@

if (opts.separator && parent.loc) {
_this.printAuxAfterComment();
}
if (opts.separator && i < len - 1) {

@@ -185,0 +189,0 @@ _this.push(opts.separator);

@@ -29,2 +29,3 @@ "use strict";

this.opts = opts;
this.last = { generated: {}, original: {} };

@@ -60,3 +61,3 @@ if (opts.sourceMaps) {

SourceMap.prototype.mark = function mark(node, type) {
SourceMap.prototype.mark = function mark(node) {
var loc = node.loc;

@@ -77,9 +78,19 @@ if (!loc) return; // no location info

var original = loc[type];
var original = loc.start;
map.addMapping({
// Avoid emitting duplicates on either side. Duplicated
// original values creates unnecesssarily large source maps
// and increases compile time. Duplicates on the generated
// side can lead to incorrect mappings.
if (comparePosition(original, this.last.original) || comparePosition(generated, this.last.generated)) {
return;
}
this.last = {
source: this.opts.sourceFileName,
generated: generated,
original: original
});
};
map.addMapping(this.last);
};

@@ -91,2 +102,6 @@

exports["default"] = SourceMap;
function comparePosition(a, b) {
return a.line === b.line && a.column === b.column;
}
module.exports = exports["default"];
{
"name": "babel-generator",
"version": "6.4.3",
"version": "6.4.5",
"description": "Turns an AST into code.",

@@ -16,3 +16,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"babel-runtime": "^5.0.0",
"babel-types": "^6.4.3",
"babel-types": "^6.4.5",
"detect-indent": "^3.0.1",

@@ -27,4 +27,4 @@ "is-integer": "^1.0.4",

"babel-helper-fixtures": "^6.3.13",
"babylon": "^6.4.2"
"babylon": "^6.4.5"
}
}
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