eval_fncdecl.js 877 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 print(x) { WScript.Echo(x+''); }
  6. const f = 'const f';
  7. let g = 'let g';
  8. eval("if (false) { function f() { } }");
  9. eval("if (true) { function g() { } }");
  10. print(f);
  11. print(g);
  12. function h(global) { }
  13. eval("function h(ineval) { }");
  14. print(h);
  15. {
  16. function i(globalblock) { }
  17. eval("function i(ineval) { }");
  18. print(i);
  19. }
  20. print(i);
  21. function j(global) { }
  22. {
  23. function j(globalblock) { }
  24. eval("function j(ineval) { }");
  25. print(j);
  26. }
  27. print(j);