switchbug.js 755 B

12345678910111213141516171819202122232425262728
  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 AsmModule() {
  6. "use asm";
  7. function f(a) {
  8. a = a|0;
  9. switch (a|0) {
  10. case 103:
  11. {
  12. a = (a+a)|0
  13. break;
  14. }
  15. }
  16. return a|0;
  17. }
  18. return {
  19. f : f
  20. };
  21. }
  22. var asmModule = new AsmModule();
  23. print(asmModule.f(103));
  24. print(asmModule.f(103));