| 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/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 // In case of JSProxy, an exception might have been thrown. | 972 // In case of JSProxy, an exception might have been thrown. |
| 973 if (isolate->has_pending_exception()) return isolate->heap()->exception(); | 973 if (isolate->has_pending_exception()) return isolate->heap()->exception(); |
| 974 return isolate->heap()->true_value(); | 974 return isolate->heap()->true_value(); |
| 975 } | 975 } |
| 976 | 976 |
| 977 // If the slot was found in a context, it should be DONT_DELETE. | 977 // If the slot was found in a context, it should be DONT_DELETE. |
| 978 if (holder->IsContext()) { | 978 if (holder->IsContext()) { |
| 979 return isolate->heap()->false_value(); | 979 return isolate->heap()->false_value(); |
| 980 } | 980 } |
| 981 | 981 |
| 982 // The slot was found in a JSObject, either a context extension object, | 982 // The slot was found in a JSReceiver, either a context extension object, |
| 983 // the global object, or the subject of a with. Try to delete it | 983 // the global object, or the subject of a with. Try to delete it |
| 984 // (respecting DONT_DELETE). | 984 // (respecting DONT_DELETE). |
| 985 Handle<JSObject> object = Handle<JSObject>::cast(holder); | 985 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); |
| 986 Maybe<bool> result = JSReceiver::DeleteProperty(object, name); | 986 Maybe<bool> result = JSReceiver::DeleteProperty(object, name); |
| 987 MAYBE_RETURN(result, isolate->heap()->exception()); | 987 MAYBE_RETURN(result, isolate->heap()->exception()); |
| 988 return isolate->heap()->ToBoolean(result.FromJust()); | 988 return isolate->heap()->ToBoolean(result.FromJust()); |
| 989 } | 989 } |
| 990 | 990 |
| 991 | 991 |
| 992 static Object* ComputeReceiverForNonGlobal(Isolate* isolate, JSObject* holder) { | 992 static Object* ComputeReceiverForNonGlobal(Isolate* isolate, JSObject* holder) { |
| 993 DCHECK(!holder->IsJSGlobalObject()); | 993 DCHECK(!holder->IsJSGlobalObject()); |
| 994 | 994 |
| 995 // If the holder isn't a context extension object, we just return it | 995 // If the holder isn't a context extension object, we just return it |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 | 1246 |
| 1247 // Lookup in the initial Object.prototype object. | 1247 // Lookup in the initial Object.prototype object. |
| 1248 Handle<Object> result; | 1248 Handle<Object> result; |
| 1249 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1249 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 1250 isolate, result, | 1250 isolate, result, |
| 1251 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1251 Object::GetProperty(isolate->initial_object_prototype(), key)); |
| 1252 return *result; | 1252 return *result; |
| 1253 } | 1253 } |
| 1254 } // namespace internal | 1254 } // namespace internal |
| 1255 } // namespace v8 | 1255 } // namespace v8 |
| OLD | NEW |