Skip to content

Commit

Permalink
Update scopestate_statefield.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Jan 17, 2025
1 parent da96738 commit 4e0cde3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/components/CellInput/scopestate_statefield.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ const find_local_definition = (locals, name, cursor) => {
}
}

const HardScopeNames = new Set(["WhileStatement", "ForStatement", "TryStatement", "LetStatement", "FunctionDefinition", "MacroDefinition", "DoClause"])
const HardScopeNames = new Set([
"WhileStatement",
"ForStatement",
"TryStatement",
"LetStatement",
"FunctionDefinition",
"MacroDefinition",
"DoClause",
"Generator",
])

const does_this_create_scope = (/** @type {TreeCursor} */ cursor) => {
if (HardScopeNames.has(cursor.name)) return true
Expand Down

0 comments on commit 4e0cde3

Please sign in to comment.