| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7874cb0 commit 15754e6
40 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,7 @@ rules: | |||
| 47 | 47 | accessor-pairs: error | |
| 48 | 48 | array-callback-return: error | |
| 49 | 49 | dot-location: [error, property] | |
| 50 | + dot-notation: error | ||
| 50 | 51 | eqeqeq: [error, smart] | |
| 51 | 52 | no-fallthrough: error | |
| 52 | 53 | no-global-assign: error | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | + /* eslint-disable dot-notation */ | ||
| 4 | + | ||
| 3 | 5 | const common = require('../common.js'); | |
| 4 | 6 | ||
| 5 | 7 | const bench = common.createBenchmark(main, { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1224,7 +1224,7 @@ const server = http2.createServer(); | |||
| 1224 | 1224 | server.on('stream', (stream) => { | |
| 1225 | 1225 | stream.respond({ ':status': 200 }, { | |
| 1226 | 1226 | getTrailers(trailers) { | |
| 1227 | - trailers['ABC'] = 'some value to send'; | ||
| 1227 | + trailers.ABC = 'some value to send'; | ||
| 1228 | 1228 | } | |
| 1229 | 1229 | }); | |
| 1230 | 1230 | stream.end('some data'); | |
@@ -1308,7 +1308,7 @@ server.on('stream', (stream) => { | |||
| 1308 | 1308 | }; | |
| 1309 | 1309 | stream.respondWithFD(fd, headers, { | |
| 1310 | 1310 | getTrailers(trailers) { | |
| 1311 | - trailers['ABC'] = 'some value to send'; | ||
| 1311 | + trailers.ABC = 'some value to send'; | ||
| 1312 | 1312 | } | |
| 1313 | 1313 | }); | |
| 1314 | 1314 | }); | |
@@ -1416,7 +1416,7 @@ const http2 = require('http2'); | |||
| 1416 | 1416 | const server = http2.createServer(); | |
| 1417 | 1417 | server.on('stream', (stream) => { | |
| 1418 | 1418 | function getTrailers(trailers) { | |
| 1419 | - trailers['ABC'] = 'some value to send'; | ||
| 1419 | + trailers.ABC = 'some value to send'; | ||
| 1420 | 1420 | } | |
| 1421 | 1421 | stream.respondWithFile('/some/file', | |
| 1422 | 1422 | { 'content-type': 'text/plain' }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,4 @@ | |||
| 1 | 1 | rules: | |
| 2 | - dot-notation: error | ||
| 3 | - | ||
| 4 | 2 | # Custom rules in tools/eslint-rules | |
| 5 | 3 | require-buffer: error | |
| 6 | 4 | buffer-constructor: error | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + de0ed84f04 | ||
| 2 | + 469036add4 | ||
| 3 | + 2caa1f5458 | ||
| 4 | + e83adf87f5 | ||
| 5 | + 808c05858a | ||
| 6 | + 1e57a8d117 | ||
| 7 | + 0089860757 | ||
| 8 | + 92bf2492cd | ||
| 9 | + 7514eb3cff | ||
| 10 | + 6934792eb3 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,11 +8,10 @@ const test_symbol = require(`./build/${common.buildType}/test_symbol`); | |||
| 8 | 8 | const sym = test_symbol.New('test'); | |
| 9 | 9 | assert.strictEqual(sym.toString(), 'Symbol(test)'); | |
| 10 | 10 | ||
| 11 | - | ||
| 12 | 11 | const myObj = {}; | |
| 13 | 12 | const fooSym = test_symbol.New('foo'); | |
| 14 | 13 | const otherSym = test_symbol.New('bar'); | |
| 15 | - myObj['foo'] = 'bar'; | ||
| 14 | + myObj.foo = 'bar'; | ||
| 16 | 15 | myObj[fooSym] = 'baz'; | |
| 17 | 16 | myObj[otherSym] = 'bing'; | |
| 18 | 17 | assert.strictEqual(myObj.foo, 'bar'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ const test_symbol = require(`./build/${common.buildType}/test_symbol`); | |||
| 7 | 7 | ||
| 8 | 8 | const fooSym = test_symbol.New('foo'); | |
| 9 | 9 | const myObj = {}; | |
| 10 | - myObj['foo'] = 'bar'; | ||
| 10 | + myObj.foo = 'bar'; | ||
| 11 | 11 | myObj[fooSym] = 'baz'; | |
| 12 | 12 | Object.keys(myObj); // -> [ 'foo' ] | |
| 13 | 13 | Object.getOwnPropertyNames(myObj); // -> [ 'foo' ] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -502,7 +502,7 @@ exports.canCreateSymLink = function() { | |||
| 502 | 502 | // whoami.exe needs to be the one from System32 | |
| 503 | 503 | // If unix tools are in the path, they can shadow the one we want, | |
| 504 | 504 | // so use the full path while executing whoami | |
| 505 | - const whoamiPath = path.join(process.env['SystemRoot'], | ||
| 505 | + const whoamiPath = path.join(process.env.SystemRoot, | ||
| 506 | 506 | 'System32', 'whoami.exe'); | |
| 507 | 507 | ||
| 508 | 508 | let err = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -168,9 +168,7 @@ class InspectorSession { | |||
| 168 | 168 | reject(message.error); | |
| 169 | 169 | } else { | |
| 170 | 170 | if (message.method === 'Debugger.scriptParsed') { | |
| 171 | - const script = message['params']; | ||
| 172 | - const scriptId = script['scriptId']; | ||
| 173 | - const url = script['url']; | ||
| 171 | + const { scriptId, url } = message.params; | ||
| 174 | 172 | this._scriptsIdsByUrl.set(scriptId, url); | |
| 175 | 173 | const fileUrl = url.startsWith('file:') ? | |
| 176 | 174 | url : getURLFromFilePath(url).toString(); | |
@@ -192,12 +190,12 @@ class InspectorSession { | |||
| 192 | 190 | ||
| 193 | 191 | _sendMessage(message) { | |
| 194 | 192 | const msg = JSON.parse(JSON.stringify(message)); // Clone! | |
| 195 | - msg['id'] = this._nextId++; | ||
| 193 | + msg.id = this._nextId++; | ||
| 196 | 194 | if (DEBUG) | |
| 197 | 195 | console.log('[sent]', JSON.stringify(msg)); | |
| 198 | 196 | ||
| 199 | 197 | const responsePromise = new Promise((resolve, reject) => { | |
| 200 | - this._commandResponsePromises.set(msg['id'], { resolve, reject }); | ||
| 198 | + this._commandResponsePromises.set(msg.id, { resolve, reject }); | ||
| 201 | 199 | }); | |
| 202 | 200 | ||
| 203 | 201 | return new Promise( | |
@@ -243,14 +241,14 @@ class InspectorSession { | |||
| 243 | 241 | } | |
| 244 | 242 | ||
| 245 | 243 | _isBreakOnLineNotification(message, line, expectedScriptPath) { | |
| 246 | - if ('Debugger.paused' === message['method']) { | ||
| 247 | - const callFrame = message['params']['callFrames'][0]; | ||
| 248 | - const location = callFrame['location']; | ||
| 249 | - const scriptPath = this._scriptsIdsByUrl.get(location['scriptId']); | ||
| 244 | + if ('Debugger.paused' === message.method) { | ||
| 245 | + const callFrame = message.params.callFrames[0]; | ||
| 246 | + const location = callFrame.location; | ||
| 247 | + const scriptPath = this._scriptsIdsByUrl.get(location.scriptId); | ||
| 250 | 248 | assert.strictEqual(scriptPath.toString(), | |
| 251 | 249 | expectedScriptPath.toString(), | |
| 252 | 250 | `${scriptPath} !== ${expectedScriptPath}`); | |
| 253 | - assert.strictEqual(line, location['lineNumber']); | ||
| 251 | + assert.strictEqual(line, location.lineNumber); | ||
| 254 | 252 | return true; | |
| 255 | 253 | } | |
| 256 | 254 | } | |
@@ -266,12 +264,12 @@ class InspectorSession { | |||
| 266 | 264 | _matchesConsoleOutputNotification(notification, type, values) { | |
| 267 | 265 | if (!Array.isArray(values)) | |
| 268 | 266 | values = [ values ]; | |
| 269 | - if ('Runtime.consoleAPICalled' === notification['method']) { | ||
| 270 | - const params = notification['params']; | ||
| 271 | - if (params['type'] === type) { | ||
| 267 | + if ('Runtime.consoleAPICalled' === notification.method) { | ||
| 268 | + const params = notification.params; | ||
| 269 | + if (params.type === type) { | ||
| 272 | 270 | let i = 0; | |
| 273 | - for (const value of params['args']) { | ||
| 274 | - if (value['value'] !== values[i++]) | ||
| 271 | + for (const value of params.args) { | ||
| 272 | + if (value.value !== values[i++]) | ||
| 275 | 273 | return false; | |
| 276 | 274 | } | |
| 277 | 275 | return i === values.length; | |
@@ -392,7 +390,7 @@ class NodeInstance { | |||
| 392 | 390 | ||
| 393 | 391 | async sendUpgradeRequest() { | |
| 394 | 392 | const response = await this.httpGet(null, '/json/list'); | |
| 395 | - const devtoolsUrl = response[0]['webSocketDebuggerUrl']; | ||
| 393 | + const devtoolsUrl = response[0].webSocketDebuggerUrl; | ||
| 396 | 394 | const port = await this.portPromise; | |
| 397 | 395 | return http.get({ | |
| 398 | 396 | port, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,8 +31,8 @@ const cluster = require('cluster'); | |||
| 31 | 31 | ||
| 32 | 32 | if (cluster.isWorker) { | |
| 33 | 33 | const result = cluster.worker.send({ | |
| 34 | - prop: process.env['cluster_test_prop'], | ||
| 35 | - overwrite: process.env['cluster_test_overwrite'] | ||
| 34 | + prop: process.env.cluster_test_prop, | ||
| 35 | + overwrite: process.env.cluster_test_overwrite | ||
| 36 | 36 | }); | |
| 37 | 37 | ||
| 38 | 38 | assert.strictEqual(result, true); | |
@@ -45,7 +45,7 @@ if (cluster.isWorker) { | |||
| 45 | 45 | ||
| 46 | 46 | // To check that the cluster extend on the process.env we will overwrite a | |
| 47 | 47 | // property | |
| 48 | - process.env['cluster_test_overwrite'] = 'old'; | ||
| 48 | + process.env.cluster_test_overwrite = 'old'; | ||
| 49 | 49 | ||
| 50 | 50 | // Fork worker | |
| 51 | 51 | const worker = cluster.fork({ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments