OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 | 675 |
676 /** | 676 /** |
677 * @param {*} value | 677 * @param {*} value |
678 * @param {string} objectGroup | 678 * @param {string} objectGroup |
679 * @param {!DebuggerAgent.ExceptionDetails=} exceptionDetails | 679 * @param {!DebuggerAgent.ExceptionDetails=} exceptionDetails |
680 * @return {!Object} | 680 * @return {!Object} |
681 */ | 681 */ |
682 _createThrownValue: function(value, objectGroup, exceptionDetails) | 682 _createThrownValue: function(value, objectGroup, exceptionDetails) |
683 { | 683 { |
684 var remoteObject = this._wrapObject(value, objectGroup); | 684 var remoteObject = this._wrapObject(value, objectGroup); |
685 try { | 685 if (!remoteObject.description){ |
686 remoteObject.description = toStringDescription(value); | 686 try { |
687 } catch (e) {} | 687 remoteObject.description = toStringDescription(value); |
688 } catch (e) {} | |
689 } | |
688 return { wasThrown: true, result: remoteObject, exceptionDetails: except ionDetails, __proto__: null }; | 690 return { wasThrown: true, result: remoteObject, exceptionDetails: except ionDetails, __proto__: null }; |
689 }, | 691 }, |
690 | 692 |
691 /** | 693 /** |
692 * @param {!Function} evalFunction | 694 * @param {!Function} evalFunction |
693 * @param {!Object} object | 695 * @param {!Object} object |
694 * @param {string} objectGroup | 696 * @param {string} objectGroup |
695 * @param {string} expression | 697 * @param {string} expression |
696 * @param {boolean} isEvalOnCallFrame | 698 * @param {boolean} isEvalOnCallFrame |
697 * @param {boolean} injectCommandLineAPI | 699 * @param {boolean} injectCommandLineAPI |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1035 return toString(obj); | 1037 return toString(obj); |
1036 | 1038 |
1037 if (isSymbol(obj)) { | 1039 if (isSymbol(obj)) { |
1038 try { | 1040 try { |
1039 return Symbol.prototype.toString.call(obj) || "Symbol"; | 1041 return Symbol.prototype.toString.call(obj) || "Symbol"; |
1040 } catch (e) { | 1042 } catch (e) { |
1041 return "Symbol"; | 1043 return "Symbol"; |
1042 } | 1044 } |
1043 } | 1045 } |
1044 | 1046 |
1047 if (obj instanceof Error && !!obj.message) | |
aandrey
2014/07/18 16:10:30
obj.message can throw
| |
1048 return className + ": " + obj.message; | |
1049 | |
1045 return className; | 1050 return className; |
1046 } | 1051 } |
1047 } | 1052 } |
1048 | 1053 |
1049 /** | 1054 /** |
1050 * @type {!InjectedScript} | 1055 * @type {!InjectedScript} |
1051 * @const | 1056 * @const |
1052 */ | 1057 */ |
1053 var injectedScript = new InjectedScript(); | 1058 var injectedScript = new InjectedScript(); |
1054 | 1059 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1693 */ | 1698 */ |
1694 _logEvent: function(event) | 1699 _logEvent: function(event) |
1695 { | 1700 { |
1696 inspectedWindow.console.log(event.type, event); | 1701 inspectedWindow.console.log(event.type, event); |
1697 } | 1702 } |
1698 } | 1703 } |
1699 | 1704 |
1700 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1705 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
1701 return injectedScript; | 1706 return injectedScript; |
1702 }) | 1707 }) |
OLD | NEW |