Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: src/inspector/injected-script-source.js

Issue 2530803002: Revert of Use parenthesis in descriptions for array/map/set lengths/sizes (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/inspector/debugger/object-preview-internal-properties-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 return className + "(" + obj.length + ")"; 632 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
642 if (typeof obj === "function") 636 if (typeof obj === "function")
643 return toString(obj); 637 return toString(obj);
644 638
645 if (isSymbol(obj)) { 639 if (isSymbol(obj)) {
646 try { 640 try {
647 // It isn't safe, because Symbol.prototype.toString can be overr iden. 641 // It isn't safe, because Symbol.prototype.toString can be overr iden.
648 return /* suppressBlacklist */ obj.toString() || "Symbol"; 642 return /* suppressBlacklist */ obj.toString() || "Symbol";
649 } catch (e) { 643 } catch (e) {
650 return "Symbol"; 644 return "Symbol";
651 } 645 }
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 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);
1074 } 1068 }
1075 return string.substr(0, maxLength) + "\u2026"; 1069 return string.substr(0, maxLength) + "\u2026";
1076 }, 1070 },
1077 1071
1078 __proto__: null 1072 __proto__: null
1079 } 1073 }
1080 1074
1081 return injectedScript; 1075 return injectedScript;
1082 }) 1076 })
OLDNEW
« no previous file with comments | « no previous file | test/inspector/debugger/object-preview-internal-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698