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