optpeep.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 Count = 0;
  6. var shouldBailout = false;
  7. function test0(){
  8. var obj0 = {};
  9. var func0 = function(p0){
  10. if((shouldBailout ? (Object.defineProperty(obj0, 'prop6', {get: function() { Count++; return 3; }, set: function(_x) { WScript.Echo('obj0.prop6 setter'); }}), 1) : 1)) {
  11. ((Math.log(obj0.prop6) - Boolean));
  12. 11 }
  13. }
  14. obj0.prop1 = {prop0: 1, prop1: 1, prop2: 1, prop3: 1, prop4: 1, prop5: 1, prop6: func0(1, 1), prop7: 1};
  15. };
  16. for (var i = 0; i < 2000; i++)
  17. {
  18. test0();
  19. }
  20. // run code with bailouts enabled
  21. shouldBailout = true;
  22. test0();
  23. if (Count != 1)
  24. {
  25. WScript.Echo("FAILED\n");
  26. }
  27. else
  28. {
  29. WScript.Echo("Passed\n");
  30. }
  31. // Windows Blue Bug 416975
  32. function test1(){
  33. function bar4 (){
  34. if(bar4())
  35. {
  36. }
  37. return (1 > 1);
  38. }
  39. bar4();
  40. };
  41. try{
  42. test1();
  43. }
  44. catch (e) {}