2
0

jmpTableTest1.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 test0(a)
  6. {
  7. switch(a)
  8. {
  9. //JumpTable
  10. case 14:
  11. WScript.Echo('14');
  12. break;
  13. case 16:
  14. WScript.Echo('16');
  15. break;
  16. //Binary Tree
  17. case 30:
  18. WScript.Echo('30');
  19. break;
  20. case 40:
  21. WScript.Echo('40');
  22. break;
  23. case 50:
  24. WScript.Echo('50');
  25. break;
  26. //JumpTable
  27. case 61:
  28. WScript.Echo('61');
  29. break;
  30. case 62:
  31. WScript.Echo('62');
  32. break;
  33. //JumpTable
  34. case 1:
  35. WScript.Echo('1');
  36. break;
  37. case 3:
  38. WScript.Echo('3');
  39. break;
  40. default:
  41. WScript.Echo('default');
  42. }
  43. }
  44. test0(1);
  45. test0(1);
  46. test0(3);
  47. test0(14);
  48. test0(16);
  49. test0(30);
  50. test0(40);
  51. test0(50);
  52. test0(61);
  53. test0(62);
  54. test0(10);