forked from patefacio/json_schema
-
Notifications
You must be signed in to change notification settings - Fork 39
CPLAT-17467 Remove usages of .slice to work around a dart2js compiler bug #145
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
6 commits
Select commit
Hold shift + click to select a range
8fbb4a0
Try removing usages of .slice to work around a dart2js compiler bug
greglittlefield-wf e43a07f
Format
greglittlefield-wf 08dc1e0
Fix indices to get unit tests to pass. I don't actually understand wh…
tonybathgate-wk 12bd23a
remove unnecessary sublist call
tonybathgate-wk e518595
revert a format change? idk why my dart format command works differently
tonybathgate-wk 79d1318
update comment to match List type
tonybathgate-wk 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -595,7 +595,7 @@ class JsonSchema { | |
// Follow JSON Pointer path of fragments if provided. | ||
if (pathUri.fragment.isNotEmpty) { | ||
final List<String> fragments = Uri.parse(pathUri.fragment).pathSegments; | ||
final foundSchema = _recursiveResolvePath(pathUri, fragments.slice(0), baseSchema, refsEncountered); | ||
final foundSchema = _recursiveResolvePath(pathUri, fragments, baseSchema, refsEncountered); | ||
_memomizedResults[currentPair] = foundSchema; | ||
return foundSchema; | ||
} | ||
|
@@ -607,7 +607,7 @@ class JsonSchema { | |
// When there are 2 possible path to be resolve, traverse both paths. | ||
JsonSchema _resolveParallelPaths( | ||
Uri pathUri, // The path being resolved | ||
ListSlice<String> fragments, // A slice of fragments being traversed. | ||
List<String> fragments, // A slice of fragments being traversed. | ||
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. nit: is this comment out of date now? |
||
JsonSchema schemaWithRef, // A JsonSchema containing a ref. | ||
Set<Uri> refsEncountered, // Refs encountered from schemaWithRef | ||
) { | ||
|
@@ -667,7 +667,7 @@ class JsonSchema { | |
} | ||
|
||
JsonSchema _recursiveResolvePath( | ||
Uri pathUri, ListSlice<String> fragments, JsonSchema baseSchema, Set<Uri> refsEncountered, | ||
Uri pathUri, List<String> fragments, JsonSchema baseSchema, Set<Uri> refsEncountered, | ||
{bool skipInitialRefCheck = false}) { | ||
// Set of properties that are ignored when set beside a `$ref`. | ||
final Set<String> consts = Set.of([r'$id', r'$schema', r'$comment']); | ||
|
@@ -762,7 +762,7 @@ class JsonSchema { | |
// If currentSchema has additional values, then traverse both paths to find the result. | ||
if (i + 1 < fragments.length && currentSchema._schemaMap.keys.toSet().difference(consts).length > 1) { | ||
return _resolveParallelPaths( | ||
pathUri, fragments.slice(i, fragments.length - 1), currentSchema, refsEncountered); | ||
pathUri, fragments.sublist(i, fragments.length - 1), currentSchema, refsEncountered); | ||
} | ||
|
||
currentSchema = _resolveSchemaWithAccounting(pathUri, currentSchema, refsEncountered); | ||
|
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.
nit: is this comment out of date now?