Skip to content

Commit

Permalink
another hack in the code to tread const in for-of loop's like let (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Apr 20, 2022
1 parent ae89c0c commit adf304d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<body>
<release version="2.61.0" date="April xx, 2022" description="Chrome/Edge 100, Firefox 99, Bugfixes">
<action type="fix" dev="rbri" issue="449">
core-js: Did another hack in the code to tread const in for-of loop's like let.
</action>
<action type="fix" dev="rbri">
neko: Some missing end-of-file checks added (this fixes possible IndexOutOfBounds exceptions).
</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,31 @@ public void constInLoop() throws Exception {
loadPageVerifyTitle2(html);
}

/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = {"1", "2"},
IE = {})
@HtmlUnitNYI(IE = {"1", "2"})
public void constInOfLoop() throws Exception {
final String html = "<html><head>\n"
+ "<script>\n"
+ LOG_TITLE_FUNCTION
+ "function test() {\n"
+ " var arr = [1, 2];\n"
+ " for(const elem of arr) {\n"
+ " log(elem);\n"
+ " }\n"
+ "}\n"
+ "</script>\n"
+ "</head>\n"
+ "<body onload='test()'>\n"
+ "</body></html>";

loadPageVerifyTitle2(html);
}

/**
* @throws Exception if the test fails
*/
Expand Down

0 comments on commit adf304d

Please # to comment.