diff --git a/js/rhino/src/org/mozilla/javascript/NativeGlobal.java b/js/rhino/src/org/mozilla/javascript/NativeGlobal.java index 45e9bc69e65e..ac2c4d9afbcf 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeGlobal.java +++ b/js/rhino/src/org/mozilla/javascript/NativeGlobal.java @@ -576,7 +576,8 @@ public class NativeGlobal implements IdFunctionMaster { Object args[] = { message }; try { - Object errorObject = cx.newObject(scopeObject, error, args); + Scriptable errorObject = cx.newObject(scopeObject, error, args); + errorObject.put("name", errorObject, error); return new EcmaError((NativeError)errorObject, sourceName, lineNumber, columnNumber, lineSource); }