forked from Leaflet/Leaflet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jshinting and major clean up of specs code, ref Leaflet#2151
- Loading branch information
Showing
28 changed files
with
327 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"browser": true, | ||
"node": true, | ||
"predef": ["define", "L", "expect", "describe", "it", "sinon", "happen", "beforeEach", "afterEach"], | ||
"strict": false, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"forin": false, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"undef": true, | ||
// "unused": true, | ||
// "quotmark": "single", | ||
"indent": 4, | ||
"trailing": true, | ||
"white": true, | ||
"smarttabs": true | ||
// "maxlen": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
function noSpecs() { | ||
xit('has no specs'); | ||
} | ||
|
||
if (!Array.prototype.map) { | ||
Array.prototype.map = function(fun /*, thisp */) { | ||
"use strict"; | ||
Array.prototype.map = function (fun /*, thisp */) { | ||
"use strict"; | ||
|
||
if (this === void 0 || this === null) | ||
throw new TypeError(); | ||
if (this === void 0 || this === null) { | ||
throw new TypeError(); | ||
} | ||
|
||
var t = Object(this); | ||
var len = t.length >>> 0; | ||
if (typeof fun !== "function") | ||
throw new TypeError(); | ||
var t = Object(this); | ||
// jshint bitwise: false | ||
var len = t.length >>> 0; | ||
if (typeof fun !== "function") { | ||
throw new TypeError(); | ||
} | ||
|
||
var res = new Array(len); | ||
var thisp = arguments[1]; | ||
for (var i = 0; i < len; i++) { | ||
if (i in t) | ||
res[i] = fun.call(thisp, t[i], i, t); | ||
} | ||
var res = new Array(len); | ||
var thisp = arguments[1]; | ||
for (var i = 0; i < len; i++) { | ||
if (i in t) { | ||
res[i] = fun.call(thisp, t[i], i, t); | ||
} | ||
} | ||
|
||
return res; | ||
}; | ||
return res; | ||
}; | ||
} | ||
|
||
expect.Assertion.prototype.near = function(expected, delta) { | ||
delta = delta || 1; | ||
expect(this.obj.x).to | ||
.be.within(expected.x - delta, expected.x + delta); | ||
expect(this.obj.y).to | ||
.be.within(expected.y - delta, expected.y + delta); | ||
expect.Assertion.prototype.near = function (expected, delta) { | ||
delta = delta || 1; | ||
expect(this.obj.x).to | ||
.be.within(expected.x - delta, expected.x + delta); | ||
expect(this.obj.y).to | ||
.be.within(expected.y - delta, expected.y + delta); | ||
}; | ||
|
||
expect.Assertion.prototype.nearLatLng = function(expected, delta) { | ||
delta = delta || 1e-4; | ||
expect(this.obj.lat).to | ||
.be.within(expected.lat - delta, expected.lat + delta); | ||
expect(this.obj.lng).to | ||
.be.within(expected.lng - delta, expected.lng + delta); | ||
}; | ||
expect.Assertion.prototype.nearLatLng = function (expected, delta) { | ||
delta = delta || 1e-4; | ||
expect(this.obj.lat).to | ||
.be.within(expected.lat - delta, expected.lat + delta); | ||
expect(this.obj.lng).to | ||
.be.within(expected.lng - delta, expected.lng + delta); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.