On Oct 11, 2011, at 5:43 AM, David Bruant wrote: > It gives me an idea for a proxy library which would be to pass a custom field > in a data descriptor indicating the type. The proxy would enforce the type > under the hood and either coerce silently or throw if the type is incorrect.
The original DOM in Netscape 2 did this -- native data structures had proxy-like wrappers with get and set traps, to use Proxy terminology. The Netscape layout engine built these structures quickly and during progressive rendering (remember dial-up?). I did not want to reify JS objects for each eagerly, so used proxy-like wrappers created on demand. The source of truth was in the C (no portable C++ back then) data structures, so I needed get and set traps. This was before accessor properties, so the resulting "DOM attributes" looked like data properties, but did not behave as if they were data properties. /be _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss