| 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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 } | 1540 } |
| 1541 }; | 1541 }; |
| 1542 | 1542 |
| 1543 | 1543 |
| 1544 DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) { | 1544 DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) { |
| 1545 if (!request.arguments) { | 1545 if (!request.arguments) { |
| 1546 return response.failed('Missing arguments'); | 1546 return response.failed('Missing arguments'); |
| 1547 } | 1547 } |
| 1548 | 1548 |
| 1549 // Pull out arguments. | 1549 // Pull out arguments. |
| 1550 var handle = request.arguments.handle; | 1550 var handles = request.arguments.handles; |
| 1551 | 1551 |
| 1552 // Check for legal arguments. | 1552 // Check for legal arguments. |
| 1553 if (IS_UNDEFINED(handle)) { | 1553 if (IS_UNDEFINED(handles)) { |
| 1554 return response.failed('Argument "handle" missing'); | 1554 return response.failed('Argument "handles" missing'); |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 // Lookup handle. | 1557 // Lookup handles. |
| 1558 var mirror = LookupMirror(handle); | 1558 var mirrors = {}; |
| 1559 if (mirror) { | 1559 for (var i = 0; i < handles.length; i++) { |
| 1560 response.body = mirror; | 1560 var handle = handles[i]; |
| 1561 } else { | 1561 var mirror = LookupMirror(handle); |
| 1562 return response.failed('Object #' + handle + '# not found'); | 1562 if (!mirror) { |
| 1563 return response.failed('Object #' + handle + '# not found'); |
| 1564 } |
| 1565 mirrors[handle] = mirror; |
| 1563 } | 1566 } |
| 1567 response.body = mirrors; |
| 1564 }; | 1568 }; |
| 1565 | 1569 |
| 1566 | 1570 |
| 1567 DebugCommandProcessor.prototype.referencesRequest_ = | 1571 DebugCommandProcessor.prototype.referencesRequest_ = |
| 1568 function(request, response) { | 1572 function(request, response) { |
| 1569 if (!request.arguments) { | 1573 if (!request.arguments) { |
| 1570 return response.failed('Missing arguments'); | 1574 return response.failed('Missing arguments'); |
| 1571 } | 1575 } |
| 1572 | 1576 |
| 1573 // Pull out arguments. | 1577 // Pull out arguments. |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 json += NumberToJSON_(elem); | 1848 json += NumberToJSON_(elem); |
| 1845 } else if (IS_STRING(elem)) { | 1849 } else if (IS_STRING(elem)) { |
| 1846 json += StringToJSON_(elem); | 1850 json += StringToJSON_(elem); |
| 1847 } else { | 1851 } else { |
| 1848 json += elem; | 1852 json += elem; |
| 1849 } | 1853 } |
| 1850 } | 1854 } |
| 1851 json += ']'; | 1855 json += ']'; |
| 1852 return json; | 1856 return json; |
| 1853 } | 1857 } |
| OLD | NEW |