Provide standalone ParseScript wrapper - #7969
Closed
annevk wants to merge 1 commit into
Closed
Conversation
Member
|
Hmm, I think having Fetch call ParseScript directly seems better. Although I understand the instinct, the part where you basically have an optional argument that takes you down the HTML-path or the Fetch-path makes this feel like not a very worthwhile wrapper. |
Member
Author
Member
|
IMO it's kind of undesired to pass undefined for the realm argument to ParseScript, even though technically it is just a pass-through. So that's why I like ParseText. |
Contributor
|
ParseScript just invokes ParseText(x, |Script|) and wraps up a couple values into a record, so if you don't want the "construct a record" part it makes more sense invoke ParseText directly, IMO. |
Member
Author
|
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.
For use by whatwg/fetch#1442.
Writing this up made me consider again whether we can pull in some of the encoding aspects as previously discussed, but I couldn't find a way that works well for all callers of "create a classic script". The main benefit of taking this PR would be that if JavaScript ever changes how this works, we only have to update HTML. Although if the return type changes I suppose we still need to update Fetch...
/webappapis.html ( diff )