This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge chakra-core/ChakraCore@391e601df6] [1.6>1.7] [MERGE #3428 @cur…
…tisman] Fix Issue #3039: Arrow function should terminate the expression unless followed by a comma Merge pull request #3428 from curtisman:fix3039
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Expected ';' | ||
2 | ||
3 | ||
Expected ';' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
try | ||
{ | ||
// Illegal case, arrow function terminates the expression | ||
eval("x=>{}/print(1)/+print(2)") | ||
} | ||
catch (e) | ||
{ | ||
print(e.message); | ||
} | ||
|
||
// Legal case, the line feed breaks the statement | ||
x=>{} | ||
/print(1)/+print(2) | ||
|
||
// Legal case, comma separate ExpressionStatement | ||
x=>{return 2;},y=>{return 3;} | ||
|
||
// Legal case, comma separate Expression (with paren) | ||
var a = (x=>{return 2;},y=>{return 3;}) | ||
print(a()) | ||
|
||
|
||
try | ||
{ | ||
eval("var a = x=>{return 2;},y=>{return 3;}"); | ||
} | ||
catch (e) | ||
{ | ||
print(e.message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters