Open AshfordN opened 3 years ago
@AshfordN Well, I've fixed the Value.Int()
and Value.SetInt()
.
However, what about Value.Assign(val interface{})
? Currently, it accepts uint64
and just truncates it to uint32
(originally, to uint
). Should we return an error instead? Or just not accept the uint64
as an interface?
I think it's appropriate to do the truncation, as long you're confident it wouldn't be a source of confusion in the future. In my opinion, the sciter docs justifies that behavior and should make it obvious.
According to the docs, sciter integers are always 32-bit; however,
sciter.Value.Int()
returnsint
, which may be either 32-bit or 64-bit, depending on the system architecture (see here). This causes inconsistencies in the way negative numbers are parsed on different architectures. That is, -1 gets interpreted as 4294967295 on a 64-bit system; while it gets interpreted correctly (as -1) on a 32 bit system.