Chromium Code Reviews| Index: src/objects.cc |
| =================================================================== |
| --- src/objects.cc (revision 11528) |
| +++ src/objects.cc (working copy) |
| @@ -8621,8 +8621,10 @@ |
| ElementsKind to_kind = (elements_kind == FAST_SMI_ONLY_ELEMENTS) |
| ? FAST_SMI_ONLY_ELEMENTS |
| : FAST_ELEMENTS; |
| - // int copy_size = Min(old_elements_raw->length(), new_elements->length()); |
| - accessor->CopyElements(this, new_elements, to_kind); |
| + { MaybeObject* maybe_failure = |
| + accessor->CopyElements(this, new_elements, to_kind); |
| + if (maybe_failure->IsFailure()) return maybe_failure; |
| + } |
|
danno
2012/05/09 12:14:44
nit: wacky formatting. why not just omit the {} an
|
| if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) { |
| set_map_and_elements(new_map, new_elements); |
| } else { |
| @@ -8666,7 +8668,10 @@ |
| FixedArrayBase* old_elements = elements(); |
| ElementsKind elements_kind = GetElementsKind(); |
| ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); |
| - accessor->CopyElements(this, elems, FAST_DOUBLE_ELEMENTS); |
| + { MaybeObject* maybe_failure = |
| + accessor->CopyElements(this, elems, FAST_DOUBLE_ELEMENTS); |
| + if (maybe_failure->IsFailure()) return maybe_failure; |
| + } |
|
danno
2012/05/09 12:14:44
nit: wacky formatting. why not just omit the {} an
fschneider
2012/05/09 12:49:50
Fixed indentation.
I still like to keep the {} to
|
| if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) { |
| set_map_and_elements(new_map, elems); |
| } else { |