OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 c.__defineSetter__(3, function setter3(n) { | 90 c.__defineSetter__(3, function setter3(n) { |
91 this.name = n; // setter 3 | 91 this.name = n; // setter 3 |
92 }); | 92 }); |
93 | 93 |
94 var d = { | 94 var d = { |
95 'c': c, | 95 'c': c, |
96 }; | 96 }; |
97 | 97 |
98 function testGetter1_1() { | 98 function testGetter1_1() { |
99 expected_function_name = 'getter1'; | 99 expected_function_name = 'get getter1'; |
100 expected_source_line_text = ' return this.name; // getter 1'; | 100 expected_source_line_text = ' return this.name; // getter 1'; |
101 debugger; | 101 debugger; |
102 var x = c.getter1; | 102 var x = c.getter1; |
103 } | 103 } |
104 | 104 |
105 function testGetter1_2() { | 105 function testGetter1_2() { |
106 expected_function_name = 'getter1'; | 106 expected_function_name = 'get getter1'; |
107 expected_source_line_text = ' return this.name; // getter 1'; | 107 expected_source_line_text = ' return this.name; // getter 1'; |
108 debugger; | 108 debugger; |
109 var x = c['getter1']; | 109 var x = c['getter1']; |
110 } | 110 } |
111 | 111 |
112 function testGetter1_3() { | 112 function testGetter1_3() { |
113 expected_function_name = 'getter1'; | 113 expected_function_name = 'get getter1'; |
114 expected_source_line_text = ' return this.name; // getter 1'; | 114 expected_source_line_text = ' return this.name; // getter 1'; |
115 for (var i = 1; i < 2; i++) { | 115 for (var i = 1; i < 2; i++) { |
116 debugger; | 116 debugger; |
117 var x = c['getter' + i]; | 117 var x = c['getter' + i]; |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 function testGetter1_4() { | 121 function testGetter1_4() { |
122 expected_function_name = 'getter1'; | 122 expected_function_name = 'get getter1'; |
123 expected_source_line_text = ' return this.name; // getter 1'; | 123 expected_source_line_text = ' return this.name; // getter 1'; |
124 debugger; | 124 debugger; |
125 var x = d.c.getter1; | 125 var x = d.c.getter1; |
126 } | 126 } |
127 | 127 |
128 function testGetter1_5() { | 128 function testGetter1_5() { |
129 expected_function_name = 'getter1'; | 129 expected_function_name = 'get getter1'; |
130 expected_source_line_text = ' return this.name; // getter 1'; | 130 expected_source_line_text = ' return this.name; // getter 1'; |
131 for (var i = 2; i != 1; i--); | 131 for (var i = 2; i != 1; i--); |
132 debugger; | 132 debugger; |
133 var x = d.c['getter' + i]; | 133 var x = d.c['getter' + i]; |
134 } | 134 } |
135 | 135 |
136 function testGetter2_1() { | 136 function testGetter2_1() { |
137 expected_function_name = 'getter2'; | 137 expected_function_name = 'get getter2'; |
138 expected_source_line_text = ' return { // getter 2'; | 138 expected_source_line_text = ' return { // getter 2'; |
139 for (var i = 2; i != 1; i--); | 139 for (var i = 2; i != 1; i--); |
140 debugger; | 140 debugger; |
141 var t = d.c.getter2.name; | 141 var t = d.c.getter2.name; |
142 } | 142 } |
143 | 143 |
144 | 144 |
145 function testGetterY_1() { | 145 function testGetterY_1() { |
146 expected_function_name = 'getterY'; | 146 expected_function_name = 'getterY'; |
147 expected_source_line_text = ' return this.name; // getter y'; | 147 expected_source_line_text = ' return this.name; // getter y'; |
(...skipping 17 matching lines...) Expand all Loading... |
165 | 165 |
166 function testIndexedSetter3_1() { | 166 function testIndexedSetter3_1() { |
167 expected_function_name = 'setter3'; | 167 expected_function_name = 'setter3'; |
168 expected_source_line_text = ' this.name = n; // setter 3'; | 168 expected_source_line_text = ' this.name = n; // setter 3'; |
169 var i = 3 | 169 var i = 3 |
170 debugger; | 170 debugger; |
171 d.c[3] = 'www'; | 171 d.c[3] = 'www'; |
172 } | 172 } |
173 | 173 |
174 function testSetter1_1() { | 174 function testSetter1_1() { |
175 expected_function_name = 'setter1'; | 175 expected_function_name = 'set setter1'; |
176 expected_source_line_text = ' this.name = n; // setter 1'; | 176 expected_source_line_text = ' this.name = n; // setter 1'; |
177 debugger; | 177 debugger; |
178 d.c.setter1 = 'aa'; | 178 d.c.setter1 = 'aa'; |
179 } | 179 } |
180 | 180 |
181 function testSetter1_2() { | 181 function testSetter1_2() { |
182 expected_function_name = 'setter1'; | 182 expected_function_name = 'set setter1'; |
183 expected_source_line_text = ' this.name = n; // setter 1'; | 183 expected_source_line_text = ' this.name = n; // setter 1'; |
184 debugger; | 184 debugger; |
185 d.c['setter1'] = 'bb'; | 185 d.c['setter1'] = 'bb'; |
186 } | 186 } |
187 | 187 |
188 function testSetter1_3() { | 188 function testSetter1_3() { |
189 expected_function_name = 'setter1'; | 189 expected_function_name = 'set setter1'; |
190 expected_source_line_text = ' this.name = n; // setter 1'; | 190 expected_source_line_text = ' this.name = n; // setter 1'; |
191 for (var i = 2; i != 1; i--); | 191 for (var i = 2; i != 1; i--); |
192 debugger; | 192 debugger; |
193 d.c['setter' + i] = i; | 193 d.c['setter' + i] = i; |
194 } | 194 } |
195 | 195 |
196 var e = { | 196 var e = { |
197 name: 'e' | 197 name: 'e' |
198 }; | 198 }; |
199 e.__proto__ = c; | 199 e.__proto__ = c; |
200 | 200 |
201 function testProtoGetter1_1() { | 201 function testProtoGetter1_1() { |
202 expected_function_name = 'getter1'; | 202 expected_function_name = 'get getter1'; |
203 expected_source_line_text = ' return this.name; // getter 1'; | 203 expected_source_line_text = ' return this.name; // getter 1'; |
204 debugger; | 204 debugger; |
205 var x = e.getter1; | 205 var x = e.getter1; |
206 } | 206 } |
207 | 207 |
208 function testProtoSetter1_1() { | 208 function testProtoSetter1_1() { |
209 expected_function_name = 'setter1'; | 209 expected_function_name = 'set setter1'; |
210 expected_source_line_text = ' this.name = n; // setter 1'; | 210 expected_source_line_text = ' this.name = n; // setter 1'; |
211 debugger; | 211 debugger; |
212 e.setter1 = 'aa'; | 212 e.setter1 = 'aa'; |
213 } | 213 } |
214 | 214 |
215 function testProtoIndexedGetter3_1() { | 215 function testProtoIndexedGetter3_1() { |
216 expected_function_name = 'getter3'; | 216 expected_function_name = 'getter3'; |
217 expected_source_line_text = ' return this.name; // getter 3'; | 217 expected_source_line_text = ' return this.name; // getter 3'; |
218 debugger; | 218 debugger; |
219 var x = e[3]; | 219 var x = e[3]; |
220 } | 220 } |
221 | 221 |
222 function testProtoIndexedSetter3_1() { | 222 function testProtoIndexedSetter3_1() { |
223 expected_function_name = 'setter3'; | 223 expected_function_name = 'setter3'; |
224 expected_source_line_text = ' this.name = n; // setter 3'; | 224 expected_source_line_text = ' this.name = n; // setter 3'; |
225 debugger; | 225 debugger; |
226 e[3] = 'new val'; | 226 e[3] = 'new val'; |
227 } | 227 } |
228 | 228 |
229 function testProtoSetter1_2() { | 229 function testProtoSetter1_2() { |
230 expected_function_name = 'setter1'; | 230 expected_function_name = 'set setter1'; |
231 expected_source_line_text = ' this.name = n; // setter 1'; | 231 expected_source_line_text = ' this.name = n; // setter 1'; |
232 for (var i = 2; i != 1; i--); | 232 for (var i = 2; i != 1; i--); |
233 debugger; | 233 debugger; |
234 e['setter' + i] = 'aa'; | 234 e['setter' + i] = 'aa'; |
235 } | 235 } |
236 | 236 |
237 for (var n in this) { | 237 for (var n in this) { |
238 if (n.substr(0, 4) != 'test') { | 238 if (n.substr(0, 4) != 'test') { |
239 continue; | 239 continue; |
240 } | 240 } |
241 state = 1; | 241 state = 1; |
242 this[n](); | 242 this[n](); |
243 assertNull(exception); | 243 if (exception) throw exception; |
244 assertEquals(4, state); | 244 assertEquals(4, state); |
245 } | 245 } |
246 | 246 |
247 // Get rid of the debug event listener. | 247 // Get rid of the debug event listener. |
248 Debug.setListener(null); | 248 Debug.setListener(null); |
OLD | NEW |