Files
Vidal Guillermo Diazleal Ortega 5151f41f3f npm package security updates (babel/traverse)
I ran the following script to update @babel/traverse from 7.15.4 to 7.23.2 packages
to address the security issue tracked in crbug.com/1493744:

`npm run install-deps audit fix --audit-level=critical`

Bug: 1493744
Change-Id: Ie3fa0dc0527b6fa9e4b7906ee2034b95900c6033
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4953413
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2023-10-20 17:29:27 +00:00

53 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.requeueComputedKeyAndDecorators = requeueComputedKeyAndDecorators;
{
exports.skipAllButComputedKey = function skipAllButComputedKey(path) {
path.skip();
if (path.node.computed) {
path.context.maybeQueue(path.get("key"));
}
};
}
function requeueComputedKeyAndDecorators(path) {
const {
context,
node
} = path;
if (node.computed) {
context.maybeQueue(path.get("key"));
}
if (node.decorators) {
for (const decorator of path.get("decorators")) {
context.maybeQueue(decorator);
}
}
}
const visitor = {
FunctionParent(path) {
if (path.isArrowFunctionExpression()) {
return;
} else {
path.skip();
if (path.isMethod()) {
requeueComputedKeyAndDecorators(path);
}
}
},
Property(path) {
if (path.isObjectProperty()) {
return;
}
path.skip();
requeueComputedKeyAndDecorators(path);
}
};
var _default = visitor;
exports.default = _default;
//# sourceMappingURL=index.js.map