Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: test/cctest/cctest.h

Issue 14894006: Make v8 compilable without V8_USE_UNSAFE_HANDLES. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: . Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index 30cbe799f902b37460efbe9e35758d585a3977ee..5a376c778864fd454466199a4c805fe61dfc4059 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -83,19 +83,21 @@ class CcTest {
const char* name() { return name_; }
const char* dependency() { return dependency_; }
bool enabled() { return enabled_; }
- static void set_default_isolate(v8::Isolate* default_isolate) {
- default_isolate_ = default_isolate;
- }
static v8::Isolate* default_isolate() { return default_isolate_; }
- static v8::Isolate* isolate() { return context()->GetIsolate(); }
- static v8::Handle<v8::Context> env() { return context(); }
+
+ static v8::Handle<v8::Context> env() {
+ return v8::Local<v8::Context>::New(default_isolate_, context_);
+ }
+
+ static v8::Isolate* isolate() { return default_isolate_; }
// Helper function to initialize the VM.
static void InitializeVM(CcTestExtensionFlags extensions = NO_EXTENSIONS);
private:
- static v8::Handle<v8::Context> context() {
- return *reinterpret_cast<v8::Handle<v8::Context>*>(&context_);
+ friend int main(int argc, char** argv);
+ static void set_default_isolate(v8::Isolate* default_isolate) {
+ default_isolate_ = default_isolate;
}
TestFunction* callback_;
const char* file_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698