File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 15
15
+../../lib/polyfill/pip_webkit.js
16
16
+../../lib/polyfill/random_uuid.js
17
17
+../../lib/polyfill/storage_estimate.js
18
+ +../../lib/polyfill/symbol.js
18
19
+../../lib/polyfill/video_play_promise.js
19
20
+../../lib/polyfill/videoplaybackquality.js
20
21
+../../lib/polyfill/vttcue.js
Original file line number Diff line number Diff line change
1
+ /*! @license
2
+ * Shaka Player
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ goog . provide ( 'shaka.polyfill.Symbol' ) ;
7
+
8
+ goog . require ( 'shaka.log' ) ;
9
+ goog . require ( 'shaka.polyfill' ) ;
10
+
11
+ /**
12
+ * @summary A polyfill to provide Symbol.prototype.description in all browsers.
13
+ * See: https://caniuse.com/mdn-javascript_builtins_symbol_description
14
+ * @export
15
+ */
16
+ shaka . polyfill . Symbol = class {
17
+ /**
18
+ * Install the polyfill if needed.
19
+ * @export
20
+ */
21
+ static install ( ) {
22
+ shaka . log . debug ( 'Symbol.install' ) ;
23
+
24
+ // eslint-disable-next-line no-restricted-syntax
25
+ const proto = Symbol . prototype ;
26
+
27
+ if ( ! ( 'description' in proto ) ) {
28
+ Object . defineProperty ( proto , 'description' , {
29
+ get : shaka . polyfill . Symbol . getSymbolDescription_ ,
30
+ } ) ;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * @this {Symbol}
36
+ * @return {(string|undefined) }
37
+ * @private
38
+ */
39
+ static getSymbolDescription_ ( ) {
40
+ const m = / \( ( .* ) \) / . exec ( this . toString ( ) ) ;
41
+ return m ? m [ 1 ] : undefined ;
42
+ }
43
+ } ;
44
+
45
+
46
+ shaka . polyfill . register ( shaka . polyfill . Symbol . install ) ;
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ goog.require('shaka.polyfill.PatchedMediaKeysNop');
45
45
goog . require ( 'shaka.polyfill.PatchedMediaKeysWebkit' ) ;
46
46
goog . require ( 'shaka.polyfill.PiPWebkit' ) ;
47
47
goog . require ( 'shaka.polyfill.RandomUUID' ) ;
48
+ goog . require ( 'shaka.polyfill.Symbol' ) ;
48
49
goog . require ( 'shaka.polyfill.VTTCue' ) ;
49
50
goog . require ( 'shaka.polyfill.VideoPlayPromise' ) ;
50
51
goog . require ( 'shaka.polyfill.VideoPlaybackQuality' ) ;
You can’t perform that action at this time.
0 commit comments