long.js icon indicating copy to clipboard operation
long.js copied to clipboard

Using symbol for isLong

Open srknzl opened this issue 4 years ago • 2 comments

It might be better to use javascript's symbols to validate if an object is long. By using a symbol, we can guarantee that the property indicating if an object is long cannot be accessed(since every symbol is unique).

srknzl avatar Mar 21 '21 16:03 srknzl

Makes me wonder how Object.getOwnPropertySymbols changes the equation.

dcodeIO avatar Oct 28 '21 07:10 dcodeIO

Might be possible, but It is much harder to modify a symbol key.

srknzl avatar Oct 28 '21 07:10 srknzl