From 7151f6dea2bc05c14aec6f7bb37a30609caf905a Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Thu, 10 Sep 2015 20:21:48 -0500 Subject: Add feature test AST node --- AstSemantics.md | 9 +++++++++ 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. -- cgit v1.2.3