toString.js 754 B

1234567891011121314151617181920212223242526272829
  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. write(toString(["a"]));
  7. function toString(o, quoteStrings) {
  8. if (quoteStrings === true) {
  9. return "recursive call"
  10. }
  11. eval("");
  12. for (var i = 0; i < o.length; ++i) {
  13. return toString(o[0], true);
  14. }
  15. }
  16. var o = {};
  17. Object.prototype.x = 20;
  18. var x = 10;
  19. with (o) {
  20. write(x);
  21. }