You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/04/06 10:07:33 UTC

[2/3] incubator-weex git commit: eslint warning

eslint warning


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/86bacfb3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/86bacfb3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/86bacfb3

Branch: refs/heads/0.12-dev
Commit: 86bacfb3399ecdad72002a630ad719e76a0bbf7c
Parents: b10d424
Author: kaifeng.ly <ka...@alibaba-inc.com>
Authored: Thu Apr 6 17:29:23 2017 +0800
Committer: kaifeng.ly <ka...@alibaba-inc.com>
Committed: Thu Apr 6 17:29:23 2017 +0800

----------------------------------------------------------------------
 html5/frameworks/legacy/app/ctrl/init.js | 58 +++++++++++++--------------
 1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/86bacfb3/html5/frameworks/legacy/app/ctrl/init.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/ctrl/init.js b/html5/frameworks/legacy/app/ctrl/init.js
index 6971199..df58ed8 100644
--- a/html5/frameworks/legacy/app/ctrl/init.js
+++ b/html5/frameworks/legacy/app/ctrl/init.js
@@ -89,49 +89,49 @@ export function init (app, code, data, services) {
           args[0](...args.slice(2))
         }
 
-        var timerId, callbackId;
-
-        if( global.setTimeoutWeex && (typeof global.setTimeoutWeex === 'function')){
-            callbackId = app.doc.taskCenter.normalize(handler);
-            timerId = global.setTimeoutWeex(app.id, callbackId, args[1]);
-            return timerId;
-        }else{
-          timer.setTimeout(handler, args[1]);
-          return app.doc.taskCenter.callbackManager.lastCallbackId.toString();
-        }
+        let timerId, callbackId
 
+        if (global.setTimeoutWeex && (typeof global.setTimeoutWeex === 'function')) {
+          callbackId = app.doc.taskCenter.normalize(handler)
+          timerId = global.setTimeoutWeex(app.id, callbackId, args[1])
+          return timerId
+        }
+        else {
+          timer.setTimeout(handler, args[1])
+          return app.doc.taskCenter.callbackManager.lastCallbackId.toString()
+        }
       },
       setInterval: (...args) => {
         const handler = function () {
           args[0](...args.slice(2))
         }
 
-        var timerId, callbackId;
-        
-        if( global.setIntervalWeex && (typeof global.setIntervalWeex === 'function')){
-          callbackId = app.doc.taskCenter.normalize(handler);
-          timerId = global.setIntervalWeex(app.id, callbackId, args[1]);
-          return timerId;
-        }else{
-          timer.setInterval(handler, args[1]);
-          return app.doc.taskCenter.callbackManager.lastCallbackId.toString();
+        let timerId, callbackId
+
+        if (global.setIntervalWeex && (typeof global.setIntervalWeex === 'function')) {
+          callbackId = app.doc.taskCenter.normalize(handler)
+          timerId = global.setIntervalWeex(app.id, callbackId, args[1])
+          return timerId
+        }
+        else {
+          timer.setInterval(handler, args[1])
+          return app.doc.taskCenter.callbackManager.lastCallbackId.toString()
         }
-        
       },
       clearTimeout: (n) => {
-        
-        if( global.clearTimeoutWeex && (typeof global.clearTimeoutWeex === 'function')){
-          global.clearTimeoutWeex(n);
-        }else{
+        if (global.clearTimeoutWeex && (typeof global.clearTimeoutWeex === 'function')) {
+          global.clearTimeoutWeex(n)
+        }
+        else {
           timer.clearTimeout(n)
         }
       },
       clearInterval: (n) => {
-        
-        if( global.clearIntervalWeex && (typeof global.clearIntervalWeex === 'function')){
-          global.clearIntervalWeex(n);
-        }else{
-          timer.clearInterval(n);
+        if (global.clearIntervalWeex && (typeof global.clearIntervalWeex === 'function')) {
+          global.clearIntervalWeex(n)
+        }
+        else {
+          timer.clearInterval(n)
         }
       }
     })