evalThis2.js 579 B

123456789101112131415
  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. var globalObject = this;
  6. function f1() {
  7. WScript.Echo(eval("\"use strict\";\ntypeof this"));
  8. }
  9. function f2() {
  10. WScript.Echo(eval("\"use strict\";\n this") === globalObject);
  11. }
  12. f1();
  13. f2();