OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 Handle<SeededNumberDictionary> dictionary = | 1402 Handle<SeededNumberDictionary> dictionary = |
1403 Handle<SeededNumberDictionary>::cast(backing_store); | 1403 Handle<SeededNumberDictionary>::cast(backing_store); |
1404 int entry = dictionary->FindEntry(key); | 1404 int entry = dictionary->FindEntry(key); |
1405 if (entry != SeededNumberDictionary::kNotFound) { | 1405 if (entry != SeededNumberDictionary::kNotFound) { |
1406 Handle<Object> result = | 1406 Handle<Object> result = |
1407 SeededNumberDictionary::DeleteProperty(dictionary, entry); | 1407 SeededNumberDictionary::DeleteProperty(dictionary, entry); |
1408 if (*result == *isolate->factory()->false_value()) { | 1408 if (*result == *isolate->factory()->false_value()) { |
1409 if (is_strict(language_mode)) { | 1409 if (is_strict(language_mode)) { |
1410 // Deleting a non-configurable property in strict mode. | 1410 // Deleting a non-configurable property in strict mode. |
1411 Handle<Object> name = isolate->factory()->NewNumberFromUint(key); | 1411 Handle<Object> name = isolate->factory()->NewNumberFromUint(key); |
1412 Handle<Object> args[2] = { name, obj }; | 1412 THROW_NEW_ERROR( |
1413 THROW_NEW_ERROR(isolate, NewTypeError("strict_delete_property", | 1413 isolate, |
1414 HandleVector(args, 2)), | 1414 NewTypeError(MessageTemplate::kStrictDeleteProperty, name, obj), |
1415 Object); | 1415 Object); |
1416 } | 1416 } |
1417 return isolate->factory()->false_value(); | 1417 return isolate->factory()->false_value(); |
1418 } | 1418 } |
1419 Handle<FixedArray> new_elements = | 1419 Handle<FixedArray> new_elements = |
1420 SeededNumberDictionary::Shrink(dictionary, key); | 1420 SeededNumberDictionary::Shrink(dictionary, key); |
1421 | 1421 |
1422 if (is_arguments) { | 1422 if (is_arguments) { |
1423 FixedArray::cast(obj->elements())->set(1, *new_elements); | 1423 FixedArray::cast(obj->elements())->set(1, *new_elements); |
1424 } else { | 1424 } else { |
1425 obj->set_elements(*new_elements); | 1425 obj->set_elements(*new_elements); |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 UNREACHABLE(); | 1851 UNREACHABLE(); |
1852 break; | 1852 break; |
1853 } | 1853 } |
1854 | 1854 |
1855 array->set_elements(*elms); | 1855 array->set_elements(*elms); |
1856 array->set_length(Smi::FromInt(number_of_elements)); | 1856 array->set_length(Smi::FromInt(number_of_elements)); |
1857 return array; | 1857 return array; |
1858 } | 1858 } |
1859 | 1859 |
1860 } } // namespace v8::internal | 1860 } } // namespace v8::internal |
OLD | NEW |