Skip to content

Commit

Permalink
Merge pull request #67 from hoodmane/type-reflection
Browse files Browse the repository at this point in the history
Add detector for type reflection
  • Loading branch information
surma authored May 16, 2023
2 parents 92781a3 + 6e6fad5 commit b34b628
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A small library to detect which features of WebAssembly are supported.
- ✅ Tree-shakable (only bundle the detectors you use)
- ✅ Provided as an ES6, CommonJS and UMD module.
- ✅ CSP compatible
- ✅ All detectors add up to only ~680B gzipped
- ✅ All detectors add up to only ~700B gzipped

## Installation

Expand Down Expand Up @@ -71,6 +71,7 @@ All detectors return a `Promise<bool>`.
| `streamingCompilation()` | [Streaming Compilation](https://webassembly.github.io/spec/web-api/index.html#streaming-modules) |
| `tailCall()` | [Tail call](https://github.com/webassembly/tail-call) |
| `threads()` | [Threads](https://github.com/webassembly/threads) |
| `typeReflection()` | [Type Reflection](https://github.com/WebAssembly/js-types) |

## Why are all the tests async?

Expand Down
22 changes: 22 additions & 0 deletions src/detectors/type-reflection/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright 2023 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
;; Name: Type Reflection
;; Proposal: https://github.com/WebAssembly/js-types
;; Features: type-reflection
*/

export default async () => {
return "Function" in WebAssembly;
};

0 comments on commit b34b628

Please sign in to comment.