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

Delta Between Two Patch Sets: lib/content/snippets.js

Issue 30033574: Issue 7419 - Allow wrapping function for abort-on-property-* (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created March 28, 2019, 8:39 p.m.
Right Patch Set: Deal with function base property delayed creation Created March 29, 2019, 3:35 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 | « no previous file | test/browser/snippets.js » ('j') | 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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 if (value && (typeof value == "object" || typeof value == "function")) 719 if (value && (typeof value == "object" || typeof value == "function"))
720 wrapPropertyAccess(value, property, descriptor); 720 wrapPropertyAccess(value, property, descriptor);
721 721
722 let currentDescriptor = Object.getOwnPropertyDescriptor(object, name); 722 let currentDescriptor = Object.getOwnPropertyDescriptor(object, name);
723 if (currentDescriptor && !currentDescriptor.configurable) 723 if (currentDescriptor && !currentDescriptor.configurable)
724 return; 724 return;
725 725
726 let setter = newValue => 726 let setter = newValue =>
727 { 727 {
728 value = newValue; 728 value = newValue;
729 if (newValue && typeof newValue == "object") 729 if (newValue && (typeof newValue == "object" || typeof value == "function"))
Manish Jethani 2019/03/29 07:08:07 We should change this too.
hub 2019/03/29 14:36:27 I considered changing here unnecessary as this is
Manish Jethani 2019/03/29 14:57:10 Well so if an intermediate property is a function
hub 2019/03/29 15:36:02 I was wondering "why would someone do that" but th
730 wrapPropertyAccess(newValue, property, descriptor); 730 wrapPropertyAccess(newValue, property, descriptor);
731 }; 731 };
732 732
733 Object.defineProperty(object, name, { 733 Object.defineProperty(object, name, {
734 get: () => value, 734 get: () => value,
735 set: setter, 735 set: setter,
736 configurable: true 736 configurable: true
737 }); 737 });
738 } 738 }
739 739
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 928
929 args[0] = url.href; 929 args[0] = url.href;
930 } 930 }
931 931
932 return fetch_.apply(this, args); 932 return fetch_.apply(this, args);
933 }; 933 };
934 } 934 }
935 935
936 exports["strip-fetch-query-parameter"] = makeInjector(stripFetchQueryParameter, 936 exports["strip-fetch-query-parameter"] = makeInjector(stripFetchQueryParameter,
937 toRegExp, regexEscape); 937 toRegExp, regexEscape);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld