| 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/v8.h" | 5 #include "src/v8.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/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 DCHECK(is_function); | 59 DCHECK(is_function); |
| 60 if ((old_attributes & DONT_DELETE) != 0) { | 60 if ((old_attributes & DONT_DELETE) != 0) { |
| 61 // Only allow reconfiguring globals to functions in user code (no | 61 // Only allow reconfiguring globals to functions in user code (no |
| 62 // natives, which are marked as read-only). | 62 // natives, which are marked as read-only). |
| 63 DCHECK((attr & READ_ONLY) == 0); | 63 DCHECK((attr & READ_ONLY) == 0); |
| 64 | 64 |
| 65 // Check whether we can reconfigure the existing property into a | 65 // Check whether we can reconfigure the existing property into a |
| 66 // function. | 66 // function. |
| 67 PropertyDetails old_details = it.property_details(); | 67 PropertyDetails old_details = it.property_details(); |
| 68 // TODO(verwaest): CALLBACKS invalidly includes ExecutableAccessInfo, | 68 // TODO(verwaest): ACCESSOR_CONSTANT invalidly includes |
| 69 // ExecutableAccessInfo, |
| 69 // which are actually data properties, not accessor properties. | 70 // which are actually data properties, not accessor properties. |
| 70 if (old_details.IsReadOnly() || old_details.IsDontEnum() || | 71 if (old_details.IsReadOnly() || old_details.IsDontEnum() || |
| 71 old_details.type() == CALLBACKS) { | 72 old_details.type() == ACCESSOR_CONSTANT) { |
| 72 return ThrowRedeclarationError(isolate, name); | 73 return ThrowRedeclarationError(isolate, name); |
| 73 } | 74 } |
| 74 // If the existing property is not configurable, keep its attributes. Do | 75 // If the existing property is not configurable, keep its attributes. Do |
| 75 attr = old_attributes; | 76 attr = old_attributes; |
| 76 } | 77 } |
| 77 } | 78 } |
| 78 | 79 |
| 79 // Define or redefine own property. | 80 // Define or redefine own property. |
| 80 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::SetOwnPropertyIgnoreAttributes( | 81 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::SetOwnPropertyIgnoreAttributes( |
| 81 global, name, value, attr)); | 82 global, name, value, attr)); |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 return Smi::FromInt(frame->GetArgumentsLength()); | 1082 return Smi::FromInt(frame->GetArgumentsLength()); |
| 1082 } | 1083 } |
| 1083 | 1084 |
| 1084 | 1085 |
| 1085 RUNTIME_FUNCTION(RuntimeReference_Arguments) { | 1086 RUNTIME_FUNCTION(RuntimeReference_Arguments) { |
| 1086 SealHandleScope shs(isolate); | 1087 SealHandleScope shs(isolate); |
| 1087 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); | 1088 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); |
| 1088 } | 1089 } |
| 1089 } | 1090 } |
| 1090 } // namespace v8::internal | 1091 } // namespace v8::internal |
| OLD | NEW |