someMoreArguments.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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(v) { WScript.Echo(v + ""); }
  6. //
  7. // function f1_* just access arguments inside eval
  8. //
  9. (function f1_0() {
  10. write(eval('arguments'));
  11. }) ("something");
  12. (function f1_1(arguments) {
  13. write(eval('arguments'));
  14. }) ("something");
  15. (function f1_2(arguments) {
  16. var x = 10;
  17. write(eval('arguments + " " + x'));
  18. }) ("something");
  19. (function f1_3() {
  20. var arguments = 10;
  21. write(eval('arguments'));
  22. }) ("something");
  23. (function f1_4() {
  24. function arguments() { }
  25. write(eval('arguments'));
  26. }) ("something");
  27. (function f1_5(arguments, arguments) {
  28. write(eval('arguments'));
  29. }) ("something");
  30. //
  31. // function f2_* access arguments inside function and then access arguments inside eval
  32. //
  33. (function f2_0() {
  34. write(arguments);
  35. write(eval('arguments'));
  36. }) ("something 2");
  37. (function f2_1(arguments) {
  38. write(arguments);
  39. write(eval('arguments'));
  40. }) ("something 2");
  41. (function f2_2(arguments) {
  42. var x = 10;
  43. write(arguments);
  44. write(eval('arguments + " " + x'));
  45. }) ("something 2");
  46. (function f2_3() {
  47. var arguments = 10;
  48. write(arguments);
  49. write(eval('arguments'));
  50. }) ("something 2");
  51. (function f2_4() {
  52. function arguments() { }
  53. write(arguments);
  54. write(eval('arguments'));
  55. }) ("something 2");
  56. (function f2_5(arguments, arguments) {
  57. write(arguments);
  58. write(eval('arguments'));
  59. }) ("something 2");