Add asin to Math
@@ -82,3 +82,29 @@ fn acosh() {
"#)
.test()
}
+
+#[test]
+fn asin() {
+ project()
+ .file("src/lib.rs", r#"
+ #![feature(proc_macro, wasm_custom_section)]
+
+ extern crate wasm_bindgen;
+ use wasm_bindgen::prelude::*;
+ use wasm_bindgen::js;
+
+ #[wasm_bindgen]
+ pub fn asin(opposite: i32, hypotenuse: i32) -> js::Number {
+ js::Math::asin(opposite / hypotenuse)
+ }
+ "#)
+ .file("test.ts", r#"
+ import * as assert from "assert";
+ import * as wasm from "./out";
+
+ export function test() {
+ assert.equal(wasm.asin(1, 1), Math.asin(1));
+ }
+ "#)
+ .test()
+}
