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

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: adding error handling 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
« no previous file with comments | « no previous file | test/mjsunit/es6/arguments-iterator.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (JSObject::DefinePropertyOrElementIgnoreAttributes(
153 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); 154 object_handle, name_handle, value_handle, NONE)
154 DCHECK(it.HolderIsReceiverOrHiddenPrototype()); 155 .is_null()) {
155
156 if (Object::SetDataProperty(&it, value).is_null()) {
157 isolate->OptionalRescheduleException(false); 156 isolate->OptionalRescheduleException(false);
158 } 157 }
159 } 158 }
160 159
161 160
162 Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo( 161 Handle<AccessorInfo> Accessors::ArgumentsIteratorInfo(
163 Isolate* isolate, PropertyAttributes attributes) { 162 Isolate* isolate, PropertyAttributes attributes) {
164 Handle<Name> name = isolate->factory()->iterator_symbol(); 163 Handle<Name> name = isolate->factory()->iterator_symbol();
165 return MakeAccessor(isolate, name, &ArgumentsIteratorGetter, 164 return MakeAccessor(isolate, name, &ArgumentsIteratorGetter,
166 &ArgumentsIteratorSetter, attributes); 165 &ArgumentsIteratorSetter, attributes);
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1488 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1490 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1489 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1491 info->set_getter(*getter); 1490 info->set_getter(*getter);
1492 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1491 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1493 return info; 1492 return info;
1494 } 1493 }
1495 1494
1496 1495
1497 } // namespace internal 1496 } // namespace internal
1498 } // namespace v8 1497 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/arguments-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698