inlinee_box.js 939 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. var glo;
  6. function tree1()
  7. {
  8. function child1()
  9. {
  10. return tree2();
  11. }
  12. return child1();
  13. }
  14. function tree2()
  15. {
  16. var x = 123;
  17. function nested()
  18. {
  19. if (doescape)
  20. {
  21. escape();
  22. }
  23. return x;
  24. }
  25. function escape()
  26. {
  27. glo = arguments.callee.caller;
  28. }
  29. return (function(param) { return param; })(nested());
  30. }
  31. var doescape = false;
  32. WScript.Echo(tree1());
  33. doescape = true;
  34. WScript.Echo(tree1());
  35. doescape = false;
  36. WScript.Echo(glo());