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

Unified Diff: lib/content/snippets.js

Issue 30033574: Issue 7419 - Allow wrapping function for abort-on-property-* (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Deal with function base property delayed creation Created March 29, 2019, 3:35 p.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 | « no previous file | test/browser/snippets.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/content/snippets.js
===================================================================
--- a/lib/content/snippets.js
+++ b/lib/content/snippets.js
@@ -711,27 +711,27 @@
descriptor.configurable = true;
Object.defineProperty(object, property, descriptor);
return;
}
let name = property.slice(0, dotIndex);
property = property.slice(dotIndex + 1);
let value = object[name];
- if (value && typeof value == "object")
+ if (value && (typeof value == "object" || typeof value == "function"))
wrapPropertyAccess(value, property, descriptor);
let currentDescriptor = Object.getOwnPropertyDescriptor(object, name);
if (currentDescriptor && !currentDescriptor.configurable)
return;
let setter = newValue =>
{
value = newValue;
- if (newValue && typeof newValue == "object")
+ if (newValue && (typeof newValue == "object" || typeof value == "function"))
wrapPropertyAccess(newValue, property, descriptor);
};
Object.defineProperty(object, name, {
get: () => value,
set: setter,
configurable: true
});
« no previous file with comments | « no previous file | test/browser/snippets.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld