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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 return new ResponsePacket(request); | 1005 return new ResponsePacket(request); |
1006 }; | 1006 }; |
1007 | 1007 |
1008 | 1008 |
1009 DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request,
stopping) { | 1009 DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request,
stopping) { |
1010 var request; // Current request. | 1010 var request; // Current request. |
1011 var response; // Generated response. | 1011 var response; // Generated response. |
1012 try { | 1012 try { |
1013 try { | 1013 try { |
1014 // Convert the JSON string to an object. | 1014 // Convert the JSON string to an object. |
1015 request = %CompileString('(' + json_request + ')', 0, false)(); | 1015 request = %CompileString('(' + json_request + ')', 0)(); |
1016 | 1016 |
1017 // Create an initial response. | 1017 // Create an initial response. |
1018 response = this.createResponse(request); | 1018 response = this.createResponse(request); |
1019 | 1019 |
1020 if (!request.type) { | 1020 if (!request.type) { |
1021 throw new Error('Type not specified'); | 1021 throw new Error('Type not specified'); |
1022 } | 1022 } |
1023 | 1023 |
1024 if (request.type != 'request') { | 1024 if (request.type != 'request') { |
1025 throw new Error("Illegal type '" + request.type + "' in request"); | 1025 throw new Error("Illegal type '" + request.type + "' in request"); |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 response.body.push(script); | 1458 response.body.push(script); |
1459 } | 1459 } |
1460 } | 1460 } |
1461 }; | 1461 }; |
1462 | 1462 |
1463 | 1463 |
1464 // Check whether the JSON response indicate that the VM should be running. | 1464 // Check whether the JSON response indicate that the VM should be running. |
1465 DebugCommandProcessor.prototype.isRunning = function(json_response) { | 1465 DebugCommandProcessor.prototype.isRunning = function(json_response) { |
1466 try { | 1466 try { |
1467 // Convert the JSON string to an object. | 1467 // Convert the JSON string to an object. |
1468 response = %CompileString('(' + json_response + ')', 0, false)(); | 1468 response = %CompileString('(' + json_response + ')', 0)(); |
1469 | 1469 |
1470 // Return whether VM should be running after this request. | 1470 // Return whether VM should be running after this request. |
1471 return response.running; | 1471 return response.running; |
1472 | 1472 |
1473 } catch (e) { | 1473 } catch (e) { |
1474 return false; | 1474 return false; |
1475 } | 1475 } |
1476 } | 1476 } |
1477 | 1477 |
1478 | 1478 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 json += NumberToJSON_(elem); | 1597 json += NumberToJSON_(elem); |
1598 } else if (IS_STRING(elem)) { | 1598 } else if (IS_STRING(elem)) { |
1599 json += StringToJSON_(elem); | 1599 json += StringToJSON_(elem); |
1600 } else { | 1600 } else { |
1601 json += elem; | 1601 json += elem; |
1602 } | 1602 } |
1603 } | 1603 } |
1604 json += ']'; | 1604 json += ']'; |
1605 return json; | 1605 return json; |
1606 } | 1606 } |
OLD | NEW |