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

Unified Diff: chrome/content/ui/progressBar.js

Issue 5055554716172288: Issue 653 -Object.defineProperty instead of defineGetter / defineSetter (Closed)
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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/ui/filters-subscriptionactions.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/progressBar.js
===================================================================
--- a/chrome/content/ui/progressBar.js
+++ b/chrome/content/ui/progressBar.js
@@ -27,20 +27,26 @@
progressBar = document.getElementById("progressBar");
canvas = document.getElementById("progressBarCanvas");
headers = Array.prototype.slice.call(progressBar.getElementsByTagName("label"));
for (let i = 0; i < headers.length; i++)
canvas.parentNode.appendChild(headers[i]);
// Expose properties
- progressBar.__defineGetter__("activeItem", getActiveItem);
- progressBar.__defineSetter__("activeItem", setActiveItem);
- progressBar.__defineGetter__("activeItemComplete", getActiveItemComplete);
- progressBar.__defineSetter__("activeItemComplete", setActiveItemComplete);
+ Object.defineProperty(progressBar, "activeItem",
+ {
+ get: getActiveItem,
+ set: setActiveItem
+ });
+ Object.defineProperty(progressBar, "activeItemComplete",
+ {
+ get: getActiveItemComplete,
+ set: setActiveItemComplete
+ });
isRTL = (window.getComputedStyle(document.documentElement).direction == "rtl");
// Run actual drawing delayed, once the sizes are fixed
window.setTimeout(init, 0);
};
window.addEventListener("load", onLoad, false);
« no previous file with comments | « chrome/content/ui/filters-subscriptionactions.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld