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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 } | 622 } |
623 return description; | 623 return description; |
624 } | 624 } |
625 | 625 |
626 if (subtype === "proxy") | 626 if (subtype === "proxy") |
627 return "Proxy"; | 627 return "Proxy"; |
628 | 628 |
629 var className = InjectedScriptHost.internalConstructorName(obj); | 629 var className = InjectedScriptHost.internalConstructorName(obj); |
630 if (subtype === "array" || subtype === "typedarray") { | 630 if (subtype === "array" || subtype === "typedarray") { |
631 if (typeof obj.length === "number") | 631 if (typeof obj.length === "number") |
632 className += "[" + obj.length + "]"; | 632 return className + "(" + obj.length + ")"; |
633 return className; | 633 return className; |
634 } | 634 } |
635 | 635 |
| 636 if (subtype === "map" || subtype === "set") { |
| 637 if (typeof obj.size === "number") |
| 638 return className + "(" + obj.size + ")"; |
| 639 return className; |
| 640 } |
| 641 |
636 if (typeof obj === "function") | 642 if (typeof obj === "function") |
637 return toString(obj); | 643 return toString(obj); |
638 | 644 |
639 if (isSymbol(obj)) { | 645 if (isSymbol(obj)) { |
640 try { | 646 try { |
641 // It isn't safe, because Symbol.prototype.toString can be overr
iden. | 647 // It isn't safe, because Symbol.prototype.toString can be overr
iden. |
642 return /* suppressBlacklist */ obj.toString() || "Symbol"; | 648 return /* suppressBlacklist */ obj.toString() || "Symbol"; |
643 } catch (e) { | 649 } catch (e) { |
644 return "Symbol"; | 650 return "Symbol"; |
645 } | 651 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); | 1073 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); |
1068 } | 1074 } |
1069 return string.substr(0, maxLength) + "\u2026"; | 1075 return string.substr(0, maxLength) + "\u2026"; |
1070 }, | 1076 }, |
1071 | 1077 |
1072 __proto__: null | 1078 __proto__: null |
1073 } | 1079 } |
1074 | 1080 |
1075 return injectedScript; | 1081 return injectedScript; |
1076 }) | 1082 }) |
OLD | NEW |