Index: src/factory.cc |
=================================================================== |
--- src/factory.cc (revision 1464) |
+++ src/factory.cc (working copy) |
@@ -153,9 +153,12 @@ |
Handle<Script> Factory::NewScript(Handle<String> source) { |
+ static uint32_t next_id = 1; |
+ |
Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE)); |
script->set_source(*source); |
script->set_name(Heap::undefined_value()); |
+ script->set_id(*Factory::NewNumberFromUint(next_id++)); |
script->set_line_offset(Smi::FromInt(0)); |
script->set_column_offset(Smi::FromInt(0)); |
script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL)); |
@@ -277,6 +280,11 @@ |
} |
+Handle<Object> Factory::NewNumberFromUint(uint32_t value) { |
+ CALL_HEAP_FUNCTION(Heap::NumberFromUint32(value), Object); |
+} |
+ |
+ |
Handle<JSObject> Factory::NewNeanderObject() { |
CALL_HEAP_FUNCTION(Heap::AllocateJSObjectFromMap(Heap::neander_map()), |
JSObject); |