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 15 matching lines...) Expand all Loading... |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 "use strict"; | 30 "use strict"; |
31 | 31 |
32 /** | 32 /** |
33 * @param {!InjectedScriptHostClass} InjectedScriptHost | 33 * @param {!InjectedScriptHostClass} InjectedScriptHost |
34 * @param {!Window|!WorkerGlobalScope} inspectedGlobalObject | 34 * @param {!Window|!WorkerGlobalScope} inspectedGlobalObject |
35 * @param {number} injectedScriptId | 35 * @param {number} injectedScriptId |
| 36 * @suppress {uselessCode} |
36 */ | 37 */ |
37 (function (InjectedScriptHost, inspectedGlobalObject, injectedScriptId) { | 38 (function (InjectedScriptHost, inspectedGlobalObject, injectedScriptId) { |
38 | 39 |
39 /** | 40 /** |
40 * Protect against Object overwritten by the user code. | 41 * Protect against Object overwritten by the user code. |
41 * @suppress {duplicate} | 42 * @suppress {duplicate} |
42 */ | 43 */ |
43 var Object = /** @type {function(new:Object, *=)} */ ({}.constructor); | 44 var Object = /** @type {function(new:Object, *=)} */ ({}.constructor); |
44 | 45 |
45 /** | 46 /** |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 /** | 793 /** |
793 * @param {!Error} error | 794 * @param {!Error} error |
794 */ | 795 */ |
795 function logError(error) | 796 function logError(error) |
796 { | 797 { |
797 // We use user code to generate custom output for object, we can use
user code for reporting error too. | 798 // We use user code to generate custom output for object, we can use
user code for reporting error too. |
798 Promise.resolve().then(/* suppressBlacklist */ inspectedGlobalObject
.console.error.bind(inspectedGlobalObject.console, "Custom Formatter Failed: " +
error.message)); | 799 Promise.resolve().then(/* suppressBlacklist */ inspectedGlobalObject
.console.error.bind(inspectedGlobalObject.console, "Custom Formatter Failed: " +
error.message)); |
799 } | 800 } |
800 | 801 |
801 /** | 802 /** |
802 * @suppressReceiverCheck | |
803 * @param {*} object | 803 * @param {*} object |
804 * @param {*=} customObjectConfig | 804 * @param {*=} customObjectConfig |
805 * @return {*} | 805 * @return {*} |
806 */ | 806 */ |
807 function wrap(object, customObjectConfig) | 807 function wrap(object, customObjectConfig) |
808 { | 808 { |
809 return injectedScript._wrapObject(object, objectGroupName, false, fa
lse, null, false, false, customObjectConfig); | 809 return injectedScript._wrapObject(object, objectGroupName, false, fa
lse, null, false, false, customObjectConfig); |
810 } | 810 } |
811 | 811 |
812 try { | 812 try { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); | 1067 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); |
1068 } | 1068 } |
1069 return string.substr(0, maxLength) + "\u2026"; | 1069 return string.substr(0, maxLength) + "\u2026"; |
1070 }, | 1070 }, |
1071 | 1071 |
1072 __proto__: null | 1072 __proto__: null |
1073 } | 1073 } |
1074 | 1074 |
1075 return injectedScript; | 1075 return injectedScript; |
1076 }) | 1076 }) |
OLD | NEW |