multinested_escape.js 716 B

123456789101112131415161718192021222324252627282930313233
  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 escape;
  6. function test(param)
  7. {
  8. function outer()
  9. {
  10. function inner()
  11. {
  12. escape = nested;
  13. }
  14. inner();
  15. }
  16. function nested()
  17. {
  18. return param;
  19. }
  20. outer();
  21. }
  22. test("test1");
  23. WScript.Echo(escape());
  24. test("test2");
  25. WScript.Echo(escape());