evalargs.js 856 B

12345678910111213141516171819202122232425262728293031323334
  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 foo() {
  6. "use strict";
  7. // --- invalid statements ---
  8. // (eval)++;
  9. // ++(eval);
  10. // (arguments)++;
  11. // ++(arguments);
  12. //
  13. // (eval) = 1;
  14. // (arguments) = 1;
  15. // --- valid statements ---
  16. eval[0]++;
  17. ++eval[0];
  18. eval.a++;
  19. ++eval.a;
  20. arguments[0]++;
  21. ++arguments[0];
  22. arguments.a++;
  23. ++arguments.a;
  24. eval[0] = 1;
  25. arguments[0] = 1;
  26. eval.a = 1;
  27. arguments.a = 1;
  28. }
  29. foo();