bug_OS10898061.js 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 foo( a = b )
  6. {
  7. eval("");
  8. var b;
  9. }
  10. function bar( {a:a = b} )
  11. {
  12. eval("");
  13. var b;
  14. }
  15. function test()
  16. {
  17. try
  18. {
  19. // foo should throw a ReferenceError: 'b' is not defined.
  20. foo();
  21. return false;
  22. }
  23. catch( a )
  24. {}
  25. try
  26. {
  27. // bar should throw a ReferenceError: 'b' is not defined.
  28. bar({});
  29. return false;
  30. }
  31. catch( a )
  32. {}
  33. return true;
  34. }
  35. WScript.Echo(test() ? "PASSED" : "FAILED");