FuncBody.bug232281.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. function test0(){
  7. var obj0 = {};
  8. var obj1 = {};
  9. var func0 = function(){
  10. }
  11. var func1 = function(argObj0,argArr1,argMath2){
  12. eval("");
  13. func0();
  14. }
  15. Object.prototype.method0 = func1;
  16. obj1.length = ((shouldBailout ? func0 = obj0.method0 : 1), func0());
  17. };
  18. var testOutcome = false;
  19. try
  20. {
  21. // generate profile
  22. test0();
  23. // run JITted code
  24. runningJITtedCode = true;
  25. test0();
  26. // run code with bailouts enabled
  27. shouldBailout = true;
  28. test0();
  29. }
  30. catch(e)
  31. {
  32. WScript.Echo("Caught expected exception. Type of exception: " + e);
  33. if (e == "Error: Out of stack space") {
  34. testOutcome = true;
  35. }
  36. }
  37. if (testOutcome) {
  38. WScript.Echo("Passed");
  39. }
  40. else {
  41. WScript.Echo("Failed");
  42. }