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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // break points set in this script. | 356 // break points set in this script. |
357 function UpdateScriptBreakPoints(script) { | 357 function UpdateScriptBreakPoints(script) { |
358 for (var i = 0; i < script_break_points.length; i++) { | 358 for (var i = 0; i < script_break_points.length; i++) { |
359 if (script_break_points[i].script_name() == script.name) { | 359 if (script_break_points[i].script_name() == script.name) { |
360 script_break_points[i].set(script); | 360 script_break_points[i].set(script); |
361 } | 361 } |
362 } | 362 } |
363 } | 363 } |
364 | 364 |
365 | 365 |
366 Debug.addListener = function(listener, opt_data) { | 366 Debug.setListener = function(listener, opt_data) { |
367 if (!IS_FUNCTION(listener)) throw new Error('Parameters have wrong types.'); | 367 if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) { |
368 %AddDebugEventListener(listener, opt_data); | 368 throw new Error('Parameters have wrong types.'); |
| 369 } |
| 370 %SetDebugEventListener(listener, opt_data); |
369 }; | 371 }; |
370 | 372 |
371 Debug.removeListener = function(listener) { | |
372 if (!IS_FUNCTION(listener)) throw new Error('Parameters have wrong types.'); | |
373 %RemoveDebugEventListener(listener); | |
374 }; | |
375 | 373 |
376 Debug.breakExecution = function(f) { | 374 Debug.breakExecution = function(f) { |
377 %Break(); | 375 %Break(); |
378 }; | 376 }; |
379 | 377 |
380 Debug.breakLocations = function(f) { | 378 Debug.breakLocations = function(f) { |
381 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); | 379 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); |
382 return %GetBreakLocations(f); | 380 return %GetBreakLocations(f); |
383 }; | 381 }; |
384 | 382 |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 json += NumberToJSON_(elem); | 1678 json += NumberToJSON_(elem); |
1681 } else if (IS_STRING(elem)) { | 1679 } else if (IS_STRING(elem)) { |
1682 json += StringToJSON_(elem); | 1680 json += StringToJSON_(elem); |
1683 } else { | 1681 } else { |
1684 json += elem; | 1682 json += elem; |
1685 } | 1683 } |
1686 } | 1684 } |
1687 json += ']'; | 1685 json += ']'; |
1688 return json; | 1686 return json; |
1689 } | 1687 } |
OLD | NEW |