Skip to content

Commit

Permalink
avm2: Use correct null parameter error in registerClassAlias
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and torokati44 committed Jan 4, 2024
1 parent dd53b4e commit 89b7f7a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/avm2/globals/flash/net.as
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ package flash.net {
public native function navigateToURL(request:URLRequest, window:String = null):void;

public function registerClassAlias(name:String, object:Class):void {
if (name == null || object == null) {
throw new TypeError("FIXME - what error should I use");
if (name == null) {
throw new TypeError("Error #2007: Parameter aliasName must be non-null.", 2007);
}
if (object == null) {
throw new TypeError("Error #2007: Parameter classObject must be non-null.", 2007);
}

this._aliasToClass[name] = object;
this._classToAlias[object] = name;
}
Expand Down

0 comments on commit 89b7f7a

Please sign in to comment.