Skip to content

Commit

Permalink
add jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
jneen committed Jul 2, 2012
1 parent 98aef1c commit ccaa2a6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .jshintrc
@@ -0,0 +1,3 @@
{
"trailing": true
}
7 changes: 6 additions & 1 deletion Makefile
Expand Up @@ -39,11 +39,16 @@ report: $(UGLY)


# -*- testing -*- # # -*- testing -*- #
MOCHA ?= mocha MOCHA ?= mocha
JSHINT ?= jshint
TESTS = ./test/*.test.js TESTS = ./test/*.test.js
.PHONY: test .PHONY: test
test: $(COMMONJS) test: jshint $(COMMONJS)
$(MOCHA) $(TESTS) $(MOCHA) $(TESTS)


.PHONY: jshint
jshint:
$(JSHINT) $(SRC)

# -*- packaging -*- # # -*- packaging -*- #


# XXX this is kind of awful, but hey, it keeps the version info in the right place. # XXX this is kind of awful, but hey, it keeps the version info in the right place.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -10,7 +10,8 @@
"main": "index.js", "main": "index.js",
"devDependencies": { "devDependencies": {
"mocha": "*", "mocha": "*",
"uglify-js": "*" "uglify-js": "*",
"jshint": "*"
}, },
"scripts": { "scripts": {
"install": "make commonjs", "install": "make commonjs",
Expand Down
8 changes: 4 additions & 4 deletions src/p.js
@@ -1,4 +1,4 @@
var P = (function(prototype, hasOwnProperty, undefined) { var P = (function(prototype, ownProperty, undefined) {
// helper functions that also help minification // helper functions that also help minification
function isObject(o) { return typeof o === 'object'; } function isObject(o) { return typeof o === 'object'; }
function isFunction(f) { return typeof f === 'function'; } function isFunction(f) { return typeof f === 'function'; }
Expand Down Expand Up @@ -46,7 +46,7 @@ var P = (function(prototype, hasOwnProperty, undefined) {
// set up the prototype of the new class // set up the prototype of the new class
// note that this resolves to `new Object` // note that this resolves to `new Object`
// if the superclass isn't given // if the superclass isn't given
var proto = C[prototype] = new _superclass; var proto = C[prototype] = new _superclass();
var _super = _superclass[prototype]; var _super = _superclass[prototype];
var extensions; var extensions;


Expand All @@ -66,7 +66,7 @@ var P = (function(prototype, hasOwnProperty, undefined) {
// ...and extend it // ...and extend it
if (isObject(extensions)) { if (isObject(extensions)) {
for (var ext in extensions) { for (var ext in extensions) {
if (hasOwnProperty.call(extensions, ext)) { if (ownProperty.call(extensions, ext)) {
proto[ext] = extensions[ext]; proto[ext] = extensions[ext];
} }
} }
Expand All @@ -79,7 +79,7 @@ var P = (function(prototype, hasOwnProperty, undefined) {
} }


return C; return C;
} };


// set the constructor property, for convenience // set the constructor property, for convenience
proto.constructor = C; proto.constructor = C;
Expand Down

0 comments on commit ccaa2a6

Please sign in to comment.