Closed NeilFraser closed 4 years ago
For posterity, and from our conversation: the only purpose of the Error value for the [[Class]] attribute in ES5.1 (and the corresponding [[ErrorData]] internal slot in ES6 and onwards) is to allow Object.prototype.toString
to distinguish Error objects so that Object.prototype.toString.apply(new Error)
will return "[object Error]
" rather than "[object Object]
"—a distinction which is not relevant to JS Interpreter because it does not separate the implementation of Error.prototype.toString
from Object.prototype.toString
. (This is arguably a bug.)
The only specified uses of [[ErrorData]] is to identify Error and NativeError instances as Error objects within
Object.prototype.toString
.
Reverted. See issue #177.
Chris, can you think of any reason why the 'Error'
.class
is needed in JS-Interpreter? We use.class
for Array and Function, since one can build children of each that are not real arrays or functions. But I don't see the point of 'Error'.