stringBailOut.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. /*
  6. *******************************UNIT TEST FOR SWITCH CASE OPTIMIZATION*******************************
  7. * Test with two switch statements.
  8. */
  9. function f(x,y)
  10. {
  11. switch(x)
  12. {
  13. case 'abc':
  14. WScript.Echo('abc');
  15. break;
  16. case 'def':
  17. WScript.Echo('def');
  18. break;
  19. case 'ghi':
  20. WScript.Echo('ghi');
  21. break;
  22. case 'jkl':
  23. WScript.Echo('jkl');
  24. break;
  25. case 'mno':
  26. WScript.Echo('mno');
  27. break;
  28. case 'pqr':
  29. WScript.Echo('pqr');
  30. break;
  31. case 'stu':
  32. WScript.Echo('stu');
  33. break;
  34. case 'vxy':
  35. WScript.Echo('vxy');
  36. break;
  37. case 'z':
  38. WScript.Echo('z');
  39. break;
  40. default:
  41. WScript.Echo('default');
  42. break;
  43. }
  44. }
  45. f('abc');
  46. f(new Object);
  47. f(new Object);