| 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/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 | 896 |
| 897 // If the slot was found in a context, it should be DONT_DELETE. | 897 // If the slot was found in a context, it should be DONT_DELETE. |
| 898 if (holder->IsContext()) { | 898 if (holder->IsContext()) { |
| 899 return isolate->heap()->false_value(); | 899 return isolate->heap()->false_value(); |
| 900 } | 900 } |
| 901 | 901 |
| 902 // The slot was found in a JSObject, either a context extension object, | 902 // The slot was found in a JSObject, either a context extension object, |
| 903 // the global object, or the subject of a with. Try to delete it | 903 // the global object, or the subject of a with. Try to delete it |
| 904 // (respecting DONT_DELETE). | 904 // (respecting DONT_DELETE). |
| 905 Handle<JSObject> object = Handle<JSObject>::cast(holder); | 905 Handle<JSObject> object = Handle<JSObject>::cast(holder); |
| 906 Handle<Object> result; | 906 Maybe<bool> result = JSReceiver::DeleteProperty(object, name); |
| 907 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 907 MAYBE_RETURN(result, isolate->heap()->exception()); |
| 908 JSReceiver::DeleteProperty(object, name)); | 908 return isolate->heap()->ToBoolean(result.FromJust()); |
| 909 return *result; | |
| 910 } | 909 } |
| 911 | 910 |
| 912 | 911 |
| 913 static Object* ComputeReceiverForNonGlobal(Isolate* isolate, JSObject* holder) { | 912 static Object* ComputeReceiverForNonGlobal(Isolate* isolate, JSObject* holder) { |
| 914 DCHECK(!holder->IsJSGlobalObject()); | 913 DCHECK(!holder->IsJSGlobalObject()); |
| 915 | 914 |
| 916 // If the holder isn't a context extension object, we just return it | 915 // If the holder isn't a context extension object, we just return it |
| 917 // as the receiver. This allows arguments objects to be used as | 916 // as the receiver. This allows arguments objects to be used as |
| 918 // receivers, but only if they are put in the context scope chain | 917 // receivers, but only if they are put in the context scope chain |
| 919 // explicitly via a with-statement. | 918 // explicitly via a with-statement. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 | 1166 |
| 1168 // Lookup in the initial Object.prototype object. | 1167 // Lookup in the initial Object.prototype object. |
| 1169 Handle<Object> result; | 1168 Handle<Object> result; |
| 1170 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1169 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 1171 isolate, result, | 1170 isolate, result, |
| 1172 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1171 Object::GetProperty(isolate->initial_object_prototype(), key)); |
| 1173 return *result; | 1172 return *result; |
| 1174 } | 1173 } |
| 1175 } // namespace internal | 1174 } // namespace internal |
| 1176 } // namespace v8 | 1175 } // namespace v8 |
| OLD | NEW |