Skip to content

Commit

Permalink
Merge pull request #88 from ember-cli/enforce-coding-standards
Browse files Browse the repository at this point in the history
Enforce coding standards
  • Loading branch information
ef4 authored Jun 23, 2016
2 parents e3bd05f + 3a4b7e0 commit 094c05d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
13 changes: 5 additions & 8 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@
"expect",
"ok",
"throws",
"define",
"loader",
"require",
"requirejs",
"test",
"-Promise"
"-Promise",
"module"
],
"expr": true,
"proto": true,
"strict": true,
"indent": 2,
"camelcase": true,
"node": true,
"browser": false,
"camelcase": false,
"node": false,
"browser": true,
"boss": true,
"curly": true,
"latedef": "nofunc",
Expand Down
7 changes: 4 additions & 3 deletions lib/loader/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ var loader, define, requireModule, require, requirejs;
(function(global) {
'use strict';

var stats;

// Save off the original values of these globals, so we can restore them if someone asks us to
var oldGlobals = {
loader: loader,
Expand Down Expand Up @@ -40,7 +42,6 @@ var loader, define, requireModule, require, requirejs;
requirejs._stats = stats;
}

var stats;

resetStats();

Expand Down Expand Up @@ -132,7 +133,7 @@ var loader, define, requireModule, require, requirejs;
this.finalized = false;
this._foundDeps = false;
this.isPending = false;
this.module = { exports: {}};
this.module = { exports: {} };
};

Module.prototype.reify = function() {
Expand Down Expand Up @@ -179,7 +180,7 @@ var loader, define, requireModule, require, requirejs;
r['default'] = r;
r.has = function(dep) {
return has(resolve(dep, name));
}
};
return r;
};

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"dependencies": {},
"devDependencies": {
"ara": "0.0.3",
"jscs": "^2.11.0",
"jshint": "^2.9.2",
"ora": "^0.2.1",
"promise-map-series": "^0.2.2",
"qunitjs": "^1.20.0",
"testem": "^1.0.0"
},
"scripts": {
"test": "testem ci",
"test": "testem ci && jshint lib tests && jscs lib tests",
"test:dev": "testem"
},
"author": "",
Expand Down
23 changes: 12 additions & 11 deletions tests/all.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*globals newDefine:false, newLoader:false, newRequire:false*/
/*globals define:true, loader:true, require:true*/
/*globals define:true, loader:true, require:true, requirejs:true */
/* jshint -W097 */

'use strict';

Expand Down Expand Up @@ -460,7 +461,7 @@ test('already evaluated modules are not pushed into the queue', function() {
};
});

var bar = require('bar');
require('bar');
deepEqual(require._stats, {
findDeps: 2,
define: 2,
Expand All @@ -474,7 +475,7 @@ test('already evaluated modules are not pushed into the queue', function() {
pendingQueueLength: 2
});

var foo = require('foo');
require('foo');
deepEqual(require._stats, {
findDeps: 2,
define: 2,
Expand Down Expand Up @@ -502,7 +503,7 @@ test('same pending modules should not be pushed to the queue more than once', fu
};
});

var bar = require('bar');
require('bar');
deepEqual(require._stats, {
findDeps: 2,
define: 2,
Expand All @@ -515,7 +516,7 @@ test('same pending modules should not be pushed to the queue more than once', fu
resolveRelative: 0,
pendingQueueLength: 2
});
})
});

test('basic CJS mode', function() {
define('a/foo', ['require', 'exports', 'module'], function(require, exports, module) {
Expand Down Expand Up @@ -1051,7 +1052,7 @@ test('alias with target \w deps', function() {
return bar;
});

define('bar', [], function(bar) {
define('bar', [], function() {
return 'I AM BAR';
});

Expand All @@ -1074,7 +1075,7 @@ test('alias with target \w deps', function() {
});

test('alias chain (simple)', function() {
define('bar', [], function(bar) {
define('bar', [], function() {
return 'I AM BAR';
});

Expand All @@ -1098,7 +1099,7 @@ test('alias chain (simple)', function() {
});

test('alias chain (long)', function() {
define('bar', [], function(bar) {
define('bar', [], function() {
return 'I AM BAR';
});

Expand All @@ -1124,11 +1125,11 @@ test('alias chain (long)', function() {
});

test('alias chains are lazy', function() {
define('bar', [], function(bar) {
define('bar', [], function() {
return 'I AM BAR';
});

define('bar2', [], function(bar) {
define('bar2', [], function() {
return 'I AM BAR2';
});

Expand Down Expand Up @@ -1162,7 +1163,7 @@ test('alias chains are lazy', function() {
test('alias chains propogate unsee', function() {
var counter = 0;

define('bar', [], function(bar) {
define('bar', [], function() {
counter++;
return 'I AM BAR';
});
Expand Down

0 comments on commit 094c05d

Please # to comment.