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

Delta Between Two Patch Sets: lib/prefs.js

Issue 29396582: Issue 5039 - add support of nullable non-object values in settings
Left Patch Set: rebase Created March 29, 2017, 11:14 a.m.
Right Patch Set: rebase Created March 29, 2017, 4:39 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 | « include/AdblockPlus/JsEngine.h ('k') | src/FilterEngine.cpp » ('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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 notificationdata: {}, 43 notificationdata: {},
44 notificationurl: "https://notification.adblockplus.org/notification.json", 44 notificationurl: "https://notification.adblockplus.org/notification.json",
45 suppress_first_run_page: false, 45 suppress_first_run_page: false,
46 disable_auto_updates: false, 46 disable_auto_updates: false,
47 first_run_subscription_auto_select: true, 47 first_run_subscription_auto_select: true,
48 notifications_ignoredcategories: [], 48 notifications_ignoredcategories: [],
49 allowed_connection_type: null 49 allowed_connection_type: null
50 }; 50 };
51 51
52 // It is for non-objects, e.g. for string, number, etc. 52 // It is for non-objects, e.g. for string, number, etc.
53 // Don't put here preferences used by adblockpluscore.
53 let nullableValues_ExpectedTypes = { 54 let nullableValues_ExpectedTypes = {
54 __proto__: null, 55 __proto__: null,
55 allowed_connection_type: "string" 56 allowed_connection_type: "string"
56 }; 57 };
57 58
58 let preconfigurable = ["suppress_first_run_page", "disable_auto_updates", 59 let preconfigurable = ["suppress_first_run_page", "disable_auto_updates",
59 "first_run_subscription_auto_select", "allowed_connection_type"]; 60 "first_run_subscription_auto_select", "allowed_connection_type"];
60 61
61 let values; 62 let values;
62 let path = _fileSystem.resolve("prefs.json"); 63 let path = _fileSystem.resolve("prefs.json");
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 166 }
166 167
167 // Define defaults 168 // Define defaults
168 for (let key in defaults) 169 for (let key in defaults)
169 defineProperty(key); 170 defineProperty(key);
170 171
171 // Set values of prefs based on defaults 172 // Set values of prefs based on defaults
172 values = Object.create(defaults); 173 values = Object.create(defaults);
173 174
174 load(); 175 load();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld