Chromium Code Reviews| Index: test/cctest/cctest.h |
| diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h |
| index 30cbe799f902b37460efbe9e35758d585a3977ee..5941383afb37d28c6eb383239a6be45e6c04f7bd 100644 |
| --- a/test/cctest/cctest.h |
| +++ b/test/cctest/cctest.h |
| @@ -87,7 +87,12 @@ class CcTest { |
| default_isolate_ = default_isolate; |
| } |
| static v8::Isolate* default_isolate() { return default_isolate_; } |
| - static v8::Isolate* isolate() { return context()->GetIsolate(); } |
| + static v8::Isolate* isolate() { |
| + v8::HandleScope handle_scope; |
| + return context()->GetIsolate(); |
|
dcarney
2013/05/06 11:40:17
store the isolate instead when the context is set
marja
2013/05/06 12:14:23
Removed this function, used default_isolate() inst
|
| + } |
| + |
| + // You need to have a valid HandleScope before calling this function. |
|
dcarney
2013/05/06 11:40:17
skip the comment
marja
2013/05/06 12:14:23
Done.
|
| static v8::Handle<v8::Context> env() { return context(); } |
| // Helper function to initialize the VM. |
| @@ -95,7 +100,7 @@ class CcTest { |
| private: |
| static v8::Handle<v8::Context> context() { |
| - return *reinterpret_cast<v8::Handle<v8::Context>*>(&context_); |
| + return v8::Local<v8::Context>::New(v8::Isolate::GetCurrent(), context_); |
|
dcarney
2013/05/06 11:40:17
use the context isolate
also, just inline this fun
marja
2013/05/06 12:14:23
Done.
marja
2013/05/06 12:14:23
Done.
|
| } |
| TestFunction* callback_; |
| const char* file_; |