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 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2899 // the property did not exist yet on the global object itself, we have to | 2899 // the property did not exist yet on the global object itself, we have to |
2900 // throw a reference error in strict mode. | 2900 // throw a reference error in strict mode. |
2901 if (it->GetReceiver()->IsJSGlobalObject() && strict_mode == STRICT) { | 2901 if (it->GetReceiver()->IsJSGlobalObject() && strict_mode == STRICT) { |
2902 Handle<Object> args[1] = {it->name()}; | 2902 Handle<Object> args[1] = {it->name()}; |
2903 THROW_NEW_ERROR(it->isolate(), | 2903 THROW_NEW_ERROR(it->isolate(), |
2904 NewReferenceError("not_defined", HandleVector(args, 1)), | 2904 NewReferenceError("not_defined", HandleVector(args, 1)), |
2905 Object); | 2905 Object); |
2906 } | 2906 } |
2907 | 2907 |
2908 if (data_store_mode == SUPER_PROPERTY) { | 2908 if (data_store_mode == SUPER_PROPERTY) { |
2909 if (strict_mode == STRICT) { | 2909 LookupIterator own_lookup(it->GetReceiver(), it->name(), |
2910 Handle<Object> args[1] = {it->name()}; | 2910 LookupIterator::OWN); |
2911 THROW_NEW_ERROR(it->isolate(), | 2911 |
2912 NewReferenceError("not_defined", HandleVector(args, 1)), | 2912 return JSObject::SetProperty(&own_lookup, value, strict_mode, store_mode, |
Toon Verwaest
2015/02/16 09:33:11
This is not correct as far as I can tell. Your imp
| |
2913 Object); | 2913 NORMAL_PROPERTY); |
2914 } | |
2915 return value; | |
2916 } | 2914 } |
2917 | 2915 |
2918 return AddDataProperty(it, value, NONE, strict_mode, store_mode); | 2916 return AddDataProperty(it, value, NONE, strict_mode, store_mode); |
2919 } | 2917 } |
2920 | 2918 |
2921 | 2919 |
2922 MaybeHandle<Object> Object::WriteToReadOnlyProperty(LookupIterator* it, | 2920 MaybeHandle<Object> Object::WriteToReadOnlyProperty(LookupIterator* it, |
2923 Handle<Object> value, | 2921 Handle<Object> value, |
2924 StrictMode strict_mode) { | 2922 StrictMode strict_mode) { |
2925 if (strict_mode != STRICT) return value; | 2923 if (strict_mode != STRICT) return value; |
(...skipping 13447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16373 Handle<DependentCode> codes = | 16371 Handle<DependentCode> codes = |
16374 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16372 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16375 DependentCode::kPropertyCellChangedGroup, | 16373 DependentCode::kPropertyCellChangedGroup, |
16376 info->object_wrapper()); | 16374 info->object_wrapper()); |
16377 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16375 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16378 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16376 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16379 cell, info->zone()); | 16377 cell, info->zone()); |
16380 } | 16378 } |
16381 | 16379 |
16382 } } // namespace v8::internal | 16380 } } // namespace v8::internal |
OLD | NEW |