singleCharStringCase.js 858 B

123456789101112131415161718192021222324252627282930313233
  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. var x = "d";
  6. function foo()
  7. {
  8. var s = unescape(x);
  9. if(s!='')
  10. {
  11. switch(s){
  12. case '0':
  13. WScript.Echo(0);
  14. break;
  15. case '1':
  16. WScript.Echo(1);
  17. break;
  18. case '2':
  19. WScript.Echo(2);
  20. break;
  21. case '3':
  22. WScript.Echo(3);
  23. break;
  24. default:
  25. break;
  26. }
  27. }
  28. }
  29. foo();
  30. foo();
  31. foo();
  32. WScript.Echo("passed");