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

Side by Side Diff: lib/hooks.js

Issue 5430129207541760: Issue 1358 - Publish build tools under the MPL 2.0 license (Closed)
Patch Set: Created Sept. 11, 2014, 3:41 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « install.rdf.tmpl ('k') | lib/keySelector.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * This file is part of the Adblock Plus build tools, 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17 4
18 function hook(obj, name, func, cleanup) 5 function hook(obj, name, func, cleanup)
19 { 6 {
20 let orig = obj[name]; 7 let orig = obj[name];
21 let origGet = obj.__lookupGetter__(name); 8 let origGet = obj.__lookupGetter__(name);
22 let origSet = obj.__lookupSetter__(name); 9 let origSet = obj.__lookupSetter__(name);
23 let dumbOverrideAttempt = false; 10 let dumbOverrideAttempt = false;
24 11
25 let newFunc = function() 12 let newFunc = function()
26 { 13 {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 { 71 {
85 obj.__defineGetter__(name, origGet); 72 obj.__defineGetter__(name, origGet);
86 } 73 }
87 if (origSet) 74 if (origSet)
88 { 75 {
89 obj.__defineSetter__(name, origSet); 76 obj.__defineSetter__(name, origSet);
90 } 77 }
91 }; 78 };
92 } 79 }
93 exports.hook = hook; 80 exports.hook = hook;
OLDNEW
« no previous file with comments | « install.rdf.tmpl ('k') | lib/keySelector.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld