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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 } | 1436 } |
1437 return; | 1437 return; |
1438 } | 1438 } |
1439 | 1439 |
1440 // Default frame range to include in backtrace. | 1440 // Default frame range to include in backtrace. |
1441 var from_index = 0 | 1441 var from_index = 0 |
1442 var to_index = kDefaultBacktraceLength; | 1442 var to_index = kDefaultBacktraceLength; |
1443 | 1443 |
1444 // Get the range from the arguments. | 1444 // Get the range from the arguments. |
1445 if (request.arguments) { | 1445 if (request.arguments) { |
1446 from_index = request.arguments.fromFrame; | 1446 if (request.arguments.fromFrame) { |
1447 if (from_index < 0) { | 1447 from_index = request.arguments.fromFrame; |
1448 return response.failed('Invalid frame number'); | |
1449 } | 1448 } |
1450 to_index = request.arguments.toFrame; | 1449 if (request.arguments.toFrame) { |
1451 if (to_index < 0) { | 1450 to_index = request.arguments.toFrame; |
| 1451 } |
| 1452 if (request.arguments.bottom) { |
| 1453 var tmp_index = total_frames - from_index; |
| 1454 from_index = total_frames - to_index |
| 1455 to_index = tmp_index; |
| 1456 } |
| 1457 if (from_index < 0 || to_index < 0) { |
1452 return response.failed('Invalid frame number'); | 1458 return response.failed('Invalid frame number'); |
1453 } | 1459 } |
1454 } | 1460 } |
1455 | 1461 |
1456 // Adjust the index. | 1462 // Adjust the index. |
1457 to_index = Math.min(total_frames, to_index); | 1463 to_index = Math.min(total_frames, to_index); |
1458 | 1464 |
1459 if (to_index <= from_index) { | 1465 if (to_index <= from_index) { |
1460 var error = 'Invalid frame range'; | 1466 var error = 'Invalid frame range'; |
1461 return response.failed(error); | 1467 return response.failed(error); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 json += NumberToJSON_(elem); | 1876 json += NumberToJSON_(elem); |
1871 } else if (IS_STRING(elem)) { | 1877 } else if (IS_STRING(elem)) { |
1872 json += StringToJSON_(elem); | 1878 json += StringToJSON_(elem); |
1873 } else { | 1879 } else { |
1874 json += elem; | 1880 json += elem; |
1875 } | 1881 } |
1876 } | 1882 } |
1877 json += ']'; | 1883 json += ']'; |
1878 return json; | 1884 return json; |
1879 } | 1885 } |
OLD | NEW |