nestedinlinestackwalkbug.js 901 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. function throwFunc() {
  6. // dummy try-catch so that this function does not get inlined
  7. try {
  8. }
  9. catch (ex) {
  10. }
  11. throw "ex" ;
  12. }
  13. function caller() {
  14. throwFunc(w);
  15. }
  16. function shapeyConstructor() {
  17. y = iczqcn;
  18. }
  19. function test() {
  20. for (var w in [1,2]) {
  21. try {
  22. new caller();
  23. } catch (e) {
  24. }
  25. }
  26. }
  27. function toptest() {
  28. try {
  29. test();
  30. new shapeyConstructor();
  31. }
  32. catch (ex) {
  33. }
  34. }
  35. toptest();
  36. toptest();
  37. toptest();
  38. WScript.Echo("PASS");