toStringWithGlobalObject.js 684 B

123456789101112
  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. let global = new Function('return this;')();
  6. console.log(global.toString());
  7. console.log(global[Symbol.toStringTag]);
  8. let descriptor = Object.getOwnPropertyDescriptor(global, Symbol.toStringTag);
  9. console.log(descriptor.writable);
  10. console.log(descriptor.enumerable);
  11. console.log(descriptor.configurable);