Unspecified Error.call

David Bruant bruant.d at gmail.com
Tue Jul 24 08:30:06 PDT 2012


I've recently discovered that the following code seems to have an 
undefined behavior in ES5.1
var o = {};
Error.call(o, 'ya'); // what is the "Error" function supposed to do with 
'this', who knows?
console.log(o.message) // undefined in latest Firefox, Chrome and Opera

The result seems consistent across browsers I could test with. Maybe I'm 
misreading the spec?


More information about the es-discuss mailing list