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

Side by Side Diff: lib/filterClasses.js

Issue 5636077285015552: Issue 656 - Replace some __proto__ with Object.create (Closed)
Patch Set: Created June 23, 2014, 8:46 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/elemHide.js ('k') | lib/filterStorage.js » ('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 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 toString: function() 61 toString: function()
62 { 62 {
63 return this.text; 63 return this.text;
64 } 64 }
65 }; 65 };
66 66
67 /** 67 /**
68 * Cache for known filters, maps string representation to filter objects. 68 * Cache for known filters, maps string representation to filter objects.
69 * @type Object 69 * @type Object
70 */ 70 */
71 Filter.knownFilters = {__proto__: null}; 71 Filter.knownFilters = Object.create(null);
72 72
73 /** 73 /**
74 * Regular expression that element hiding filters should match 74 * Regular expression that element hiding filters should match
75 * @type RegExp 75 * @type RegExp
76 */ 76 */
77 Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?: [$^*]?=[^\(\)"]*)?\))*)|#([^{}]+))$/; 77 Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?: [$^*]?=[^\(\)"]*)?\))*)|#([^{}]+))$/;
78 /** 78 /**
79 * Regular expression that RegExp filters specified as RegExps should match 79 * Regular expression that RegExp filters specified as RegExps should match
80 * @type RegExp 80 * @type RegExp
81 */ 81 */
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 include = false; 359 include = false;
360 domain = domain.substr(1); 360 domain = domain.substr(1);
361 } 361 }
362 else 362 else
363 { 363 {
364 include = true; 364 include = true;
365 hasIncludes = true; 365 hasIncludes = true;
366 } 366 }
367 367
368 if (!domains) 368 if (!domains)
369 domains = {__proto__: null}; 369 domains = Object.create(null);
370 370
371 domains[domain] = include; 371 domains[domain] = include;
372 } 372 }
373 domains[""] = !hasIncludes; 373 domains[""] = !hasIncludes;
374 } 374 }
375 375
376 this.domainSource = null; 376 this.domainSource = null;
377 } 377 }
378 378
379 Object.defineProperty(this, "domains", {value: domains, enumerable: true}); 379 Object.defineProperty(this, "domains", {value: domains, enumerable: true});
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 function ElemHideException(text, domains, selector) 891 function ElemHideException(text, domains, selector)
892 { 892 {
893 ElemHideBase.call(this, text, domains, selector); 893 ElemHideBase.call(this, text, domains, selector);
894 } 894 }
895 exports.ElemHideException = ElemHideException; 895 exports.ElemHideException = ElemHideException;
896 896
897 ElemHideException.prototype = 897 ElemHideException.prototype =
898 { 898 {
899 __proto__: ElemHideBase.prototype 899 __proto__: ElemHideBase.prototype
900 }; 900 };
OLDNEW
« no previous file with comments | « lib/elemHide.js ('k') | lib/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld