Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 5d67854462dbaa5d3a6967a5696014509f9e8cf1..91f4ecc7ae57ce75b9b2f5193c9b66a01508c15d 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -3303,6 +3303,11 @@ void Heap::CreateInitialObjects() { |
// Handling of script id generation is in Factory::NewScript. |
set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); |
+ // Allocate the empty script. |
+ Handle<Script> script = factory->NewScript(factory->empty_string()); |
+ script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
+ set_empty_script(*script); |
+ |
Handle<PropertyCell> cell = factory->NewPropertyCell(); |
cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); |
set_array_protector(*cell); |