isin.js 962 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 print(x) { WScript.Echo(x) }
  6. // Verify that side-effects happen in the right order w.r.t. evaluation of operands.
  7. (function () {
  8. //CHECK#1
  9. var NUMBER = 0;
  10. if ((NUMBER = Number, "MAX_VALUE") in NUMBER !== true) {
  11. print('#1: var NUMBER = 0; (NUMBER = Number, "MAX_VALUE") in NUMBER === true');
  12. }
  13. //CHECK#2
  14. var max_value = "MAX_VALUE";
  15. if (max_value in (max_value = "none", Number) !== true) {
  16. print('#2: var max_value = "MAX_VALUE"; max_value in (max_value = "none", Number) === true');
  17. }
  18. })();
  19. print('Passed');