diff options
Diffstat (limited to 'tools/eslint/node_modules/concat-stream/node_modules/inherits/test.js')
-rw-r--r-- | tools/eslint/node_modules/concat-stream/node_modules/inherits/test.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/inherits/test.js b/tools/eslint/node_modules/concat-stream/node_modules/inherits/test.js new file mode 100644 index 0000000000..fc53012d31 --- /dev/null +++ b/tools/eslint/node_modules/concat-stream/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') |