| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (!value.IsEmpty()) { | 154 if (!value.IsEmpty()) { |
| 155 CHECK_EQ(value, result); | 155 CHECK_EQ(value, result); |
| 156 } | 156 } |
| 157 } else { | 157 } else { |
| 158 CHECK(expectations == EXPECT_EXCEPTION); | 158 CHECK(expectations == EXPECT_EXCEPTION); |
| 159 CHECK(catcher.HasCaught()); | 159 CHECK(catcher.HasCaught()); |
| 160 if (!value.IsEmpty()) { | 160 if (!value.IsEmpty()) { |
| 161 CHECK_EQ(value, catcher.Exception()); | 161 CHECK_EQ(value, catcher.Exception()); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 HEAP->CollectAllAvailableGarbage(); // Clean slate for the next test. |
| 164 } | 165 } |
| 165 | 166 |
| 166 | 167 |
| 167 v8::Handle<Value> DeclarationContext::HandleGet(Local<String> key, | 168 v8::Handle<Value> DeclarationContext::HandleGet(Local<String> key, |
| 168 const AccessorInfo& info) { | 169 const AccessorInfo& info) { |
| 169 DeclarationContext* context = GetInstance(info); | 170 DeclarationContext* context = GetInstance(info); |
| 170 context->get_count_++; | 171 context->get_count_++; |
| 171 return context->Get(key); | 172 return context->Get(key); |
| 172 } | 173 } |
| 173 | 174 |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 SimpleContext context; | 834 SimpleContext context; |
| 834 context.Check(firsts[i], EXPECT_RESULT, Number::New(1)); | 835 context.Check(firsts[i], EXPECT_RESULT, Number::New(1)); |
| 835 // TODO(rossberg): All tests should actually be errors in Harmony, | 836 // TODO(rossberg): All tests should actually be errors in Harmony, |
| 836 // 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 |
| 837 // is not lexical. | 838 // is not lexical. |
| 838 context.Check(seconds[j], | 839 context.Check(seconds[j], |
| 839 i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2)); | 840 i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2)); |
| 840 } | 841 } |
| 841 } | 842 } |
| 842 } | 843 } |
| OLD | NEW |