Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/background.js

Issue 5721433737003008: Issue 1985 - Replaced __proto__ with Object.create() and Object.getPrototypeOf() (Closed)
Patch Set: Created Feb. 11, 2015, 11:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « qunit/common.js ('k') | safari/ext/common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/background.js
===================================================================
--- a/safari/ext/background.js
+++ b/safari/ext/background.js
@@ -19,7 +19,7 @@
{
/* Pages */
- var pages = {__proto__: null};
+ var pages = Object.create(null);
var pageCounter = 0;
var Page = function(id, tab, url)
@@ -501,8 +501,9 @@
};
});
- if (obj.__proto__)
- objectInfo.prototypeId = this.registerObject(obj.__proto__, objects);
+ var proto = Object.getPrototypeOf(obj);
+ if (proto)
+ objectInfo.prototypeId = this.registerObject(proto, objects);
if (obj == Object.prototype)
objectInfo.prototypeOf = "Object";
@@ -537,7 +538,7 @@
frameId = 0;
if (!('_pages' in tab))
- tab._pages = {__proto__: null};
+ tab._pages = Object.create(null);
var page = new Page(pageId, tab, message.url);
pages[pageId] = tab._pages[pageId] = page;
« no previous file with comments | « qunit/common.js ('k') | safari/ext/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld