diff options
| author | Luke Wagner <mail@lukewagner.name> | 2015-09-10 20:21:48 -0500 |
|---|---|---|
| committer | Luke Wagner <mail@lukewagner.name> | 2015-09-10 20:22:08 -0500 |
| commit | 7151f6dea2bc05c14aec6f7bb37a30609caf905a (patch) | |
| tree | a305f9003188fd3ba14490a9e81e783d00f6d246 | |
| parent | d902182706664be2f99cd3540a26fd1ddb3877cf (diff) | |
| download | nanowasm-design-7151f6dea2bc05c14aec6f7bb37a30609caf905a.tar.gz | |
Add feature test AST node
| -rw-r--r-- | AstSemantics.md | 9 | ||||
| -rw-r--r-- | FeatureTest.md | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/AstSemantics.md b/AstSemantics.md index 77b9fc4..c42adc3 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -531,3 +531,12 @@ round-to-nearest ties-to-even rounding. Truncation from floating point to integer where IEEE 754-2008 would specify an invalid operation exception (e.g. when the floating point value is NaN or outside the range which rounds to an integer in range) traps. + +## Feature test + +To support [feature testing](FeatureTest.md), an AST node would be provided: + + * `has_feature`: return whether the given feature is supported, identified by string + +In the MVP, `has_feature` would always return false. As features were added post-MVP, +`has_feature` would start returning true. diff --git a/FeatureTest.md b/FeatureTest.md index cd6ca34..0214bd8 100644 --- a/FeatureTest.md +++ b/FeatureTest.md @@ -4,8 +4,8 @@ Any feature not present in [the MVP](MVP.md) will have a corresponding feature test. This allows polyfills to elegantly emulate a feature, and allows developers to fallback to another implementation if they so desire. -Feature tests will be available from WebAssembly itself, as well as from -JavaScript. +Feature tests will be available from +[WebAssembly itself](AstSemantics.md#feature-test), as well as from JavaScript. -Details -[are still be hashed out](https://github.com/WebAssembly/design/issues/90). +See also [better feature testing support](FutureFeatures.md#better-feature-testing-support) +in future features. |
