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

6to5

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

6to5 - npm Package Compare versions

Comparing version 1.13.9 to 1.13.10

34

lib/6to5/transformation/transformers/es6-destructuring.js

@@ -0,1 +1,3 @@

// TODO: Clean up
var t = require("../../types");

@@ -186,6 +188,34 @@ var _ = require("lodash");

exports.AssignmentExpression = function (node, parent, file) {
exports.AssignmentExpression = function (node, parent, file, scope) {
if (parent.type === "ExpressionStatement") return;
if (!t.isPattern(node.left)) return;
throw file.errorWithNode(node, "AssignmentExpression destructuring outside of a ExpressionStatement is forbidden due to current 6to5 limitations");
var tempName = file.generateUid("temp", scope);
var temp = t.identifier(tempName);
scope.push(tempName, temp);
var nodes = [];
nodes.push(t.assignmentExpression("=", temp, node.right));
push({
kind: false,
file: file,
scope: scope
}, nodes, node.left, temp);
nodes.push(temp);
nodes = nodes.map(function (node) {
if (t.isExpressionStatement(node)) {
return node.expression;
} else if (t.isVariableDeclaration(node)) {
var declar = node.declarations[0];
scope.push(declar.id.name, declar.id);
return t.assignmentExpression("=", declar.id, declar.init);
} else {
return node;
}
});
return t.sequenceExpression(nodes);
};

@@ -192,0 +222,0 @@

2

lib/6to5/traverse/scope.js

@@ -115,3 +115,3 @@ module.exports = Scope;

} else {
throw new Error("wtf");
throw new TypeError("cannot add a declaration here in node type " + block.type);
}

@@ -118,0 +118,0 @@ };

{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "1.13.9",
"version": "1.13.10",
"author": "Sebastian McKenzie <sebmck@gmail.com>",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/6to5/6to5",

Sorry, the diff of this file is too big to display

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