Index: src/accessors.cc |
=================================================================== |
--- src/accessors.cc (revision 3266) |
+++ src/accessors.cc (working copy) |
@@ -315,7 +315,14 @@ |
HandleScope scope; |
Handle<Script> script(Script::cast(JSValue::cast(object)->value())); |
InitScriptLineEnds(script); |
- return script->line_ends(); |
+ if (script->line_ends_js_array()->IsUndefined()) { |
+ Handle<FixedArray> line_ends_fixed_array( |
+ FixedArray::cast(script->line_ends_fixed_array())); |
+ Handle<FixedArray> copy = Factory::CopyFixedArray(line_ends_fixed_array); |
+ Handle<JSArray> js_array = Factory::NewJSArrayWithElements(copy); |
+ script->set_line_ends_js_array(*js_array); |
+ } |
+ return script->line_ends_js_array(); |
} |