loopinit.js 790 B

1234567891011121314151617181920212223242526272829
  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. // Test initialization of let/const outside loop that we will try and box if loop body bails out.
  6. function f1()
  7. {
  8. {
  9. while (Math ^= [1])
  10. {
  11. Math;
  12. }
  13. let x = 0;
  14. {
  15. function foo() { WScript.Echo('foo') }
  16. }
  17. WScript.Echo(x);
  18. }
  19. let y = 1;
  20. WScript.Echo(y);
  21. foo();
  22. }
  23. f1();
  24. f1();
  25. WScript.Echo('pass');