2
0

test105.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 test0Runner() {
  6. var shouldBailout = 0;
  7. function test0() {
  8. var o = { prop0: 0 };
  9. var n = 0;
  10. var i = 0;
  11. while(i < 2) {
  12. while(o.prop0 < 0)
  13. while(i + 1)
  14. o.prop0 = 0;
  15. if(shouldBailout)
  16. delete o.prop0;
  17. ++n;
  18. ++i;
  19. }
  20. WScript.Echo("test0: " + n);
  21. };
  22. test0();
  23. shouldBailout = 1;
  24. test0();
  25. })();
  26. function test1(o, x) {
  27. var c = 1.1;
  28. c += 0.1;
  29. x += 0.1;
  30. test1a(x);
  31. var sum = -1;
  32. for(var i = 0; i < 2; ++i) {
  33. var d;
  34. if(o)
  35. d = 2.2;
  36. else
  37. d = 2.3;
  38. for(var j = 0; j < 2; ++j)
  39. if(i === 1)
  40. sum += o.d;
  41. test1a(x);
  42. x = c;
  43. c = d;
  44. test1a(x);
  45. }
  46. return sum;
  47. function test1a(x) {
  48. try {
  49. WScript.Echo("test1: " + x);
  50. }
  51. catch(ex) {
  52. }
  53. }
  54. }
  55. (function test1Runner() {
  56. var o = { a: 0.1, b: 0.1, c: 0.1, d: 3.1 };
  57. WScript.Echo("test1: " + test1(o, 0.1));
  58. o.d = "4.1";
  59. WScript.Echo("test1: " + test1(o, 0.1));
  60. })();