inlinestackwalkbug.js 907 B

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