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 #include "test/inspector/inspector-impl.h" | 7 #include "test/inspector/inspector-impl.h" |
8 | 8 |
9 #if !defined(_WIN32) && !defined(_WIN64) | 9 #if !defined(_WIN32) && !defined(_WIN64) |
10 #include <unistd.h> // NOLINT | 10 #include <unistd.h> // NOLINT |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 .ToLocalChecked(); | 216 .ToLocalChecked(); |
217 } | 217 } |
218 | 218 |
219 v8::ScriptCompiler::Source scriptSource(source, origin); | 219 v8::ScriptCompiler::Source scriptSource(source, origin); |
220 if (!is_module_) { | 220 if (!is_module_) { |
221 v8::Local<v8::Script> script; | 221 v8::Local<v8::Script> script; |
222 if (!v8::ScriptCompiler::Compile(local_context, &scriptSource) | 222 if (!v8::ScriptCompiler::Compile(local_context, &scriptSource) |
223 .ToLocal(&script)) | 223 .ToLocal(&script)) |
224 return; | 224 return; |
225 v8::MaybeLocal<v8::Value> result; | 225 v8::MaybeLocal<v8::Value> result; |
| 226 if (inspector_) |
| 227 inspector_->willExecuteScript(local_context, |
| 228 script->GetUnboundScript()->GetId()); |
226 result = script->Run(local_context); | 229 result = script->Run(local_context); |
| 230 if (inspector_) inspector_->didExecuteScript(local_context); |
227 } else { | 231 } else { |
228 v8::Local<v8::Module> module; | 232 v8::Local<v8::Module> module; |
229 if (!v8::ScriptCompiler::CompileModule(isolate, &scriptSource) | 233 if (!v8::ScriptCompiler::CompileModule(isolate, &scriptSource) |
230 .ToLocal(&module)) { | 234 .ToLocal(&module)) { |
231 return; | 235 return; |
232 } | 236 } |
233 if (!module->Instantiate(local_context, &TaskRunner::ModuleResolveCallback)) | 237 if (!module->Instantiate(local_context, &TaskRunner::ModuleResolveCallback)) |
234 return; | 238 return; |
235 v8::Local<v8::Value> result; | 239 v8::Local<v8::Value> result; |
236 if (!module->Evaluate(local_context).ToLocal(&result)) return; | 240 if (!module->Evaluate(local_context).ToLocal(&result)) return; |
237 TaskRunner* runner = TaskRunner::FromContext(local_context); | 241 TaskRunner* runner = TaskRunner::FromContext(local_context); |
238 runner->RegisterModule(name_, module); | 242 runner->RegisterModule(name_, module); |
239 } | 243 } |
240 } | 244 } |
OLD | NEW |