diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/@babel/traverse/lib/path')
-rw-r--r-- | tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/introspection.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/introspection.js b/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/introspection.js index 175ef2d771..2cd224a81b 100644 --- a/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/introspection.js +++ b/tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/introspection.js @@ -94,9 +94,12 @@ function isCompletionRecord(allowInsideFunction) { let first = true; do { - const container = path.container; + const { + type, + container + } = path; - if (path.isFunction() && !first) { + if (!first && (path.isFunction() || type === "StaticBlock")) { return !!allowInsideFunction; } @@ -105,7 +108,7 @@ function isCompletionRecord(allowInsideFunction) { if (Array.isArray(container) && path.key !== container.length - 1) { return false; } - } while ((path = path.parentPath) && !path.isProgram()); + } while ((path = path.parentPath) && !path.isProgram() && !path.isDoExpression()); return true; } |