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

Unified Diff: test/cctest/cctest.h

Issue 83343002: Remove usage of deprecated APIs from cctests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « no previous file | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index 428245dcf47a7c861f2bf099eab95e0f5bc6c3cf..4db0d83cb82047324be13ca8861d628e232676be 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -255,7 +255,7 @@ class LocalContext {
virtual ~LocalContext() {
v8::HandleScope scope(isolate_);
v8::Local<v8::Context>::New(isolate_, context_)->Exit();
- context_.Dispose();
+ context_.Reset();
}
v8::Context* operator->() {
@@ -294,7 +294,7 @@ static inline v8::Local<v8::Value> v8_num(double x) {
static inline v8::Local<v8::String> v8_str(const char* x) {
- return v8::String::New(x);
+ return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), x);
}
@@ -305,7 +305,8 @@ static inline v8::Local<v8::Script> v8_compile(const char* x) {
// Helper function that compiles and runs the source.
static inline v8::Local<v8::Value> CompileRun(const char* source) {
- return v8::Script::Compile(v8::String::New(source))->Run();
+ return v8::Script::Compile(
+ v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), source))->Run();
}
@@ -314,10 +315,12 @@ static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source,
const char* origin_url,
int line_number,
int column_number) {
- v8::ScriptOrigin origin(v8::String::New(origin_url),
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::ScriptOrigin origin(v8::String::NewFromUtf8(isolate, origin_url),
v8::Integer::New(line_number),
v8::Integer::New(column_number));
- return v8::Script::Compile(v8::String::New(source), &origin)->Run();
+ return v8::Script::Compile(v8::String::NewFromUtf8(isolate, source), &origin)
+ ->Run();
}
« no previous file with comments | « no previous file | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698