| 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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 }; | 1359 }; |
| 1360 | 1360 |
| 1361 | 1361 |
| 1362 DebugCommandProcessor.prototype.frameRequest_ = function(request, response) { | 1362 DebugCommandProcessor.prototype.frameRequest_ = function(request, response) { |
| 1363 // No frames no source. | 1363 // No frames no source. |
| 1364 if (this.exec_state_.frameCount() == 0) { | 1364 if (this.exec_state_.frameCount() == 0) { |
| 1365 return response.failed('No frames'); | 1365 return response.failed('No frames'); |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 // With no arguments just keep the selected frame. | 1368 // With no arguments just keep the selected frame. |
| 1369 if (request.arguments && request.arguments.number >= 0) { | 1369 if (request.arguments) { |
| 1370 index = request.arguments.number; |
| 1371 if (index < 0 || this.exec_state_.frameCount() <= index) { |
| 1372 return response.failed('Invalid frame number'); |
| 1373 } |
| 1374 |
| 1370 this.exec_state_.setSelectedFrame(request.arguments.number); | 1375 this.exec_state_.setSelectedFrame(request.arguments.number); |
| 1371 } | 1376 } |
| 1372 response.body = this.exec_state_.frame(); | 1377 response.body = this.exec_state_.frame(); |
| 1373 }; | 1378 }; |
| 1374 | 1379 |
| 1375 | 1380 |
| 1376 DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { | 1381 DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { |
| 1377 if (!request.arguments) { | 1382 if (!request.arguments) { |
| 1378 return response.failed('Missing arguments'); | 1383 return response.failed('Missing arguments'); |
| 1379 } | 1384 } |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 json += NumberToJSON_(elem); | 1653 json += NumberToJSON_(elem); |
| 1649 } else if (IS_STRING(elem)) { | 1654 } else if (IS_STRING(elem)) { |
| 1650 json += StringToJSON_(elem); | 1655 json += StringToJSON_(elem); |
| 1651 } else { | 1656 } else { |
| 1652 json += elem; | 1657 json += elem; |
| 1653 } | 1658 } |
| 1654 } | 1659 } |
| 1655 json += ']'; | 1660 json += ']'; |
| 1656 return json; | 1661 return json; |
| 1657 } | 1662 } |
| OLD | NEW |