From cec8a6c9d3761a507d4593000defab8a298aab81 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 16 Oct 2015 16:23:29 +0200 Subject: [PATCH] Fix the remaining lint errors. --- static/cosmopolite.js | 8 +++++--- static/verify.sh | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/static/cosmopolite.js b/static/cosmopolite.js index f3a92e0..97817af 100644 --- a/static/cosmopolite.js +++ b/static/cosmopolite.js @@ -191,7 +191,7 @@ Cosmopolite.typeMessage; /** * @typedef {{command: string, arguments: Object, - onSuccess: (function(Object)|null)}} + onSuccess: (?function(Object))}} * @private */ Cosmopolite.typeRPC_; @@ -540,7 +540,8 @@ Cosmopolite.prototype.pin = function(subject, message) { // Ugly hack, but we need this to promise to resolve before the callback // fires. This is the equivalent of sched_yield(), and probably about as // reliable. - window.setTimeout(this.onPin_.bind(this, Object.create(args)), 0); + var msg = /** @type {Cosmopolite.typeMessage} */ (Object.create(args)); + window.setTimeout(this.onPin_.bind(this, msg), 0); return; } @@ -566,7 +567,8 @@ Cosmopolite.prototype.unpin = function(id) { if (pin['subject']['local']) { resolve(); - window.setTimeout(this.onUnpin_.bind(this, Object.create(pin)), 0); + var msg = /** @type {Cosmopolite.typeMessage} */ (Object.create(pin)); + window.setTimeout(this.onUnpin_.bind(this, msg), 0); return; } diff --git a/static/verify.sh b/static/verify.sh index c7f2f91..9e5515a 100755 --- a/static/verify.sh +++ b/static/verify.sh @@ -6,7 +6,7 @@ curl \ --data output_format=json \ --data output_info=errors \ --data output_info=warnings \ - --data language=ECMASCRIPT5 \ + --data language=ECMASCRIPT6 \ --data warning_level=verbose \ --data-urlencode "js_code@cosmopolite.js" \ http://closure-compiler.appspot.com/compile