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

Unified Diff: lib/filterClasses.js

Issue 6055266931965952: Issue 1273 - Worked around WebKit getter misoptimization on Safari 8 (Closed)
Patch Set: Created Aug. 27, 2014, 9:48 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 | « lib/elemHide.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterClasses.js
===================================================================
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -324,6 +324,12 @@
*/
get domains()
{
+ // despite this property is cached, the getter is called
Wladimir Palant 2014/08/27 12:52:55 "Despite this property being cached" please (capit
+ // several times on Safari, due to WebKit bug 132872
+ let prop = Object.getOwnPropertyDescriptor(this, "domains");
+ if (prop)
+ return prop.value;
+
let domains = null;
if (this.domainSource)
@@ -514,6 +520,12 @@
*/
get regexp()
{
+ // despite this property is cached, the getter is called
Wladimir Palant 2014/08/27 12:52:55 Same as above, "Despite this property being cached
+ // several times on Safari, due to WebKit bug 132872
+ let prop = Object.getOwnPropertyDescriptor(this, "regexp");
+ if (prop)
+ return prop.value;
+
// Remove multiple wildcards
let source = this.regexpSource
.replace(/\*+/g, "*") // remove multiple wildcards
« no previous file with comments | « lib/elemHide.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld