jitdefer.js 973 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 foo(param)
  6. {
  7. var x = 100;
  8. function bar()
  9. {
  10. WScript.Echo(x);
  11. }
  12. function baz(param1)
  13. {
  14. function inner(){
  15. count++;
  16. WScript.Echo("COUNT: " + count);
  17. bar();
  18. o["i"] = arguments["callee"];
  19. }
  20. if(param1)
  21. return inner()
  22. else
  23. return bar();
  24. }
  25. if(param)
  26. return baz(true);
  27. else
  28. return baz(false);
  29. }
  30. var count = 0;
  31. var o = {};
  32. WScript.Echo(foo(false));
  33. WScript.Echo(foo(true));
  34. WScript.Echo(o.i());