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

Unified Diff: test/cctest/test-ordered-hash-table.cc

Issue 238973011: Revert "ES6: Add support for Map/Set forEach" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/x64/full-codegen-x64.cc ('k') | test/mjsunit/harmony/collections.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-ordered-hash-table.cc
diff --git a/test/cctest/test-ordered-hash-table.cc b/test/cctest/test-ordered-hash-table.cc
index fc3515fc4aeb187840ac4ab5c0a6e588ffbf9319..f6ebc16f1ef3467c4ea08751277aecb403153482 100644
--- a/test/cctest/test-ordered-hash-table.cc
+++ b/test/cctest/test-ordered-hash-table.cc
@@ -36,23 +36,7 @@ namespace {
using namespace v8::internal;
-
-void CheckIterResultObject(Isolate* isolate,
- Handle<JSObject> result,
- Handle<Object> value,
- bool done) {
- CHECK(Object::GetProperty(isolate, result, "value").ToHandleChecked()
- ->SameValue(*value));
- CHECK(Object::GetProperty(isolate, result, "done").ToHandleChecked()
- ->IsBoolean());
- CHECK_EQ(Object::GetProperty(isolate, result, "done").ToHandleChecked()
- ->BooleanValue(), done);
-}
-
-
TEST(Set) {
- i::FLAG_harmony_collections = true;
-
LocalContext context;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
@@ -62,11 +46,6 @@ TEST(Set) {
CHECK_EQ(0, ordered_set->NumberOfElements());
CHECK_EQ(0, ordered_set->NumberOfDeletedElements());
- Handle<JSSetIterator> value_iterator =
- JSSetIterator::Create(ordered_set, JSSetIterator::kKindValues);
- Handle<JSSetIterator> value_iterator_2 =
- JSSetIterator::Create(ordered_set, JSSetIterator::kKindValues);
-
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> obj = factory->NewJSObjectFromMap(map);
CHECK(!ordered_set->Contains(*obj));
@@ -89,18 +68,6 @@ TEST(Set) {
CHECK(ordered_set->Contains(*obj2));
CHECK(ordered_set->Contains(*obj3));
- // Test iteration
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator), obj1, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator), obj2, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator), obj3, false);
- CheckIterResultObject(isolate,
- JSSetIterator::Next(value_iterator),
- factory->undefined_value(),
- true);
-
// Test growth
ordered_set = OrderedHashSet::Add(ordered_set, obj);
Handle<JSObject> obj4 = factory->NewJSObjectFromMap(map);
@@ -114,22 +81,6 @@ TEST(Set) {
CHECK_EQ(0, ordered_set->NumberOfDeletedElements());
CHECK_EQ(4, ordered_set->NumberOfBuckets());
- // Test iteration after growth
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj1, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj2, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj3, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj4, false);
- CheckIterResultObject(isolate,
- JSSetIterator::Next(value_iterator_2),
- factory->undefined_value(),
- true);
-
// Test shrinking
ordered_set = OrderedHashSet::Remove(ordered_set, obj);
ordered_set = OrderedHashSet::Remove(ordered_set, obj1);
@@ -141,8 +92,6 @@ TEST(Set) {
TEST(Map) {
- i::FLAG_harmony_collections = true;
-
LocalContext context;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
@@ -152,11 +101,6 @@ TEST(Map) {
CHECK_EQ(0, ordered_map->NumberOfElements());
CHECK_EQ(0, ordered_map->NumberOfDeletedElements());
- Handle<JSMapIterator> value_iterator =
- JSMapIterator::Create(ordered_map, JSMapIterator::kKindValues);
- Handle<JSMapIterator> key_iterator =
- JSMapIterator::Create(ordered_map, JSMapIterator::kKindKeys);
-
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> obj = factory->NewJSObjectFromMap(map);
Handle<JSObject> val = factory->NewJSObjectFromMap(map);
@@ -184,18 +128,6 @@ TEST(Map) {
CHECK(ordered_map->Lookup(*obj2)->SameValue(*val2));
CHECK(ordered_map->Lookup(*obj3)->SameValue(*val3));
- // Test iteration
- CheckIterResultObject(
- isolate, JSMapIterator::Next(value_iterator), val1, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(value_iterator), val2, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(value_iterator), val3, false);
- CheckIterResultObject(isolate,
- JSMapIterator::Next(value_iterator),
- factory->undefined_value(),
- true);
-
// Test growth
ordered_map = OrderedHashMap::Put(ordered_map, obj, val);
Handle<JSObject> obj4 = factory->NewJSObjectFromMap(map);
@@ -209,22 +141,6 @@ TEST(Map) {
CHECK_EQ(5, ordered_map->NumberOfElements());
CHECK_EQ(4, ordered_map->NumberOfBuckets());
- // Test iteration after growth
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj1, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj2, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj3, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj4, false);
- CheckIterResultObject(isolate,
- JSMapIterator::Next(key_iterator),
- factory->undefined_value(),
- true);
-
// Test shrinking
ordered_map = OrderedHashMap::Put(
ordered_map, obj, factory->the_hole_value());
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | test/mjsunit/harmony/collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698