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

Side by Side Diff: test/cctest/test-global-handles.cc

Issue 22169002: fix 16045 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698