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

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

Issue 15038002: Revert "deprecate Context::New which returns Persistent" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « test/cctest/test-decls.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-hashing.cc
diff --git a/test/cctest/test-hashing.cc b/test/cctest/test-hashing.cc
index 154761313935d7fce15d4decdcb64e3dbdef01a7..6cf63d9fbbb95eb7d0cd81be057e8df14e6ecdde 100644
--- a/test/cctest/test-hashing.cc
+++ b/test/cctest/test-hashing.cc
@@ -47,6 +47,8 @@ using namespace v8::internal;
typedef uint32_t (*HASH_FUNCTION)();
+static v8::Persistent<v8::Context> env;
+
#define __ masm->
@@ -233,10 +235,7 @@ static uint32_t PseudoRandom(uint32_t i, uint32_t j) {
TEST(StringHash) {
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope handle_scope(isolate);
- v8::Context::Scope context_scope(v8::Context::New(isolate));
-
+ if (env.IsEmpty()) env = v8::Context::New();
for (uint8_t a = 0; a < String::kMaxOneByteCharCode; a++) {
// Numbers are hashed differently.
if (a >= '0' && a <= '9') continue;
@@ -254,9 +253,7 @@ TEST(StringHash) {
TEST(NumberHash) {
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope handle_scope(isolate);
- v8::Context::Scope context_scope(v8::Context::New(isolate));
+ if (env.IsEmpty()) env = v8::Context::New();
// Some specific numbers
for (uint32_t key = 0; key < 42; key += 7) {
« no previous file with comments | « test/cctest/test-decls.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698