Skip to content
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

Added AMD externs so that Binaryen builds fine #5748

Merged
merged 1 commit into from
Nov 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/closure-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,3 +1100,10 @@ var GL;
* @suppress {undefinedVars}
*/
var SDL;

// Module loaders externs, primarily for Binaryen
Copy link
Member

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?

Copy link
Contributor Author

@nazar-pc nazar-pc Nov 8, 2017

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.

Copy link
Member

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.

Copy link
Contributor

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.


/**
* @param {Function} wrapper
*/
var define = function (wrapper) {};