medikoo / dbjs

In-Memory Database Engine for JavaScript
MIT License
28 stars 4 forks source link

Validation of set property #36

Open medikoo opened 9 years ago

medikoo commented 9 years ago

/cc @kamsi @mtuchowski

Sometimes we try to set properties directly in dbjs via obj.foo = 'bar', but if property of given name was never defined in dbjs (on any object), then it doesn't reach dbjs getter but becomes natural ECMAScript property set.

This behavior leads to issues, as our settings may get lost, when we do not expect it.

It might be good to try to find possibly dev only solution that would warn us about such usage (or even throw). It might be possible in ES6 with usage of proxies, or with Object.observe if V8 implements it.

mtuchowski commented 9 years ago

:+1: