reservedWords.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function write(args)
  6. {
  7. WScript.Echo(args);
  8. }
  9. var foo = {};
  10. foo.with =10;
  11. write(foo.with);
  12. foo.if = foo.with;
  13. write(foo.if);
  14. foo.function = function (){ write("Inside foo.function");}
  15. function bar()
  16. {
  17. this.function();
  18. }
  19. var k = bar.apply(foo);
  20. var tokenCodes = {
  21. null: 0,
  22. true: 1,
  23. false: 2,
  24. break:3,
  25. case:4,
  26. catch: function() { write("Inside tokenCodes.catch");}
  27. };
  28. tokenCodes.catch();
  29. for(var i in tokenCodes)
  30. {
  31. write(i);
  32. }
  33. var allTokenCodes = {
  34. break : 1,
  35. case : 1,
  36. catch : 1,
  37. class : 1,
  38. const : 1,
  39. continue : 1,
  40. debugger : 1,
  41. decimal : 1,
  42. default : 1,
  43. delete : 1,
  44. do : 1,
  45. else : 1,
  46. enum : 1,
  47. export : 1,
  48. extends : 1,
  49. false : 1,
  50. finally : 1,
  51. for : 1,
  52. function : 1,
  53. if : 1,
  54. import : 1,
  55. in : 1,
  56. instanceof : 1,
  57. invariant : 1,
  58. long : 1,
  59. namespace : 1,
  60. native : 1,
  61. new : 1,
  62. null : 1,
  63. package : 1,
  64. private : 1,
  65. return : 1,
  66. sbyte : 1,
  67. super : 1,
  68. switch : 1,
  69. this : 1,
  70. throw : 1,
  71. throws : 1,
  72. transient : 1,
  73. true : 1,
  74. try : 1,
  75. typeof : 1,
  76. var : 1,
  77. void : 1,
  78. volatile : 1,
  79. while : 1,
  80. with : 1
  81. }
  82. for(var i in allTokenCodes)
  83. {
  84. write(i);
  85. }