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

Side by Side Diff: src/runtime/runtime-object.cc

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: more tests Created 5 years, 1 month 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 isolate->heap()->exception()); 175 isolate->heap()->exception());
176 return *obj; 176 return *obj;
177 } 177 }
178 178
179 179
180 RUNTIME_FUNCTION(Runtime_SetPrototype) { 180 RUNTIME_FUNCTION(Runtime_SetPrototype) {
181 HandleScope scope(isolate); 181 HandleScope scope(isolate);
182 DCHECK(args.length() == 2); 182 DCHECK(args.length() == 2);
183 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); 183 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
184 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); 184 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1);
185 MAYBE_RETURN( 185
186 JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR), 186 Maybe<bool> status =
187 isolate->heap()->exception()); 187 JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR);
188 if (status.IsNothing()) return isolate->heap()->exception();
189 if (!status.FromJust()) {
190 THROW_NEW_ERROR_RETURN_FAILURE(
191 isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject));
192 }
188 return *obj; 193 return *obj;
189 } 194 }
190 195
191 196
192 // Enumerator used as indices into the array returned from GetOwnProperty 197 // Enumerator used as indices into the array returned from GetOwnProperty
193 enum PropertyDescriptorIndices { 198 enum PropertyDescriptorIndices {
194 IS_ACCESSOR_INDEX, 199 IS_ACCESSOR_INDEX,
195 VALUE_INDEX, 200 VALUE_INDEX,
196 GETTER_INDEX, 201 GETTER_INDEX,
197 SETTER_INDEX, 202 SETTER_INDEX,
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 1573
1569 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { 1574 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) {
1570 HandleScope scope(isolate); 1575 HandleScope scope(isolate);
1571 DCHECK(args.length() == 2); 1576 DCHECK(args.length() == 2);
1572 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); 1577 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0);
1573 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); 1578 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1);
1574 return JSReceiver::DefineProperties(isolate, o, properties); 1579 return JSReceiver::DefineProperties(isolate, o, properties);
1575 } 1580 }
1576 } // namespace internal 1581 } // namespace internal
1577 } // namespace v8 1582 } // namespace v8
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime/runtime-proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698