Browse Source

AudioContext: Refactor to class style. (#24840)

* AudioContext: Refactor to class style.

* AudioContext: make static function
linbingquan 2 years ago
parent
commit
c460c578fe
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/audio/AudioContext.js

+ 5 - 5
src/audio/AudioContext.js

@@ -1,8 +1,8 @@
 let _context;
 let _context;
 
 
-const AudioContext = {
+class AudioContext {
 
 
-	getContext: function () {
+	static getContext() {
 
 
 		if ( _context === undefined ) {
 		if ( _context === undefined ) {
 
 
@@ -12,14 +12,14 @@ const AudioContext = {
 
 
 		return _context;
 		return _context;
 
 
-	},
+	}
 
 
-	setContext: function ( value ) {
+	static setContext( value ) {
 
 
 		_context = value;
 		_context = value;
 
 
 	}
 	}
 
 
-};
+}
 
 
 export { AudioContext };
 export { AudioContext };