mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-18 15:31:48 +03:00
d5b81595ec
First added in #161 this never ended up panning out, so let's remove the experimental suport which isn't actually used by anything today and hold off on any other changes until an RFC happens.
48 lines
965 B
Rust
48 lines
965 B
Rust
use wasm_bindgen_test::*;
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
#[wasm_bindgen(module = "tests/wasm/u64.js")]
|
|
extern {
|
|
fn i64_js_identity(a: i64) -> i64;
|
|
fn u64_js_identity(a: u64) -> u64;
|
|
fn js_works();
|
|
}
|
|
|
|
#[wasm_bindgen]
|
|
pub fn zero() -> u64 { 0 }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn one() -> u64 { 1 }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn neg_one() -> i64 { -1 }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn i32_min() -> i64 { i32::min_value() as i64 }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn u32_max() -> u64 { u32::max_value() as u64 }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn i64_min() -> i64 { i64::min_value() }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn u64_max() -> u64 { u64::max_value() }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn i64_rust_identity(a: i64) -> i64 { i64_js_identity(a) }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn u64_rust_identity(a: u64) -> u64 { u64_js_identity(a) }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn i64_slice(a: &[i64]) -> Vec<i64> { a.to_vec() }
|
|
|
|
#[wasm_bindgen]
|
|
pub fn u64_slice(a: &[u64]) -> Vec<u64> { a.to_vec() }
|
|
|
|
#[wasm_bindgen_test]
|
|
fn works() {
|
|
js_works();
|
|
}
|