OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 15535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15546 real_receiver = PrototypeIterator::GetCurrent<JSObject>(iter); | 15546 real_receiver = PrototypeIterator::GetCurrent<JSObject>(iter); |
15547 iter.Advance(); | 15547 iter.Advance(); |
15548 all_extensible = all_extensible && real_receiver->map()->is_extensible(); | 15548 all_extensible = all_extensible && real_receiver->map()->is_extensible(); |
15549 } | 15549 } |
15550 } | 15550 } |
15551 Handle<Map> map(real_receiver->map()); | 15551 Handle<Map> map(real_receiver->map()); |
15552 | 15552 |
15553 // Nothing to do if prototype is already set. | 15553 // Nothing to do if prototype is already set. |
15554 if (map->prototype() == *value) return Just(true); | 15554 if (map->prototype() == *value) return Just(true); |
15555 | 15555 |
15556 bool immutable_proto = object->map()->is_immutable_proto(); | 15556 bool immutable_proto = map->is_immutable_proto(); |
15557 if (immutable_proto) { | 15557 if (immutable_proto) { |
15558 RETURN_FAILURE( | 15558 RETURN_FAILURE( |
15559 isolate, should_throw, | 15559 isolate, should_throw, |
15560 NewTypeError(MessageTemplate::kImmutablePrototypeSet, object)); | 15560 NewTypeError(MessageTemplate::kImmutablePrototypeSet, object)); |
15561 } | 15561 } |
15562 | 15562 |
15563 // From 8.6.2 Object Internal Methods | 15563 // From 8.6.2 Object Internal Methods |
15564 // ... | 15564 // ... |
15565 // In addition, if [[Extensible]] is false the value of the [[Class]] and | 15565 // In addition, if [[Extensible]] is false the value of the [[Class]] and |
15566 // [[Prototype]] internal properties of the object may not be modified. | 15566 // [[Prototype]] internal properties of the object may not be modified. |
(...skipping 4711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20278 // Check if the accessor uses a cached property. | 20278 // Check if the accessor uses a cached property. |
20279 if (!fti->cached_property_name()->IsTheHole(isolate)) { | 20279 if (!fti->cached_property_name()->IsTheHole(isolate)) { |
20280 return handle(Name::cast(fti->cached_property_name())); | 20280 return handle(Name::cast(fti->cached_property_name())); |
20281 } | 20281 } |
20282 } | 20282 } |
20283 return MaybeHandle<Name>(); | 20283 return MaybeHandle<Name>(); |
20284 } | 20284 } |
20285 | 20285 |
20286 } // namespace internal | 20286 } // namespace internal |
20287 } // namespace v8 | 20287 } // namespace v8 |
OLD | NEW |