Repository navigation
List of reserved keywords #2536
Description
Activity
DanielRosenwasser commented
on Mar 28, 2015 MemberMore actionsWhile you could refer to the ES6 spec to figure out a partial list, it might be better to go directly to the code for the current list. Perhaps it would be better to keep a complete list as part of the TS spec (Anders Hejlsberg (@ahejlsberg))
Based on the code, I ripped this out for you:
Reserved Words Strict Mode Reserved Words Contextual Keywords breakasanycaseimplementsbooleancatchinterfaceconstructorclassletdeclareconstpackagegetcontinueprivatemoduledebuggerprotectedrequiredefaultpublicnumberdeletestaticsetdoyieldstringelsesymbolenumtypeexportfromextendsoffalsefinallyforfunctionifimportininstanceofnewnullreturnsuperswitchthisthrowtruetrytypeofvarvoidwhilewithAnd if you want to just copy more easily:
Reserved Words breakcasecatchclassconstcontinuedebuggerdefaultdeletedoelseenumexportextendsfalsefinallyforfunctionifimportininstanceofnewnullreturnsuperswitchthisthrowtruetrytypeofvarvoidwhilewithStrict Mode Reserved Words asimplementsinterfaceletpackageprivateprotectedpublicstaticyieldContextual Keywords anybooleanconstructordeclaregetmodulerequirenumbersetstringsymboltypefromofReacted by Sam Felix, Jonas Oppenlaender, Balakrishnan (Balki) Ranganathan, Steven, Hadrien TOMA, Trevor Chunestudy, Humphrey Hills, Dmitry Razumikhin, scf37, Ivan Babak and 12 more- addedQuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
on Mar 28, 2015 DanielRosenwasser commented
on May 1, 2015 MemberMore actionsAlso
namespace, maybeasyncandawaiteventually.Daniel Rosenwasser (@DanielRosenwasser) looks like this should have a wiki page
I tried a few of reserve words mentioned here on the Typescript Playground and didn't encounter any issues. IMO, the keywords should match at least those for ES6. For the later I have a list here https://github.com/crissdev/is-keyword-js/blob/master/index.js which is a list created from MDN site.
- locked and limited conversation to collaborators
on Jun 18, 2018
Is there a list of reserved keywords for Typescript somewhere? I have looked around and couldn't find it, even in the language specification.