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

Delta Between Two Patch Sets: lib/io.js

Issue 5055554716172288: Issue 653 -Object.defineProperty instead of defineGetter / defineSetter (Closed)
Left Patch Set: Created June 9, 2014, 9:29 a.m.
Right Patch Set: I am generally not a big fan of iterating over property names. It seems like for most objects here … Created June 26, 2014, 8:33 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 | « lib/filterStorage.js ('k') | lib/utils.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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 21 matching lines...) Expand all
32 const BUFFER_SIZE = 0x8000; // 32kB 32 const BUFFER_SIZE = 0x8000; // 32kB
33 33
34 let IO = exports.IO = 34 let IO = exports.IO =
35 { 35 {
36 /** 36 /**
37 * Retrieves the platform-dependent line break string. 37 * Retrieves the platform-dependent line break string.
38 */ 38 */
39 get lineBreak() 39 get lineBreak()
40 { 40 {
41 let lineBreak = (Services.appinfo.OS == "WINNT" ? "\r\n" : "\n"); 41 let lineBreak = (Services.appinfo.OS == "WINNT" ? "\r\n" : "\n");
42 Object.defineProperty(IO, "lineBreak", {value: lineBreak}); 42 Object.defineProperty(this, "lineBreak", {value: lineBreak});
Wladimir Palant 2014/06/23 11:12:41 Use this rather than IO here?
43 return lineBreak; 43 return lineBreak;
44 }, 44 },
45 45
46 /** 46 /**
47 * Tries to interpret a file path as an absolute path or a path relative to 47 * Tries to interpret a file path as an absolute path or a path relative to
48 * user's profile. Returns a file or null on failure. 48 * user's profile. Returns a file or null on failure.
49 */ 49 */
50 resolveFilePath: function(/**String*/ path) /**nsIFile*/ 50 resolveFilePath: function(/**String*/ path) /**nsIFile*/
51 { 51 {
52 if (!path) 52 if (!path)
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 else 355 else
356 callback(e); 356 callback(e);
357 }); 357 });
358 } 358 }
359 catch(e) 359 catch(e)
360 { 360 {
361 callback(e); 361 callback(e);
362 } 362 }
363 } 363 }
364 } 364 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld