mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-30 19:41:56 +00:00
Add support for optional numbers
This commit is contained in:
committed by
Alex Crichton
parent
2a6d98a6c9
commit
c49c18826d
@@ -67,6 +67,17 @@ global.UndefinedMethod = class UndefinedMethod {
|
||||
}
|
||||
};
|
||||
|
||||
global.OptionalMethod = class OptionalMethod {
|
||||
constructor() {}
|
||||
opt(a) {
|
||||
if (a == undefined) {
|
||||
return undefined;
|
||||
} else {
|
||||
return a + 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
global.Unforgeable = class Unforgeable {
|
||||
constructor() {
|
||||
this.uno = 1;
|
||||
|
Reference in New Issue
Block a user