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

Unified Diff: Source/core/inspector/InjectedScriptSource.js

Issue 312143003: This fixes bug with trying to get properties of non-object (symbol). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScriptSource.js
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index b60be3e95288e365eddde8188f7fb2b7acba3747..7388835d1d222accdebda2d11a6e90d401b2a8fa 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -383,7 +383,7 @@ InjectedScript.prototype = {
var object = this._objectForId(parsedObjectId);
var objectGroupName = this._idToObjectGroupName[parsedObjectId.id];
- if (!this._isDefined(object))
+ if (!this._isDefined(object) || this._isSymbol(object))
aandrey 2014/06/04 13:03:51 typeof object !== "object"
Alexandra Mikhaylova 2014/06/04 14:08:37 Done.
return false;
var descriptors = this._propertyDescriptors(object, ownProperties, accessorPropertiesOnly);
@@ -415,7 +415,7 @@ InjectedScript.prototype = {
var parsedObjectId = this._parseObjectId(objectId);
var object = this._objectForId(parsedObjectId);
var objectGroupName = this._idToObjectGroupName[parsedObjectId.id];
- if (!this._isDefined(object))
+ if (!this._isDefined(object) || this._isSymbol(object))
aandrey 2014/06/04 13:03:51 ditto
Alexandra Mikhaylova 2014/06/04 14:08:37 Done.
return false;
var descriptors = [];
var internalProperties = InjectedScriptHost.getInternalProperties(object);
@@ -497,8 +497,7 @@ InjectedScript.prototype = {
continue;
var name = property;
- var type = typeof property;
- if (type === "symbol")
+ if (injectedScript._isSymbol(property))
aandrey 2014/06/04 13:03:51 revert
Alexandra Mikhaylova 2014/06/04 14:08:37 Done.
name = injectedScript._describe(property);
try {
@@ -532,7 +531,7 @@ InjectedScript.prototype = {
descriptor.name = name;
if (o === object)
descriptor.isOwn = true;
- if (type === "symbol")
+ if (injectedScript._isSymbol(property))
descriptor.symbol = property;
push(descriptors, descriptor);
}
@@ -874,7 +873,7 @@ InjectedScript.prototype = {
/**
* @param {Object} objectId
- * @return {Object}
+ * @return {Object|symbol}
*/
_objectForId: function(objectId)
{
@@ -950,6 +949,16 @@ InjectedScript.prototype = {
},
/**
+ * @param {*} object
+ * @return {boolean}
+ */
+ _isSymbol: function(object)
+ {
+ var type = typeof object;
+ return (type === "symbol");
+ },
+
+ /**
* @param {*} obj
* @return {string?}
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698