Skip to content

Conversation

@sjrd
Copy link
Member

@sjrd sjrd commented Dec 19, 2016

No description provided.

@sjrd
Copy link
Member Author

sjrd commented Dec 19, 2016

Review by @gzm0
Expected date of announcement: Wednesday 21.

@sjrd sjrd requested a review from gzm0 December 19, 2016 21:20
Copy link
Contributor

@gzm0 gzm0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a minor comment about the wording "top-level objects".

{% endhighlight %}

which allows to call `main()` from JavaScript.
`@JSExportTopLevel` methods must be declared in top-level `object`s.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you deliberately saying top-level for simplicity here? @JSExportTopLevel is allowed in any static object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's deliberate. People don't know what a "static" object is, so a full sentence would be necessary. The verbosity is not worth it IMO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.


While an `@JSExport`ed method inside an `@JSExport`ed object allows JavaScript code to call a "static" method,
it does not feel like a top-level function from JavaScript's point of view.
`@JSExportTopLevel` allows to export a method of a top-level object as a truly top-level function:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about top-level here...

@sjrd sjrd merged commit 573efd8 into scala-js:master Dec 21, 2016
@sjrd sjrd deleted the scalajs-0.6.14 branch December 21, 2016 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants