Commit 6980f195 authored by yangguo's avatar yangguo Committed by Commit bot

Do not use deprecated API in cctest/test-debug.

R=jochen@chromium.org

Review URL: https://codereview.chromium.org/1459783005

Cr-Commit-Position: refs/heads/master@{#32115}
parent 9ebd096f
......@@ -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)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment