Skip to content
  • Iustin Pop's avatar
    Change opcode/luxi showJSON generation in THH · 84c2e6ca
    Iustin Pop authored
    
    
    Currently, the opcode and luxi "showJSON" functions generate directly
    a JSValue; in contrast, the object (single-constructor) types generate
    a 'toDict' function, and then `showJSON = makeObj . toDict`. This is
    useful, as the 'dict' form can be manipulated if needed.
    
    This patch changes the opcode and luxi types to behave the same; we
    generate a dict, and then (since this differs between opcodes and
    luxi) generate showJSON either as `makeObj . toDict` (for opcodes), or
    (for luxi) `showJSON . map sn . toDict`.
    
    The change is needed for MetaOpCode implementation.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
    84c2e6ca