Pass numbers in js as enums to Rust successfully

This commit is contained in:
Ryan Levick
2018-02-22 10:55:44 +01:00
parent 01c31cb33d
commit 45543c545e
3 changed files with 31 additions and 23 deletions

View File

@ -1051,7 +1051,8 @@ impl<'a, 'b> SubContext<'a, 'b> {
passed_args.push_str(arg);
};
match *arg {
shared::TYPE_NUMBER => {
shared::TYPE_ENUM | shared::TYPE_NUMBER => {
// TODO: TS for Enum
dst_ts.push_str(": number");
if self.cx.config.debug {
self.cx.expose_assert_num();