Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Added back jslint prefer-const rule
Browse files Browse the repository at this point in the history
Issue #132 is fixed in chakracore so adding back the jslint rule of prefer-const.
  • Loading branch information
kunalspathak committed Nov 12, 2015
1 parent 0e514a5 commit 82ad0b3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ rules:
# ECMAScript 6
# list: http://eslint.org/docs/rules/#ecmascript-6
## Suggest using 'const' wherever possible
prefer-const: 1
prefer-const: 2

# Strict Mode
# list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
Expand Down
2 changes: 1 addition & 1 deletion lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class LineParser {
this.shouldFail = false;
const wasWithinStrLiteral = this._literal !== null;

for (let current of line) {
for (const current of line) {
if (previous === '\\') {
// valid escaping, skip processing. previous doesn't matter anymore
previous = null;
Expand Down
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function formatCollectionIterator(ctx, value, recurseTimes, visibleKeys, keys) {
var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1;
var vals = mirror.preview();
var output = [];
for (let o of vals) {
for (const o of vals) {
output.push(formatValue(ctx, o, nextRecurseTimes));
}
return output;
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-http-response-multiheaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const norepeat = [
const server = http.createServer(function(req, res) {
var num = req.headers['x-num'];
if (num == 1) {
for (let name of norepeat) {
for (const name of norepeat) {
res.setHeader(name, ['A', 'B']);
}
res.setHeader('X-A', ['A', 'B']);
} else if (num == 2) {
const headers = {};
for (let name of norepeat) {
for (const name of norepeat) {
headers[name] = ['A', 'B'];
}
headers['X-A'] = ['A', 'B'];
Expand All @@ -44,7 +44,7 @@ server.listen(common.PORT, common.mustCall(function() {
{port:common.PORT, headers:{'x-num': n}},
common.mustCall(function(res) {
if (n == 2) server.close();
for (let name of norepeat) {
for (const name of norepeat) {
assert.equal(res.headers[name], 'A');
}
assert.equal(res.headers['x-a'], 'A, B');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ map.set(1, 2);
var mirror = Debug.MakeMirror(map.entries(), true);
var vals = mirror.preview();
var valsOutput = [];
for (let o of vals) {
for (const o of vals) {
valsOutput.push(o);
}

Expand Down

0 comments on commit 82ad0b3

Please sign in to comment.