You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
593 B
28 lines
593 B
|
3 years ago
|
"use strict";
|
||
|
|
|
||
|
|
Object.defineProperty(exports, "__esModule", {
|
||
|
|
value: true
|
||
|
|
});
|
||
|
|
exports.default = isScope;
|
||
|
|
|
||
|
|
var _generated = require("./generated");
|
||
|
|
|
||
|
|
function isScope(node, parent) {
|
||
|
|
if ((0, _generated.isBlockStatement)(node) && (0, _generated.isFunction)(parent, {
|
||
|
|
body: node
|
||
|
|
})) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ((0, _generated.isBlockStatement)(node) && (0, _generated.isCatchClause)(parent, {
|
||
|
|
body: node
|
||
|
|
})) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ((0, _generated.isPattern)(node) && (0, _generated.isFunction)(parent)) {
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
return (0, _generated.isScopable)(node);
|
||
|
|
}
|