nested_escape.js 735 B

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