Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: test/cctest/test-heap.cc

Issue 1191313003: More cleanup related to setting array.length (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index c9d47757bf7cd820d208f07c699408255701dd97..e0c2818c8ddda0da50a250795c298c18e0f5bdec 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -785,7 +785,7 @@ TEST(JSArray) {
JSArray::Initialize(array, 0);
// Set array length to 0.
- JSArray::SetElementsLength(array, handle(Smi::FromInt(0), isolate)).Check();
+ JSArray::SetLength(array, 0);
CHECK_EQ(Smi::FromInt(0), array->length());
// Must be in fast mode.
CHECK(array->HasFastSmiOrObjectElements());
@@ -797,13 +797,11 @@ TEST(JSArray) {
CHECK_EQ(*element, *name);
// Set array length with larger than smi value.
- Handle<Object> length =
- factory->NewNumberFromUint(static_cast<uint32_t>(Smi::kMaxValue) + 1);
- JSArray::SetElementsLength(array, length).Check();
+ JSArray::SetLength(array, static_cast<uint32_t>(Smi::kMaxValue) + 1);
uint32_t int_length = 0;
- CHECK(length->ToArrayIndex(&int_length));
- CHECK_EQ(*length, array->length());
+ CHECK(array->length()->ToArrayIndex(&int_length));
+ CHECK_EQ(static_cast<uint32_t>(Smi::kMaxValue) + 1, int_length);
CHECK(array->HasDictionaryElements()); // Must be in slow mode.
// array[length] = name.
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698