OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "test/unittests/compiler-dispatcher/compiler-dispatcher-helper.h" |
| 6 |
| 7 #include <memory> |
| 8 |
| 9 #include "include/v8.h" |
| 10 #include "src/api.h" |
| 11 |
| 12 namespace v8 { |
| 13 namespace internal { |
| 14 |
| 15 Handle<Object> RunJS(v8::Isolate* isolate, const char* script) { |
| 16 return Utils::OpenHandle( |
| 17 *v8::Script::Compile( |
| 18 isolate->GetCurrentContext(), |
| 19 v8::String::NewFromUtf8(isolate, script, v8::NewStringType::kNormal) |
| 20 .ToLocalChecked()) |
| 21 .ToLocalChecked() |
| 22 ->Run(isolate->GetCurrentContext()) |
| 23 .ToLocalChecked()); |
| 24 } |
| 25 |
| 26 } // namespace internal |
| 27 } // namespace v8 |
OLD | NEW |