| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 | 2111 |
| 2112 DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
{ | 2112 DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
{ |
| 2113 if (!Debug.LiveEdit) { | 2113 if (!Debug.LiveEdit) { |
| 2114 return response.failed('LiveEdit feature is not supported'); | 2114 return response.failed('LiveEdit feature is not supported'); |
| 2115 } | 2115 } |
| 2116 if (!request.arguments) { | 2116 if (!request.arguments) { |
| 2117 return response.failed('Missing arguments'); | 2117 return response.failed('Missing arguments'); |
| 2118 } | 2118 } |
| 2119 var script_id = request.arguments.script_id; | 2119 var script_id = request.arguments.script_id; |
| 2120 var preview_only = !!request.arguments.preview_only; | 2120 var preview_only = !!request.arguments.preview_only; |
| 2121 | 2121 |
| 2122 var scripts = %DebugGetLoadedScripts(); | 2122 var scripts = %DebugGetLoadedScripts(); |
| 2123 | 2123 |
| 2124 var the_script = null; | 2124 var the_script = null; |
| 2125 for (var i = 0; i < scripts.length; i++) { | 2125 for (var i = 0; i < scripts.length; i++) { |
| 2126 if (scripts[i].id == script_id) { | 2126 if (scripts[i].id == script_id) { |
| 2127 the_script = scripts[i]; | 2127 the_script = scripts[i]; |
| 2128 } | 2128 } |
| 2129 } | 2129 } |
| 2130 if (!the_script) { | 2130 if (!the_script) { |
| 2131 response.failed('Script not found'); | 2131 response.failed('Script not found'); |
| 2132 return; | 2132 return; |
| 2133 } | 2133 } |
| 2134 | 2134 |
| 2135 var change_log = new Array(); | 2135 var change_log = new Array(); |
| 2136 | 2136 |
| 2137 if (!IS_STRING(request.arguments.new_source)) { | 2137 if (!IS_STRING(request.arguments.new_source)) { |
| 2138 throw "new_source argument expected"; | 2138 throw "new_source argument expected"; |
| 2139 } | 2139 } |
| 2140 | 2140 |
| 2141 var new_source = request.arguments.new_source; | 2141 var new_source = request.arguments.new_source; |
| 2142 | 2142 |
| 2143 var result_description = Debug.LiveEdit.SetScriptSource(the_script, | 2143 var result_description = Debug.LiveEdit.SetScriptSource(the_script, |
| 2144 new_source, preview_only, change_log); | 2144 new_source, preview_only, change_log); |
| 2145 response.body = {change_log: change_log, result: result_description}; | 2145 response.body = {change_log: change_log, result: result_description}; |
| 2146 | 2146 |
| 2147 if (!preview_only && !this.running_ && result_description.stack_modified) { | 2147 if (!preview_only && !this.running_ && result_description.stack_modified) { |
| 2148 response.body.stepin_recommended = true; | 2148 response.body.stepin_recommended = true; |
| 2149 } | 2149 } |
| 2150 }; | 2150 }; |
| 2151 | 2151 |
| 2152 | 2152 |
| 2153 DebugCommandProcessor.prototype.debuggerFlagsRequest_ = function(request, | 2153 DebugCommandProcessor.prototype.debuggerFlagsRequest_ = function(request, |
| 2154 response) { | 2154 response) { |
| 2155 // Check for legal request. | 2155 // Check for legal request. |
| 2156 if (!request.arguments) { | 2156 if (!request.arguments) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 case 'string': | 2302 case 'string': |
| 2303 case 'number': | 2303 case 'number': |
| 2304 json = value; | 2304 json = value; |
| 2305 break | 2305 break |
| 2306 | 2306 |
| 2307 default: | 2307 default: |
| 2308 json = null; | 2308 json = null; |
| 2309 } | 2309 } |
| 2310 return json; | 2310 return json; |
| 2311 } | 2311 } |
| OLD | NEW |