Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
0c7c82e0
Commit
0c7c82e0
authored
7 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
Scheduler tweaks
parent
8416a827
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-util/scheduler.ts
+5
-2
5 additions, 2 deletions
src/mol-util/scheduler.ts
with
5 additions
and
2 deletions
src/mol-util/scheduler.ts
+
5
−
2
View file @
0c7c82e0
...
@@ -89,7 +89,7 @@ function createImmediateActions() {
...
@@ -89,7 +89,7 @@ function createImmediateActions() {
function
canUsePostMessage
()
{
function
canUsePostMessage
()
{
// The test against `importScripts` prevents this implementation from being installed inside a web worker,
// The test against `importScripts` prevents this implementation from being installed inside a web worker,
// where `global.postMessage` means something completely different and can't be used for this purpose.
// where `global.postMessage` means something completely different and can't be used for this purpose.
const
global
=
window
as
any
;
const
global
=
typeof
window
!==
'
undefined
'
?
window
as
any
:
void
0
;
if
(
global
&&
global
.
postMessage
&&
!
global
.
importScripts
)
{
if
(
global
&&
global
.
postMessage
&&
!
global
.
importScripts
)
{
let
postMessageIsAsynchronous
=
true
;
let
postMessageIsAsynchronous
=
true
;
const
oldOnMessage
=
global
.
onmessage
;
const
oldOnMessage
=
global
.
onmessage
;
...
@@ -108,6 +108,7 @@ function createImmediateActions() {
...
@@ -108,6 +108,7 @@ function createImmediateActions() {
// * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
// * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
const
messagePrefix
=
'
setImmediate$
'
+
Math
.
random
()
+
'
$
'
;
const
messagePrefix
=
'
setImmediate$
'
+
Math
.
random
()
+
'
$
'
;
const
global
=
typeof
window
!==
'
undefined
'
?
window
as
any
:
void
0
;
const
onGlobalMessage
=
function
(
event
:
any
)
{
const
onGlobalMessage
=
function
(
event
:
any
)
{
if
(
event
.
source
===
global
&&
if
(
event
.
source
===
global
&&
typeof
event
.
data
===
'
string
'
&&
typeof
event
.
data
===
'
string
'
&&
...
@@ -187,7 +188,9 @@ function createImmediateActions() {
...
@@ -187,7 +188,9 @@ function createImmediateActions() {
const
immediateActions
=
(
function
()
{
const
immediateActions
=
(
function
()
{
if
(
typeof
setImmediate
!==
'
undefined
'
)
{
if
(
typeof
setImmediate
!==
'
undefined
'
)
{
return
{
setImmediate
,
clearImmediate
};
if
(
typeof
window
!==
'
undefined
'
)
{
return
{
setImmediate
:
(
handler
:
any
,
...
args
:
any
[])
=>
window
.
setImmediate
(
handler
,
...
args
as
any
),
clearImmediate
:
(
handle
:
any
)
=>
window
.
clearImmediate
(
handle
)
};
}
else
return
{
setImmediate
,
clearImmediate
}
}
}
return
createImmediateActions
();
return
createImmediateActions
();
}());
}());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment