summaryrefslogtreecommitdiff
path: root/js/src/Ice/browser/TimerUtil.js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-03-27 14:59:44 +0200
committerJose <jose@zeroc.com>2018-03-27 14:59:44 +0200
commit50c89b62292e9af17c0e55430805ea1dba1b2b97 (patch)
treee03433b24f57e9effca21c1bfdf0690f5cb841ae /js/src/Ice/browser/TimerUtil.js
parentJavaScript ESLINT prefer arrow callbacks (diff)
downloadice-50c89b62292e9af17c0e55430805ea1dba1b2b97.tar.bz2
ice-50c89b62292e9af17c0e55430805ea1dba1b2b97.tar.xz
ice-50c89b62292e9af17c0e55430805ea1dba1b2b97.zip
JavaScript ESLINT no var usage, prefer let and const
https://eslint.org/docs/rules/no-var
Diffstat (limited to 'js/src/Ice/browser/TimerUtil.js')
-rw-r--r--js/src/Ice/browser/TimerUtil.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/src/Ice/browser/TimerUtil.js b/js/src/Ice/browser/TimerUtil.js
index f34b1c35010..90317ec92d5 100644
--- a/js/src/Ice/browser/TimerUtil.js
+++ b/js/src/Ice/browser/TimerUtil.js
@@ -195,7 +195,7 @@ if(typeof(WorkerGlobalScope) !== 'undefined' && this instanceof WorkerGlobalScop
}
else if(worker === undefined)
{
- var url;
+ let url;
try
{
url = URL.createObjectURL(new Blob([workerCode()], {type : 'text/javascript'}));
@@ -205,8 +205,10 @@ else if(worker === undefined)
}
catch(ex)
{
- URL.revokeObjectURL(url);
-
+ if(url !== undefined)
+ {
+ URL.revokeObjectURL(url);
+ }
//
// Fallback on setInterval/setTimeout if the worker creating failed. Some IE10 and IE11 don't
// support creating workers from blob URLs for instance.