Everything is Permitted: Extending Built-ins
summary
History shows Prototype starts at 104 lines and by 1.4 adds ~30 methods, which breaks for in loops when extending object prototypes, so the claim is that safe extension requires specifics not slogans. Practical tools include ES5's Object.defineProperty to make nonenumerable methods and the canonical function.prototype.bind polyfill. Node examples actually augment Date for timezones and work. Language proposals like scoped object extensions or refinements aim to isolate extensions lexically.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 4:28Prototype early days
- 8:15Prototype evolution
- 11:45Ethics of modifying built-ins
- 15:18Active Support extensions
- 19:59Risks of monkey patching
- 23:33Best practices for extensions
- 26:42Safe built-in extensions
- 30:12Polyfilling ES5 methods
- 31:57Standardizing Function.prototype.bind
- 33:22Future of class boxes
- 36:57Conclusion and Q&A
related talks
28mJavaScript inheritance: beyond the basics
50mMetaprogramming in JavaScript
21mAsk not what JavaScript can do for you
32mBreak all the rules
22mWelcome our new ES5 overlords
01h 52mPro.Prototypes Workshop
45mJavaScript Prototypes Behind the Scenes
38mExploring the Enigmatic: Navigating JS's Uncharted Realms
