reserved.js 810 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. var freeze = Object.freeze
  3. , keywords, future, futureStrict, all;
  4. // 7.6.1.1 Keywords
  5. keywords = freeze(['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do',
  6. 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new',
  7. 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while',
  8. 'with']);
  9. // 7.6.1.2 Future Reserved Words
  10. future = freeze(['class', 'const', 'enum', 'exports', 'extends', 'import', 'super'])
  11. // Future Reserved Words (only in strict mode)
  12. futureStrict = freeze(['implements', 'interface', 'let', 'package', 'private', 'protected', 'public',
  13. 'static', 'yield']);
  14. all = module.exports = keywords.concat(future, futureStrict);
  15. all.keywords = keywords;
  16. all.future = future;
  17. all.futureStrict = futureStrict;
  18. freeze(all);