-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* const/let instead of var * classes * pass our own eslint checks
- Loading branch information
Showing
8 changed files
with
76 additions
and
77 deletions.
There are no files selected for viewing
36 changes: 18 additions & 18 deletions
36
lib/jasmine-core/example/node_example/lib/jasmine_examples/Player.js
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,24 +1,24 @@ | ||
function Player() { | ||
} | ||
Player.prototype.play = function(song) { | ||
this.currentlyPlayingSong = song; | ||
this.isPlaying = true; | ||
}; | ||
|
||
Player.prototype.pause = function() { | ||
this.isPlaying = false; | ||
}; | ||
class Player { | ||
play(song) { | ||
this.currentlyPlayingSong = song; | ||
this.isPlaying = true; | ||
} | ||
|
||
Player.prototype.resume = function() { | ||
if (this.isPlaying) { | ||
throw new Error("song is already playing"); | ||
pause() { | ||
this.isPlaying = false; | ||
} | ||
|
||
this.isPlaying = true; | ||
}; | ||
resume() { | ||
if (this.isPlaying) { | ||
throw new Error('song is already playing'); | ||
} | ||
|
||
Player.prototype.makeFavorite = function() { | ||
this.currentlyPlayingSong.persistFavoriteStatus(true); | ||
}; | ||
this.isPlaying = true; | ||
} | ||
|
||
makeFavorite() { | ||
this.currentlyPlayingSong.persistFavoriteStatus(true); | ||
} | ||
} | ||
|
||
module.exports = Player; |
11 changes: 5 additions & 6 deletions
11
lib/jasmine-core/example/node_example/lib/jasmine_examples/Song.js
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,9 +1,8 @@ | ||
function Song() { | ||
class Song { | ||
persistFavoriteStatus(value) { | ||
// something complicated | ||
throw new Error('not yet implemented'); | ||
} | ||
} | ||
|
||
Song.prototype.persistFavoriteStatus = function(value) { | ||
// something complicated | ||
throw new Error("not yet implemented"); | ||
}; | ||
|
||
module.exports = Song; |
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
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,22 +1,22 @@ | ||
function Player() { | ||
} | ||
Player.prototype.play = function(song) { | ||
this.currentlyPlayingSong = song; | ||
this.isPlaying = true; | ||
}; | ||
|
||
Player.prototype.pause = function() { | ||
this.isPlaying = false; | ||
}; | ||
class Player { | ||
play(song) { | ||
this.currentlyPlayingSong = song; | ||
this.isPlaying = true; | ||
} | ||
|
||
Player.prototype.resume = function() { | ||
if (this.isPlaying) { | ||
throw new Error("song is already playing"); | ||
pause() { | ||
this.isPlaying = false; | ||
} | ||
|
||
this.isPlaying = true; | ||
}; | ||
resume() { | ||
if (this.isPlaying) { | ||
throw new Error('song is already playing'); | ||
} | ||
|
||
Player.prototype.makeFavorite = function() { | ||
this.currentlyPlayingSong.persistFavoriteStatus(true); | ||
}; | ||
this.isPlaying = true; | ||
} | ||
|
||
makeFavorite() { | ||
this.currentlyPlayingSong.persistFavoriteStatus(true); | ||
} | ||
} |
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,7 +1,6 @@ | ||
function Song() { | ||
class Song { | ||
persistFavoriteStatus(value) { | ||
// something complicated | ||
throw new Error('not yet implemented'); | ||
} | ||
} | ||
|
||
Song.prototype.persistFavoriteStatus = function(value) { | ||
// something complicated | ||
throw new Error("not yet implemented"); | ||
}; |