Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add jshint

  • Loading branch information...
commit ccaa2a6d50a275180dd55c3fc5dad3df98f29a20 1 parent 98aef1c
@jneen authored
Showing with 15 additions and 6 deletions.
  1. +3 −0  .jshintrc
  2. +6 −1 Makefile
  3. +2 −1  package.json
  4. +4 −4 src/p.js
View
3  .jshintrc
@@ -0,0 +1,3 @@
+{
+ "trailing": true
+}
View
7 Makefile
@@ -39,11 +39,16 @@ report: $(UGLY)
# -*- testing -*- #
MOCHA ?= mocha
+JSHINT ?= jshint
TESTS = ./test/*.test.js
.PHONY: test
-test: $(COMMONJS)
+test: jshint $(COMMONJS)
$(MOCHA) $(TESTS)
+.PHONY: jshint
+jshint:
+ $(JSHINT) $(SRC)
+
# -*- packaging -*- #
# XXX this is kind of awful, but hey, it keeps the version info in the right place.
View
3  package.json
@@ -10,7 +10,8 @@
"main": "index.js",
"devDependencies": {
"mocha": "*",
- "uglify-js": "*"
+ "uglify-js": "*",
+ "jshint": "*"
},
"scripts": {
"install": "make commonjs",
View
8 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
function isObject(o) { return typeof o === 'object'; }
function isFunction(f) { return typeof f === 'function'; }
@@ -46,7 +46,7 @@ var P = (function(prototype, hasOwnProperty, undefined) {
// set up the prototype of the new class
// note that this resolves to `new Object`
// if the superclass isn't given
- var proto = C[prototype] = new _superclass;
+ var proto = C[prototype] = new _superclass();
var _super = _superclass[prototype];
var extensions;
@@ -66,7 +66,7 @@ var P = (function(prototype, hasOwnProperty, undefined) {
// ...and extend it
if (isObject(extensions)) {
for (var ext in extensions) {
- if (hasOwnProperty.call(extensions, ext)) {
+ if (ownProperty.call(extensions, ext)) {
proto[ext] = extensions[ext];
}
}
@@ -79,7 +79,7 @@ var P = (function(prototype, hasOwnProperty, undefined) {
}
return C;
- }
+ };
// set the constructor property, for convenience
proto.constructor = C;
Please sign in to comment.
Something went wrong with that request. Please try again.