arguments3.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. var echo = function(v) {
  6. WScript.Echo(v);
  7. }
  8. var get_args = function(a, b) {
  9. return arguments;
  10. }
  11. echo("--- toString test ---");
  12. echo(get_args());
  13. echo(get_args(1, '2', null));
  14. echo("\n--- getOwnPropertyNames should enumerate all properties ---");
  15. //
  16. // TODO: Currently the following outputs 2 length properties.
  17. //
  18. echo(Object.getOwnPropertyNames(
  19. get_args()));
  20. echo(Object.getOwnPropertyNames(
  21. get_args(1)));
  22. echo(Object.getOwnPropertyNames(
  23. get_args(1, 2)));
  24. var a = get_args(1, 2, '3', 'arg4', 'arg5');
  25. echo(Object.getOwnPropertyNames(a));
  26. delete a[0];
  27. delete a[1];
  28. delete a[4];
  29. a[0] = 'arg0';
  30. echo(Object.getOwnPropertyNames(a));