-
Notifications
You must be signed in to change notification settings - Fork 690
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
Require import/export names to be UTF-8. #1016
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,8 @@ In the future, other kinds of imports may be added. Imports are designed to | |
allow modules to share code and data while still allowing separate compilation | ||
and caching. | ||
|
||
All imports include two opaque names: a *module name* and an *export name*. The | ||
All imports include two opaque names: a *module name* and an *export name*, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In JS.md, which type of exception should occur if import or export are invalid UTF-8 strings? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JS.md already seems to specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be a validation requirement, so WebAssembly.validate would return false, and APIs that throw would throw WebAssembly.CompileError. The design docs don't specify the details of validation, so there doesn't seem to be a clear place to specify this; perhaps we could just handle this in eventual spec PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sgtm |
||
which are required to be [valid UTF-8]. The | ||
interpretation of these names is up to the host environment but designed to | ||
allow a host environments, like the [Web](Web.md), to support a two-level | ||
namespace. | ||
|
@@ -108,7 +109,8 @@ native `syscall`. For example, a shell environment could define a builtin | |
|
||
A module can declare a sequence of **exports** which are returned at | ||
instantiation time to the host environment. Each export has three fields: | ||
a *name*, whose meaning is defined by the host environment, a *type*, | ||
a *name*, which is required to be [valid UTF-8], | ||
whose meaning is defined by the host environment, a *type*, | ||
indicating whether the export is a function, global, memory or table, and | ||
an *index* into the type's corresponding [index space](Modules.md). | ||
|
||
|
@@ -380,3 +382,4 @@ In the future, operators like `i32.add` could be added to allow more expressive | |
[future types]: FutureFeatures.md#more-table-operators-and-types | ||
[future dom]: FutureFeatures.md#gc/dom-integration | ||
[future multiple tables]: FutureFeatures.md#multiple-tables-and-memories | ||
[valid UTF-8]: https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail |
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.
"UTF-8" here and elsewhere.
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.
done