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

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: merging with master Created 5 years 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 | « src/regexp/mips64/regexp-macro-assembler-mips64.cc ('k') | src/x64/macro-assembler-x64.h » ('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 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 isolate->heap()->exception()); 176 isolate->heap()->exception());
177 return *obj; 177 return *obj;
178 } 178 }
179 179
180 180
181 RUNTIME_FUNCTION(Runtime_SetPrototype) { 181 RUNTIME_FUNCTION(Runtime_SetPrototype) {
182 HandleScope scope(isolate); 182 HandleScope scope(isolate);
183 DCHECK(args.length() == 2); 183 DCHECK(args.length() == 2);
184 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); 184 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
185 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); 185 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1);
186 MAYBE_RETURN( 186
187 JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR), 187 Maybe<bool> status =
188 isolate->heap()->exception()); 188 JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR);
189 if (status.IsNothing()) return isolate->heap()->exception();
190 if (!status.FromJust()) {
191 THROW_NEW_ERROR_RETURN_FAILURE(
192 isolate, NewTypeError(MessageTemplate::kObjectSetPrototypeFailed, obj,
193 prototype));
194 }
189 return *obj; 195 return *obj;
190 } 196 }
191 197
192 198
193 // Enumerator used as indices into the array returned from GetOwnProperty 199 // Enumerator used as indices into the array returned from GetOwnProperty
194 enum PropertyDescriptorIndices { 200 enum PropertyDescriptorIndices {
195 IS_ACCESSOR_INDEX, 201 IS_ACCESSOR_INDEX,
196 VALUE_INDEX, 202 VALUE_INDEX,
197 GETTER_INDEX, 203 GETTER_INDEX,
198 SETTER_INDEX, 204 SETTER_INDEX,
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 1580
1575 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { 1581 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) {
1576 HandleScope scope(isolate); 1582 HandleScope scope(isolate);
1577 DCHECK(args.length() == 2); 1583 DCHECK(args.length() == 2);
1578 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); 1584 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0);
1579 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); 1585 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1);
1580 return JSReceiver::DefineProperties(isolate, o, properties); 1586 return JSReceiver::DefineProperties(isolate, o, properties);
1581 } 1587 }
1582 } // namespace internal 1588 } // namespace internal
1583 } // namespace v8 1589 } // namespace v8
OLDNEW
« no previous file with comments | « src/regexp/mips64/regexp-macro-assembler-mips64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698