avm2: Fix `Error.toString` regression
This was introduced by #14897, and to make sure this won't happen again I added a test. Fixes #14901.
This commit is contained in:
parent
2057417824
commit
1804c23b93
|
@ -23,7 +23,7 @@ package {
|
|||
|
||||
prototype.toString = function():String {
|
||||
var self:Error = this;
|
||||
return self.message.length == 0 ? self.name : self.name + ": " + self.message;
|
||||
return self.message !== "" ? self.name + ": " + self.message : self.name;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package {
|
||||
import flash.display.Sprite;
|
||||
|
||||
public class Test extends Sprite {}
|
||||
}
|
||||
|
||||
var e = new Error(null);
|
||||
trace(e.toString());
|
|
@ -0,0 +1 @@
|
|||
Error: null
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
num_frames = 1
|
Loading…
Reference in New Issue