@babel/plugin-transform-new-target
Advanced tools
Comparing version 7.0.0-beta.46 to 7.0.0-beta.47
@@ -9,3 +9,3 @@ "use strict"; | ||
function _helperPluginUtils() { | ||
var data = require("@babel/helper-plugin-utils"); | ||
const data = require("@babel/helper-plugin-utils"); | ||
@@ -20,3 +20,3 @@ _helperPluginUtils = function _helperPluginUtils() { | ||
function _core() { | ||
var data = require("@babel/core"); | ||
const data = require("@babel/core"); | ||
@@ -30,3 +30,3 @@ _core = function _core() { | ||
var _default = (0, _helperPluginUtils().declare)(function (api) { | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
api.assertVersion(7); | ||
@@ -36,6 +36,6 @@ return { | ||
visitor: { | ||
MetaProperty: function MetaProperty(path) { | ||
var meta = path.get("meta"); | ||
var property = path.get("property"); | ||
var scope = path.scope; | ||
MetaProperty(path) { | ||
const meta = path.get("meta"); | ||
const property = path.get("property"); | ||
const scope = path.scope; | ||
@@ -47,3 +47,3 @@ if (meta.isIdentifier({ | ||
})) { | ||
var func = path.findParent(function (path) { | ||
const func = path.findParent(path => { | ||
if (path.isClass()) return true; | ||
@@ -68,3 +68,3 @@ | ||
var node = func.node; | ||
const node = func.node; | ||
@@ -80,12 +80,13 @@ if (!node.id) { | ||
var _constructor = _core().types.memberExpression(_core().types.thisExpression(), _core().types.identifier("constructor")); | ||
const constructor = _core().types.memberExpression(_core().types.thisExpression(), _core().types.identifier("constructor")); | ||
if (func.isClass()) { | ||
path.replaceWith(_constructor); | ||
path.replaceWith(constructor); | ||
return; | ||
} | ||
path.replaceWith(_core().types.conditionalExpression(_core().types.binaryExpression("instanceof", _core().types.thisExpression(), _core().types.cloneNode(node.id)), _constructor, scope.buildUndefinedNode())); | ||
path.replaceWith(_core().types.conditionalExpression(_core().types.binaryExpression("instanceof", _core().types.thisExpression(), _core().types.cloneNode(node.id)), constructor, scope.buildUndefinedNode())); | ||
} | ||
} | ||
} | ||
@@ -92,0 +93,0 @@ }; |
{ | ||
"name": "@babel/plugin-transform-new-target", | ||
"version": "7.0.0-beta.46", | ||
"version": "7.0.0-beta.47", | ||
"description": "Transforms new.target meta property", | ||
@@ -12,13 +12,13 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.46" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.47" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.46" | ||
"@babel/core": "7.0.0-beta.47" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.46", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.46", | ||
"@babel/plugin-proposal-class-properties": "7.0.0-beta.46", | ||
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.46" | ||
"@babel/core": "7.0.0-beta.47", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.47", | ||
"@babel/plugin-proposal-class-properties": "7.0.0-beta.47", | ||
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.47" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
4753
+ Added@babel/code-frame@7.0.0-beta.47(transitive)
+ Added@babel/core@7.0.0-beta.47(transitive)
+ Added@babel/generator@7.0.0-beta.47(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.47(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.47(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.47(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.47(transitive)
+ Added@babel/helpers@7.0.0-beta.47(transitive)
+ Added@babel/highlight@7.0.0-beta.47(transitive)
+ Added@babel/template@7.0.0-beta.47(transitive)
+ Added@babel/traverse@7.0.0-beta.47(transitive)
+ Added@babel/types@7.0.0-beta.47(transitive)
+ Addedbabylon@7.0.0-beta.47(transitive)
- Removed@babel/code-frame@7.0.0-beta.46(transitive)
- Removed@babel/core@7.0.0-beta.46(transitive)
- Removed@babel/generator@7.0.0-beta.46(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.46(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.46(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.46(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.46(transitive)
- Removed@babel/helpers@7.0.0-beta.46(transitive)
- Removed@babel/highlight@7.0.0-beta.46(transitive)
- Removed@babel/template@7.0.0-beta.46(transitive)
- Removed@babel/traverse@7.0.0-beta.46(transitive)
- Removed@babel/types@7.0.0-beta.46(transitive)
- Removedbabylon@7.0.0-beta.46(transitive)