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

Side by Side Diff: lib/compat.js

Issue 29372820: Issue 4795 - Avoid shorthand method syntax where prototype matters (Closed)
Patch Set: Created Jan. 23, 2017, 1:42 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // 49 //
50 // XPCOM emulation 50 // XPCOM emulation
51 // 51 //
52 52
53 let Components = 53 let Components =
54 { 54 {
55 interfaces: 55 interfaces:
56 { 56 {
57 nsIFile: {DIRECTORY_TYPE: 0}, 57 nsIFile: {DIRECTORY_TYPE: 0},
58 nsIFileURL() {}, 58
59 nsIHttpChannel() {}, 59 // We don't use the method definition shorthand syntax for these functions
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
60 nsITimer: {TYPE_REPEATING_SLACK: 0}, 65 nsITimer: {TYPE_REPEATING_SLACK: 0},
61 nsIInterfaceRequestor: null, 66 nsIInterfaceRequestor: null,
62 nsIChannelEventSink: null 67 nsIChannelEventSink: null
63 }, 68 },
64 classes: 69 classes:
65 { 70 {
66 "@mozilla.org/timer;1": 71 "@mozilla.org/timer;1":
67 { 72 {
68 createInstance() { return new FakeTimer(); } 73 createInstance() { return new FakeTimer(); }
69 }, 74 },
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 status: -1, 262 status: -1,
258 notificationCallbacks: {}, 263 notificationCallbacks: {},
259 loadFlags: 0, 264 loadFlags: 0,
260 INHIBIT_CACHING: 0, 265 INHIBIT_CACHING: 0,
261 VALIDATE_ALWAYS: 0, 266 VALIDATE_ALWAYS: 0,
262 QueryInterface() 267 QueryInterface()
263 { 268 {
264 return this; 269 return this;
265 } 270 }
266 }; 271 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld