OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 using namespace v8::internal; | 37 using namespace v8::internal; |
38 | 38 |
39 | 39 |
40 void CheckIterResultObject(Isolate* isolate, | 40 void CheckIterResultObject(Isolate* isolate, |
41 Handle<JSObject> result, | 41 Handle<JSObject> result, |
42 Handle<Object> value, | 42 Handle<Object> value, |
43 bool done) { | 43 bool done) { |
44 CHECK(Object::GetProperty(isolate, result, "value").ToHandleChecked() | 44 Handle<Object> value_object = |
45 ->SameValue(*value)); | 45 Object::GetProperty(isolate, result, "value").ToHandleChecked(); |
46 CHECK(Object::GetProperty(isolate, result, "done").ToHandleChecked() | 46 Handle<Object> done_object = |
47 ->IsBoolean()); | 47 Object::GetProperty(isolate, result, "done").ToHandleChecked(); |
48 CHECK_EQ(Object::GetProperty(isolate, result, "done").ToHandleChecked() | 48 |
49 ->BooleanValue(), done); | 49 CHECK_EQ(*value_object, *value); |
| 50 CHECK(done_object->IsBoolean()); |
| 51 CHECK_EQ(done_object->BooleanValue(), done); |
50 } | 52 } |
51 | 53 |
52 | 54 |
53 TEST(Set) { | 55 TEST(Set) { |
54 i::FLAG_harmony_collections = true; | 56 i::FLAG_harmony_collections = true; |
55 | 57 |
56 LocalContext context; | 58 LocalContext context; |
57 Isolate* isolate = CcTest::i_isolate(); | 59 Isolate* isolate = CcTest::i_isolate(); |
58 Factory* factory = isolate->factory(); | 60 Factory* factory = isolate->factory(); |
59 HandleScope scope(isolate); | 61 HandleScope scope(isolate); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 ordered_map = OrderedHashMap::Put( | 235 ordered_map = OrderedHashMap::Put( |
234 ordered_map, obj2, factory->the_hole_value()); | 236 ordered_map, obj2, factory->the_hole_value()); |
235 ordered_map = OrderedHashMap::Put( | 237 ordered_map = OrderedHashMap::Put( |
236 ordered_map, obj3, factory->the_hole_value()); | 238 ordered_map, obj3, factory->the_hole_value()); |
237 CHECK_EQ(1, ordered_map->NumberOfElements()); | 239 CHECK_EQ(1, ordered_map->NumberOfElements()); |
238 CHECK_EQ(2, ordered_map->NumberOfBuckets()); | 240 CHECK_EQ(2, ordered_map->NumberOfBuckets()); |
239 } | 241 } |
240 | 242 |
241 | 243 |
242 } | 244 } |
OLD | NEW |