This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch webservice
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit b042367eb36f0d9b7f33941c898720c582edbc82
Author: Alex Harui <[email protected]>
AuthorDate: Thu Oct 3 14:15:14 2019 -0700

    setup context root for JS at runtime instead of compile time
---
 .../royale/mx/messaging/config/LoaderConfig.as     | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/config/LoaderConfig.as
 
b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/config/LoaderConfig.as
index b4775ec..e1b363a 100644
--- 
a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/config/LoaderConfig.as
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/config/LoaderConfig.as
@@ -23,6 +23,7 @@ COMPILE::SWF
 {
 import flash.display.DisplayObject;
 }
+import mx.core.IFlexModuleFactory;
 import mx.core.mx_internal;
 
 use namespace mx_internal;
@@ -65,6 +66,9 @@ public class LoaderConfig
         // if somebody has set this in our applicationdomain hierarchy, don't 
overwrite it
         if (!_url)
         {
+            if (root is IFlexModuleFactory)
+                _contextRoot = (root as 
IFlexModuleFactory).info()["contextRoot"];
+            
             _url = location.href;
             _parameters = {};
             var query:String = location.search.substring(1);
@@ -108,6 +112,32 @@ public class LoaderConfig
     
//--------------------------------------------------------------------------
 
     //----------------------------------
+    //  contextRoot
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  Storage for the contextRoot property.
+     */
+    COMPILE::JS
+    mx_internal static var _contextRoot:String = null;
+    
+    /**
+     *  If the LoaderConfig has been initialized, this
+     *  should represent the contextRoot specified at compile time.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Royale 1.0
+     */
+    COMPILE::JS
+    public static function get contextRoot():String
+    {
+        return _contextRoot;
+    }
+    
+    //----------------------------------
     //  parameters
     //----------------------------------
 

Reply via email to