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
5a60e543
Commit
5a60e543
authored
Jul 21, 2015
by
Mark Haines
Browse files
Add more workarounds for closure compiler in javascript bindings
parent
bb70307b
Changes
1
Show whitespace changes
Inline
Side-by-side
javascript/olm_pre.js
View file @
5a60e543
...
...
@@ -2,10 +2,10 @@ var olm_exports = {};
var
get_random_values
;
var
process
;
// Shadow the process object so that emscripten won't get
// confused by browserify
if
(
global
&&
global
.
window
)
{
if
(
global
&&
global
[
"
window
"
]
)
{
// We're running with browserify
module
[
"
exports
"
]
=
olm_exports
;
global
.
window
[
"
Olm
"
]
=
olm_exports
;
global
[
"
window
"
]
[
"
Olm
"
]
=
olm_exports
;
get_random_values
=
function
(
buf
)
{
window
.
crypto
.
getRandomValues
(
buf
);
};
...
...
@@ -23,7 +23,7 @@ if (global && global.window) {
var
bytes
=
nodeCrypto
.
randomBytes
(
buf
.
length
);
buf
.
set
(
bytes
);
}
process
=
global
.
process
;
process
=
global
[
"
process
"
]
;
}
else
{
throw
new
Error
(
"
Cannot find global to attach library to
"
);
}
...
...
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