11.this_sm.js 751 B

1234567891011121314151617181920212223
  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. "use strict";
  6. function write(v) { WScript.Echo(v + ""); }
  7. function f() {
  8. write("this : " + this);
  9. write("typeof(this) : " + typeof (this));
  10. eval('write("this : " + this);');
  11. eval('write("typeof(this) : " + typeof (this));');
  12. }
  13. f();
  14. f.call();
  15. f.call(undefined);
  16. f.call(null);
  17. f.call(this);
  18. f.call(10);
  19. f.call(new Number(10));