Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal: No-ASI mode #1064
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
WebReflection
Jan 12, 2018
I think it's been stated various times directives, such as 'use strict', won't ever be introduced again in the specs and this seems to be like a good fit for a linter (a new kind, if you want/need).
However, I like the SpiderMonkey behavior where you can (and you should) enable warnings and ASI mistakes will most likely come up (it's also funny the ASI, non-ASI debate always ends up with code nobody writes like the one in your example)
TL;DR I think unreachable code warnings are a very good red flag for any production code so that, beside non-ASI gotchas, it'd be cool of engines would all offer similar SpiderMonkey functionality during syntax parsing/code analysis.
WebReflection
commented
Jan 12, 2018
|
I think it's been stated various times directives, such as However, I like the SpiderMonkey behavior where you can (and you should) enable warnings and ASI mistakes will most likely come up (it's also funny the ASI, non-ASI debate always ends up with code nobody writes like the one in your example) TL;DR I think unreachable code warnings are a very good red flag for any production code so that, beside non-ASI gotchas, it'd be cool of engines would all offer similar SpiderMonkey functionality during syntax parsing/code analysis. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erights
Jan 12, 2018
I think it's been stated various times directives, such as 'use strict', won't ever be introduced again in the specs
@WebReflection There is no such absolute prohibition. Any proposal to add another would need to meet a very high bar. Indeed, a high enough bar that none is likely. However, if a proposal with a strong enough case is made, we would consider it.
erights
commented
Jan 12, 2018
@WebReflection There is no such absolute prohibition. Any proposal to add another would need to meet a very high bar. Indeed, a high enough bar that none is likely. However, if a proposal with a strong enough case is made, we would consider it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
annevk
Jan 12, 2018
Contributor
This should probably be closed given that feature requests are not supposed to be made in this repository. Please see https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md for guidelines on how to propose a new feature.
|
This should probably be closed given that feature requests are not supposed to be made in this repository. Please see https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md for guidelines on how to propose a new feature. |

manisenkov commentedJan 12, 2018
Inspired by debates at this PR.
Does it make sense to introduce No-ASI mode that can be activated, for instance, by
"use noasi";(similarily as"use strict";for the strict mode) clause at the begin of the script?At first look it could be simple to implement this mode in JS interpreters: whenever a case where normally semicolon must be automatically inserted is encountered, it just raise
SyntaxErrorinstead.For instance: