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

6to5-core

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

6to5-core - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

29

lib/6to5/transformation/transformers/es6/parameters.default.js
"use strict";
var util = require("../../../util");
var t = require("../../../types");
var traverse = require("../../../traverse");
var util = require("../../../util");
var t = require("../../../types");

@@ -13,2 +14,11 @@ var hasDefaults = function (node) {

var iifeVisitor = {
enter: function (node, parent, scope, context, state) {
if (t.isReferencedIdentifier(node, parent) && scope.hasOwn(node.name)) {
state.iife = true;
context.stop();
}
}
};
exports.Function = function (node, parent, scope) {

@@ -19,3 +29,2 @@ if (!hasDefaults(node)) return;

var iife = false;
var body = [];

@@ -28,2 +37,4 @@

var state = { iife: false, scope: scope };
for (var i = 0; i < node.params.length; i++) {

@@ -42,6 +53,8 @@ var param = node.params[i];

// we're accessing a variable that's already defined within this function
var localDeclar = scope.get(left.name, true);
if (localDeclar !== left) {
iife = true;
if (!state.iife) {
if (t.isIdentifier(right) && scope.hasOwn(right.name)) {
state.iife = true;
} else {
traverse(right, iifeVisitor, scope, state);
}
}

@@ -62,3 +75,3 @@

if (iife) {
if (state.iife) {
var container = t.functionExpression(null, [], node.body, node.generator);

@@ -65,0 +78,0 @@ container._aliasFunction = true;

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

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

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