diff options
Diffstat (limited to 'src/corelib/platform/wasm/qtcontextfulpromise_injection.js')
-rw-r--r-- | src/corelib/platform/wasm/qtcontextfulpromise_injection.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/corelib/platform/wasm/qtcontextfulpromise_injection.js b/src/corelib/platform/wasm/qtcontextfulpromise_injection.js deleted file mode 100644 index ce5623171c..0000000000 --- a/src/corelib/platform/wasm/qtcontextfulpromise_injection.js +++ /dev/null @@ -1,32 +0,0 @@ -`Copyright (C) 2022 The Qt Company Ltd. -Copyright (C) 2016 Intel Corporation. -SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0`; - -if (window.qtContextfulPromiseSupport) { - ++window.qtContextfulPromiseSupport.refs; -} else { - window.qtContextfulPromiseSupport = { - refs: 1, - removeRef: () => { - --window.qtContextfulPromiseSupport.refs, 0 === window.qtContextfulPromiseSupport.refs && delete window.qtContextfulPromiseSupport; - }, - makePromise: (a, b, c) => new window.qtContextfulPromiseSupport.ContextfulPromise(a, b, c), - }; - - window.qtContextfulPromiseSupport.ContextfulPromise = class { - constructor(a, b, c) { - (this.wrappedPromise = a), (this.context = b), (this.callbackThunk = c); - } - then() { - return (this.wrappedPromise = this.wrappedPromise.then((a) => { this.callbackThunk("then", this.context, a); })), this; - } - catch() { - return (this.wrappedPromise = this.wrappedPromise.catch((a) => { this.callbackThunk("catch", this.context, a); })), this; - } - finally() { - return (this.wrappedPromise = this.wrappedPromise.finally(() => this.callbackThunk("finally", this.context, undefined))), this; - } - }; -} - -document.querySelector("[qtinjection=contextfulpromise]")?.remove(); |