funcname_asg.js 752 B

1234567891011121314151617181920212223242526
  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()
  6. {
  7. var i = 0;
  8. // This only create one function assignment. The name f1 is only available inside the function
  9. // via LdFuncExpr
  10. var f = function f1()
  11. {
  12. if (i == 0)
  13. {
  14. i++;
  15. return f1();
  16. }
  17. return i;
  18. }
  19. return f();
  20. }
  21. WScript.Echo(test());
  22. WScript.Echo(test());