OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 return details; | 1136 return details; |
1137 }; | 1137 }; |
1138 | 1138 |
1139 | 1139 |
1140 /** | 1140 /** |
1141 * Protocol packages send from the debugger. | 1141 * Protocol packages send from the debugger. |
1142 * @param {string} json - raw protocol packet as JSON string. | 1142 * @param {string} json - raw protocol packet as JSON string. |
1143 * @constructor | 1143 * @constructor |
1144 */ | 1144 */ |
1145 function ProtocolPackage(json) { | 1145 function ProtocolPackage(json) { |
1146 this.packet_ = eval('(' + json + ')'); | 1146 this.packet_ = JSON.parse(json); |
1147 this.refs_ = []; | 1147 this.refs_ = []; |
1148 if (this.packet_.refs) { | 1148 if (this.packet_.refs) { |
1149 for (var i = 0; i < this.packet_.refs.length; i++) { | 1149 for (var i = 0; i < this.packet_.refs.length; i++) { |
1150 this.refs_[this.packet_.refs[i].handle] = this.packet_.refs[i]; | 1150 this.refs_[this.packet_.refs[i].handle] = this.packet_.refs[i]; |
1151 } | 1151 } |
1152 } | 1152 } |
1153 } | 1153 } |
1154 | 1154 |
1155 | 1155 |
1156 /** | 1156 /** |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 json += NumberToJSON_(elem); | 1611 json += NumberToJSON_(elem); |
1612 } else if (typeof(elem) === 'string') { | 1612 } else if (typeof(elem) === 'string') { |
1613 json += StringToJSON_(elem); | 1613 json += StringToJSON_(elem); |
1614 } else { | 1614 } else { |
1615 json += elem; | 1615 json += elem; |
1616 } | 1616 } |
1617 } | 1617 } |
1618 json += ']'; | 1618 json += ']'; |
1619 return json; | 1619 return json; |
1620 } | 1620 } |
OLD | NEW |