@@ -54,7 +54,9 @@ data JSNum = JSInt Int
54 deriving Eq
54 deriving Eq
57−data JSWord = JSWord8 Word8 deriving Eq
57+data JSWord = JSWord8 Word8
60data JSAnnotation = JSConstructor deriving Eq
62data JSAnnotation = JSConstructor deriving Eq
@@ -263,7 +265,8 @@ compileJS (JSWhile cond body) =
265compileJS (JSWord word)
267compileJS (JSWord word)
268+ | JSWord8 b <- word = show b
266− | JSWord8 b <- word = show b
269+ | JSWord16 b <- word = show b
268jsTailcall :: JS -> JS
271jsTailcall :: JS -> JS
269jsTailcall call =
272jsTailcall call =
@@ -1642,6 +1645,7 @@ translateConstant PtrType = JSType JSPtrTy
1642translateConstant Forgot = JSType JSForgotTy
1645translateConstant Forgot = JSType JSForgotTy
1643translateConstant (BI i) = jsBigInt $ JSString (show i)
1646translateConstant (BI i) = jsBigInt $ JSString (show i)
1644translateConstant (B8 b) = JSWord (JSWord8 b)
1647translateConstant (B8 b) = JSWord (JSWord8 b)
1648+translateConstant (B16 b) = JSWord (JSWord16 b)
1645translateConstant c =
1649translateConstant c =
1646 jsError $ "Unimplemented Constant: " ++ show c
1650 jsError $ "Unimplemented Constant: " ++ show c