binop-kills.js 803 B

1234567891011121314151617181920212223242526272829303132333435
  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 binary operations with potential side-effects on already-evaluated opnds.
  6. function foo() {
  7. var x = 0;
  8. var z = x & (x = 1)
  9. WScript.Echo(z)
  10. x = 0;
  11. x &= (x |= 1);
  12. WScript.Echo(x);
  13. }
  14. foo();
  15. (function () {
  16. var f = 5;
  17. x = (f * (f++));
  18. WScript.Echo("x = " + x);
  19. })();
  20. var o = new Object();
  21. function func(b) {
  22. b.blah = b.blah2 = b = null;
  23. }
  24. func(o);