Skip to content

Commit

Permalink
Using "function (" consistently, rather than "function(".
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 25, 2014
1 parent 98eeb67 commit b59c517
Show file tree
Hide file tree
Showing 19 changed files with 643 additions and 643 deletions.
8 changes: 4 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function(grunt) {
module.exports = function (grunt) {
var browsers = [
{ browserName: "firefox", version: "19", platform: "XP" },
{ browserName: "firefox", platform: "linux" },
Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = function(grunt) {
'saucelabs-mocha': {
all: {
options: {
urls: (function() {
urls: (function () {
var urls = ["http://localhost:9999/test/"];
if (grunt.option('extra')) {
urls.push("http://localhost:9999/test-sham/");
Expand All @@ -58,7 +58,7 @@ module.exports = function(grunt) {
},
//concurrency: 3,
browsers: browsers,
testname: (function() {
testname: (function () {
var testname = "mocha";
if (process.env.TRAVIS_PULL_REQUEST &&
process.env.TRAVIS_PULL_REQUEST !== 'false') {
Expand All @@ -70,7 +70,7 @@ module.exports = function(grunt) {
}
return testname;
})(),
tags: (function() {
tags: (function () {
var tags = [];
if (process.env.TRAVIS_PULL_REQUEST &&
process.env.TRAVIS_PULL_REQUEST !== 'false') {
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ Number.isInteger(2.4) // false.

Math.sign(400) // 1, 0 or -1 depending on sign. In this case 1.

[5, 10, 15, 10].find(function(item) {return item / 2 === 5;}) // 10
[5, 10, 15, 10].findIndex(function(item) {return item / 2 === 5;}) // 1
[5, 10, 15, 10].find(function (item) {return item / 2 === 5;}) // 10
[5, 10, 15, 10].findIndex(function (item) {return item / 2 === 5;}) // 1

// Replacement for `{}` key-value storage.
// Keys can be anything.
Expand All @@ -166,11 +166,11 @@ set.delete(5)
// Promises, see
// http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript
// https://github.com/petkaantonov/bluebird/#what-are-promises-and-why-should-i-use-them
Promise.resolve(5).then(function(value) {
Promise.resolve(5).then(function (value) {
if ( ... ) throw new Error("whoops!");
// do some stuff
return anotherPromise();
}).catch(function(e) {
}).catch(function (e) {
// any errors thrown asynchronously end up here
});
```
Expand Down

0 comments on commit b59c517

Please sign in to comment.