diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-03-19 13:43:24 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-03-25 01:45:38 +0100 |
commit | c1278e53293a49c925451987d906f7b00977f4d4 (patch) | |
tree | 054adb3c03e66719b02377011cdf3f0de225a962 /test/parallel/test-util-inherits.js | |
parent | c6b6c92185316e13738e6fa931fdd5303e381e46 (diff) | |
download | android-node-v8-c1278e53293a49c925451987d906f7b00977f4d4.tar.gz android-node-v8-c1278e53293a49c925451987d906f7b00977f4d4.tar.bz2 android-node-v8-c1278e53293a49c925451987d906f7b00977f4d4.zip |
lib,test: minor refactoring
This refactors a couple tests to have upper case first characters
in comments and to use `input` instead of `i`.
It also adds a few TODOs and rewrites a few lines to use default
arguments and to prevent function recreation when unnecessary.
PR-URL: https://github.com/nodejs/node/pull/19445
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-util-inherits.js')
-rw-r--r-- | test/parallel/test-util-inherits.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index 9d89022088..d37cb6bf8b 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -2,15 +2,15 @@ const common = require('../common'); const assert = require('assert'); -const inherits = require('util').inherits; +const { inherits } = require('util'); -// super constructor +// Super constructor function A() { this._a = 'a'; } A.prototype.a = function() { return this._a; }; -// one level of inheritance +// One level of inheritance function B(value) { A.call(this); this._b = value; @@ -25,7 +25,7 @@ assert.strictEqual(b.a(), 'a'); assert.strictEqual(b.b(), 'b'); assert.strictEqual(b.constructor, B); -// two levels of inheritance +// Two levels of inheritance function C() { B.call(this, 'b'); this._c = 'c'; @@ -40,7 +40,7 @@ const c = new C(); assert.strictEqual(c.getValue(), 'abc'); assert.strictEqual(c.constructor, C); -// inherits can be called after setting prototype properties +// Inherits can be called after setting prototype properties function D() { C.call(this); this._d = 'd'; |