1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Convert src to ES6

The bulk of this is just export/import changes, though there's a couple pieces to highlight:
* We no longer use default exports. This is because it's discouraged by the JS community, though not in any official capacity.
* We now use `polyfillSuper` for some prototype inheritance because the tests, and sometimes webpack, break on "cannot call EncryptionAlgorithm without 'new'". It's very much a workaround, and definitely not needed when we use real classes.

There is some import shuffling to help keep the imports clean - this was done by my IDE.
This commit is contained in:
Travis Ralston
2019-12-17 15:04:27 -07:00
parent 4dbda8dffd
commit d3ce0cb82f
65 changed files with 706 additions and 861 deletions

View File

@@ -15,15 +15,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import logger from '../../../logger';
import RequestCallbackChannel from "./RequestCallbackChannel";
import {logger} from '../../../logger';
import {RequestCallbackChannel} from "./RequestCallbackChannel";
import {EventEmitter} from 'events';
import {
newUnknownMethodError,
newUnexpectedMessageError,
errorFromEvent,
errorFactory,
} from "../Error";
import {errorFactory, errorFromEvent, newUnexpectedMessageError, newUnknownMethodError} from "../Error";
// the recommended amount of time before a verification request
// should be (automatically) cancelled without user interaction
@@ -57,7 +52,7 @@ export const PHASE_DONE = 6;
* send and receive verification events are put in `InRoomChannel` or `ToDeviceChannel`.
* @event "change" whenever the state of the request object has changed.
*/
export default class VerificationRequest extends EventEmitter {
export class VerificationRequest extends EventEmitter {
constructor(channel, verificationMethods, userId, client) {
super();
this.channel = channel;