break3.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // do while and while loops and break
  6. function AsmModule() {
  7. "use asm";
  8. var x1 = 10;
  9. function f3(x,y){
  10. x = x|0;
  11. y = +y;
  12. var m = 1000;
  13. var n = 10;
  14. var z = 1.1;
  15. a: while((x|0) < 30)
  16. {
  17. x = (x+1)|0
  18. if((x|0) > 10)
  19. {
  20. n = 0;
  21. do
  22. {
  23. if((n|0) > 50)
  24. break a;
  25. x = (x+1)|0;
  26. y = +(y * z)
  27. n = (n + 1)|0
  28. }while((n|0) < 100)
  29. }
  30. }
  31. return +y;
  32. }
  33. return f3
  34. }
  35. var f3 = AsmModule();
  36. print(f3(1,1.5))
  37. print(f3(1,1.5))