@babel/plugin-proposal-function-sent
Advanced tools
Comparing version 7.21.4-esm.4 to 7.22.5
@@ -1,13 +0,19 @@ | ||
import { declare } from "@babel/helper-plugin-utils"; | ||
import syntaxFunctionSent from "@babel/plugin-syntax-function-sent"; | ||
import wrapFunction from "@babel/helper-wrap-function"; | ||
import { types as t } from "@babel/core"; | ||
export default declare(api => { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
var _pluginSyntaxFunctionSent = require("@babel/plugin-syntax-function-sent"); | ||
var _helperWrapFunction = require("@babel/helper-wrap-function"); | ||
var _core = require("@babel/core"); | ||
var _default = (0, _helperPluginUtils.declare)(api => { | ||
api.assertVersion(7); | ||
const isFunctionSent = node => t.isIdentifier(node.meta, { | ||
const isFunctionSent = node => _core.types.isIdentifier(node.meta, { | ||
name: "function" | ||
}) && t.isIdentifier(node.property, { | ||
}) && _core.types.isIdentifier(node.property, { | ||
name: "sent" | ||
}); | ||
const hasBeenReplaced = (node, sentId) => t.isAssignmentExpression(node) && t.isIdentifier(node.left, { | ||
const hasBeenReplaced = (node, sentId) => _core.types.isAssignmentExpression(node) && _core.types.isIdentifier(node.left, { | ||
name: sentId | ||
@@ -21,3 +27,3 @@ }); | ||
if (!hasBeenReplaced(path.parent, this.sentId)) { | ||
path.replaceWith(t.assignmentExpression("=", t.identifier(this.sentId), path.node)); | ||
path.replaceWith(_core.types.assignmentExpression("=", _core.types.identifier(this.sentId), path.node)); | ||
} | ||
@@ -27,3 +33,3 @@ }, | ||
if (isFunctionSent(path.node)) { | ||
path.replaceWith(t.identifier(this.sentId)); | ||
path.replaceWith(_core.types.identifier(this.sentId)); | ||
} | ||
@@ -34,3 +40,3 @@ } | ||
name: "proposal-function-sent", | ||
inherits: syntaxFunctionSent, | ||
inherits: _pluginSyntaxFunctionSent.default, | ||
visitor: { | ||
@@ -47,4 +53,4 @@ MetaProperty(path, state) { | ||
}); | ||
fnPath.node.body.body.unshift(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(sentId), t.yieldExpression())])); | ||
wrapFunction(fnPath, state.addHelper("skipFirstGeneratorNext")); | ||
fnPath.node.body.body.unshift(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.identifier(sentId), _core.types.yieldExpression())])); | ||
(0, _helperWrapFunction.default)(fnPath, state.addHelper("skipFirstGeneratorNext")); | ||
} | ||
@@ -54,3 +60,4 @@ } | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-proposal-function-sent", | ||
"version": "7.21.4-esm.4", | ||
"version": "7.22.5", | ||
"description": "Compile the function.sent meta property to valid ES2015 code", | ||
@@ -20,12 +20,12 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.21.4-esm.4", | ||
"@babel/helper-wrap-function": "7.21.4-esm.4", | ||
"@babel/plugin-syntax-function-sent": "7.21.4-esm.4" | ||
"@babel/helper-plugin-utils": "^7.22.5", | ||
"@babel/helper-wrap-function": "^7.22.5", | ||
"@babel/plugin-syntax-function-sent": "^7.22.5" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0-0 || ^7.21.4-esm.2" | ||
"@babel/core": "^7.0.0-0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.21.4-esm.4", | ||
"@babel/helper-plugin-test-runner": "7.21.4-esm.4" | ||
"@babel/core": "^7.22.5", | ||
"@babel/helper-plugin-test-runner": "^7.22.5" | ||
}, | ||
@@ -36,3 +36,3 @@ "engines": { | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "module" | ||
"type": "commonjs" | ||
} |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9210
56
0
5
No
+ Added@babel/helper-plugin-utils@7.24.8(transitive)
+ Added@babel/helper-wrap-function@7.25.0(transitive)
+ Added@babel/plugin-syntax-function-sent@7.24.7(transitive)
- Removed@babel/code-frame@7.21.4-esm.4(transitive)
- Removed@babel/generator@7.21.4-esm.4(transitive)
- Removed@babel/helper-environment-visitor@7.21.4-esm.4(transitive)
- Removed@babel/helper-function-name@7.21.4-esm.4(transitive)
- Removed@babel/helper-hoist-variables@7.21.4-esm.4(transitive)
- Removed@babel/helper-plugin-utils@7.21.4-esm.4(transitive)
- Removed@babel/helper-split-export-declaration@7.21.4-esm.4(transitive)
- Removed@babel/helper-string-parser@7.21.4-esm.4(transitive)
- Removed@babel/helper-validator-identifier@7.21.4-esm.4(transitive)
- Removed@babel/helper-wrap-function@7.21.4-esm.4(transitive)
- Removed@babel/highlight@7.21.4-esm.4(transitive)
- Removed@babel/parser@7.21.4-esm.4(transitive)
- Removed@babel/plugin-syntax-function-sent@7.21.4-esm.4(transitive)
- Removed@babel/template@7.21.4-esm.4(transitive)
- Removed@babel/traverse@7.21.4-esm.4(transitive)
- Removed@babel/types@7.21.4-esm.4(transitive)