OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 15056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15067 if (is_extensible.FromJust()) return Just(bool_trap_result); | 15067 if (is_extensible.FromJust()) return Just(bool_trap_result); |
15068 // 11. Let targetProto be ? target.[[GetPrototypeOf]](). | 15068 // 11. Let targetProto be ? target.[[GetPrototypeOf]](). |
15069 Handle<Object> target_proto; | 15069 Handle<Object> target_proto; |
15070 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, target_proto, | 15070 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, target_proto, |
15071 Object::GetPrototype(isolate, target), | 15071 Object::GetPrototype(isolate, target), |
15072 Nothing<bool>()); | 15072 Nothing<bool>()); |
15073 // 12. If booleanTrapResult is true and SameValue(V, targetProto) is false, | 15073 // 12. If booleanTrapResult is true and SameValue(V, targetProto) is false, |
15074 // throw a TypeError exception. | 15074 // throw a TypeError exception. |
15075 if (bool_trap_result && !value->SameValue(*target_proto)) { | 15075 if (bool_trap_result && !value->SameValue(*target_proto)) { |
15076 isolate->Throw(*isolate->factory()->NewTypeError( | 15076 isolate->Throw(*isolate->factory()->NewTypeError( |
15077 MessageTemplate::kProxyTrapViolatesInvariant, target)); | 15077 MessageTemplate::kProxyTrapViolatesInvariant, trap_name)); |
15078 return Nothing<bool>(); | 15078 return Nothing<bool>(); |
15079 } | 15079 } |
15080 // 13. Return booleanTrapResult. | 15080 // 13. Return booleanTrapResult. |
15081 return Just(bool_trap_result); | 15081 return Just(bool_trap_result); |
15082 } | 15082 } |
15083 | 15083 |
15084 | 15084 |
15085 Maybe<bool> JSObject::SetPrototype(Handle<JSObject> object, | 15085 Maybe<bool> JSObject::SetPrototype(Handle<JSObject> object, |
15086 Handle<Object> value, bool from_javascript, | 15086 Handle<Object> value, bool from_javascript, |
15087 ShouldThrow should_throw) { | 15087 ShouldThrow should_throw) { |
(...skipping 4075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19163 if (cell->value() != *new_value) { | 19163 if (cell->value() != *new_value) { |
19164 cell->set_value(*new_value); | 19164 cell->set_value(*new_value); |
19165 Isolate* isolate = cell->GetIsolate(); | 19165 Isolate* isolate = cell->GetIsolate(); |
19166 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19166 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19167 isolate, DependentCode::kPropertyCellChangedGroup); | 19167 isolate, DependentCode::kPropertyCellChangedGroup); |
19168 } | 19168 } |
19169 } | 19169 } |
19170 | 19170 |
19171 } // namespace internal | 19171 } // namespace internal |
19172 } // namespace v8 | 19172 } // namespace v8 |
OLD | NEW |