Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: src/accessors.cc

Issue 342453002: Arguments object has @@iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased, adapted to getdataproperty change Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index c2361b3e9cda753c69ae5e12bb57ded05385cde8..9a2431bbe731774c1794ea7d8108940b0142a00a 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -156,6 +156,46 @@ 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);
+
+ if (SetPropertyOnInstanceIfInherited(isolate, info, name, value)) return;
+
+ LookupIterator it(object, Utils::OpenHandle(*name));
+ CHECK(it.HasProperty());
+ DCHECK(it.HolderIsReceiverOrHiddenPrototype());
+ Object::SetDataProperty(&it, value);
+}
+
+
+Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo(
+ Isolate* isolate, PropertyAttributes attributes) {
+ Handle<Name> name(isolate->native_context()->iterator_symbol(), isolate);
+ return MakeAccessor(isolate, name, &ArgumentsIteratorGetter,
+ &ArgumentsIteratorSetter, attributes);
+}
+
+
+//
// Accessors::ArrayLength
//
« no previous file with comments | « src/accessors.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698