qtLoader: Don't assign properties on random self
The 'const self = this;' declaration was omitted in QtLoader constructor, which made all of the self.something = value assignments actually assign to the scope self variable (window.self, in most cases). Make the loader always be constructed with 'new', and assign 'this' to 'self' to always assign properties to the QtLoader instance. Change-Id: I9cf7cc95e7341531a702edc431aa242b39911f66 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
f6b1c875d9
commit
18425c3329
@ -109,8 +109,25 @@
|
||||
// Loading to Running occurs.
|
||||
|
||||
|
||||
// Forces the use of constructor on QtLoader instance.
|
||||
// This passthrough makes both the old-style:
|
||||
//
|
||||
// const loader = QtLoader(config);
|
||||
//
|
||||
// and the new-style:
|
||||
//
|
||||
// const loader = new QtLoader(config);
|
||||
//
|
||||
// styles work.
|
||||
function QtLoader(config)
|
||||
{
|
||||
return new _QtLoader(config);
|
||||
}
|
||||
|
||||
function _QtLoader(config)
|
||||
{
|
||||
const self = this;
|
||||
|
||||
// The Emscripten module and module configuration object. The module
|
||||
// object is created in completeLoadEmscriptenModule().
|
||||
self.module = undefined;
|
||||
|
Loading…
x
Reference in New Issue
Block a user