Index: src/snapshot/code-serializer.cc |
diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc |
index 86a91643d246d5595b2cdd97497b0f8425d55c62..511f1117521b257fe4ec02c378d13d1e62c478ec 100644 |
--- a/src/snapshot/code-serializer.cc |
+++ b/src/snapshot/code-serializer.cc |
@@ -104,6 +104,12 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
return SerializeObject(isolate()->heap()->undefined_value(), how_to_code, |
where_to_point, skip); |
} |
+ |
+ if (obj->IsScript()) { |
+ // Wrapper object is a context-dependent JSValue. Reset it here. |
+ Script::cast(obj)->set_wrapper(isolate()->heap()->undefined_value()); |
+ } |
+ |
// Past this point we should not see any (context-specific) maps anymore. |
CHECK(!obj->IsMap()); |
// There should be no references to the global object embedded. |