Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick d102e7a. rdar://problem/101940195
Fix duplicated name in class static block https://bugs.webkit.org/show_bug.cgi?id=247426 rdar://101940195 Reviewed by Mark Lam. When parsing block statement in static block mode, we should alllow var declaration in the block scope. This is becuase static block is evaluated as a function call, where function scope should allow var declaration. In this case, var variables would be bounded under the static block scope when checking hoistable declarations in the parsing phase. * JSTests/stress/class-static-block.js: (foo.x): (foo): * Source/JavaScriptCore/parser/Parser.cpp: (JSC::Parser<LexerType>::parseBlockStatement): * Source/JavaScriptCore/parser/Parser.h: (JSC::Scope::setAllowsVarDeclarations): Canonical link: https://commits.webkit.org/256311@main Canonical link: https://commits.webkit.org/256138.58@safari-7615.1.12-branch
- Loading branch information