arguments.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 print(x) { WScript.Echo(x+""); }
  6. let arguments = 'global let arguments';
  7. print(arguments);
  8. function testLetBlockScope() {
  9. {
  10. let arguments = 'let arguments block scoped';
  11. print(arguments);
  12. }
  13. print(arguments);
  14. }
  15. testLetBlockScope();
  16. function testConstBlockScope() {
  17. {
  18. const arguments = 'const arguments block scoped';
  19. print(arguments);
  20. }
  21. print(arguments);
  22. }
  23. testConstBlockScope();
  24. eval("let arguments = 'eval global let arguments'; print(arguments);");
  25. eval("const arguments = 'eval global const arguments'; print(arguments);");
  26. function testLetFunctionScope() {
  27. let arguments = 'let arguments function scope';
  28. print(arguments);
  29. }
  30. testLetFunctionScope();
  31. function testConstFunctionScope() {
  32. const arguments = 'const arguments function scope';
  33. print(arguments);
  34. }
  35. testConstFunctionScope();
  36. // OS 206284
  37. function test() {
  38. (function() { /*sStart*/ ;
  39. {
  40. let veymqa = arguments;
  41. for (let gvvmwv = 0, arguments; gvvmwv < 12; ++gvvmwv) {}
  42. };; /*sEnd*/
  43. })();
  44. }
  45. test();