Merged
Conversation
Mugen87
requested changes
Feb 5, 2017
src/core/Clock.js
Outdated
| start: function () { | ||
|
|
||
| this.startTime = ( performance || Date ).now(); | ||
| this.startTime = ( typeof performance === 'undefined' ? Date : performance ).now(); |
Collaborator
There was a problem hiding this comment.
Can you please add a comment in the respective lines? Something like // see #10732
Collaborator
|
I don't now why, but the format of the comment looks strange. Maybe like this? 😉 this.startTime = ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732 |
Contributor
Author
|
@Mugen87 I added this one first, then looked to other comments to follow your code style and moved to line before, lol. Will update that again now |
Contributor
Author
|
@Mugen87 I reimplemented that commit. See now |
Contributor
Author
Collaborator
|
Looks good! |
Contributor
Author
Contributor
Author
Contributor
Author
|
Or should i close it? |
Collaborator
|
It's still a valid PR but I'm unable to merge. Let's wait what @mrdoob says... |
Owner
|
Looks good indeed! (Sorry for the delay!) |
Owner
|
Thanks! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is based on issue #8112
Current usage of
( performance || Date ).now()breaks node.js with the following error:I suggest the use of
( typeof performance === 'undefined' ? Date : performance ).now(). It works in node.js environment as expected.