Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
6611165b
Commit
6611165b
authored
Oct 03, 2020
by
Lukas Lihotzki
Browse files
do not pollute the global object
parent
add885c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
javascript/olm_prefix.js
View file @
6611165b
var
Olm
=
(
function
()
{
var
olm_exports
=
{};
var
onInitSuccess
;
var
onInitFail
;
javascript/olm_suffix.js
View file @
6611165b
...
...
@@ -17,16 +17,20 @@ olm_exports['init'] = function(opts) {
return
olmInitPromise
;
};
return
olm_exports
;
})();
if
(
typeof
(
window
)
!==
'
undefined
'
)
{
// We've been imported directly into a browser. Define the global 'Olm' object.
// (we do this even if module.exports was defined, because it's useful to have
// Olm in the global scope for browserified and webpacked apps.)
window
[
"
Olm
"
]
=
o
lm
_exports
;
window
[
"
Olm
"
]
=
O
lm
;
}
if
(
typeof
module
===
'
object
'
)
{
// Emscripten sets the module exports to be its module
// with wrapped c functions. Clobber it with our higher
// level wrapper class.
module
.
exports
=
o
lm
_exports
;
module
.
exports
=
O
lm
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment