зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug:
Norris, I realize this is probably a nuisance, but the following problem causes our regression test suite to fail: js> foo = new Error("bar") undefined: bar js> foo.name Error js> foo.toString() undefined: bar Our test suite expects: js> foo = new Error("bar") Error: bar js> foo.name Error js> foo.toString() Error: bar I have not yet tried the debugger with the RC2 release, but I expect to get to that later today. I hope I'm not to late to influence the 1.5R3 release. Thanks, dave
This commit is contained in:
Родитель
b4ed051d8d
Коммит
b0c8c14266
|
@ -128,7 +128,12 @@ public class NativeError extends IdScriptable {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return getName() + ": " + getMessage();
|
||||
// The "name" property is usually just defined in the prototype,
|
||||
// so use getProperty to fetch it.
|
||||
Object name = ScriptableObject.getProperty(this, "name");
|
||||
if (name == NOT_FOUND)
|
||||
name = Undefined.instance;
|
||||
return name + ": " + getMessage();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче