Skip to content

Commit

Permalink
avm2: Stub flash.net.getClassByAlias and improve flash.net.registerCl…
Browse files Browse the repository at this point in the history
…assAlias stub
  • Loading branch information
Lord-McSweeney authored and Aaron1011 committed Jun 10, 2023
1 parent 4d8feea commit dced644
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/src/avm2/globals/flash/net.as
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@ package flash.net {

import flash.net.URLRequest;
import __ruffle__.stub_method;

internal var _classLookups:Object = {};

public native function navigateToURL(request:URLRequest, window:String = null):void;

public function registerClassAlias(a:String, b:Object):void {
public function registerClassAlias(name:String, object:Class):void {
stub_method("flash.net", "registerClassAlias");
this._classLookups[name] = object;
}

public function getClassByAlias(name:String):Class {
if (this._classLookups[name]) {
return this._classLookups[name];
} else {
return null;
}
}

public function sendToURL(request:URLRequest):void {
Expand Down

0 comments on commit dced644

Please sign in to comment.