toString2.js 623 B

12345678910111213141516
  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. Object.prototype.toString = function() { return "toString() Overwritten"; }
  7. var o = new Object();
  8. //
  9. // Currently toString is not looked up and hence not called.
  10. // Commenting for now
  11. //
  12. write(o);