OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 context.Check("var x = 0; x", | 216 context.Check("var x = 0; x", |
217 1, // access | 217 1, // access |
218 2, // declaration + initialization | 218 2, // declaration + initialization |
219 2, // declaration + initialization | 219 2, // declaration + initialization |
220 EXPECT_RESULT, Number::New(0)); | 220 EXPECT_RESULT, Number::New(0)); |
221 } | 221 } |
222 | 222 |
223 { DeclarationContext context; | 223 { DeclarationContext context; |
224 context.Check("function x() { }; x", | 224 context.Check("function x() { }; x", |
225 1, // access | 225 1, // access |
226 1, // declaration | 226 0, |
227 0, | 227 0, |
228 EXPECT_RESULT); | 228 EXPECT_RESULT); |
229 } | 229 } |
230 | 230 |
231 { DeclarationContext context; | 231 { DeclarationContext context; |
232 context.Check("const x; x", | 232 context.Check("const x; x", |
233 1, // access | 233 1, // access |
234 2, // declaration + initialization | 234 2, // declaration + initialization |
235 2, // declaration + initialization | 235 2, // declaration + initialization |
236 EXPECT_RESULT, Undefined()); | 236 EXPECT_RESULT, Undefined()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 context.Check("var x = 0; x", | 271 context.Check("var x = 0; x", |
272 1, // access | 272 1, // access |
273 1, // initialization | 273 1, // initialization |
274 2, // declaration + initialization | 274 2, // declaration + initialization |
275 EXPECT_RESULT, Number::New(0)); | 275 EXPECT_RESULT, Number::New(0)); |
276 } | 276 } |
277 | 277 |
278 { PresentPropertyContext context; | 278 { PresentPropertyContext context; |
279 context.Check("function x() { }; x", | 279 context.Check("function x() { }; x", |
280 1, // access | 280 1, // access |
281 1, // declaration | 281 0, |
282 0, | 282 0, |
283 EXPECT_RESULT); | 283 EXPECT_RESULT); |
284 } | 284 } |
285 | 285 |
286 { PresentPropertyContext context; | 286 { PresentPropertyContext context; |
287 context.Check("const x; x", | 287 context.Check("const x; x", |
288 0, | 288 0, |
289 0, | 289 0, |
290 1, // (re-)declaration | 290 1, // (re-)declaration |
291 EXPECT_EXCEPTION); // x has already been declared! | 291 EXPECT_EXCEPTION); // x has already been declared! |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 context.Check("var x = 0; x", | 325 context.Check("var x = 0; x", |
326 1, // access | 326 1, // access |
327 2, // declaration + initialization | 327 2, // declaration + initialization |
328 2, // declaration + initialization | 328 2, // declaration + initialization |
329 EXPECT_RESULT, Number::New(0)); | 329 EXPECT_RESULT, Number::New(0)); |
330 } | 330 } |
331 | 331 |
332 { AbsentPropertyContext context; | 332 { AbsentPropertyContext context; |
333 context.Check("function x() { }; x", | 333 context.Check("function x() { }; x", |
334 1, // access | 334 1, // access |
335 1, // declaration | 335 0, |
336 0, | 336 0, |
337 EXPECT_RESULT); | 337 EXPECT_RESULT); |
338 } | 338 } |
339 | 339 |
340 { AbsentPropertyContext context; | 340 { AbsentPropertyContext context; |
341 context.Check("const x; x", | 341 context.Check("const x; x", |
342 1, // access | 342 1, // access |
343 2, // declaration + initialization | 343 2, // declaration + initialization |
344 2, // declaration + initializetion | 344 2, // declaration + initializetion |
345 EXPECT_RESULT, Undefined()); | 345 EXPECT_RESULT, Undefined()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 context.Check("var x = 0; x", | 415 context.Check("var x = 0; x", |
416 1, // access | 416 1, // access |
417 2, // declaration + initialization | 417 2, // declaration + initialization |
418 2, // declaration + initialization | 418 2, // declaration + initialization |
419 EXPECT_RESULT, Number::New(0)); | 419 EXPECT_RESULT, Number::New(0)); |
420 } | 420 } |
421 | 421 |
422 { AppearingPropertyContext context; | 422 { AppearingPropertyContext context; |
423 context.Check("function x() { }; x", | 423 context.Check("function x() { }; x", |
424 1, // access | 424 1, // access |
425 1, // declaration | 425 0, |
426 0, | 426 0, |
427 EXPECT_RESULT); | 427 EXPECT_RESULT); |
428 } | 428 } |
429 | 429 |
430 { AppearingPropertyContext context; | 430 { AppearingPropertyContext context; |
431 context.Check("const x; x", | 431 context.Check("const x; x", |
432 0, | 432 0, |
433 1, // declaration | 433 1, // declaration |
434 2, // declaration + initialization | 434 2, // declaration + initialization |
435 EXPECT_EXCEPTION); // x has already been declared! | 435 EXPECT_EXCEPTION); // x has already been declared! |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 HandleScope scope; | 584 HandleScope scope; |
585 | 585 |
586 { AbsentInPrototypeContext context; | 586 { AbsentInPrototypeContext context; |
587 context.Check("if (false) { var x = 0; }; x", | 587 context.Check("if (false) { var x = 0; }; x", |
588 0, | 588 0, |
589 0, | 589 0, |
590 1, // declaration | 590 1, // declaration |
591 EXPECT_RESULT, Undefined()); | 591 EXPECT_RESULT, Undefined()); |
592 } | 592 } |
593 } | 593 } |
OLD | NEW |