delete.js 735 B

12345678910111213141516171819202122
  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 x = "let x";
  6. this.x = 20;
  7. WScript.Echo(this.x);
  8. delete(this.x);
  9. WScript.Echo(x);
  10. WScript.Echo(x);
  11. if (this.x)
  12. WScript.Echo(this.x);
  13. Object.preventExtensions(this);
  14. Object.getOwnPropertyNames(this).forEach(function (p) {
  15. Object.defineProperty(this, p, { configurable: false });
  16. });
  17. if (Object.isSealed(this)) {
  18. WScript.Echo("PASS");
  19. }