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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 : is_initialized_(false), get_count_(0), set_count_(0), query_count_(0) { | 112 : is_initialized_(false), get_count_(0), set_count_(0), query_count_(0) { |
113 // Do nothing. | 113 // Do nothing. |
114 } | 114 } |
115 | 115 |
116 | 116 |
117 void DeclarationContext::InitializeIfNeeded() { | 117 void DeclarationContext::InitializeIfNeeded() { |
118 if (is_initialized_) return; | 118 if (is_initialized_) return; |
119 Isolate* isolate = CcTest::isolate(); | 119 Isolate* isolate = CcTest::isolate(); |
120 HandleScope scope(isolate); | 120 HandleScope scope(isolate); |
121 Local<FunctionTemplate> function = FunctionTemplate::New(); | 121 Local<FunctionTemplate> function = FunctionTemplate::New(); |
122 Local<Value> data = External::New(this); | 122 Local<Value> data = External::New(CcTest::isolate(), this); |
123 GetHolder(function)->SetNamedPropertyHandler(&HandleGet, | 123 GetHolder(function)->SetNamedPropertyHandler(&HandleGet, |
124 &HandleSet, | 124 &HandleSet, |
125 &HandleQuery, | 125 &HandleQuery, |
126 0, 0, | 126 0, 0, |
127 data); | 127 data); |
128 Local<Context> context = Context::New(isolate, | 128 Local<Context> context = Context::New(isolate, |
129 0, | 129 0, |
130 function->InstanceTemplate(), | 130 function->InstanceTemplate(), |
131 Local<Value>()); | 131 Local<Value>()); |
132 context_.Reset(isolate, context); | 132 context_.Reset(isolate, context); |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 SimpleContext context; | 854 SimpleContext context; |
855 context.Check(firsts[i], EXPECT_RESULT, Number::New(1)); | 855 context.Check(firsts[i], EXPECT_RESULT, Number::New(1)); |
856 // TODO(rossberg): All tests should actually be errors in Harmony, | 856 // TODO(rossberg): All tests should actually be errors in Harmony, |
857 // but we currently do not detect the cases where the first declaration | 857 // but we currently do not detect the cases where the first declaration |
858 // is not lexical. | 858 // is not lexical. |
859 context.Check(seconds[j], | 859 context.Check(seconds[j], |
860 i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2)); | 860 i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2)); |
861 } | 861 } |
862 } | 862 } |
863 } | 863 } |
OLD | NEW |