Lines Matching refs:script
28 // LiveEdit feature implementation. The script should be executed after
32 // according to changes of script source (if possible).
34 // When new script source is put in, the difference is calculated textually,
39 // version of the script) it remains unchanged, but the code that could
40 // create a new instance of this function goes away. An old version of script
50 // Applies the change to the script.
53 function ApplyPatchMultiChunk(script, diff_array, new_source, preview_only,
56 var old_source = script.source;
58 // Gather compile information about old version of script.
59 var old_compile_info = GatherCompileInfo(old_source, script);
61 // Build tree structures for old and new versions of the script.
69 // Find all SharedFunctionInfo's that were compiled from this script.
70 FindLiveSharedInfos(root_old_node, script);
72 // Gather compile information about new version of script.
75 new_compile_info = GatherCompileInfo(new_source, script);
77 throw new Failure("Failed to compile new version of script: " + e);
81 // Link recompiled script data with other data.
99 // business and should have link to the actual script updated.
164 var break_points_restorer = TemporaryRemoveBreakPoints(script, change_log);
168 // Create an old script only if there are function that should be linked
171 %LiveEditReplaceScript(script, new_source, null);
174 var old_script_name = CreateNameForOldScript(script);
176 // Update the script text and create a new script representing an old
177 // version of the script.
178 old_script = %LiveEditReplaceScript(script, new_source,
184 // We need to link to old script all former nested functions.
193 // Link to an actual script all the functions that we are going to use.
196 link_to_original_script_list[i].info.shared_function_info, script);
229 // Fully compiles source string as a script. Returns Array of
230 // FunctionCompileInfo -- a descriptions of all functions of the script.
235 // All functions get compiled linked to script provided as parameter script.
236 // TODO(LiveEdit): consider not using actual scripts as script, because
238 function GatherCompileInfo(source, script) {
241 var raw_compile_info = %LiveEditGatherCompileInfo(script, source);
248 // Remove all links to the actual script. Breakpoints system and
250 // particular script is a regular function.
317 // linked to a script and breakpoints subsystem does not really
346 // Makes a function associated with another instance of a script (the
391 // the script.
394 // of script.
511 // in script may have been shifted.
542 // Sometimes only function body is changed (functions in old and new script
552 // an actual tree of functions in script.
585 // positions from old to new in a current non-changed part of script.
679 // function in new script. Typically it should succeed (non-damaged functions
682 // in new script may become enclosed into other function; the innocent change
728 "No corresponding function in new script found";
738 "No corresponding function in new script found";
745 "No corresponding function in new script found";
776 "Script became damaged");
779 function FindLiveSharedInfos(old_code_tree, script) {
780 var shared_raw_list = %LiveEditFindSharedFunctionInfosForScript(script);
789 // in old version of the script.
858 // Adds a suffix to script name to mark that it is old version.
859 function CreateNameForOldScript(script) {
861 return script.name + " (old)";
981 // LiveEdit main entry point: changes a script text to a new string.
982 function SetScriptSource(script, new_source, preview_only, change_log) {
983 var old_source = script.source;
985 return ApplyPatchMultiChunk(script, diff, new_source, preview_only,
995 // Applies the change to the script.
1000 // @param {Script} script that is being changed
1003 function ApplySingleChunkPatch(script, change_pos, change_len, new_str,
1005 var old_source = script.source;
1011 return ApplyPatchMultiChunk(script,