Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-object-super

Package Overview
Dependencies
Maintainers
4
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-object-super - npm Package Compare versions

Comparing version 8.0.0-alpha.4 to 8.0.0-alpha.5

34

lib/index.js

@@ -14,6 +14,22 @@ import { declare } from '@babel/helper-plugin-utils';

var index = declare(api => {
api.assertVersion(7);
api.assertVersion("8.0.0-alpha.5");
const newLets = new Set();
return {
name: "transform-object-super",
visitor: {
Loop: {
exit(path) {
newLets.forEach(v => {
if (v.scopePath === path) {
path.scope.push({
id: v.id,
kind: "let"
});
path.scope.crawl();
path.requeue();
newLets.delete(v);
}
});
}
},
ObjectExpression(path, state) {

@@ -27,5 +43,15 @@ let objectRef;

if (objectRef) {
path.scope.push({
id: types.cloneNode(objectRef)
});
const scopePath = path.findParent(p => p.isFunction() || p.isProgram() || p.isLoop());
const useLet = scopePath.isLoop();
if (useLet) {
newLets.add({
scopePath,
id: types.cloneNode(objectRef)
});
} else {
path.scope.push({
id: types.cloneNode(objectRef),
kind: "var"
});
}
path.replaceWith(types.assignmentExpression("=", types.cloneNode(objectRef), path.node));

@@ -32,0 +58,0 @@ }

12

package.json
{
"name": "@babel/plugin-transform-object-super",
"version": "8.0.0-alpha.4",
"version": "8.0.0-alpha.5",
"description": "Compile ES2015 object super to ES5",

@@ -20,11 +20,11 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^8.0.0-alpha.4",
"@babel/helper-replace-supers": "^8.0.0-alpha.4"
"@babel/helper-plugin-utils": "^8.0.0-alpha.5",
"@babel/helper-replace-supers": "^8.0.0-alpha.5"
},
"peerDependencies": {
"@babel/core": "^8.0.0-alpha.4"
"@babel/core": "^8.0.0-alpha.5"
},
"devDependencies": {
"@babel/core": "^8.0.0-alpha.4",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.4"
"@babel/core": "^8.0.0-alpha.5",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.5"
},

@@ -31,0 +31,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc