Lets say we have
type User = object
name: cstring
id: cstring
if we do
var user: User
user.name = "Somename"
user.id = "Someid"
The resulting JS code is
var user = {[name: "Somename", id: "Someid"]}
but if we initialize it directly like
var user = User(name: "Somename", id: "Someid")
The resulting JS code is
var user = {[name: "Somename", id: "Someid", m_type: NIT80354703475]}
this is with -d:release and -d:danger, and when you have nested objects its very annoying
Is there any switch to turn the type info off?
Tnx, it worked!
Still, this is a workaround, the good thing about Nim when compiling to JS is that you can use the types, but i still dont see why this extra typeinfo is added, the size of the output could be reduced by half if it wasn't this m_type. Who needs it anyway :)))