shadowedsetter.js 616 B

123456789101112131415161718
  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. evaluate = WScript.LoadScript;
  6. this.__defineSetter__("x", function () { });
  7. evaluate(`
  8. let x = 'let';
  9. Object.defineProperty(this, "x", { value:
  10. 0xdec0 })
  11. if (x === 'let' && this.x === 57024)
  12. {
  13. WScript.Echo('pass');
  14. }
  15. `);