implicit_upwardexposed.js 758 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. function test0() {
  6. function func0() {
  7. return -(this.prop0 = 0.1);
  8. }
  9. return new func0().prop0;
  10. }
  11. WScript.Echo(test0());
  12. Object.defineProperty(
  13. Object.prototype, 'prop0', {
  14. get: function () {
  15. return "get";
  16. },
  17. set: function (a) {
  18. WScript.Echo("set:" + a);
  19. }
  20. }
  21. );
  22. WScript.Echo(test0());