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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 HandleScope scope(isolate); | 486 HandleScope scope(isolate); |
487 v8::Handle<v8::Object> object = v8::Object::New(); | 487 v8::Handle<v8::Object> object = v8::Object::New(); |
488 object->Set(i, v8::Integer::New(i, v8_isolate)); | 488 object->Set(i, v8::Integer::New(i, v8_isolate)); |
489 indices[i] = eternals->Create(isolate, *v8::Utils::OpenHandle(*object)); | 489 indices[i] = eternals->Create(isolate, *v8::Utils::OpenHandle(*object)); |
490 } | 490 } |
491 | 491 |
492 isolate->heap()->CollectAllAvailableGarbage(); | 492 isolate->heap()->CollectAllAvailableGarbage(); |
493 | 493 |
494 for (int i = 0; i < kArrayLength; i++) { | 494 for (int i = 0; i < kArrayLength; i++) { |
495 HandleScope scope(isolate); | 495 HandleScope scope(isolate); |
496 v8::Handle<v8::Value> local = v8::Utils::ToLocal(eternals->Get(i)); | 496 v8::Handle<v8::Value> local = |
| 497 v8::Utils::ToLocal(eternals->Get(indices[i])); |
497 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(local); | 498 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(local); |
498 v8::Handle<v8::Value> value = object->Get(i); | 499 v8::Handle<v8::Value> value = object->Get(i); |
499 CHECK(value->IsInt32()); | 500 CHECK(value->IsInt32()); |
500 CHECK_EQ(i, value->Int32Value()); | 501 CHECK_EQ(i, value->Int32Value()); |
501 } | 502 } |
502 | 503 |
503 CHECK_EQ(kArrayLength, eternals->NumberOfHandles()); | 504 CHECK_EQ(kArrayLength, eternals->NumberOfHandles()); |
504 } | 505 } |
505 | 506 |
OLD | NEW |