| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent de63698 commit db61c95
806 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../../common'); | |
| 3 | - var assert = require('assert'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | 4 | const binding = require(`./build/${common.buildType}/binding`); | |
| 5 | 5 | ||
| 6 | 6 | binding(5, common.mustCall(function(err, val) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,8 +5,8 @@ const common = require('../../common'); | |||
| 5 | 5 | const binding = require(`./build/${common.buildType}/binding`); | |
| 6 | 6 | ||
| 7 | 7 | function check(size, alignment, offset) { | |
| 8 | - var buf = binding.alloc(size, alignment, offset); | ||
| 9 | - var slice = buf.slice(size >>> 1); | ||
| 8 | + let buf = binding.alloc(size, alignment, offset); | ||
| 9 | + let slice = buf.slice(size >>> 1); | ||
| 10 | 10 | ||
| 11 | 11 | buf = null; | |
| 12 | 12 | binding.check(slice); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../../common'); | |
| 3 | - var assert = require('assert'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | 4 | const binding = require(`./build/${common.buildType}/binding`); | |
| 5 | 5 | assert.strictEqual(binding(), 'world'); | |
| 6 | 6 | console.log('binding.hello() =', binding()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../../common'); | |
| 3 | - var assert = require('assert'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | 4 | const binding = require(`./build/${common.buildType}/binding`); | |
| 5 | 5 | assert.strictEqual(binding.hello(), 'world'); | |
| 6 | 6 | console.log('binding.hello() =', binding.hello()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,9 +14,9 @@ common.refreshTmpDir(); | |||
| 14 | 14 | // make a path that is more than 260 chars long. | |
| 15 | 15 | // Any given folder cannot have a name longer than 260 characters, | |
| 16 | 16 | // so create 10 nested folders each with 30 character long names. | |
| 17 | - var addonDestinationDir = path.resolve(common.tmpDir); | ||
| 17 | + let addonDestinationDir = path.resolve(common.tmpDir); | ||
| 18 | 18 | ||
| 19 | - for (var i = 0; i < 10; i++) { | ||
| 19 | + for (let i = 0; i < 10; i++) { | ||
| 20 | 20 | addonDestinationDir = path.join(addonDestinationDir, 'x'.repeat(30)); | |
| 21 | 21 | fs.mkdirSync(addonDestinationDir); | |
| 22 | 22 | } | |
@@ -28,10 +28,10 @@ const addonPath = path.join(__dirname, | |||
| 28 | 28 | const addonDestinationPath = path.join(addonDestinationDir, 'binding.node'); | |
| 29 | 29 | ||
| 30 | 30 | // Copy binary to long path destination | |
| 31 | - var contents = fs.readFileSync(addonPath); | ||
| 31 | + const contents = fs.readFileSync(addonPath); | ||
| 32 | 32 | fs.writeFileSync(addonDestinationPath, contents); | |
| 33 | 33 | ||
| 34 | 34 | // Attempt to load at long path destination | |
| 35 | - var addon = require(addonDestinationPath); | ||
| 35 | + const addon = require(addonDestinationPath); | ||
| 36 | 36 | assert.notEqual(addon, null); | |
| 37 | 37 | assert.strictEqual(addon.hello(), 'world'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,7 @@ assert.throws(function() { | |||
| 65 | 65 | results.push(2); | |
| 66 | 66 | ||
| 67 | 67 | setImmediate(common.mustCall(function() { | |
| 68 | - for (var i = 0; i < results.length; i++) { | ||
| 68 | + for (let i = 0; i < results.length; i++) { | ||
| 69 | 69 | assert.strictEqual(results[i], i, | |
| 70 | 70 | `verifyExecutionOrder(${arg}) results: ${results}`); | |
| 71 | 71 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,30 +1,30 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - var common = require('../../common'); | ||
| 3 | - var assert = require('assert'); | ||
| 4 | - var repl = require('repl'); | ||
| 5 | - var stream = require('stream'); | ||
| 6 | - var path = require('path'); | ||
| 7 | - var buildType = process.config.target_defaults.default_configuration; | ||
| 8 | - var buildPath = path.join(__dirname, 'build', buildType, 'binding'); | ||
| 2 | + const common = require('../../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const repl = require('repl'); | ||
| 5 | + const stream = require('stream'); | ||
| 6 | + const path = require('path'); | ||
| 7 | + const buildType = process.config.target_defaults.default_configuration; | ||
| 8 | + let buildPath = path.join(__dirname, 'build', buildType, 'binding'); | ||
| 9 | 9 | // On Windows, escape backslashes in the path before passing it to REPL. | |
| 10 | 10 | if (common.isWindows) | |
| 11 | 11 | buildPath = buildPath.replace(/\\/g, '/'); | |
| 12 | - var cb_ran = false; | ||
| 12 | + let cb_ran = false; | ||
| 13 | 13 | ||
| 14 | 14 | process.on('exit', function() { | |
| 15 | 15 | assert(cb_ran); | |
| 16 | 16 | console.log('ok'); | |
| 17 | 17 | }); | |
| 18 | 18 | ||
| 19 | - var lines = [ | ||
| 19 | + const lines = [ | ||
| 20 | 20 | // This line shouldn't cause an assertion error. | |
| 21 | 21 | 'require(\'' + buildPath + '\')' + | |
| 22 | 22 | // Log output to double check callback ran. | |
| 23 | 23 | '.method(function() { console.log(\'cb_ran\'); });', | |
| 24 | 24 | ]; | |
| 25 | 25 | ||
| 26 | - var dInput = new stream.Readable(); | ||
| 27 | - var dOutput = new stream.Writable(); | ||
| 26 | + const dInput = new stream.Readable(); | ||
| 27 | + const dOutput = new stream.Writable(); | ||
| 28 | 28 | ||
| 29 | 29 | dInput._read = function _read(size) { | |
| 30 | 30 | while (lines.length > 0 && this.push(lines.shift())); | |
@@ -38,7 +38,7 @@ dOutput._write = function _write(chunk, encoding, cb) { | |||
| 38 | 38 | cb(); | |
| 39 | 39 | }; | |
| 40 | 40 | ||
| 41 | - var options = { | ||
| 41 | + const options = { | ||
| 42 | 42 | input: dInput, | |
| 43 | 43 | output: dOutput, | |
| 44 | 44 | terminal: false, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) { | |||
| 14 | 14 | return; | |
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | + let buf; | ||
| 17 | 18 | try { | |
| 18 | - var buf = Buffer.allocUnsafe(kStringMaxLength); | ||
| 19 | + buf = Buffer.allocUnsafe(kStringMaxLength); | ||
| 19 | 20 | } catch (e) { | |
| 20 | 21 | // If the exception is not due to memory confinement then rethrow it. | |
| 21 | 22 | if (e.message !== 'Array buffer allocation failed') throw (e); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) { | |||
| 14 | 14 | // v8::String::kMaxLength defined in v8.h | |
| 15 | 15 | const kStringMaxLength = process.binding('buffer').kStringMaxLength; | |
| 16 | 16 | ||
| 17 | + let buf; | ||
| 17 | 18 | try { | |
| 18 | - var buf = Buffer.allocUnsafe(kStringMaxLength + 1); | ||
| 19 | + buf = Buffer.allocUnsafe(kStringMaxLength + 1); | ||
| 19 | 20 | } catch (e) { | |
| 20 | 21 | // If the exception is not due to memory confinement then rethrow it. | |
| 21 | 22 | if (e.message !== 'Array buffer allocation failed') throw (e); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) { | |||
| 14 | 14 | // v8::String::kMaxLength defined in v8.h | |
| 15 | 15 | const kStringMaxLength = process.binding('buffer').kStringMaxLength; | |
| 16 | 16 | ||
| 17 | + let buf; | ||
| 17 | 18 | try { | |
| 18 | - var buf = Buffer.allocUnsafe(kStringMaxLength + 1); | ||
| 19 | + buf = Buffer.allocUnsafe(kStringMaxLength + 1); | ||
| 19 | 20 | } catch (e) { | |
| 20 | 21 | // If the exception is not due to memory confinement then rethrow it. | |
| 21 | 22 | if (e.message !== 'Array buffer allocation failed') throw (e); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments