bailout-branch.js 797 B

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 o = {x: 1};
  6. function Ctor() {};
  7. Ctor.prototype.valueOf = function() {
  8. return o.x++;
  9. }
  10. var c = new Ctor();
  11. var test_less = function(o, c)
  12. {
  13. var n = 0;
  14. for (var i = 0; i < 1; i++)
  15. {
  16. if (o.x < c)
  17. {
  18. n += o.x;
  19. }
  20. else
  21. {
  22. n -= o.x;
  23. }
  24. }
  25. return n;
  26. }
  27. WScript.Echo("RESULT: " + test_less(o,c));