[Pkg-javascript-commits] [node-inherits] 05/08: New upstream version 2.0.3
Jérémy Lal
kapouer at moszumanska.debian.org
Thu Nov 17 22:00:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
kapouer pushed a commit to branch master
in repository node-inherits.
commit d02c40656089675b9639a9fd2ae3cdff04c729c7
Author: Jérémy Lal <kapouer at melix.org>
Date: Thu Nov 17 22:33:27 2016 +0100
New upstream version 2.0.3
---
.travis.yml | 7 +++++++
inherits.js | 8 +++++++-
package.json | 11 +++++++++--
test.js | 16 ++++++++--------
4 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..c070d37
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,7 @@
+sudo: false
+language: node_js
+node_js:
+ - '0.10'
+ - '4'
+ - '5'
+ - '6'
diff --git a/inherits.js b/inherits.js
index 29f5e24..3b94763 100644
--- a/inherits.js
+++ b/inherits.js
@@ -1 +1,7 @@
-module.exports = require('util').inherits
+try {
+ var util = require('util');
+ if (typeof util.inherits !== 'function') throw '';
+ module.exports = util.inherits;
+} catch (e) {
+ module.exports = require('./inherits_browser.js');
+}
diff --git a/package.json b/package.json
index 0e36965..7cf62b9 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "inherits",
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
- "version": "2.0.1",
+ "version": "2.0.3",
"keywords": [
"inheritance",
"class",
@@ -18,5 +18,12 @@
"license": "ISC",
"scripts": {
"test": "node test"
- }
+ },
+ "devDependencies": {
+ "tap": "^7.1.0"
+ },
+ "files": [
+ "inherits.js",
+ "inherits_browser.js"
+ ]
}
diff --git a/test.js b/test.js
index fc53012..1716ea4 100644
--- a/test.js
+++ b/test.js
@@ -1,13 +1,13 @@
var inherits = require('./inherits.js')
-var assert = require('assert')
+var t = require('tap')
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)
+ t.equal(c.constructor, Child)
+ t.equal(c.constructor.super_, Parent)
+ t.equal(Object.getPrototypeOf(c), Child.prototype)
+ t.equal(Object.getPrototypeOf(Object.getPrototypeOf(c)), Parent.prototype)
+ t.isa(c, Child)
+ t.isa(c, Parent)
}
function Child() {
@@ -22,4 +22,4 @@ inherits(Child, Parent)
var c = new Child
test(c)
-console.log('ok')
+t.isa(inherits, 'function')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-inherits.git
More information about the Pkg-javascript-commits
mailing list