@babel/helper-replace-supers
Advanced tools
Comparing version 7.21.4-esm.2 to 7.21.4-esm.3
@@ -1,7 +0,25 @@ | ||
import environmentVisitor from "@babel/helper-environment-visitor"; | ||
import memberExpressionToFunctions from "@babel/helper-member-expression-to-functions"; | ||
import optimiseCall from "@babel/helper-optimise-call-expression"; | ||
import template from "@babel/template"; | ||
import traverse from "@babel/traverse"; | ||
import * as _t from "@babel/types"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
Object.defineProperty(exports, "environmentVisitor", { | ||
enumerable: true, | ||
get: function () { | ||
return _helperEnvironmentVisitor.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "skipAllButComputedKey", { | ||
enumerable: true, | ||
get: function () { | ||
return _helperEnvironmentVisitor.skipAllButComputedKey; | ||
} | ||
}); | ||
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor"); | ||
var _helperMemberExpressionToFunctions = require("@babel/helper-member-expression-to-functions"); | ||
var _helperOptimiseCallExpression = require("@babel/helper-optimise-call-expression"); | ||
var _template = require("@babel/template"); | ||
var _traverse = require("@babel/traverse"); | ||
var _t = require("@babel/types"); | ||
const { | ||
@@ -18,3 +36,2 @@ assignmentExpression, | ||
} = _t; | ||
export { default as environmentVisitor, skipAllButComputedKey } from "@babel/helper-environment-visitor"; | ||
function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) { | ||
@@ -25,3 +42,3 @@ objectRef = cloneNode(objectRef); | ||
} | ||
const visitor = traverse.visitors.merge([environmentVisitor, { | ||
const visitor = _traverse.default.visitors.merge([_helperEnvironmentVisitor.default, { | ||
Super(path, state) { | ||
@@ -38,3 +55,3 @@ const { | ||
}]); | ||
const unshadowSuperBindingVisitor = traverse.visitors.merge([environmentVisitor, { | ||
const unshadowSuperBindingVisitor = _traverse.default.visitors.merge([_helperEnvironmentVisitor.default, { | ||
Scopable(path, { | ||
@@ -110,15 +127,15 @@ refName | ||
const thisRefs = this._getThisRefs(); | ||
return optimiseCall(this._get(superMember, thisRefs), cloneNode(thisRefs.this), args, false); | ||
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), cloneNode(thisRefs.this), args, false); | ||
}, | ||
optionalCall(superMember, args) { | ||
const thisRefs = this._getThisRefs(); | ||
return optimiseCall(this._get(superMember, thisRefs), cloneNode(thisRefs.this), args, true); | ||
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), cloneNode(thisRefs.this), args, true); | ||
}, | ||
delete(superMember) { | ||
if (superMember.node.computed) { | ||
return sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"), [cloneNode(superMember.node.property)]), template.expression.ast` | ||
return sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"), [cloneNode(superMember.node.property)]), _template.default.expression.ast` | ||
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }() | ||
`]); | ||
} else { | ||
return template.expression.ast` | ||
return _template.default.expression.ast` | ||
function () { throw new ReferenceError("'delete super.prop' is invalid"); }() | ||
@@ -173,9 +190,9 @@ `; | ||
call(superMember, args) { | ||
return optimiseCall(this.get(superMember), thisExpression(), args, false); | ||
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, false); | ||
}, | ||
optionalCall(superMember, args) { | ||
return optimiseCall(this.get(superMember), thisExpression(), args, true); | ||
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, true); | ||
} | ||
}); | ||
export default class ReplaceSupers { | ||
class ReplaceSupers { | ||
constructor(opts) { | ||
@@ -210,3 +227,3 @@ var _opts$constantSuper; | ||
const handler = this.constantSuper ? looseHandlers : specHandlers; | ||
memberExpressionToFunctions(this.methodPath, visitor, Object.assign({ | ||
(0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({ | ||
file: this.file, | ||
@@ -223,3 +240,4 @@ scope: this.methodPath.scope, | ||
} | ||
exports.default = ReplaceSupers; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/helper-replace-supers", | ||
"version": "7.21.4-esm.2", | ||
"version": "7.21.4-esm.3", | ||
"description": "Helper function to replace supers", | ||
@@ -17,8 +17,8 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-environment-visitor": "7.21.4-esm.2", | ||
"@babel/helper-member-expression-to-functions": "7.21.4-esm.2", | ||
"@babel/helper-optimise-call-expression": "7.21.4-esm.2", | ||
"@babel/template": "7.21.4-esm.2", | ||
"@babel/traverse": "7.21.4-esm.2", | ||
"@babel/types": "7.21.4-esm.2" | ||
"@babel/helper-environment-visitor": "7.21.4-esm.3", | ||
"@babel/helper-member-expression-to-functions": "7.21.4-esm.3", | ||
"@babel/helper-optimise-call-expression": "7.21.4-esm.3", | ||
"@babel/template": "7.21.4-esm.3", | ||
"@babel/traverse": "7.21.4-esm.3", | ||
"@babel/types": "7.21.4-esm.3" | ||
}, | ||
@@ -25,0 +25,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
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
31813
234
+ Added@babel/code-frame@7.21.4-esm.3(transitive)
+ Added@babel/generator@7.21.4-esm.3(transitive)
+ Added@babel/helper-environment-visitor@7.21.4-esm.3(transitive)
+ Added@babel/helper-function-name@7.21.4-esm.3(transitive)
+ Added@babel/helper-hoist-variables@7.21.4-esm.3(transitive)
+ Added@babel/helper-member-expression-to-functions@7.21.4-esm.3(transitive)
+ Added@babel/helper-optimise-call-expression@7.21.4-esm.3(transitive)
+ Added@babel/helper-split-export-declaration@7.21.4-esm.3(transitive)
+ Added@babel/helper-string-parser@7.21.4-esm.3(transitive)
+ Added@babel/helper-validator-identifier@7.21.4-esm.3(transitive)
+ Added@babel/highlight@7.21.4-esm.3(transitive)
+ Added@babel/parser@7.21.4-esm.3(transitive)
+ Added@babel/template@7.21.4-esm.3(transitive)
+ Added@babel/traverse@7.21.4-esm.3(transitive)
+ Added@babel/types@7.21.4-esm.3(transitive)
- Removed@babel/code-frame@7.21.4-esm.2(transitive)
- Removed@babel/generator@7.21.4-esm.2(transitive)
- Removed@babel/helper-environment-visitor@7.21.4-esm.2(transitive)
- Removed@babel/helper-function-name@7.21.4-esm.2(transitive)
- Removed@babel/helper-hoist-variables@7.21.4-esm.2(transitive)
- Removed@babel/helper-member-expression-to-functions@7.21.4-esm.2(transitive)
- Removed@babel/helper-optimise-call-expression@7.21.4-esm.2(transitive)
- Removed@babel/helper-split-export-declaration@7.21.4-esm.2(transitive)
- Removed@babel/helper-string-parser@7.21.4-esm.2(transitive)
- Removed@babel/helper-validator-identifier@7.21.4-esm.2(transitive)
- Removed@babel/highlight@7.21.4-esm.2(transitive)
- Removed@babel/parser@7.21.4-esm.2(transitive)
- Removed@babel/template@7.21.4-esm.2(transitive)
- Removed@babel/traverse@7.21.4-esm.2(transitive)
- Removed@babel/types@7.21.4-esm.2(transitive)
Updated@babel/helper-member-expression-to-functions@7.21.4-esm.3
Updated@babel/template@7.21.4-esm.3
Updated@babel/traverse@7.21.4-esm.3
Updated@babel/types@7.21.4-esm.3