Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: src/debug-debugger.js

Issue 6903172: Use JSON.parse instead of eval for the debugger JSON protocol. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 return new ProtocolMessage(request); 1328 return new ProtocolMessage(request);
1329 }; 1329 };
1330 1330
1331 1331
1332 DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request) { 1332 DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request) {
1333 var request; // Current request. 1333 var request; // Current request.
1334 var response; // Generated response. 1334 var response; // Generated response.
1335 try { 1335 try {
1336 try { 1336 try {
1337 // Convert the JSON string to an object. 1337 // Convert the JSON string to an object.
1338 request = %CompileString('(' + json_request + ')')(); 1338 request = JSON.parse(json_request);
1339 1339
1340 // Create an initial response. 1340 // Create an initial response.
1341 response = this.createResponse(request); 1341 response = this.createResponse(request);
1342 1342
1343 if (!request.type) { 1343 if (!request.type) {
1344 throw new Error('Type not specified'); 1344 throw new Error('Type not specified');
1345 } 1345 }
1346 1346
1347 if (request.type != 'request') { 1347 if (request.type != 'request') {
1348 throw new Error("Illegal type '" + request.type + "' in request"); 1348 throw new Error("Illegal type '" + request.type + "' in request");
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 case 'string': 2560 case 'string':
2561 case 'number': 2561 case 'number':
2562 json = value; 2562 json = value;
2563 break 2563 break
2564 2564
2565 default: 2565 default:
2566 json = null; 2566 json = null;
2567 } 2567 }
2568 return json; 2568 return json;
2569 } 2569 }
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698