Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
old mode 100644 |
new mode 100755 |
index a51a9b117e7a1969acb146e047175eaf1ac4740e..f65e4662035684c84acab61691cec88ef4f543bd |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2574,7 +2574,13 @@ Genesis::Genesis(Isolate* isolate, |
StackLimitCheck check(isolate); |
if (check.HasOverflowed()) return; |
- native_context_ = Snapshot::NewContextFromSnapshot(); |
+ // We can only de-serialize a context if the isolate was initialized from |
+ // a snapshot. Otherwise we have to build the context from scratch. |
+ if (isolate->initialized_from_snapshot()) |
danno
2013/06/25 18:40:35
V8 style nit: then/else blocks wrapped in {}
Sigurður Ásgeirsson
2013/06/27 13:06:40
Done.
|
+ native_context_ = Snapshot::NewContextFromSnapshot(); |
+ else |
+ native_context_ = Handle<Context>(); |
+ |
if (!native_context().is_null()) { |
AddToWeakNativeContextList(*native_context()); |
isolate->set_context(*native_context()); |