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.
If this is primarily for binaryen, could this be done there instead?
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.
I believe it is not possible to pass additional arguments like externs to Closure Compiler externally, at least not right now. Also Binaryen is tightly related project.
However, allowing external arguments to Closure Compiler would be useful in general if someone can implement it.
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.
Thanks, I see.
Let's leave this as it is, then. Also I think
define
is from AMD, so it could help other things too, so makes sense to do it here.lgtm, just waiting to merge on your ping to @dcodeIO.
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.
Makes sense to me to have
define
being declared. For instance,wabt.js
has a very similar wrapper that will benefit from this.Ideally, binaryen.js would have its own specific externs. That would also remove the necessity to use
[' ... ']
everywhere to prevent renaming. But that's another story, of course.