Browse Source

[RN] Third-party ES6 Symbol ponyfill

master
Lyubo Marinov 8 years ago
parent
commit
acd83ede2f
2 changed files with 6 additions and 24 deletions
  1. 1
    0
      package.json
  2. 5
    24
      react/features/base/react/Symbol.js

+ 1
- 0
package.json View File

@@ -21,6 +21,7 @@
21 21
     "autosize": "^1.18.13",
22 22
     "bootstrap": "3.1.1",
23 23
     "es6-iterator": "2.0.0",
24
+    "es6-symbol": "3.1.0",
24 25
     "i18next": "7.0.0",
25 26
     "i18next-browser-languagedetector": "1.0.1",
26 27
     "i18next-xhr-backend": "1.3.0",

+ 5
- 24
react/features/base/react/Symbol.js View File

@@ -1,24 +1,5 @@
1
-// FIXME React Native does not polyfill Symbol at versions 0.39.2 or earlier.
2
-export default (global => {
3
-    let clazz = global.Symbol;
4
-
5
-    if (typeof clazz === 'undefined') {
6
-        // XXX At the time of this writing we use Symbol only as a way to
7
-        // prevent collisions in Redux action types. Consequently, the Symbol
8
-        // implementation provided bellow is minimal and specific to our
9
-        // purpose.
10
-        const toString = function() {
11
-            return this.join(''); // eslint-disable-line no-invalid-this
12
-        };
13
-
14
-        clazz = description => {
15
-            const thiz = (description || '').split('');
16
-
17
-            thiz.toString = toString;
18
-
19
-            return thiz;
20
-        };
21
-    }
22
-
23
-    return clazz;
24
-})(global || window || this); // eslint-disable-line no-invalid-this
1
+// XXX React Native 0.41.2 does not polyfill Symbol. The React source code of
2
+// jitsi/jitsi-meet does utilize Symbol though. However, it is satisfied with a
3
+// ponyfill.
4
+import Symbol from 'es6-symbol';
5
+export { Symbol as default };

Loading…
Cancel
Save