-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
- Version: v7.4.0
- Platform: Windows 10 64bit
The following code is executed normally from a file, but throws from REPL.
function f(){} f()
// REPL output:
var f = function f(){} f()
^
SyntaxError: Unexpected identifierI guess the function declaration is converted to function expression which unlike the declaration requires semicolon. However, everything works fine with 5; function f(){} f().
Also, this code works in REPL: function f(){}, a=9, but it shouldn't.
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.