bug70.js 834 B

12345678910111213141516171819202122232425262728293031323334
  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 shouldBailout = false;
  6. var count = 0;
  7. function test0(){
  8. var func1 = function(){
  9. h = d;
  10. }
  11. var d = 309820929.1;
  12. (((shouldBailout ? (d = { valueOf: function() { count++; return 3; } }, 1) : 1) ? +d : 1) );
  13. };
  14. // generate profile
  15. test0();
  16. // run JITted code
  17. test0();
  18. // run code with bailouts enabled
  19. shouldBailout = true;
  20. test0();
  21. if (count == 1)
  22. {
  23. WScript.Echo("Passed");
  24. }
  25. else
  26. {
  27. WScript.Echo("FAILED");
  28. }