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: Created June 9, 2014, 9:29 a.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
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);

Powered by Google App Engine
This is Rietveld