Chromium Code Reviews| Index: src/accessors.cc |
| diff --git a/src/accessors.cc b/src/accessors.cc |
| index c2361b3e9cda753c69ae5e12bb57ded05385cde8..d2636d2bd589c59ce788196320abf0235d3d77ac 100644 |
| --- a/src/accessors.cc |
| +++ b/src/accessors.cc |
| @@ -156,6 +156,45 @@ bool SetPropertyOnInstanceIfInherited( |
| // |
| +// Accessors::ArgumentsIterator |
| +// |
| + |
| + |
| +void Accessors::ArgumentsIteratorGetter( |
| + v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| + i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
| + DisallowHeapAllocation no_allocation; |
| + HandleScope scope(isolate); |
| + Object* result = isolate->native_context()->array_values_iterator(); |
| + info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(result, isolate))); |
| +} |
| + |
| + |
| +void Accessors::ArgumentsIteratorSetter( |
| + v8::Local<v8::Name> name, v8::Local<v8::Value> val, |
| + const v8::PropertyCallbackInfo<void>& info) { |
| + i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
| + HandleScope scope(isolate); |
| + Handle<JSObject> object = Utils::OpenHandle(*info.This()); |
| + Handle<Object> value = Utils::OpenHandle(*val); |
| + LookupIterator it(object, Utils::OpenHandle(*name)); |
| + // Advance the iterator to find out more about the property. |
| + bool has_property = it.HasProperty(); |
| + DCHECK(has_property); |
| + MaybeHandle<Object> maybe = Object::SetDataProperty(&it, value); |
|
Toon Verwaest
2014/08/18 13:47:25
This doesn't seem right to me, if only because the
arv (Not doing code reviews)
2014/08/18 14:16:56
The intent is to replace the existing interceptor
wingo
2014/08/20 15:46:57
As Erik says the intent is that arguments[@@iterat
Toon Verwaest
2014/08/21 11:07:20
To be clear what I meant, what about:
o = {__prot
|
| + maybe.Check(); |
| +} |
| + |
| + |
| +Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo( |
| + Isolate* isolate, PropertyAttributes attributes) { |
| + return MakeAccessor(isolate, isolate->factory()->length_string(), |
|
Toon Verwaest
2014/08/21 11:07:20
Ok, in that case this is part of what confused me.
|
| + &ArgumentsIteratorGetter, &ArgumentsIteratorSetter, |
| + attributes); |
| +} |
| + |
| + |
| +// |
| // Accessors::ArrayLength |
| // |