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

Unified Diff: chrome/content/composer.js

Issue 6520005931827200: Issue 2259 - Removed non-standard JavaScript code from Element Hiding Helper (Closed)
Patch Set: Created April 1, 2015, 3:16 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 | « no previous file | lib/aardvark.js » ('j') | lib/main.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/composer.js
===================================================================
--- a/chrome/content/composer.js
+++ b/chrome/content/composer.js
@@ -101,11 +101,10 @@
};
}
else {
- obj.__defineGetter__(key, function() {
- return orig[key];
- });
- obj.__defineSetter__(key, function(value) {
- orig[key] = value;
+ Object.defineProperty(obj, key, {
+ get: () => orig[key],
+ set: value => { orig[key] = value; },
+ enumerable: true
});
}
}
@@ -250,11 +249,11 @@
else if (attr.name == "class" && /\S/.test(attr.selected))
{
let knownClasses = {};
- for each (let cls in attr.value.split(/\s+/))
+ for (let cls of attr.value.split(/\s+/))
knownClasses[cls] = true;
- let classes = attr.selected.split(/\s+/).filter(function(cls) cls != "");
- if (classes.every(function(cls) knownClasses.hasOwnProperty(cls)))
+ let classes = attr.selected.split(/\s+/).filter(cls => cls != "");
+ if (classes.every(cls => knownClasses.hasOwnProperty(cls)))
expression += "." + classes.map(escapeName).join(".");
else
useFallback = true;
« no previous file with comments | « no previous file | lib/aardvark.js » ('j') | lib/main.js » ('J')

Powered by Google App Engine
This is Rietveld