New JavaScript CharStreams functions#1776
Merged
parrt merged 1 commit intoantlr:masterfrom Mar 29, 2017
Merged
Conversation
Member
|
@ericvergnaud analogous to Java, C# |
| // | ||
| // Invokes onload(result) on success, onerror(error) on | ||
| // failure. | ||
| fromBlob: function(blob, encoding, onload, onerror) { |
Contributor
There was a problem hiding this comment.
can we use camel case for onload and onerror?
Contributor
Author
|
Sure, will change to camel case. I was just copying the signature of
FileLoader.
…On Tue, Mar 21, 2017, 10:21 AM ericvergnaud ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In runtime/JavaScript/src/antlr4/CharStreams.js
<#1776 (comment)>:
> +// All returned InputStreams support the full range of Unicode
+// up to U+10FFFF (the default behavior of InputStream only supports
+// code points up to U+FFFF).
+var CharStreams = {
+ // Creates an InputStream from a string.
+ fromString: function(str) {
+ return InputStream(str, true);
+ },
+
+ // Asynchronously creates an InputStream from a blob given the
+ // encoding of the bytes in that blob (defaults to 'utf8' if
+ // encoding is null).
+ //
+ // Invokes onload(result) on success, onerror(error) on
+ // failure.
+ fromBlob: function(blob, encoding, onload, onerror) {
can we use camel case for onload and onerror?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1776 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApAU8yfCQyHj29zwN1GnTW0NTWc8eujks5rn_kKgaJpZM4Mi92a>
.
|
07238c8 to
f72e225
Compare
Contributor
Author
|
OK, changed to camelCase. |
Member
|
@bhamiltoncx are these consistent now with our tweaks to the Java stream API? |
Contributor
Author
|
Yep, all consistent (again, other than lacking a perf pass so we don't yet take a size). |
Member
|
As it looks like @ericvergnaud did not have any serious objections, I'm merging. |
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.
Based on the discussion at #1771 (comment) , this brings the Java runtime's
CharStreamsfactory API to JavaScript.I updated
BaseBrowserTestto illustrate usage of the new API.