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

Unified Diff: test/cctest/cctest.h

Issue 1459783005: Do not use deprecated API in cctest/test-debug. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/test-debug.cc » ('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 4cfb8b0d7075d94f1d64f3cc44bb6e84c027895d..6243ac5327d0e2a6ccb98ac7d99d93d10bec7b82 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -341,6 +341,13 @@ static inline v8::Local<v8::String> v8_str(const char* x) {
}
+static inline v8::Local<v8::String> v8_str(v8::Isolate* isolate,
+ const char* x) {
+ return v8::String::NewFromUtf8(isolate, x, v8::NewStringType::kNormal)
+ .ToLocalChecked();
+}
+
+
static inline v8::Local<v8::Symbol> v8_symbol(const char* name) {
return v8::Symbol::New(v8::Isolate::GetCurrent(), v8_str(name));
}
@@ -392,6 +399,18 @@ static inline v8::MaybeLocal<v8::Value> CompileRun(
}
+static inline v8::Local<v8::Value> CompileRunChecked(v8::Isolate* isolate,
+ const char* source) {
+ v8::Local<v8::String> source_string =
+ v8::String::NewFromUtf8(isolate, source, v8::NewStringType::kNormal)
+ .ToLocalChecked();
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();
+ v8::Local<v8::Script> script =
+ v8::Script::Compile(context, source_string).ToLocalChecked();
+ return script->Run(context).ToLocalChecked();
+}
+
+
static inline v8::Local<v8::Value> CompileRun(v8::Local<v8::String> source) {
v8::Local<v8::Value> result;
if (v8_compile(source)
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698