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

Side by Side Diff: chrome/content/common.js

Issue 29350387: Issue 4353 - Remove deprecated __proto__ syntax (Closed)
Patch Set: Created Sept. 1, 2016, 11:44 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 | chrome/content/tests/filterClasses.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 const Cc = Components.classes; 1 const Cc = Components.classes;
2 const Ci = Components.interfaces; 2 const Ci = Components.interfaces;
3 const Cr = Components.results; 3 const Cr = Components.results;
4 const Cu = Components.utils; 4 const Cu = Components.utils;
5 5
6 const MILLIS_IN_SECOND = 1000; 6 const MILLIS_IN_SECOND = 1000;
7 const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND; 7 const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND;
8 const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE; 8 const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE;
9 const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR; 9 const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR;
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 this._backup = { 71 this._backup = {
72 subscriptions: FilterStorage.subscriptions, 72 subscriptions: FilterStorage.subscriptions,
73 storageKnown: FilterStorage.knownSubscriptions, 73 storageKnown: FilterStorage.knownSubscriptions,
74 subscriptionsKnown: Subscription.knownSubscriptions, 74 subscriptionsKnown: Subscription.knownSubscriptions,
75 filtersKnown: Filter.knownFilters, 75 filtersKnown: Filter.knownFilters,
76 listeners: FilterNotifierGlobal.listeners, 76 listeners: FilterNotifierGlobal.listeners,
77 sourceFile: FilterStorage.sourceFile 77 sourceFile: FilterStorage.sourceFile
78 }; 78 };
79 79
80 FilterStorage.subscriptions = []; 80 FilterStorage.subscriptions = [];
81 FilterStorage.knownSubscriptions = {__proto__: null}; 81 FilterStorage.knownSubscriptions = Object.create(null);
82 Subscription.knownSubscriptions = {__proto__: null}; 82 Subscription.knownSubscriptions = Object.create(null);
83 Filter.knownFilters = {__proto__: null}; 83 Filter.knownFilters = Object.create(null);
84 if (!keepListeners) 84 if (!keepListeners)
85 { 85 {
86 FilterNotifierGlobal.listeners = []; 86 FilterNotifierGlobal.listeners = [];
87 } 87 }
88 88
89 defaultMatcher.clear(); 89 defaultMatcher.clear();
90 ElemHide.clear(); 90 ElemHide.clear();
91 CSSRules.clear(); 91 CSSRules.clear();
92 } 92 }
93 93
(...skipping 23 matching lines...) Expand all
117 QUnit.done = function() 117 QUnit.done = function()
118 { 118 {
119 FilterNotifier.triggerListeners("load"); 119 FilterNotifier.triggerListeners("load");
120 return origDone.apply(this, arguments); 120 return origDone.apply(this, arguments);
121 }; 121 };
122 reinitScheduled = true; 122 reinitScheduled = true;
123 } 123 }
124 124
125 function preparePrefs() 125 function preparePrefs()
126 { 126 {
127 this._pbackup = {__proto__: null}; 127 this._pbackup = Object.create(null);
128 for (let pref in Prefs) 128 for (let pref in Prefs)
129 { 129 {
130 if (Prefs.__lookupSetter__(pref)) 130 if (Prefs.__lookupSetter__(pref))
131 this._pbackup[pref] = Prefs[pref]; 131 this._pbackup[pref] = Prefs[pref];
132 } 132 }
133 Prefs.enabled = true; 133 Prefs.enabled = true;
134 } 134 }
135 135
136 function restorePrefs() 136 function restorePrefs()
137 { 137 {
(...skipping 17 matching lines...) Expand all
155 // Replace Date.now() function 155 // Replace Date.now() function
156 this["_origNow" + module] = global.Date.now; 156 this["_origNow" + module] = global.Date.now;
157 global.Date.now = function() currentTime; 157 global.Date.now = function() currentTime;
158 } 158 }
159 159
160 // Wrap timers 160 // Wrap timers
161 if (processTimers) 161 if (processTimers)
162 { 162 {
163 processTimers(function wrapTimer(timer) 163 processTimers(function wrapTimer(timer)
164 { 164 {
165 let wrapper = {__proto__: timer}; 165 let wrapper = Object.create(timer);
166 let callback = timer.callback; 166 let callback = timer.callback;
167 wrapper.handler = function() callback.notify(wrapper); 167 wrapper.handler = function() callback.notify(wrapper);
168 wrapper.nextExecution = currentTime + timer.delay; 168 wrapper.nextExecution = currentTime + timer.delay;
169 scheduledTasks.push(wrapper); 169 scheduledTasks.push(wrapper);
170 timer.cancel(); 170 timer.cancel();
171 return wrapper; 171 return wrapper;
172 }); 172 });
173 } 173 }
174 174
175 // Register observer to track outstanding requests 175 // Register observer to track outstanding requests
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 return oldFinish.apply(this, arguments); 527 return oldFinish.apply(this, arguments);
528 } 528 }
529 window.addEventListener("unload", function() 529 window.addEventListener("unload", function()
530 { 530 {
531 debuggerService.off(); 531 debuggerService.off();
532 }, true); 532 }, true);
533 debuggerService.on(); 533 debuggerService.on();
534 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA; 534 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA;
535 debuggerService.clearProfileData(); 535 debuggerService.clearProfileData();
536 } 536 }
OLDNEW
« no previous file with comments | « no previous file | chrome/content/tests/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld