anchor.diff:  open WebSharper.JavaScript
   open WebSharper.Core.Attributes
   
  +type private OptionalFieldKind =
  +    | NotOption = 0     // The field doesn't have type option<'T>
  +    | NormalOption = 1  // The field has type option<'T>
  +    | MarkedOption = 2  // The field has type option<'T> and is marked [<OptionalField>]
  +
   [<JavaScript>]
   module private Encode =
   
  
positive.code:             l |> List.iter (fun x -> a.JS.Push (encEl x) |> ignore)
              a)
  
      let Record (fields: (string * (obj -> obj))[]) =
          box (fun (x: obj) ->
              let o = New []
              fields |> Array.iter (fun (name, enc) ->
                  o?(name) <- enc x?(name))
              o)
  
      let Array (encEl: 'T -> obj) =
  
negative.code:                 let fields =
                      FST.GetRecordFields(t, flags)
                      |> Array.map (fun f ->
                          WebSharper.Core.Json.Internal.GetName f, f, f.PropertyType)
                  ((fun es -> ok (call "Record" [J.NewArray es])), fields)
                  ||> Array.fold (fun k (n, f, t) ->
                      fun es ->
                          let t, optionKind =
                              if t.IsGenericType && t.GetGenericTypeDefinition() = typedefof<option<_>> then
                                  let kind =
                                      if Array.isEmpty (f.GetCustomAttributes(typeof<OptionalFieldAttribute>, false)) then
                                          OptionalFieldKind.NormalOption
                                      else OptionalFieldKind.MarkedOption
                                  t.GetGenericArguments().[0], cInt (int kind)
                              else t, cInt (int OptionalFieldKind.NotOption)
                          encode name call (T.FromType t) >>= fun e ->
                          k (J.NewArray [cString n; e; optionKind] :: es))
                  <| []
              else
                  fail (name + ": Type not supported: " + t.FullName)
  