-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[WIP] Remove usage of retainLines
#5594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2b8e256
Remove usage of `retainLines`
SimenB 0c1dd5c
update changelog
SimenB 8f9e54f
Move callsite to jest-util, add sourcemap support
rickhanlonii ab81892
This is a type
rickhanlonii 1189fe7
Merge remote-tracking branch 'upstream/master' into remove-retainlines
rickhanlonii 8e50d0f
Remove unused function moved to jest-util
rickhanlonii 6ad7202
Fix lint
rickhanlonii 6ec7b74
Minor clean `up
rickhanlonii 11948b8
Feedback updates
rickhanlonii 765f78a
fix flow violations and minimize diff
SimenB f0c6e08
add todo
SimenB d4b0600
Merge branch 'master' into remove-retainlines
SimenB 7ce154d
use sourcemaps in buffered console as well
SimenB 3f2ccb8
fix stupid typo
SimenB e73423d
Add unit tests for get_callsite
rickhanlonii 0a29175
Fix tests
rickhanlonii e7ccbc6
Merge remote-tracking branch 'upstream/master' into remove-retainlines
rickhanlonii 2e0e0a3
Merge branch 'master' into remove-retainlines
SimenB 736eb2b
move changelog entry
SimenB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix flow violations and minimize diff
- Loading branch information
commit 765f78a758ac7cdb41f1aba46344ca842ff23678
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,15 @@ | ||
| /** | ||
| * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @flow | ||
| */ | ||
|
|
||
| import type {SourceMapRegistry} from 'types/SourceMaps'; | ||
|
|
||
| import fs from 'fs'; | ||
| import fs from 'graceful-fs'; | ||
| import callsites from 'callsites'; | ||
| import {SourceMapConsumer} from 'source-map'; | ||
|
|
||
|
|
@@ -37,7 +46,7 @@ const addSourceMapConsumer = (callsite, consumer) => { | |
| }); | ||
| }; | ||
|
|
||
| export default (level: number, sourceMaps?: SourceMapRegistry) => { | ||
| export default (level: number, sourceMaps: ?SourceMapRegistry) => { | ||
| const levelAfterThisCall = level + 1; | ||
| const stack = callsites()[levelAfterThisCall]; | ||
| const sourceMapFileName = sourceMaps && sourceMaps[stack.getFileName()]; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either add a |
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rickhanlonii would you mind adding a couple of unit tests to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done