OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus build tools, | 2 * This file is part of the Adblock Plus build tools, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 { | 44 { |
45 if (typeof cleanup == "function") | 45 if (typeof cleanup == "function") |
46 cleanup(); | 46 cleanup(); |
47 } | 47 } |
48 }; | 48 }; |
49 newFunc.toString = function() | 49 newFunc.toString = function() |
50 { | 50 { |
51 dumbOverrideAttempt = true; | 51 dumbOverrideAttempt = true; |
52 return orig.toString(); | 52 return orig.toString(); |
53 }; | 53 }; |
| 54 newFunc.toSource = function() |
| 55 { |
| 56 dumbOverrideAttempt = true; |
| 57 return orig.toSource(); |
| 58 } |
54 | 59 |
55 obj.__defineGetter__(name, function() | 60 obj.__defineGetter__(name, function() |
56 { | 61 { |
57 dumbOverrideAttempt = false; | 62 dumbOverrideAttempt = false; |
58 return newFunc; | 63 return newFunc; |
59 }); | 64 }); |
60 | 65 |
61 obj.__defineSetter__(name, function(value) | 66 obj.__defineSetter__(name, function(value) |
62 { | 67 { |
63 if (dumbOverrideAttempt) | 68 if (dumbOverrideAttempt) |
(...skipping 15 matching lines...) Expand all Loading... |
79 { | 84 { |
80 obj.__defineGetter__(name, origGet); | 85 obj.__defineGetter__(name, origGet); |
81 } | 86 } |
82 if (origSet) | 87 if (origSet) |
83 { | 88 { |
84 obj.__defineSetter__(name, origSet); | 89 obj.__defineSetter__(name, origSet); |
85 } | 90 } |
86 }; | 91 }; |
87 } | 92 } |
88 exports.hook = hook; | 93 exports.hook = hook; |
OLD | NEW |