Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 43be499b3d88ff78ce7c5d16791a7dcac0ee5c03..5c27b69135f34618d8b9727cc3ea0cf9ed343944 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -8181,6 +8181,12 @@ Isolate* Isolate::GetCurrent() { |
Isolate* Isolate::New(const Isolate::CreateParams& params) { |
i::Isolate* isolate = new i::Isolate(false); |
+ return IsolateNewImpl(isolate, params); |
+} |
+ |
+// This is separate so that tests can provide a different |isolate|. |
+Isolate* IsolateNewImpl(internal::Isolate* isolate, |
+ const v8::Isolate::CreateParams& params) { |
Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
CHECK(params.array_buffer_allocator != NULL); |
isolate->set_array_buffer_allocator(params.array_buffer_allocator); |