From dced6445eebbab1775578fdf0a9331012120f359 Mon Sep 17 00:00:00 2001 From: Lord-McSweeney <84632019+Lord-McSweeney@users.noreply.github.com> Date: Sat, 10 Jun 2023 10:49:57 -0700 Subject: [PATCH] avm2: Stub flash.net.getClassByAlias and improve flash.net.registerClassAlias stub --- core/src/avm2/globals/flash/net.as | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/avm2/globals/flash/net.as b/core/src/avm2/globals/flash/net.as index 0c1b6471ddee..2f66eebaa2f8 100644 --- a/core/src/avm2/globals/flash/net.as +++ b/core/src/avm2/globals/flash/net.as @@ -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 {