OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 v8::Local<v8::Name> name, v8::Local<v8::Value> val, | 174 v8::Local<v8::Name> name, v8::Local<v8::Value> val, |
175 const v8::PropertyCallbackInfo<void>& info) { | 175 const v8::PropertyCallbackInfo<void>& info) { |
176 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 176 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
177 HandleScope scope(isolate); | 177 HandleScope scope(isolate); |
178 Handle<JSObject> object = Utils::OpenHandle(*info.This()); | 178 Handle<JSObject> object = Utils::OpenHandle(*info.This()); |
179 Handle<Object> value = Utils::OpenHandle(*val); | 179 Handle<Object> value = Utils::OpenHandle(*val); |
180 | 180 |
181 if (SetPropertyOnInstanceIfInherited(isolate, info, name, value)) return; | 181 if (SetPropertyOnInstanceIfInherited(isolate, info, name, value)) return; |
182 | 182 |
183 LookupIterator it(object, Utils::OpenHandle(*name)); | 183 LookupIterator it(object, Utils::OpenHandle(*name)); |
184 CHECK(it.HasProperty()); | 184 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); |
185 DCHECK(it.HolderIsReceiverOrHiddenPrototype()); | 185 DCHECK(it.HolderIsReceiverOrHiddenPrototype()); |
186 Object::SetDataProperty(&it, value); | 186 Object::SetDataProperty(&it, value); |
187 } | 187 } |
188 | 188 |
189 | 189 |
190 Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo( | 190 Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo( |
191 Isolate* isolate, PropertyAttributes attributes) { | 191 Isolate* isolate, PropertyAttributes attributes) { |
192 Handle<Name> name(isolate->native_context()->iterator_symbol(), isolate); | 192 Handle<Name> name(isolate->native_context()->iterator_symbol(), isolate); |
193 return MakeAccessor(isolate, name, &ArgumentsIteratorGetter, | 193 return MakeAccessor(isolate, name, &ArgumentsIteratorGetter, |
194 &ArgumentsIteratorSetter, attributes); | 194 &ArgumentsIteratorSetter, attributes); |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 info->set_data(Smi::FromInt(index)); | 1413 info->set_data(Smi::FromInt(index)); |
1414 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1414 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1415 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1415 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1416 info->set_getter(*getter); | 1416 info->set_getter(*getter); |
1417 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1417 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1418 return info; | 1418 return info; |
1419 } | 1419 } |
1420 | 1420 |
1421 | 1421 |
1422 } } // namespace v8::internal | 1422 } } // namespace v8::internal |
OLD | NEW |