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

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

Issue 2554623003: Show functions in object previews (Closed)
Patch Set: rebase to drop symbool cl 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/runtime/evaluate-with-generate-preview.js » ('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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 // Ignore computed properties unless they have getters. 939 // Ignore computed properties unless they have getters.
940 if (!("value" in descriptor)) { 940 if (!("value" in descriptor)) {
941 if (descriptor.get) 941 if (descriptor.get)
942 this._appendPropertyPreview(preview, { name: name, type: "ac cessor", __proto__: null }, propertiesThreshold); 942 this._appendPropertyPreview(preview, { name: name, type: "ac cessor", __proto__: null }, propertiesThreshold);
943 continue; 943 continue;
944 } 944 }
945 945
946 var value = descriptor.value; 946 var value = descriptor.value;
947 var type = typeof value; 947 var type = typeof value;
948 948
949 // Never render functions in object preview.
950 if (type === "function" && (this.subtype !== "array" || !isUInt32(na me)))
951 continue;
952
953 // Special-case HTMLAll. 949 // Special-case HTMLAll.
954 if (type === "undefined" && injectedScript._isHTMLAllCollection(valu e)) 950 if (type === "undefined" && injectedScript._isHTMLAllCollection(valu e))
955 type = "object"; 951 type = "object";
956 952
957 // Render own properties. 953 // Render own properties.
958 if (value === null) { 954 if (value === null) {
959 this._appendPropertyPreview(preview, { name: name, type: "object ", subtype: "null", value: "null", __proto__: null }, propertiesThreshold); 955 this._appendPropertyPreview(preview, { name: name, type: "object ", subtype: "null", value: "null", __proto__: null }, propertiesThreshold);
960 continue; 956 continue;
961 } 957 }
962 958
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 return string.substr(0, leftHalf) + "\u2026" + string.substr(string. length - rightHalf, rightHalf); 1061 return string.substr(0, leftHalf) + "\u2026" + string.substr(string. length - rightHalf, rightHalf);
1066 } 1062 }
1067 return string.substr(0, maxLength) + "\u2026"; 1063 return string.substr(0, maxLength) + "\u2026";
1068 }, 1064 },
1069 1065
1070 __proto__: null 1066 __proto__: null
1071 } 1067 }
1072 1068
1073 return injectedScript; 1069 return injectedScript;
1074 }) 1070 })
OLDNEW
« no previous file with comments | « no previous file | test/inspector/runtime/evaluate-with-generate-preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698