OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "test/inspector/task-runner.h" | 5 #include "test/inspector/task-runner.h" |
6 | 6 |
7 #if !defined(_WIN32) && !defined(_WIN64) | 7 #if !defined(_WIN32) && !defined(_WIN64) |
8 #include <unistd.h> // NOLINT | 8 #include <unistd.h> // NOLINT |
9 #endif // !defined(_WIN32) && !defined(_WIN64) | 9 #endif // !defined(_WIN32) && !defined(_WIN64) |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 v8::MicrotasksScope microtasks_scope(isolate, | 125 v8::MicrotasksScope microtasks_scope(isolate, |
126 v8::MicrotasksScope::kRunMicrotasks); | 126 v8::MicrotasksScope::kRunMicrotasks); |
127 v8::HandleScope handle_scope(isolate); | 127 v8::HandleScope handle_scope(isolate); |
128 v8::Local<v8::Context> local_context = context.Get(isolate); | 128 v8::Local<v8::Context> local_context = context.Get(isolate); |
129 v8::Context::Scope context_scope(local_context); | 129 v8::Context::Scope context_scope(local_context); |
130 | 130 |
131 v8::ScriptOrigin origin(v8::String::Empty(isolate)); | 131 v8::ScriptOrigin origin(v8::String::Empty(isolate)); |
132 v8::Local<v8::String> source = | 132 v8::Local<v8::String> source = |
133 v8::String::NewFromTwoByte(isolate, expression_.characters16(), | 133 v8::String::NewFromTwoByte(isolate, expression_.characters16(), |
134 v8::NewStringType::kNormal, | 134 v8::NewStringType::kNormal, |
135 expression_.length()) | 135 static_cast<int>(expression_.length())) |
136 .ToLocalChecked(); | 136 .ToLocalChecked(); |
137 | 137 |
138 v8::ScriptCompiler::Source scriptSource(source, origin); | 138 v8::ScriptCompiler::Source scriptSource(source, origin); |
139 v8::Local<v8::Script> script; | 139 v8::Local<v8::Script> script; |
140 if (!v8::ScriptCompiler::Compile(local_context, &scriptSource) | 140 if (!v8::ScriptCompiler::Compile(local_context, &scriptSource) |
141 .ToLocal(&script)) | 141 .ToLocal(&script)) |
142 return; | 142 return; |
143 v8::MaybeLocal<v8::Value> result; | 143 v8::MaybeLocal<v8::Value> result; |
144 result = script->Run(local_context); | 144 result = script->Run(local_context); |
145 } | 145 } |
OLD | NEW |