misc_bugs.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  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. WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  6. var tests = [
  7. {
  8. name: "Inner function of 'async' function has default - should not throw any assert",
  9. body: function () {
  10. assert.doesNotThrow(function () { eval(`async function f1() {
  11. function foo(a = function() { } ) { };
  12. }`); });
  13. assert.doesNotThrow(function () { eval(`var f1 = async ( ) => {
  14. function foo(a = function() { } ) { } };`); });
  15. assert.doesNotThrow(function () { eval(`async function f1() {
  16. function foo() {
  17. async function f2() {
  18. function bar (a = function () {} ) {
  19. }
  20. }
  21. }
  22. }`); });
  23. }
  24. },
  25. ];
  26. testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });