diff --git a/.jshintrc b/.jshintrc index 959f0a5..e5934ae 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,16 +1,24 @@ { - "asi" : true, + "bitwise" : true, "boss" : true, "browser" : true, - "curly" : false, - "debug" : true, - "devel" : true, - "eqeqeq" : false, - "eqnull" : true, - "expr" : true, - "laxbreak" : true, - "laxcomma" : true, - "multistr" : true, - "supernew" : true, - "validthis" : true + "camelcase" : true, + "curly" : true, + "eqeqeq" : true, + "es3" : true, + "forin" : true, + "freeze" : true, + "immed" : true, + "indent" : 2, + "latedef" : true, + "newcap" : true, + "noarg" : true, + "noempty" : true, + "nonbsp" : true, + "nonew" : true, + "quotmark" : "single", + "undef" : true, + "unused" : true, + "strict" : true, + "trailing" : true } diff --git a/Gruntfile.js b/Gruntfile.js index 306b1cb..0c62e9d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,23 +1,23 @@ /* jshint node: true */ module.exports = function(grunt) { - "use strict"; + 'use strict'; grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - jshint: { - all: [ - "*.js", - "spec/*.js" - ], - options: { - jshintrc: '.jshintrc' - } - }, - jasmine: { - src: "method-proxy.js", - options: { - specs: "spec/**/*.js" + pkg: grunt.file.readJSON('package.json'), + jshint: { + all: [ + '*.js', + 'spec/*.js' + ], + options: { + jshintrc: '.jshintrc' + } + }, + jasmine: { + src: 'method-proxy.js', + options: { + specs: 'spec/**/*.js' } } }); diff --git a/method-proxy.js b/method-proxy.js index 9172888..63e785f 100644 --- a/method-proxy.js +++ b/method-proxy.js @@ -1,4 +1,6 @@ -var MethodProxy = function(object, queue) { +window.MethodProxy = function(object, queue) { + 'use strict'; + this.init = function(object, queue) { var item; diff --git a/spec/method-proxy.js b/spec/method-proxy.js index 32f4ba5..cc2584c 100644 --- a/spec/method-proxy.js +++ b/spec/method-proxy.js @@ -1,4 +1,14 @@ +/* global MethodProxy:false */ +/* global describe:false */ +/* global it:false */ +/* global beforeEach:false */ +/* global spyOn:false */ +/* global expect:false */ describe('MethodProxy', function() { + 'use strict'; + + var FB, FBMethodProxy; + beforeEach(function() { FB = { aMethod : function() {}, @@ -54,7 +64,7 @@ describe('MethodProxy', function() { spyOn(FB, 'aMethod'); spyOn(FB.anObject, 'anotherMethod'); - new MethodProxy(FB, queue); + queue = new MethodProxy(FB, queue); expect(FB.aMethod).toHaveBeenCalledWith('my argument'); expect(FB.anObject.anotherMethod) .toHaveBeenCalledWith('my other argument', 'one more');