| Summary: | Functions are lexically scoped inside static blocks where variable declarations are allowed, ASSERT_WITH_MESSAGE(!m_declaredVariables.size(), "..."); | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Corban Amouzou <c0dineDev> |
| Component: | JavaScriptCore | Assignee: | Yijia Huang <yijia_huang> |
| Status: | RESOLVED FIXED | ||
| Severity: | Trivial | CC: | mark.lam, webkit-bug-importer, yijia_huang, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | All | ||
| OS: | All | ||
Pull request: https://github.com/WebKit/WebKit/pull/9729 Committed 259981@main (b9e63fd65e32): <https://commits.webkit.org/259981@main> Reviewed commits have been landed. Closing PR #9729 and removing active labels. |
In Source/JavaScriptCore/parser/Parser.h we hit the assertion: ASSERT_WITH_MESSAGE(!m_declaredVariables.size(), "..."); This is triggered by a simple case where a class function is declared inside of a static scope: class A { static { var B; function C() {} } } What's interesting is that I would assume the variables inside that block would be scoped to that class statically, IE the variable B would be accessible through A.B, but that simply is not the case. It's not a pressing concern, but it seems like a possible regression of https://bugs.webkit.org/show_bug.cgi?id=168844