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

Delta Between Two Patch Sets: lib/compat.js

Issue 29372820: Issue 4795 - Avoid shorthand method syntax where prototype matters (Closed)
Left Patch Set: Created Jan. 23, 2017, 1:42 p.m.
Right Patch Set: Addressed Sebastian's feedback Created Feb. 17, 2017, 8:12 a.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 | no next file » | 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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 let onShutdown = { 43 let onShutdown = {
44 done: false, 44 done: false,
45 add() {}, 45 add() {},
46 remove() {} 46 remove() {}
47 }; 47 };
48 48
49 // 49 //
50 // XPCOM emulation 50 // XPCOM emulation
51 // 51 //
52 52
53 function nsIFileURL() {}
54 function nsIHttpChannel() {}
55
53 let Components = 56 let Components =
54 { 57 {
55 interfaces: 58 interfaces:
56 { 59 {
57 nsIFile: {DIRECTORY_TYPE: 0}, 60 nsIFile: {DIRECTORY_TYPE: 0},
58 61 nsIFileURL,
59 // We don't use the method definition shorthand syntax for these functions 62 nsIHttpChannel,
Sebastian Noack 2017/01/23 13:54:22 I had a hard time to understand what is going on h
kzar 2017/01/23 13:59:13 It surely could, I'm open to suggestions.
Sebastian Noack 2017/02/16 12:05:10 With our just established ESLint configuration thi
kzar 2017/02/17 09:40:28 Done.
60 // since that gives them the prototype of undefined which breaks instanceof
61 // checks.
62 nsIFileURL: function() {},
63 nsIHttpChannel: function() {},
64
65 nsITimer: {TYPE_REPEATING_SLACK: 0}, 63 nsITimer: {TYPE_REPEATING_SLACK: 0},
66 nsIInterfaceRequestor: null, 64 nsIInterfaceRequestor: null,
67 nsIChannelEventSink: null 65 nsIChannelEventSink: null
68 }, 66 },
69 classes: 67 classes:
70 { 68 {
71 "@mozilla.org/timer;1": 69 "@mozilla.org/timer;1":
72 { 70 {
73 createInstance() { return new FakeTimer(); } 71 createInstance() { return new FakeTimer(); }
74 }, 72 },
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 status: -1, 260 status: -1,
263 notificationCallbacks: {}, 261 notificationCallbacks: {},
264 loadFlags: 0, 262 loadFlags: 0,
265 INHIBIT_CACHING: 0, 263 INHIBIT_CACHING: 0,
266 VALIDATE_ALWAYS: 0, 264 VALIDATE_ALWAYS: 0,
267 QueryInterface() 265 QueryInterface()
268 { 266 {
269 return this; 267 return this;
270 } 268 }
271 }; 269 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld