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 12474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12485 object->SetElement(index, *value, NONE, strict_mode, false), | 12485 object->SetElement(index, *value, NONE, strict_mode, false), |
12486 Object); | 12486 Object); |
12487 } | 12487 } |
12488 | 12488 |
12489 | 12489 |
12490 Handle<Object> JSObject::SetElement(Handle<JSObject> object, | 12490 Handle<Object> JSObject::SetElement(Handle<JSObject> object, |
12491 uint32_t index, | 12491 uint32_t index, |
12492 Handle<Object> value, | 12492 Handle<Object> value, |
12493 PropertyAttributes attr, | 12493 PropertyAttributes attr, |
12494 StrictModeFlag strict_mode, | 12494 StrictModeFlag strict_mode, |
| 12495 bool check_prototype, |
12495 SetPropertyMode set_mode) { | 12496 SetPropertyMode set_mode) { |
12496 if (object->HasExternalArrayElements()) { | 12497 if (object->HasExternalArrayElements()) { |
12497 if (!value->IsNumber() && !value->IsUndefined()) { | 12498 if (!value->IsNumber() && !value->IsUndefined()) { |
12498 bool has_exception; | 12499 bool has_exception; |
12499 Handle<Object> number = | 12500 Handle<Object> number = |
12500 Execution::ToNumber(object->GetIsolate(), value, &has_exception); | 12501 Execution::ToNumber(object->GetIsolate(), value, &has_exception); |
12501 if (has_exception) return Handle<Object>(); | 12502 if (has_exception) return Handle<Object>(); |
12502 value = number; | 12503 value = number; |
12503 } | 12504 } |
12504 } | 12505 } |
12505 CALL_HEAP_FUNCTION( | 12506 CALL_HEAP_FUNCTION( |
12506 object->GetIsolate(), | 12507 object->GetIsolate(), |
12507 object->SetElement(index, *value, attr, strict_mode, true, set_mode), | 12508 object->SetElement(index, *value, attr, strict_mode, check_prototype, |
| 12509 set_mode), |
12508 Object); | 12510 Object); |
12509 } | 12511 } |
12510 | 12512 |
12511 | 12513 |
12512 MaybeObject* JSObject::SetElement(uint32_t index, | 12514 MaybeObject* JSObject::SetElement(uint32_t index, |
12513 Object* value_raw, | 12515 Object* value_raw, |
12514 PropertyAttributes attributes, | 12516 PropertyAttributes attributes, |
12515 StrictModeFlag strict_mode, | 12517 StrictModeFlag strict_mode, |
12516 bool check_prototype, | 12518 bool check_prototype, |
12517 SetPropertyMode set_mode) { | 12519 SetPropertyMode set_mode) { |
(...skipping 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16478 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16480 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16479 static const char* error_messages_[] = { | 16481 static const char* error_messages_[] = { |
16480 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16482 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16481 }; | 16483 }; |
16482 #undef ERROR_MESSAGES_TEXTS | 16484 #undef ERROR_MESSAGES_TEXTS |
16483 return error_messages_[reason]; | 16485 return error_messages_[reason]; |
16484 } | 16486 } |
16485 | 16487 |
16486 | 16488 |
16487 } } // namespace v8::internal | 16489 } } // namespace v8::internal |
OLD | NEW |