Changeset 185158 in webkit for trunk/Source/JavaScriptCore/tests
- Timestamp:
- Jun 3, 2015, 11:48:41 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/tests/stress/poly-setter-combo.js
r172129 r185158 4 4 5 5 function Cons2() { 6 this._values = [] 6 7 } 7 8 Cons2.prototype.__defineSetter__("f", function(value) { 8 9 counter++; 9 10 this._f = value; 11 this._values[value] = 1; 10 12 }); 11 13 Cons2.prototype.__defineGetter__("f", function() { return this._f; }); 14 15 function Cons3() { 16 } 17 Cons3.prototype.f = 42; 18 Cons3.prototype.g = 43; 19 20 function Cons4() { 21 this._values = [] 22 } 23 Cons4.prototype.g = 16; 24 Cons4.prototype.__defineSetter__("f", function(value) { 25 counter++; 26 this._f = value; 27 this._values[value] = 1; 28 }); 29 Cons4.prototype.__defineGetter__("f", function() { return this._f; }); 12 30 13 31 function foo(o, value) { … … 28 46 } 29 47 30 for (var i = 0; i < 100000; ++i) { 31 test(new Cons1(), i, counter); 32 test(new Cons2(), i, counter + 1); 33 34 var o = {}; 35 o.__defineSetter__("f", function(value) { 36 this._f = value; 37 counter++; 38 }); 39 o.__defineGetter__("f", function() { return this._f; }); 40 test(o, i, counter + 1); 48 function runTestWithConstructors(constructor1, constructor2) { 49 for (var i = 0; i < 5000; ++i) { 50 test(new constructor1(), i, counter); 51 test(new constructor2(), i, counter + 1); 41 52 42 test({f: 42}, i, counter); 53 var o = {}; 54 o.__defineGetter__("f", function() { 55 counter++; 56 return 84; 57 }); 58 test(o, 84, counter + 1); 59 60 var o = {}; 61 o.__defineSetter__("f", function(value) { 62 this._f = value; 63 counter++; 64 }); 65 o.__defineGetter__("f", function() { return this._f; }); 66 test(o, i, counter + 1); 67 68 test({f: 42}, i, counter); 69 } 43 70 } 71 72 for (var i = 0; i < 2; ++i) { 73 runTestWithConstructors(Cons1, Cons2); 74 runTestWithConstructors(Cons3, Cons2); 75 runTestWithConstructors(Cons1, Cons4); 76 runTestWithConstructors(Cons3, Cons4); 77 }
Note:
See TracChangeset
for help on using the changeset viewer.