diff options
Diffstat (limited to 'deps/v8/test/unittests/test-utils.cc')
-rw-r--r-- | deps/v8/test/unittests/test-utils.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/deps/v8/test/unittests/test-utils.cc b/deps/v8/test/unittests/test-utils.cc index d19c3372395..2b099e0ea5a 100644 --- a/deps/v8/test/unittests/test-utils.cc +++ b/deps/v8/test/unittests/test-utils.cc @@ -6,7 +6,7 @@ #include "include/libplatform/libplatform.h" #include "include/v8.h" -#include "src/api.h" +#include "src/api-inl.h" #include "src/base/platform/time.h" #include "src/flags.h" #include "src/isolate.h" @@ -67,17 +67,19 @@ Local<Value> TestWithIsolate::RunJS(const char* source) { TestWithContext::TestWithContext() : context_(Context::New(isolate())), context_scope_(context_) {} - TestWithContext::~TestWithContext() {} +v8::Local<v8::String> TestWithContext::NewString(const char* string) { + return v8::String::NewFromUtf8(v8_isolate(), string, + v8::NewStringType::kNormal) + .ToLocalChecked(); +} + void TestWithContext::SetGlobalProperty(const char* name, v8::Local<v8::Value> value) { - v8::Local<v8::String> property_name = - v8::String::NewFromUtf8(v8_isolate(), name, v8::NewStringType::kNormal) - .ToLocalChecked(); CHECK(v8_context() ->Global() - ->Set(v8_context(), property_name, value) + ->Set(v8_context(), NewString(name), value) .FromJust()); } @@ -89,6 +91,10 @@ TestWithIsolateAndZone::~TestWithIsolateAndZone() {} Factory* TestWithIsolate::factory() const { return isolate()->factory(); } +Handle<Object> TestWithIsolate::RunJSInternal(const char* source) { + return Utils::OpenHandle(*::v8::TestWithIsolate::RunJS(source)); +} + base::RandomNumberGenerator* TestWithIsolate::random_number_generator() const { return isolate()->random_number_generator(); } |