callback/callback-js — Issue #13: builder should have prototype extension/override capability
Author: filmaj
Created: 2012-01-20 22:20:49+00:00
State: open

i think its worth having this generic ability.

My specific use case for this requirement comes from the [File API's Entry object](https://github.com/filmaj/callback-js/blob/master/lib/plugin/Entry.js).

The [common platform's Entry definition simply invokes `exec`](https://github.com/filmaj/callback-js/commit/440e504094a304e5f78a47d1aa28b0a6e41dfb66#L0R165). However, [BlackBerry's implementation has no need to call `exec`](https://github.com/filmaj/callback-js/blob/440e504094a304e5f78a47d1aa28b0a6e41dfb66/lib/plugin/blackberry/Entry.js), since instead we can call methods on the `blackberry.io.*` namespace.

So, some kind of mechanism to simply override the common Entry's `remove` method would be nice (and probably useful in other parts of the project as we add more APIs). However, [builder only builds properties](https://github.com/filmaj/callback-js/blob/440e504094a304e5f78a47d1aa28b0a6e41dfb66/lib/builder.js#L3) and doesn't work with any module's prototype. Any ideas on how to gracefully support overriding specific prototype methods?