shladdpeep.js 683 B

123456789101112131415161718192021
  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 foo(x,y)
  6. {
  7. const c = x + 1;
  8. const d = y + 1;
  9. x = (d + (c << 0))|0;
  10. x += (d + (c << 1))|0;
  11. x += (d + (c << 2))|0;
  12. x += (d + (c << 3))|0;
  13. x += (d + (c << 4))|0;
  14. return x;
  15. }
  16. print(foo(2,3));
  17. print(foo(2,3));
  18. print(foo(-12346578,3));
  19. print(foo(2,12346578));