@babel/plugin-transform-new-target
Advanced tools
Comparing version 7.0.0-beta.43 to 7.0.0-beta.44
@@ -9,5 +9,5 @@ "use strict"; | ||
function _helperPluginUtils() { | ||
const data = require("@babel/helper-plugin-utils"); | ||
var data = require("@babel/helper-plugin-utils"); | ||
_helperPluginUtils = function () { | ||
_helperPluginUtils = function _helperPluginUtils() { | ||
return data; | ||
@@ -20,5 +20,5 @@ }; | ||
function _core() { | ||
const data = require("@babel/core"); | ||
var data = require("@babel/core"); | ||
_core = function () { | ||
_core = function _core() { | ||
return data; | ||
@@ -30,3 +30,3 @@ }; | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
var _default = (0, _helperPluginUtils().declare)(function (api) { | ||
api.assertVersion(7); | ||
@@ -36,8 +36,6 @@ return { | ||
visitor: { | ||
MetaProperty(path) { | ||
const meta = path.get("meta"); | ||
const property = path.get("property"); | ||
const { | ||
scope | ||
} = path; | ||
MetaProperty: function MetaProperty(path) { | ||
var meta = path.get("meta"); | ||
var property = path.get("property"); | ||
var scope = path.scope; | ||
@@ -49,3 +47,3 @@ if (meta.isIdentifier({ | ||
})) { | ||
const func = path.findParent(path => { | ||
var func = path.findParent(function (path) { | ||
if (path.isClass()) return true; | ||
@@ -70,5 +68,3 @@ | ||
const { | ||
node | ||
} = func; | ||
var node = func.node; | ||
@@ -84,13 +80,12 @@ if (!node.id) { | ||
const constructor = _core().types.memberExpression(_core().types.thisExpression(), _core().types.identifier("constructor")); | ||
var _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())); | ||
} | ||
} | ||
} | ||
@@ -97,0 +92,0 @@ }; |
{ | ||
"name": "@babel/plugin-transform-new-target", | ||
"version": "7.0.0-beta.43", | ||
"version": "7.0.0-beta.44", | ||
"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.43" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.44" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.43" | ||
"@babel/core": "7.0.0-beta.44" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.43", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.43", | ||
"@babel/plugin-proposal-class-properties": "7.0.0-beta.43", | ||
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.43" | ||
"@babel/core": "7.0.0-beta.44", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.44", | ||
"@babel/plugin-proposal-class-properties": "7.0.0-beta.44", | ||
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.44" | ||
} | ||
} |
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
4778
67
+ Added@babel/code-frame@7.0.0-beta.44(transitive)
+ Added@babel/core@7.0.0-beta.44(transitive)
+ Added@babel/generator@7.0.0-beta.44(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.44(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.44(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.44(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.44(transitive)
+ Added@babel/helpers@7.0.0-beta.44(transitive)
+ Added@babel/highlight@7.0.0-beta.44(transitive)
+ Added@babel/template@7.0.0-beta.44(transitive)
+ Added@babel/traverse@7.0.0-beta.44(transitive)
+ Added@babel/types@7.0.0-beta.44(transitive)
+ Addedbabylon@7.0.0-beta.44(transitive)
- Removed@babel/code-frame@7.0.0-beta.43(transitive)
- Removed@babel/core@7.0.0-beta.43(transitive)
- Removed@babel/generator@7.0.0-beta.43(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.43(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.43(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.43(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.43(transitive)
- Removed@babel/helpers@7.0.0-beta.43(transitive)
- Removed@babel/highlight@7.0.0-beta.43(transitive)
- Removed@babel/template@7.0.0-beta.43(transitive)
- Removed@babel/traverse@7.0.0-beta.43(transitive)
- Removed@babel/types@7.0.0-beta.43(transitive)
- Removedbabylon@7.0.0-beta.43(transitive)