OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 15692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15703 if (IsKey(k)) { | 15703 if (IsKey(k)) { |
15704 Object* value = ValueAt(i); | 15704 Object* value = ValueAt(i); |
15705 Name* key; | 15705 Name* key; |
15706 if (k->IsSymbol()) { | 15706 if (k->IsSymbol()) { |
15707 key = Symbol::cast(k); | 15707 key = Symbol::cast(k); |
15708 } else { | 15708 } else { |
15709 // Ensure the key is a unique name before writing into the | 15709 // Ensure the key is a unique name before writing into the |
15710 // instance descriptor. | 15710 // instance descriptor. |
15711 MaybeObject* maybe_key = heap->InternalizeString(String::cast(k)); | 15711 MaybeObject* maybe_key = heap->InternalizeString(String::cast(k)); |
15712 if (!maybe_key->To(&key)) return maybe_key; | 15712 if (!maybe_key->To(&key)) return maybe_key; |
| 15713 if (key->Equals(heap->empty_string())) return this; |
15713 } | 15714 } |
15714 | 15715 |
15715 PropertyDetails details = DetailsAt(i); | 15716 PropertyDetails details = DetailsAt(i); |
15716 int enumeration_index = details.dictionary_index(); | 15717 int enumeration_index = details.dictionary_index(); |
15717 PropertyType type = details.type(); | 15718 PropertyType type = details.type(); |
15718 | 15719 |
15719 if (value->IsJSFunction()) { | 15720 if (value->IsJSFunction()) { |
15720 ConstantDescriptor d(key, value, details.attributes()); | 15721 ConstantDescriptor d(key, value, details.attributes()); |
15721 descriptors->Set(enumeration_index - 1, &d, witness); | 15722 descriptors->Set(enumeration_index - 1, &d, witness); |
15722 } else if (type == NORMAL) { | 15723 } else if (type == NORMAL) { |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16482 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16483 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16483 static const char* error_messages_[] = { | 16484 static const char* error_messages_[] = { |
16484 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16485 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16485 }; | 16486 }; |
16486 #undef ERROR_MESSAGES_TEXTS | 16487 #undef ERROR_MESSAGES_TEXTS |
16487 return error_messages_[reason]; | 16488 return error_messages_[reason]; |
16488 } | 16489 } |
16489 | 16490 |
16490 | 16491 |
16491 } } // namespace v8::internal | 16492 } } // namespace v8::internal |
OLD | NEW |