-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Circular function expressions #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserStatementIsNotAMemberVariableDeclaration1.ts (1 errors) ==== | ||
| ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserStatementIsNotAMemberVariableDeclaration1.ts (2 errors) ==== | ||
| return { | ||
| ~~~~~~ | ||
| !!! A 'return' statement can only be used within a function body. | ||
|
|
@@ -7,6 +7,8 @@ | |
|
|
||
| // 'private' should not be considered a member variable here. | ||
| private[key] = value; | ||
| ~~~~~~~ | ||
| !!! Cannot find name 'private'. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously this error wouldn't be reported because the expression in the return statement isn't type checked if the return statement occurs in a disallowed location. It's not worth the complexity to recompute whether we should skip the function expression body check phase, so the check always occurs. |
||
|
|
||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting.. why was that missed before?
also the comment seems wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this error wouldn't be reported because the expression in the return statement isn't type checked if the return statement occurs in a disallowed location. It's not worth the complexity to recompute whether we should skip the function expression body check phase, so the check always occurs.