NativeError.js_captureStackTrace causes ClassCastException when 'Error' has been overridden #366
Labels
Java Exception Leaking
Issues related to Java Exceptions leaking into JavaScript
non-Ecma
Triage
Issues yet to be triaged
java.lang.ClassCastException: org.mozilla.v17.javascript.NativeObject cannot be cast to org.mozilla.v17.javascript.Function
var oldError = Error;
Error = {};
oldError.captureStackTrace({});
The issue is because NativeError.js_captureStackTrace creates a new "Error" on line 303.
NativeError err = (NativeError)cx.newObject(thisObj, "Error");
It needs to create NativeError directly instead of assuming JS defined "Error" is the object it wants.
The text was updated successfully, but these errors were encountered: