Miscellaneous_MaxInterpret.js 693 B

123456789101112131415161718
  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. // 'arguments[0] = ...' needs to kill 'o' and in turn, 'o.p' as well
  6. function test0() {
  7. var o = { p: 0 };
  8. var func0 = function(o) {
  9. ++o.p;
  10. arguments[0] = "x";
  11. ++o.p;
  12. }
  13. func0(o);
  14. return o.p;
  15. };
  16. WScript.Echo("test0: " + test0());
  17. WScript.Echo("test0: " + test0());