| 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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 1, // (re-)declaration | 688 1, // (re-)declaration |
| 689 EXPECT_RESULT, Number::New(0)); | 689 EXPECT_RESULT, Number::New(0)); |
| 690 } | 690 } |
| 691 } | 691 } |
| 692 | 692 |
| 693 | 693 |
| 694 | 694 |
| 695 class SimpleContext { | 695 class SimpleContext { |
| 696 public: | 696 public: |
| 697 SimpleContext() { | 697 SimpleContext() { |
| 698 context_ = Context::New(0); | 698 context_ = Context::New(); |
| 699 context_->Enter(); | 699 context_->Enter(); |
| 700 } | 700 } |
| 701 | 701 |
| 702 virtual ~SimpleContext() { | 702 virtual ~SimpleContext() { |
| 703 context_->Exit(); | 703 context_->Exit(); |
| 704 context_.Dispose(context_->GetIsolate()); | 704 context_.Dispose(context_->GetIsolate()); |
| 705 } | 705 } |
| 706 | 706 |
| 707 void Check(const char* source, | 707 void Check(const char* source, |
| 708 Expectations expectations, | 708 Expectations expectations, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 SimpleContext context; | 834 SimpleContext context; |
| 835 context.Check(firsts[i], EXPECT_RESULT, Number::New(1)); | 835 context.Check(firsts[i], EXPECT_RESULT, Number::New(1)); |
| 836 // TODO(rossberg): All tests should actually be errors in Harmony, | 836 // TODO(rossberg): All tests should actually be errors in Harmony, |
| 837 // but we currently do not detect the cases where the first declaration | 837 // but we currently do not detect the cases where the first declaration |
| 838 // is not lexical. | 838 // is not lexical. |
| 839 context.Check(seconds[j], | 839 context.Check(seconds[j], |
| 840 i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2)); | 840 i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2)); |
| 841 } | 841 } |
| 842 } | 842 } |
| 843 } | 843 } |
| OLD | NEW |