| OLD | NEW |
| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // 1. Let obj be ? ToObject(O). | 280 // 1. Let obj be ? ToObject(O). |
| 281 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, object, | 281 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, object, |
| 282 Execution::ToObject(isolate, object)); | 282 Execution::ToObject(isolate, object)); |
| 283 // 2. Let key be ? ToPropertyKey(P). | 283 // 2. Let key be ? ToPropertyKey(P). |
| 284 Handle<Name> key; | 284 Handle<Name> key; |
| 285 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key, | 285 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key, |
| 286 Object::ToName(isolate, raw_name)); | 286 Object::ToName(isolate, raw_name)); |
| 287 | 287 |
| 288 // 3. Let desc be ? obj.[[GetOwnProperty]](key). | 288 // 3. Let desc be ? obj.[[GetOwnProperty]](key). |
| 289 PropertyDescriptor desc; | 289 PropertyDescriptor desc; |
| 290 bool found = JSReceiver::GetOwnPropertyDescriptor( | 290 Maybe<bool> found = JSReceiver::GetOwnPropertyDescriptor( |
| 291 isolate, Handle<JSReceiver>::cast(object), key, &desc); | 291 isolate, Handle<JSReceiver>::cast(object), key, &desc); |
| 292 if (isolate->has_pending_exception()) return isolate->heap()->exception(); | 292 MAYBE_RETURN(found, isolate->heap()->exception()); |
| 293 // 4. Return FromPropertyDescriptor(desc). | 293 // 4. Return FromPropertyDescriptor(desc). |
| 294 if (!found) return isolate->heap()->undefined_value(); | 294 if (!found.FromJust()) return isolate->heap()->undefined_value(); |
| 295 return *desc.ToObject(isolate); | 295 return *desc.ToObject(isolate); |
| 296 } | 296 } |
| 297 | 297 |
| 298 | 298 |
| 299 RUNTIME_FUNCTION(Runtime_PreventExtensions) { | 299 RUNTIME_FUNCTION(Runtime_PreventExtensions) { |
| 300 HandleScope scope(isolate); | 300 HandleScope scope(isolate); |
| 301 DCHECK(args.length() == 1); | 301 DCHECK(args.length() == 1); |
| 302 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); | 302 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); |
| 303 MAYBE_RETURN(JSReceiver::PreventExtensions(obj, Object::THROW_ON_ERROR), | 303 MAYBE_RETURN(JSReceiver::PreventExtensions(obj, Object::THROW_ON_ERROR), |
| 304 isolate->heap()->exception()); | 304 isolate->heap()->exception()); |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 | 1434 |
| 1435 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { | 1435 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { |
| 1436 HandleScope scope(isolate); | 1436 HandleScope scope(isolate); |
| 1437 DCHECK(args.length() == 2); | 1437 DCHECK(args.length() == 2); |
| 1438 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); | 1438 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); |
| 1439 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); | 1439 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); |
| 1440 return JSReceiver::DefineProperties(isolate, o, properties); | 1440 return JSReceiver::DefineProperties(isolate, o, properties); |
| 1441 } | 1441 } |
| 1442 } // namespace internal | 1442 } // namespace internal |
| 1443 } // namespace v8 | 1443 } // namespace v8 |
| OLD | NEW |