| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 Debug.disassemble = function(f) { | 467 Debug.disassemble = function(f) { |
| 468 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); | 468 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); |
| 469 return %DebugDisassembleFunction(f); | 469 return %DebugDisassembleFunction(f); |
| 470 }; | 470 }; |
| 471 | 471 |
| 472 Debug.disassembleConstructor = function(f) { | 472 Debug.disassembleConstructor = function(f) { |
| 473 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); | 473 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); |
| 474 return %DebugDisassembleConstructor(f); | 474 return %DebugDisassembleConstructor(f); |
| 475 }; | 475 }; |
| 476 | 476 |
| 477 Debug.ExecuteInDebugContext = function(f, without_debugger) { |
| 478 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); |
| 479 return %ExecuteInDebugContext(f, !!without_debugger); |
| 480 }; |
| 481 |
| 477 Debug.sourcePosition = function(f) { | 482 Debug.sourcePosition = function(f) { |
| 478 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); | 483 if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.'); |
| 479 return %FunctionGetScriptSourcePosition(f); | 484 return %FunctionGetScriptSourcePosition(f); |
| 480 }; | 485 }; |
| 481 | 486 |
| 482 | 487 |
| 483 Debug.findFunctionSourceLocation = function(func, opt_line, opt_column) { | 488 Debug.findFunctionSourceLocation = function(func, opt_line, opt_column) { |
| 484 var script = %FunctionGetScript(func); | 489 var script = %FunctionGetScript(func); |
| 485 var script_offset = %FunctionGetScriptSourcePosition(func); | 490 var script_offset = %FunctionGetScriptSourcePosition(func); |
| 486 return script.locationFromLine(opt_line, opt_column, script_offset); | 491 return script.locationFromLine(opt_line, opt_column, script_offset); |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 new_string, change_log); | 2008 new_string, change_log); |
| 2004 } | 2009 } |
| 2005 } | 2010 } |
| 2006 | 2011 |
| 2007 try { | 2012 try { |
| 2008 invocation(); | 2013 invocation(); |
| 2009 } catch (e) { | 2014 } catch (e) { |
| 2010 if (e instanceof Debug.LiveEditChangeScript.Failure) { | 2015 if (e instanceof Debug.LiveEditChangeScript.Failure) { |
| 2011 // Let's treat it as a "success" so that body with change_log will be | 2016 // Let's treat it as a "success" so that body with change_log will be |
| 2012 // sent back. "change_log" will have "failure" field set. | 2017 // sent back. "change_log" will have "failure" field set. |
| 2013 change_log.push( { failure: true } ); | 2018 change_log.push( { failure: true, message: e.toString() } ); |
| 2014 } else { | 2019 } else { |
| 2015 throw e; | 2020 throw e; |
| 2016 } | 2021 } |
| 2017 } | 2022 } |
| 2018 response.body = {change_log: change_log}; | 2023 response.body = {change_log: change_log}; |
| 2019 }; | 2024 }; |
| 2020 | 2025 |
| 2021 | 2026 |
| 2022 // Check whether the previously processed command caused the VM to become | 2027 // Check whether the previously processed command caused the VM to become |
| 2023 // running. | 2028 // running. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 case 'string': | 2143 case 'string': |
| 2139 case 'number': | 2144 case 'number': |
| 2140 json = value; | 2145 json = value; |
| 2141 break | 2146 break |
| 2142 | 2147 |
| 2143 default: | 2148 default: |
| 2144 json = null; | 2149 json = null; |
| 2145 } | 2150 } |
| 2146 return json; | 2151 return json; |
| 2147 } | 2152 } |
| OLD | NEW |