Index: src/debug/liveedit.js |
diff --git a/src/debug/liveedit.js b/src/debug/liveedit.js |
index e9ee8092a269900dab3a505f8e793579dcbbca6b..42f2fb7573c804aa1ddd328dfecfb96b71c8c45e 100644 |
--- a/src/debug/liveedit.js |
+++ b/src/debug/liveedit.js |
@@ -30,6 +30,7 @@ |
var GetScriptBreakPoints; |
var GlobalArray = global.Array; |
var MathFloor = global.Math.floor; |
+ var MathMax = global.Math.max; |
var SyntaxError = global.SyntaxError; |
utils.Import(function(from) { |
@@ -80,6 +81,10 @@ |
} |
throw failure; |
} |
+ |
+ var max_function_literal_id = |
+ MathMax.apply(null, new_compile_info.map(i => i.function_literal_id)); |
Toon Verwaest
2016/12/06 21:10:14
What about just +new_compile_info.reduce((a,b)=>a>
jochen (gone - plz use gerrit)
2016/12/07 15:57:00
why does this make the stack grow like crazy?
Toon Verwaest
2016/12/08 07:31:30
.apply with a possibly huge array? Don't they all
jochen (gone - plz use gerrit)
2016/12/08 12:31:14
k
|
+ |
var root_new_node = BuildCodeInfoTree(new_compile_info); |
// Link recompiled script data with other data. |
@@ -186,8 +191,7 @@ |
// Update the script text and create a new script representing an old |
// version of the script. |
- old_script = %LiveEditReplaceScript(script, new_source, |
- old_script_name); |
+ old_script = %LiveEditReplaceScript(script, new_source, old_script_name); |
var link_to_old_script_report = new GlobalArray(); |
change_log.push( { linked_to_old_script: link_to_old_script_report } ); |
@@ -201,12 +205,6 @@ |
preview_description.created_script_name = old_script_name; |
} |
- // Link to an actual script all the functions that we are going to use. |
- for (var i = 0; i < link_to_original_script_list.length; i++) { |
- %LiveEditFunctionSetScript( |
- link_to_original_script_list[i].info.shared_function_info, script); |
- } |
- |
for (var i = 0; i < replace_code_list.length; i++) { |
PatchFunctionCode(replace_code_list[i], change_log); |
} |
@@ -221,13 +219,25 @@ |
position_patch_report); |
if (update_positions_list[i].live_shared_function_infos) { |
- update_positions_list[i].live_shared_function_infos. |
- forEach(function (info) { |
- %LiveEditFunctionSourceUpdated(info.raw_array); |
- }); |
+ var new_function_literal_id = |
+ update_positions_list[i] |
+ .corresponding_node.info.function_literal_id; |
+ update_positions_list[i].live_shared_function_infos.forEach(function( |
+ info) { |
+ %LiveEditFunctionSourceUpdated( |
+ info.raw_array, new_function_literal_id); |
+ }); |
} |
} |
+ %LiveEditFixupScript(script, max_function_literal_id); |
+ |
+ // Link to an actual script all the functions that we are going to use. |
Toon Verwaest
2016/12/06 21:10:14
Link all the function we're going to use to an act
jochen (gone - plz use gerrit)
2016/12/07 15:57:00
done
|
+ for (var i = 0; i < link_to_original_script_list.length; i++) { |
+ %LiveEditFunctionSetScript( |
+ link_to_original_script_list[i].info.shared_function_info, script); |
+ } |
+ |
break_points_restorer(pos_translator, old_script); |
preview_description.updated = true; |
@@ -845,6 +855,7 @@ |
this.scope_info = raw_array[4]; |
this.outer_index = raw_array[5]; |
this.shared_function_info = raw_array[6]; |
+ this.function_literal_id = raw_array[8]; |
this.next_sibling_index = null; |
this.raw_array = raw_array; |
} |