bug13674598.js 753 B

123456789101112131415161718192021222324252627
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. // BailOutOnMulOverflow should restore the pre-op value of 'b'. If it does not, 'a' will be assigned the wrong value.
  6. var a;
  7. function foo()
  8. {
  9. var b = 1073741824 | undefined;
  10. try
  11. {
  12. b *= 2;
  13. }
  14. catch(e)
  15. {
  16. }
  17. a = b;
  18. }
  19. foo();
  20. foo();
  21. foo();
  22. WScript.Echo( a == 2147483648 ? "PASSED" : "FAILED");