generators-applyargs.js 608 B

12345678910111213141516171819
  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 f() {
  6. var s = "";
  7. for (var i in arguments) {
  8. s += arguments[i];
  9. }
  10. WScript.Echo(s);
  11. }
  12. function* gf() {
  13. f.apply(this, arguments);
  14. }
  15. var g = gf('p', 'a', 's', 's', 'e', 'd');
  16. g.next();