| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 519 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 520 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); | 520 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); |
| 521 return DeleteProperty(isolate, object, key, STRICT); | 521 return DeleteProperty(isolate, object, key, STRICT); |
| 522 } | 522 } |
| 523 | 523 |
| 524 | 524 |
| 525 // ES6 section 12.9.3, operator in. | 525 // ES6 section 12.9.3, operator in. |
| 526 RUNTIME_FUNCTION(Runtime_HasProperty) { | 526 RUNTIME_FUNCTION(Runtime_HasProperty) { |
| 527 HandleScope scope(isolate); | 527 HandleScope scope(isolate); |
| 528 DCHECK_EQ(2, args.length()); | 528 DCHECK_EQ(2, args.length()); |
| 529 CONVERT_ARG_HANDLE_CHECKED(Object, key, 0); | 529 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 530 CONVERT_ARG_HANDLE_CHECKED(Object, object, 1); | 530 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); |
| 531 | 531 |
| 532 // Check that {object} is actually a receiver. | 532 // Check that {object} is actually a receiver. |
| 533 if (!object->IsJSReceiver()) { | 533 if (!object->IsJSReceiver()) { |
| 534 THROW_NEW_ERROR_RETURN_FAILURE( | 534 THROW_NEW_ERROR_RETURN_FAILURE( |
| 535 isolate, | 535 isolate, |
| 536 NewTypeError(MessageTemplate::kInvalidInOperatorUse, key, object)); | 536 NewTypeError(MessageTemplate::kInvalidInOperatorUse, key, object)); |
| 537 } | 537 } |
| 538 Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(object); | 538 Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(object); |
| 539 | 539 |
| 540 // Convert the {key} to a name. | 540 // Convert the {key} to a name. |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 isolate, o, key, &success, LookupIterator::OWN); | 965 isolate, o, key, &success, LookupIterator::OWN); |
| 966 if (!success) return isolate->heap()->exception(); | 966 if (!success) return isolate->heap()->exception(); |
| 967 MAYBE_RETURN( | 967 MAYBE_RETURN( |
| 968 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 968 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
| 969 isolate->heap()->exception()); | 969 isolate->heap()->exception()); |
| 970 return *value; | 970 return *value; |
| 971 } | 971 } |
| 972 | 972 |
| 973 } // namespace internal | 973 } // namespace internal |
| 974 } // namespace v8 | 974 } // namespace v8 |
| OLD | NEW |