tostring_escape.js 700 B

12345678910111213141516171819202122232425
  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 escape;
  6. Function.prototype.toString = function()
  7. {
  8. escape = this;
  9. return "toString";
  10. }
  11. function test3(param)
  12. {
  13. var func3 = function() { return param; }
  14. return func3 + "3";
  15. }
  16. WScript.Echo(test3("test1"));
  17. WScript.Echo(escape());
  18. WScript.Echo(test3("test2"));
  19. WScript.Echo(escape());