| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 */ | 120 */ |
| 121 function bind(func, thisObject, var_args) | 121 function bind(func, thisObject, var_args) |
| 122 { | 122 { |
| 123 var args = slice(arguments, 2); | 123 var args = slice(arguments, 2); |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * @param {...} var_args | 126 * @param {...} var_args |
| 127 */ | 127 */ |
| 128 function bound(var_args) | 128 function bound(var_args) |
| 129 { | 129 { |
| 130 return InjectedScriptHost.callFunction(func, thisObject, concat(args, sl
ice(arguments))); | 130 return InjectedScriptHost.suppressWarningsAndCallFunction(func, thisObje
ct, concat(args, slice(arguments))); |
| 131 } | 131 } |
| 132 bound.toString = function() | 132 bound.toString = function() |
| 133 { | 133 { |
| 134 return "bound: " + toString(func); | 134 return "bound: " + toString(func); |
| 135 }; | 135 }; |
| 136 return bound; | 136 return bound; |
| 137 } | 137 } |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * @param {T} obj | 140 * @param {T} obj |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 return description; | 727 return description; |
| 728 } | 728 } |
| 729 | 729 |
| 730 var className = InjectedScriptHost.internalConstructorName(obj); | 730 var className = InjectedScriptHost.internalConstructorName(obj); |
| 731 if (subtype === "array") { | 731 if (subtype === "array") { |
| 732 if (typeof obj.length === "number") | 732 if (typeof obj.length === "number") |
| 733 className += "[" + obj.length + "]"; | 733 className += "[" + obj.length + "]"; |
| 734 return className; | 734 return className; |
| 735 } | 735 } |
| 736 | 736 |
| 737 // NodeList in JSC is a function, check for array prior to this. | |
| 738 if (typeof obj === "function") | 737 if (typeof obj === "function") |
| 739 return toString(obj); | 738 return toString(obj); |
| 740 | 739 |
| 741 if (isSymbol(obj)) { | 740 if (isSymbol(obj)) { |
| 742 try { | 741 try { |
| 743 return /** @type {string} */ (InjectedScriptHost.callFunction(Sy
mbol.prototype.toString, obj)) || "Symbol"; | 742 return /** @type {string} */ (InjectedScriptHost.suppressWarning
sAndCallFunction(Symbol.prototype.toString, obj)) || "Symbol"; |
| 744 } catch (e) { | 743 } catch (e) { |
| 745 return "Symbol"; | 744 return "Symbol"; |
| 746 } | 745 } |
| 747 } | 746 } |
| 748 | 747 |
| 749 if (InjectedScriptHost.subtype(obj) === "error") { | 748 if (InjectedScriptHost.subtype(obj) === "error") { |
| 750 try { | 749 try { |
| 751 var stack = obj.stack; | 750 var stack = obj.stack; |
| 752 var message = obj.message && obj.message.length ? ": " + obj.mes
sage : ""; | 751 var message = obj.message && obj.message.length ? ": " + obj.mes
sage : ""; |
| 753 var firstCallFrame = /^\s+at\s/m.exec(stack); | 752 var firstCallFrame = /^\s+at\s/m.exec(stack); |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 */ | 1325 */ |
| 1327 _logEvent: function(event) | 1326 _logEvent: function(event) |
| 1328 { | 1327 { |
| 1329 inspectedGlobalObject.console.log(event.type, event); | 1328 inspectedGlobalObject.console.log(event.type, event); |
| 1330 } | 1329 } |
| 1331 } | 1330 } |
| 1332 | 1331 |
| 1333 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1332 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
| 1334 return injectedScript; | 1333 return injectedScript; |
| 1335 }) | 1334 }) |
| OLD | NEW |