File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ data Main
127127 | StaticVDom
128128 | Dynamic
129129 { _message :: Can. Type ,
130+ _isBytes :: Bool ,
130131 _decoder :: Expr
131132 }
132133
@@ -349,15 +350,15 @@ instance Binary Main where
349350 case main of
350351 StaticString -> putWord8 0
351352 StaticVDom -> putWord8 1
352- Dynamic a b -> putWord8 2 >> put a >> put b
353+ Dynamic a b c -> putWord8 2 >> put a >> put b >> put c
353354
354355 get =
355356 do
356357 word <- getWord8
357358 case word of
358359 0 -> return StaticString
359360 1 -> return StaticVDom
360- 2 -> liftM2 Dynamic get get
361+ 2 -> liftM3 Dynamic get get get
361362 _ -> fail " problem getting Opt.Main binary"
362363
363364instance Binary Node where
Original file line number Diff line number Diff line change @@ -891,9 +891,12 @@ generateMain mode argLookup home main =
891891 Opt. StaticVDom ->
892892 JS. Ref (JsName. fromKernel Name. virtualDom " init" )
893893 # JS. Ref (JsName. fromGlobal home " main" )
894- Opt. Dynamic _ decoder ->
894+ Opt. Dynamic _ False decoder ->
895895 JS. Ref (JsName. fromGlobal home " main" )
896896 # generateJsExpr mode argLookup home decoder
897+ Opt. Dynamic _ True _ ->
898+ JS. Ref (JsName. fromGlobal home " main" )
899+ # JS. Null
897900
898901(#) :: JS. Expr -> JS. Expr -> JS. Expr
899902(#) func arg =
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ addDefHelp platform region annotations home name args body graph@(Opt.LocalGraph
200200 Result. ok $
201201 addMain $
202202 Names. run $
203- Opt. Dynamic message <$> Port. toFlagsDecoder flags
203+ Opt. Dynamic message ( Port. isBytes flags) <$> Port. toFlagsDecoder flags
204204 Left (subType, invalidPayload) ->
205205 Result. throw (E. BadFlags region subType invalidPayload)
206206 _ ->
You can’t perform that action at this time.
0 commit comments