OLD | NEW |
---|---|
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 Loading... | |
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 return Symbol.prototype.toString.call(obj); | |
yurys
2014/05/22 15:25:49
toString(obj) as Symbol.prototype.toString can be
aandrey
2014/05/22 15:29:50
We already use Object.prototype.toString in the co
aandrey
2014/05/22 15:31:12
wrap it in try-catch
yurys
2014/05/22 15:49:37
I'm wondering if the conversion is prohibited by t
Alexandra Mikhaylova
2014/05/22 16:07:59
Done, wrapped in a try-catch block.
| |
1013 | |
1011 if (className === "Object") { | 1014 if (className === "Object") { |
1012 // In Chromium DOM wrapper prototypes will have Object as their cons tructor name, | 1015 // In Chromium DOM wrapper prototypes will have Object as their cons tructor name, |
1013 // get the real DOM wrapper name from the constructor property. | 1016 // get the real DOM wrapper name from the constructor property. |
1014 var constructorName = obj.constructor && obj.constructor.name; | 1017 var constructorName = obj.constructor && obj.constructor.name; |
1015 if (constructorName) | 1018 if (constructorName) |
1016 return constructorName; | 1019 return constructorName; |
1017 } | 1020 } |
1018 return className; | 1021 return className; |
1019 } | 1022 } |
1020 } | 1023 } |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1621 */ | 1624 */ |
1622 _logEvent: function(event) | 1625 _logEvent: function(event) |
1623 { | 1626 { |
1624 inspectedWindow.console.log(event.type, event); | 1627 inspectedWindow.console.log(event.type, event); |
1625 } | 1628 } |
1626 } | 1629 } |
1627 | 1630 |
1628 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1631 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
1629 return injectedScript; | 1632 return injectedScript; |
1630 }) | 1633 }) |
OLD | NEW |