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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3070 // TODO(verwaest): Throw a TypeError with a more specific message. | 3070 // TODO(verwaest): Throw a TypeError with a more specific message. |
3071 return WriteToReadOnlyProperty(it, value, strict_mode); | 3071 return WriteToReadOnlyProperty(it, value, strict_mode); |
3072 } | 3072 } |
3073 | 3073 |
3074 Handle<JSObject> receiver = it->GetStoreTarget(); | 3074 Handle<JSObject> receiver = it->GetStoreTarget(); |
3075 | 3075 |
3076 // If the receiver is a JSGlobalProxy, store on the prototype (JSGlobalObject) | 3076 // If the receiver is a JSGlobalProxy, store on the prototype (JSGlobalObject) |
3077 // instead. If the prototype is Null, the proxy is detached. | 3077 // instead. If the prototype is Null, the proxy is detached. |
3078 if (receiver->IsJSGlobalProxy()) return value; | 3078 if (receiver->IsJSGlobalProxy()) return value; |
3079 | 3079 |
| 3080 // If the receiver is Indexed Exotic object (currently only typed arrays), |
| 3081 // disallow adding properties with numeric names. |
| 3082 if (it->IsSpecialNumericIndex()) return value; |
| 3083 |
3080 // Possibly migrate to the most up-to-date map that will be able to store | 3084 // Possibly migrate to the most up-to-date map that will be able to store |
3081 // |value| under it->name() with |attributes|. | 3085 // |value| under it->name() with |attributes|. |
3082 it->PrepareTransitionToDataProperty(value, attributes, store_mode); | 3086 it->PrepareTransitionToDataProperty(value, attributes, store_mode); |
3083 if (it->state() != LookupIterator::TRANSITION) { | 3087 if (it->state() != LookupIterator::TRANSITION) { |
3084 if (strict_mode == SLOPPY) return value; | 3088 if (strict_mode == SLOPPY) return value; |
3085 | 3089 |
3086 Handle<Object> args[1] = {it->name()}; | 3090 Handle<Object> args[1] = {it->name()}; |
3087 THROW_NEW_ERROR(it->isolate(), | 3091 THROW_NEW_ERROR(it->isolate(), |
3088 NewTypeError("object_not_extensible", | 3092 NewTypeError("object_not_extensible", |
3089 HandleVector(args, arraysize(args))), | 3093 HandleVector(args, arraysize(args))), |
(...skipping 13421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16511 Handle<DependentCode> codes = | 16515 Handle<DependentCode> codes = |
16512 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16516 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16513 DependentCode::kPropertyCellChangedGroup, | 16517 DependentCode::kPropertyCellChangedGroup, |
16514 info->object_wrapper()); | 16518 info->object_wrapper()); |
16515 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16519 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16516 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16520 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16517 cell, info->zone()); | 16521 cell, info->zone()); |
16518 } | 16522 } |
16519 | 16523 |
16520 } } // namespace v8::internal | 16524 } } // namespace v8::internal |
OLD | NEW |