Add support for optional numbers

This commit is contained in:
Anton Danilkin
2018-08-03 16:28:35 +03:00
committed by Alex Crichton
parent 2a6d98a6c9
commit c49c18826d
25 changed files with 801 additions and 57 deletions

View File

@@ -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;