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

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

Issue 1397853005: [es6] Partially implement Reflect.preventExtensions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: s/Object/JSObject/ Created 5 years, 2 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 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 298 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
299 GetOwnProperty(isolate, obj, name)); 299 GetOwnProperty(isolate, obj, name));
300 return *result; 300 return *result;
301 } 301 }
302 302
303 303
304 RUNTIME_FUNCTION(Runtime_PreventExtensions) { 304 RUNTIME_FUNCTION(Runtime_PreventExtensions) {
305 HandleScope scope(isolate); 305 HandleScope scope(isolate);
306 DCHECK(args.length() == 1); 306 DCHECK(args.length() == 1);
307 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 307 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
308 Handle<Object> result; 308 ASSIGN_OR_RETURN_EXCEPTION(
309 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 309 isolate, bool, result,
310 JSObject::PreventExtensions(obj)); 310 JSReceiver::PreventExtensions(obj, THROW_ON_ERROR));
311 return *result; 311 return *obj;
312 } 312 }
313 313
314 314
315 RUNTIME_FUNCTION(Runtime_IsExtensible) { 315 RUNTIME_FUNCTION(Runtime_IsExtensible) {
316 HandleScope scope(isolate); 316 HandleScope scope(isolate);
317 DCHECK(args.length() == 1); 317 DCHECK(args.length() == 1);
318 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 318 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
319 return isolate->heap()->ToBoolean(JSObject::IsExtensible(obj)); 319 return isolate->heap()->ToBoolean(JSObject::IsExtensible(obj));
320 } 320 }
321 321
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 1639
1640 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { 1640 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) {
1641 HandleScope scope(isolate); 1641 HandleScope scope(isolate);
1642 DCHECK(args.length() == 2); 1642 DCHECK(args.length() == 2);
1643 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); 1643 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0);
1644 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); 1644 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1);
1645 return JSReceiver::DefineProperties(isolate, o, properties); 1645 return JSReceiver::DefineProperties(isolate, o, properties);
1646 } 1646 }
1647 } // namespace internal 1647 } // namespace internal
1648 } // namespace v8 1648 } // namespace v8
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698