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
183
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 7.0.0-beta.39 to 7.0.0-beta.40

51

lib/generators/expressions.js

@@ -14,2 +14,4 @@ "use strict";

exports.Decorator = Decorator;
exports.OptionalMemberExpression = OptionalMemberExpression;
exports.OptionalCallExpression = OptionalCallExpression;
exports.CallExpression = CallExpression;

@@ -119,3 +121,33 @@ exports.Import = Import;

function CallExpression(node) {
function OptionalMemberExpression(node) {
this.print(node.object, node);
if (!node.computed && t.isMemberExpression(node.property)) {
throw new TypeError("Got a MemberExpression for MemberExpression property");
}
var computed = node.computed;
if (t.isLiteral(node.property) && typeof node.property.value === "number") {
computed = true;
}
if (node.optional) {
this.token("?.");
}
if (computed) {
this.token("[");
this.print(node.property, node);
this.token("]");
} else {
if (!node.optional) {
this.token(".");
}
this.print(node.property, node);
}
}
function OptionalCallExpression(node) {
this.print(node.callee, node);

@@ -133,2 +165,10 @@ this.print(node.typeParameters, node);

function CallExpression(node) {
this.print(node.callee, node);
this.print(node.typeParameters, node);
this.token("(");
this.printList(node.arguments, node);
this.token(")");
}
function Import() {

@@ -222,6 +262,2 @@ this.word("import");

if (node.optional) {
this.token("?.");
}
if (computed) {

@@ -232,6 +268,3 @@ this.token("[");

} else {
if (!node.optional) {
this.token(".");
}
this.token(".");
this.print(node.property, node);

@@ -238,0 +271,0 @@ }

1

lib/index.js

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

_this = _Printer.call(this, format, map) || this;
_this.ast = void 0;
_this.ast = ast;

@@ -31,0 +30,0 @@ return _this;

@@ -28,5 +28,3 @@ "use strict";

function Printer(format, map) {
this.format = void 0;
this.inForStatementInitCounter = 0;
this._buf = void 0;
this._printStack = [];

@@ -33,0 +31,0 @@ this._indent = 0;

{
"name": "@babel/generator",
"version": "7.0.0-beta.39",
"version": "7.0.0-beta.40",
"description": "Turns an AST into code.",

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

"dependencies": {
"@babel/types": "7.0.0-beta.39",
"@babel/types": "7.0.0-beta.40",
"jsesc": "^2.5.1",

@@ -22,5 +22,5 @@ "lodash": "^4.2.0",

"devDependencies": {
"@babel/helper-fixtures": "7.0.0-beta.39",
"babylon": "7.0.0-beta.39"
"@babel/helper-fixtures": "7.0.0-beta.40",
"babylon": "7.0.0-beta.40"
}
}
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