es5Arguments.js 810 B

12345678910111213141516171819202122232425262728293031
  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){
  6. "use strict";
  7. a = 42;
  8. var res = {};
  9. var args = arguments;
  10. res.a = function() { return a; };
  11. res.arg = function() { return args[0]; };
  12. return res;
  13. }
  14. var x = foo(17);
  15. WScript.SetTimeout(testFunction, 50);
  16. /////////////////
  17. function testFunction()
  18. {
  19. telemetryLog(`a: ${x.a()}`, true); //42
  20. telemetryLog(`arg: ${x.arg()}`, true); //17
  21. emitTTDLog(ttdLogURI);
  22. }