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

Unified Diff: lib/filterValidation.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Addressed some more feedback Created Jan. 18, 2017, 11:44 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
« no previous file with comments | « lib/filterComposer.js ('k') | lib/icon.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterValidation.js
diff --git a/lib/filterValidation.js b/lib/filterValidation.js
index f5de14b7a75c670802a37fa676a10cb51c51dcd5..c280fcceba42d50b1b00ba55a1b5f0b091ba8a40 100644
--- a/lib/filterValidation.js
+++ b/lib/filterValidation.js
@@ -17,8 +17,10 @@
/** @module filterValidation */
-let {Filter, InvalidFilter, ElemHideBase} = require("filterClasses");
-let {Utils} = require("utils");
+"use strict";
+
+const {Filter, InvalidFilter, ElemHideBase} = require("filterClasses");
+const {Utils} = require("utils");
/**
* An error returned by
@@ -63,7 +65,7 @@ FilterParsingError.prototype = {
*
* @return {string}
*/
- toString: function()
+ toString()
{
let message;
if (this.reason)
@@ -115,7 +117,7 @@ let parseFilter =
* @param {string} text
* @return {ParsedFilter}
*/
-exports.parseFilter = function(text)
+exports.parseFilter = text =>
{
let filter = null;
text = Filter.normalize(text);
@@ -149,7 +151,7 @@ exports.parseFilter = function(text)
* @param {string} text
* @return {ParsedFilters}
*/
-exports.parseFilters = function(text)
+exports.parseFilters = text =>
{
let lines = text.split("\n");
let filters = [];
« no previous file with comments | « lib/filterComposer.js ('k') | lib/icon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld