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: Created March 28, 2019, 8:39 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') | test/browser/snippets.js » ('J')
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,17 +711,17 @@
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 =>
{
« no previous file with comments | « no previous file | test/browser/snippets.js » ('j') | test/browser/snippets.js » ('J')

Powered by Google App Engine
This is Rietveld