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

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

Issue 2521853003: Re-land of Use parenthesis in descriptions for array/map/set lengths/sizes (Closed)
Patch Set: ac 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 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
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 })
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