浏览代码

Comments

master
Lyubo Marinov 7 年前
父节点
当前提交
8436f23e05

+ 11
- 3
react/features/app/actions.js 查看文件

30
  * state.
30
  * state.
31
  * @param {Object} newLocation - The location URI to navigate to. The value
31
  * @param {Object} newLocation - The location URI to navigate to. The value
32
  * cannot be undefined and is assumed to have all properties such as
32
  * cannot be undefined and is assumed to have all properties such as
33
- * {@code host} and {@code room} defined values.
33
+ * {@code host}, {@code contextRoot}, and {@code room} defined. Depending on the
34
+ * property, it may have a value equal to {@code undefined} and that may be
35
+ * acceptable.
34
  * @private
36
  * @private
35
  * @returns {void}
37
  * @returns {void}
36
  */
38
  */
55
     }
57
     }
56
 
58
 
57
     /**
59
     /**
58
-     * Notifies that an attempt to load the config(uration) of domain has
59
-     * completed.
60
+     * Notifies that an attempt to load a config(uration) has completed. Due to
61
+     * the asynchronous native of the loading, the specified <tt>config</tt> may
62
+     * or may not be required by the time the notification arrives.
60
      *
63
      *
61
      * @param {string|undefined} err - If the loading has failed, the error
64
      * @param {string|undefined} err - If the loading has failed, the error
62
      * detailing the cause of the failure.
65
      * detailing the cause of the failure.
65
      * @returns {void}
68
      * @returns {void}
66
      */
69
      */
67
     function configLoaded(err, config) {
70
     function configLoaded(err, config) {
71
+        // FIXME Due to the asynchronous native of the loading, the specified
72
+        // config may or may not be required by the time the notification
73
+        // arrives.
74
+
68
         if (err) {
75
         if (err) {
69
             // XXX The failure could be, for example, because of a
76
             // XXX The failure could be, for example, because of a
70
             // certificate-related error. In which case the connection will
77
             // certificate-related error. In which case the connection will
186
  *
193
  *
187
  * @param {Object} location - The location URI which specifies the host to load
194
  * @param {Object} location - The location URI which specifies the host to load
188
  * the config.js from.
195
  * the config.js from.
196
+ * @private
189
  * @returns {Promise<Object>}
197
  * @returns {Promise<Object>}
190
  */
198
  */
191
 function _loadConfig(location: Object) {
199
 function _loadConfig(location: Object) {

+ 4
- 4
react/features/base/lib-jitsi-meet/functions.js 查看文件

67
                 .then(() => {
67
                 .then(() => {
68
                     const { config } = window;
68
                     const { config } = window;
69
 
69
 
70
-                    // We don't want to pollute global scope.
70
+                    // We don't want to pollute the global scope.
71
                     window.config = undefined;
71
                     window.config = undefined;
72
 
72
 
73
                     if (typeof config !== 'object') {
73
                     if (typeof config !== 'object') {
82
                     throw err;
82
                     throw err;
83
                 });
83
                 });
84
     } else {
84
     } else {
85
-        // Return config.js file from global scope. We can't use the version
86
-        // that's being used for the React Native app because the old/current
87
-        // Web app uses config from the global scope.
85
+        // Return "the config.js file" from the global scope - that is how the
86
+        // Web app on both the client and the server was implemented before the
87
+        // React Native app was even conceived.
88
         promise = Promise.resolve(window.config);
88
         promise = Promise.resolve(window.config);
89
     }
89
     }
90
 
90
 

+ 3
- 5
react/features/base/util/loadScript.native.js 查看文件

1
 /**
1
 /**
2
  * Loads a script from a specific URL. React Native cannot load a JS
2
  * Loads a script from a specific URL. React Native cannot load a JS
3
  * file/resource/URL via a <script> HTML element, so the implementation
3
  * file/resource/URL via a <script> HTML element, so the implementation
4
- * fetches the specified src as plain text using fetch() and then
5
- * evaluates the fetched string as JavaScript code (i.e. via the {@link eval}
6
- * function).
4
+ * fetches the specified <tt>url</tt> as plain text using {@link fetch()} and
5
+ * then evaluates the fetched string as JavaScript code (using {@link eval()}).
7
  *
6
  *
8
- * @param {string} url - The absolute URL from the which the script is to be
7
+ * @param {string} url - The absolute URL from which the script is to be
9
  * (down)loaded.
8
  * (down)loaded.
10
  * @returns {void}
9
  * @returns {void}
11
  */
10
  */
20
                 default:
19
                 default:
21
                     throw response.statusText;
20
                     throw response.statusText;
22
                 }
21
                 }
23
-
24
             })
22
             })
25
             .then(responseText => {
23
             .then(responseText => {
26
                 eval.call(window, responseText); // eslint-disable-line no-eval
24
                 eval.call(window, responseText); // eslint-disable-line no-eval

正在加载...
取消
保存