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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 6055266931965952: Issue 1273 - Worked around WebKit getter misoptimization on Safari 8 (Closed)
Left Patch Set: Created Aug. 27, 2014, 9:48 a.m.
Right Patch Set: Fixed typo in comment Created Aug. 27, 2014, 12:59 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/elemHide.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 * @type Boolean 317 * @type Boolean
318 */ 318 */
319 domainSourceIsUpperCase: false, 319 domainSourceIsUpperCase: false,
320 320
321 /** 321 /**
322 * Map containing domains that this filter should match on/not match on or nul l if the filter should match on all domains 322 * Map containing domains that this filter should match on/not match on or nul l if the filter should match on all domains
323 * @type Object 323 * @type Object
324 */ 324 */
325 get domains() 325 get domains()
326 { 326 {
327 // despite this property is cached, the getter is called 327 // Despite this property being cached, the getter is called
Wladimir Palant 2014/08/27 12:52:55 "Despite this property being cached" please (capit
328 // several times on Safari, due to WebKit bug 132872 328 // several times on Safari, due to WebKit bug 132872
329 let prop = Object.getOwnPropertyDescriptor(this, "domains"); 329 let prop = Object.getOwnPropertyDescriptor(this, "domains");
330 if (prop) 330 if (prop)
331 return prop.value; 331 return prop.value;
332 332
333 let domains = null; 333 let domains = null;
334 334
335 if (this.domainSource) 335 if (this.domainSource)
336 { 336 {
337 let source = this.domainSource; 337 let source = this.domainSource;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 * Expression from which a regular expression should be generated - for delaye d creation of the regexp property 513 * Expression from which a regular expression should be generated - for delaye d creation of the regexp property
514 * @type String 514 * @type String
515 */ 515 */
516 regexpSource: null, 516 regexpSource: null,
517 /** 517 /**
518 * Regular expression to be used when testing against this filter 518 * Regular expression to be used when testing against this filter
519 * @type RegExp 519 * @type RegExp
520 */ 520 */
521 get regexp() 521 get regexp()
522 { 522 {
523 // despite this property is cached, the getter is called 523 // Despite this property being cached, the getter is called
Wladimir Palant 2014/08/27 12:52:55 Same as above, "Despite this property being cached
524 // several times on Safari, due to WebKit bug 132872 524 // several times on Safari, due to WebKit bug 132872
525 let prop = Object.getOwnPropertyDescriptor(this, "regexp"); 525 let prop = Object.getOwnPropertyDescriptor(this, "regexp");
526 if (prop) 526 if (prop)
527 return prop.value; 527 return prop.value;
528 528
529 // Remove multiple wildcards 529 // Remove multiple wildcards
530 let source = this.regexpSource 530 let source = this.regexpSource
531 .replace(/\*+/g, "*") // remove multiple wildcards 531 .replace(/\*+/g, "*") // remove multiple wildcards
532 .replace(/\^\|$/, "^") // remove anchors following separator placeho lder 532 .replace(/\^\|$/, "^") // remove anchors following separator placeho lder
533 .replace(/\W/g, "\\$&") // escape special symbols 533 .replace(/\W/g, "\\$&") // escape special symbols
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 function ElemHideException(text, domains, selector) 902 function ElemHideException(text, domains, selector)
903 { 903 {
904 ElemHideBase.call(this, text, domains, selector); 904 ElemHideBase.call(this, text, domains, selector);
905 } 905 }
906 exports.ElemHideException = ElemHideException; 906 exports.ElemHideException = ElemHideException;
907 907
908 ElemHideException.prototype = 908 ElemHideException.prototype =
909 { 909 {
910 __proto__: ElemHideBase.prototype 910 __proto__: ElemHideBase.prototype
911 }; 911 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld