You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @filename: test.jsfunctiontest(...args,){}// trailing comma not allowedclassC{asyncstaticfoo(){}// modifiers are in the wrong order}
@decorator// invalid decorator locationasyncvarv=1;// invalid modifier locationlet{...rest: rest}={};// rest property cannot have a property name
Expected behavior:
All errors above are reported in JS files as they result in parse errors when executed.
Actual behavior:
The above file has no errors. They are not reported as syntax errors because TypeScript's parser is more permissive than the spec in many cases. Since grammar errors are only reported during type-checking they are ignored in JS files without // @ts-check.
Other JS parsers, e.g. javascript VMs, emit a parse error for the code above.
Related Issues: #6107 suggests moving grammar errors to the binding phase #6802
The text was updated successfully, but these errors were encountered:
TypeScript Version: 3.3.0-dev.20181222
Search Terms:
Code
Expected behavior:
All errors above are reported in JS files as they result in parse errors when executed.
Actual behavior:
The above file has no errors. They are not reported as syntax errors because TypeScript's parser is more permissive than the spec in many cases. Since grammar errors are only reported during type-checking they are ignored in JS files without
// @ts-check
.Other JS parsers, e.g. javascript VMs, emit a parse error for the code above.
Related Issues:
#6107 suggests moving grammar errors to the binding phase
#6802
The text was updated successfully, but these errors were encountered: