| 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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 if (request.type != 'request') { | 1189 if (request.type != 'request') { |
| 1190 throw new Error("Illegal type '" + request.type + "' in request"); | 1190 throw new Error("Illegal type '" + request.type + "' in request"); |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 if (!request.command) { | 1193 if (!request.command) { |
| 1194 throw new Error('Command not specified'); | 1194 throw new Error('Command not specified'); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 // TODO(yurys): remove request.arguments.compactFormat check once |
| 1198 // ChromeDevTools are switched to 'inlineRefs' |
| 1199 if (request.arguments && (request.arguments.inlineRefs || |
| 1200 request.arguments.compactFormat)) { |
| 1201 response.setOption('inlineRefs', true); |
| 1202 } |
| 1203 |
| 1197 if (request.command == 'continue') { | 1204 if (request.command == 'continue') { |
| 1198 this.continueRequest_(request, response); | 1205 this.continueRequest_(request, response); |
| 1199 } else if (request.command == 'break') { | 1206 } else if (request.command == 'break') { |
| 1200 this.breakRequest_(request, response); | 1207 this.breakRequest_(request, response); |
| 1201 } else if (request.command == 'setbreakpoint') { | 1208 } else if (request.command == 'setbreakpoint') { |
| 1202 this.setBreakPointRequest_(request, response); | 1209 this.setBreakPointRequest_(request, response); |
| 1203 } else if (request.command == 'changebreakpoint') { | 1210 } else if (request.command == 'changebreakpoint') { |
| 1204 this.changeBreakPointRequest_(request, response); | 1211 this.changeBreakPointRequest_(request, response); |
| 1205 } else if (request.command == 'clearbreakpoint') { | 1212 } else if (request.command == 'clearbreakpoint') { |
| 1206 this.clearBreakPointRequest_(request, response); | 1213 this.clearBreakPointRequest_(request, response); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 to_index = request.arguments.toFrame; | 1504 to_index = request.arguments.toFrame; |
| 1498 } | 1505 } |
| 1499 if (request.arguments.bottom) { | 1506 if (request.arguments.bottom) { |
| 1500 var tmp_index = total_frames - from_index; | 1507 var tmp_index = total_frames - from_index; |
| 1501 from_index = total_frames - to_index | 1508 from_index = total_frames - to_index |
| 1502 to_index = tmp_index; | 1509 to_index = tmp_index; |
| 1503 } | 1510 } |
| 1504 if (from_index < 0 || to_index < 0) { | 1511 if (from_index < 0 || to_index < 0) { |
| 1505 return response.failed('Invalid frame number'); | 1512 return response.failed('Invalid frame number'); |
| 1506 } | 1513 } |
| 1507 if (request.arguments.compactFormat) { | |
| 1508 response.setOption('compactFormat', true); | |
| 1509 } | |
| 1510 } | 1514 } |
| 1511 | 1515 |
| 1512 // Adjust the index. | 1516 // Adjust the index. |
| 1513 to_index = Math.min(total_frames, to_index); | 1517 to_index = Math.min(total_frames, to_index); |
| 1514 | 1518 |
| 1515 if (to_index <= from_index) { | 1519 if (to_index <= from_index) { |
| 1516 var error = 'Invalid frame range'; | 1520 var error = 'Invalid frame range'; |
| 1517 return response.failed(error); | 1521 return response.failed(error); |
| 1518 } | 1522 } |
| 1519 | 1523 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1689 if (IS_UNDEFINED(handles)) { | 1693 if (IS_UNDEFINED(handles)) { |
| 1690 return response.failed('Argument "handles" missing'); | 1694 return response.failed('Argument "handles" missing'); |
| 1691 } | 1695 } |
| 1692 | 1696 |
| 1693 // Set 'includeSource' option for script lookup. | 1697 // Set 'includeSource' option for script lookup. |
| 1694 if (!IS_UNDEFINED(request.arguments.includeSource)) { | 1698 if (!IS_UNDEFINED(request.arguments.includeSource)) { |
| 1695 includeSource = %ToBoolean(request.arguments.includeSource); | 1699 includeSource = %ToBoolean(request.arguments.includeSource); |
| 1696 response.setOption('includeSource', includeSource); | 1700 response.setOption('includeSource', includeSource); |
| 1697 } | 1701 } |
| 1698 | 1702 |
| 1699 if (request.arguments.compactFormat) { | |
| 1700 response.setOption('compactFormat', true); | |
| 1701 } | |
| 1702 | |
| 1703 // Lookup handles. | 1703 // Lookup handles. |
| 1704 var mirrors = {}; | 1704 var mirrors = {}; |
| 1705 for (var i = 0; i < handles.length; i++) { | 1705 for (var i = 0; i < handles.length; i++) { |
| 1706 var handle = handles[i]; | 1706 var handle = handles[i]; |
| 1707 var mirror = LookupMirror(handle); | 1707 var mirror = LookupMirror(handle); |
| 1708 if (!mirror) { | 1708 if (!mirror) { |
| 1709 return response.failed('Object #' + handle + '# not found'); | 1709 return response.failed('Object #' + handle + '# not found'); |
| 1710 } | 1710 } |
| 1711 mirrors[handle] = mirror; | 1711 mirrors[handle] = mirror; |
| 1712 } | 1712 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1977 case 'string': | 1977 case 'string': |
| 1978 case 'number': | 1978 case 'number': |
| 1979 json = value; | 1979 json = value; |
| 1980 break | 1980 break |
| 1981 | 1981 |
| 1982 default: | 1982 default: |
| 1983 json = null; | 1983 json = null; |
| 1984 } | 1984 } |
| 1985 return json; | 1985 return json; |
| 1986 } | 1986 } |
| OLD | NEW |