Asynchronous Error Handling

Asynchronous callbacks happen asynchronously. http://jsbin.com/laraqozi/1/edit This is pretty beginner stuff, or so I thought, But after having fixed a bug in YUI that cost hundreds of man hours, it seems worth discussing. function doSomethingBad() { throw Error("oh no!") } function deferCallback(f) { try { setTimeout(f, 100…

Exotic Objects

EcmaScript has historically kept its hands off the dirty details of host objects. What is a Host Object? In order for JavaScript to be in any way useful, we must have some things; some components to script. This is where the host environment and host objects come in. In a…