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

Side by Side Diff: Source/core/inspector/InjectedScriptSource.js

Issue 295633003: Show information about Symbols in DevTools console. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: REBASE Created 6 years, 7 months 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
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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 if (subtype === "array") { 1001 if (subtype === "array") {
1002 if (typeof obj.length === "number") 1002 if (typeof obj.length === "number")
1003 className += "[" + obj.length + "]"; 1003 className += "[" + obj.length + "]";
1004 return className; 1004 return className;
1005 } 1005 }
1006 1006
1007 // NodeList in JSC is a function, check for array prior to this. 1007 // NodeList in JSC is a function, check for array prior to this.
1008 if (typeof obj === "function") 1008 if (typeof obj === "function")
1009 return toString(obj); 1009 return toString(obj);
1010 1010
1011 if (typeof obj === "symbol") {
1012 try {
1013 return Symbol.prototype.toString.call(obj) || "Symbol";
1014 } catch (e) {
1015 return "Symbol";
1016 }
1017 }
1018
1011 if (className === "Object") { 1019 if (className === "Object") {
1012 // In Chromium DOM wrapper prototypes will have Object as their cons tructor name, 1020 // In Chromium DOM wrapper prototypes will have Object as their cons tructor name,
1013 // get the real DOM wrapper name from the constructor property. 1021 // get the real DOM wrapper name from the constructor property.
1014 var constructorName = obj.constructor && obj.constructor.name; 1022 var constructorName = obj.constructor && obj.constructor.name;
1015 if (constructorName) 1023 if (constructorName)
1016 return constructorName; 1024 return constructorName;
1017 } 1025 }
1018 return className; 1026 return className;
1019 } 1027 }
1020 } 1028 }
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 */ 1629 */
1622 _logEvent: function(event) 1630 _logEvent: function(event)
1623 { 1631 {
1624 inspectedWindow.console.log(event.type, event); 1632 inspectedWindow.console.log(event.type, event);
1625 } 1633 }
1626 } 1634 }
1627 1635
1628 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1636 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1629 return injectedScript; 1637 return injectedScript;
1630 }) 1638 })
OLDNEW
« no previous file with comments | « LayoutTests/inspector/console/console-format-es6-symbols-error-expected.txt ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698