fieldcopyprop_deletestrict.js 663 B

123456789101112131415161718192021222324
  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. // Test to make sure field copy prop can deal with delete
  6. "use strict";
  7. function f() {
  8. var x = new Object();
  9. x.y = 1;
  10. delete x.y;
  11. if (x.y === undefined)
  12. {
  13. WScript.Echo("Pass");
  14. }
  15. return x;
  16. }
  17. function g(o)
  18. {
  19. delete o.y;
  20. }
  21. g(f());