Lines Matching refs:Script
5 // LiveEdit feature implementation. The script should be executed after
9 // according to changes of script source (if possible).
11 // When new script source is put in, the difference is calculated textually,
16 // version of the script) it remains unchanged, but the code that could
17 // create a new instance of this function goes away. An old version of script
44 // Applies the change to the script.
47 function ApplyPatchMultiChunk(script, diff_array, new_source, preview_only,
50 var old_source = script.source;
52 // Gather compile information about old version of script.
53 var old_compile_info = GatherCompileInfo(old_source, script);
55 // Build tree structures for old and new versions of the script.
63 // Find all SharedFunctionInfo's that were compiled from this script.
64 FindLiveSharedInfos(root_old_node, script);
66 // Gather compile information about new version of script.
69 new_compile_info = GatherCompileInfo(new_source, script);
72 new Failure("Failed to compile new version of script: " + e);
85 // Link recompiled script data with other data.
103 // business and should have link to the actual script updated.
175 var break_points_restorer = TemporaryRemoveBreakPoints(script, change_log);
179 // Create an old script only if there are function that should be linked
182 %LiveEditReplaceScript(script, new_source, null);
185 var old_script_name = CreateNameForOldScript(script);
187 // Update the script text and create a new script representing an old
188 // version of the script.
189 old_script = %LiveEditReplaceScript(script, new_source,
195 // We need to link to old script all former nested functions.
204 // Link to an actual script all the functions that we are going to use.
207 link_to_original_script_list[i].info.shared_function_info, script);
237 // Fully compiles source string as a script. Returns Array of
238 // FunctionCompileInfo -- a descriptions of all functions of the script.
243 // All functions get compiled linked to script provided as parameter script.
244 // TODO(LiveEdit): consider not using actual scripts as script, because
246 function GatherCompileInfo(source, script) {
249 var raw_compile_info = %LiveEditGatherCompileInfo(script, source);
256 // Remove all links to the actual script. Breakpoints system and
258 // particular script is a regular function.
325 // linked to a script and breakpoints subsystem does not really
354 // Makes a function associated with another instance of a script (the
399 // the script.
402 // of script.
519 // in script may have been shifted.
550 // Sometimes only function body is changed (functions in old and new script
560 // an actual tree of functions in script.
593 // positions from old to new in a current non-changed part of script.
687 // function in new script. Typically it should succeed (non-damaged functions
690 // in new script may become enclosed into other function; the innocent change
749 "No corresponding function in new script found";
759 "No corresponding function in new script found";
766 "No corresponding function in new script found";
796 "Script became damaged");
799 function FindLiveSharedInfos(old_code_tree, script) {
800 var shared_raw_list = %LiveEditFindSharedFunctionInfosForScript(script);
809 // in old version of the script.
878 // Adds a suffix to script name to mark that it is old version.
879 function CreateNameForOldScript(script) {
881 return script.name + " (old)";
993 function createPositionStruct(script, position) {
995 var location = script.locationFromPosition(position, true);
1008 var script = e.scriptObject;
1011 start: createPositionStruct(script, e.startPosition),
1012 end: createPositionStruct(script, e.endPosition)
1022 // LiveEdit main entry point: changes a script text to a new string.
1023 function SetScriptSource(script, new_source, preview_only, change_log) {
1024 var old_source = script.source;
1026 return ApplyPatchMultiChunk(script, diff, new_source, preview_only,
1034 // Applies the change to the script.
1039 // @param {Script} script that is being changed
1042 function ApplySingleChunkPatch(script, change_pos, change_len, new_str,
1044 var old_source = script.source;
1050 return ApplyPatchMultiChunk(script,