Chromium Code Reviews| 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 } | 514 } |
| 515 | 515 |
| 516 // Use the prototype as the holder for the interceptors. | 516 // Use the prototype as the holder for the interceptors. |
| 517 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) { | 517 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) { |
| 518 return function->PrototypeTemplate(); | 518 return function->PrototypeTemplate(); |
| 519 } | 519 } |
| 520 }; | 520 }; |
| 521 | 521 |
| 522 | 522 |
| 523 TEST(ExistsInPrototype) { | 523 TEST(ExistsInPrototype) { |
| 524 v8::internal::FLAG_es52_globals = true; | |
|
Michael Starzinger
2012/04/20 13:28:45
Likewise.
rossberg
2012/04/20 14:01:07
Done.
| |
| 524 HandleScope scope; | 525 HandleScope scope; |
| 525 | 526 |
| 526 // Sanity check to make sure that the holder of the interceptor | 527 // Sanity check to make sure that the holder of the interceptor |
| 527 // really is the prototype object. | 528 // really is the prototype object. |
| 528 { ExistsInPrototypeContext context; | 529 { ExistsInPrototypeContext context; |
| 529 context.Check("this.x = 87; this.x", | 530 context.Check("this.x = 87; this.x", |
| 530 0, | 531 0, |
| 531 0, | 532 0, |
| 532 0, | 533 0, |
| 533 EXPECT_RESULT, Number::New(87)); | 534 EXPECT_RESULT, Number::New(87)); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 } | 577 } |
| 577 | 578 |
| 578 // Use the prototype as the holder for the interceptors. | 579 // Use the prototype as the holder for the interceptors. |
| 579 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) { | 580 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) { |
| 580 return function->PrototypeTemplate(); | 581 return function->PrototypeTemplate(); |
| 581 } | 582 } |
| 582 }; | 583 }; |
| 583 | 584 |
| 584 | 585 |
| 585 TEST(AbsentInPrototype) { | 586 TEST(AbsentInPrototype) { |
| 587 v8::internal::FLAG_es52_globals = true; | |
|
Michael Starzinger
2012/04/20 13:28:45
Likewise.
rossberg
2012/04/20 14:01:07
Done.
| |
| 586 HandleScope scope; | 588 HandleScope scope; |
| 587 | 589 |
| 588 { AbsentInPrototypeContext context; | 590 { AbsentInPrototypeContext context; |
| 589 context.Check("if (false) { var x = 0; }; x", | 591 context.Check("if (false) { var x = 0; }; x", |
| 590 0, | 592 0, |
| 591 0, | 593 0, |
| 592 0, // declaration | 594 0, // declaration |
| 593 EXPECT_RESULT, Undefined()); | 595 EXPECT_RESULT, Undefined()); |
| 594 } | 596 } |
| 595 } | 597 } |
| OLD | NEW |