callTarget.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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(){
  6. var arrObj0 = {};
  7. var func2 = function(){
  8. }
  9. arrObj0.method0 = func2;
  10. var i32 = new Int32Array(2);
  11. var VarArr0 = 1;
  12. var __loopvar0 = 0;
  13. for(var _strvar27 in i32 ) {
  14. if(_strvar27.indexOf('method') != -1) continue;
  15. if(__loopvar0++ > 3) break;
  16. arrObj0.method0.call(Object.prototype , (arrObj0.length ? 351445441 : -496151049), VarArr0[1]);
  17. }
  18. };
  19. test0();
  20. test0();
  21. test0();
  22. WScript.Echo("PASSED\n");
  23. function test1(){
  24. var obj0 = {};
  25. var func1 = function(){
  26. }
  27. obj0.method0 = func1;
  28. var ary = new Array(10);
  29. function _array2iterate(_array2tmp) {
  30. for(var _array2i in _array2tmp) {
  31. if(_array2tmp[_array2i] instanceof Array) {
  32. _array2iterate(_array2tmp[_array2i]);
  33. }
  34. obj0.method0.call(obj0 , ary[1]);
  35. }
  36. }
  37. _array2iterate([[obj0.prop1, [obj0.prop0]]]);
  38. };
  39. test1();
  40. test1();
  41. test1();
  42. WScript.Echo("PASSED\n");
  43. function test2(){
  44. function bar0 (){
  45. this.prop0;
  46. }
  47. var obj = {func: bar0};
  48. var __loopvar1 = 0;
  49. do {
  50. __loopvar1++;
  51. function v5524()
  52. {
  53. if(false)
  54. {
  55. var uniqobj0 = 1;
  56. }
  57. else
  58. return obj.func.call(uniqobj0);
  59. }
  60. v5524();
  61. } while((1) && __loopvar1 < 3)
  62. };
  63. test2();
  64. test2();
  65. test2();
  66. WScript.Echo("PASSED\n");
  67. function test3(a, b)
  68. {
  69. return String.prototype.replace.call(a, b, "a")
  70. }
  71. test3("foobar", /foo/i)
  72. test3("foobar", /foo/i)
  73. test3("foobar", /foo/i)
  74. print("passed")
  75. function test4()
  76. {
  77. function bar(a)
  78. {
  79. return 'call'
  80. }
  81. function test()
  82. {
  83. return this;
  84. }
  85. function foo()
  86. {
  87. test[bar('1')](this);
  88. test.call(this);
  89. }
  90. foo()
  91. foo()
  92. foo()
  93. }
  94. test4()
  95. print("passed")