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

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: Wrap Symbol.prototype.toString.call in a try-catch block 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
« no previous file with comments | « no previous file | Source/devtools/protocol.json » ('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 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")
aandrey 2014/05/22 16:10:16 { ... }
Alexandra Mikhaylova 2014/05/26 10:38:34 Done.
1012 try {
1013 return Symbol.prototype.toString.call(obj);
aandrey 2014/05/22 16:10:16 || "Symbol";
Alexandra Mikhaylova 2014/05/26 10:38:34 Done.
1014 } catch (e) {
1015 return "Symbol";
1016 }
1017
1011 if (className === "Object") { 1018 if (className === "Object") {
1012 // In Chromium DOM wrapper prototypes will have Object as their cons tructor name, 1019 // In Chromium DOM wrapper prototypes will have Object as their cons tructor name,
1013 // get the real DOM wrapper name from the constructor property. 1020 // get the real DOM wrapper name from the constructor property.
1014 var constructorName = obj.constructor && obj.constructor.name; 1021 var constructorName = obj.constructor && obj.constructor.name;
1015 if (constructorName) 1022 if (constructorName)
1016 return constructorName; 1023 return constructorName;
1017 } 1024 }
1018 return className; 1025 return className;
1019 } 1026 }
1020 } 1027 }
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 */ 1628 */
1622 _logEvent: function(event) 1629 _logEvent: function(event)
1623 { 1630 {
1624 inspectedWindow.console.log(event.type, event); 1631 inspectedWindow.console.log(event.type, event);
1625 } 1632 }
1626 } 1633 }
1627 1634
1628 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1635 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1629 return injectedScript; 1636 return injectedScript;
1630 }) 1637 })
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698