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

Side by Side Diff: src/accessors.cc

Issue 1332873002: Fixing Sloppy Symbol.iterator setter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
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/accessors.h" 5 #include "src/accessors.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 Object* result = isolate->native_context()->array_values_iterator(); 139 Object* result = isolate->native_context()->array_values_iterator();
140 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(result, isolate))); 140 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(result, isolate)));
141 } 141 }
142 142
143 143
144 void Accessors::ArgumentsIteratorSetter( 144 void Accessors::ArgumentsIteratorSetter(
145 v8::Local<v8::Name> name, v8::Local<v8::Value> val, 145 v8::Local<v8::Name> name, v8::Local<v8::Value> val,
146 const v8::PropertyCallbackInfo<void>& info) { 146 const v8::PropertyCallbackInfo<void>& info) {
147 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 147 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
148 HandleScope scope(isolate); 148 HandleScope scope(isolate);
149 Handle<JSObject> object = Utils::OpenHandle(*info.This()); 149 Handle<JSObject> object_handle = Utils::OpenHandle(*info.This());
150 Handle<Object> value = Utils::OpenHandle(*val); 150 Handle<Object> value_handle = Utils::OpenHandle(*val);
151 Handle<Name> name_handle = Utils::OpenHandle(*name);
151 152
152 LookupIterator it(object, Utils::OpenHandle(*name)); 153 JSObject::DefinePropertyOrElementIgnoreAttributes(object_handle, name_handle,
153 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); 154 value_handle, NONE)
154 DCHECK(it.HolderIsReceiverOrHiddenPrototype()); 155 .Check();
Camillo Bruni 2015/09/10 13:59:48 I am not fully sure if and how I should check for
Jakob Kummerow 2015/09/10 14:29:20 if: yes, I think you should. (Rule of thumb: if a
155
156 if (Object::SetDataProperty(&it, value).is_null()) {
157 isolate->OptionalRescheduleException(false);
158 }
159 } 156 }
160 157
161 158
162 Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo( 159 Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo(
163 Isolate* isolate, PropertyAttributes attributes) { 160 Isolate* isolate, PropertyAttributes attributes) {
164 Handle<Name> name = isolate->factory()->iterator_symbol(); 161 Handle<Name> name = isolate->factory()->iterator_symbol();
165 return MakeAccessor(isolate, name, &ArgumentsIteratorGetter, 162 return MakeAccessor(isolate, name, &ArgumentsIteratorGetter,
166 &ArgumentsIteratorSetter, attributes); 163 &ArgumentsIteratorSetter, attributes);
167 } 164 }
168 165
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1486 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1490 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1487 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1491 info->set_getter(*getter); 1488 info->set_getter(*getter);
1492 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1489 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1493 return info; 1490 return info;
1494 } 1491 }
1495 1492
1496 1493
1497 } // namespace internal 1494 } // namespace internal
1498 } // namespace v8 1495 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/arguments-iterator.js » ('j') | test/mjsunit/es6/arguments-iterator.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698