From 986fb3e9fd6f81f3d0b9c72833d5b1943f66c5d9 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 7 Dec 2017 14:26:59 -0800 Subject: [PATCH] re-add AsyncInterface definition, fix comment --- externs/polymer-internal-shared-types.js | 9 ++++++++- lib/mixins/property-effects.html | 4 ++-- lib/utils/async.html | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/externs/polymer-internal-shared-types.js b/externs/polymer-internal-shared-types.js index 30220a35c6..525aaae7a1 100644 --- a/externs/polymer-internal-shared-types.js +++ b/externs/polymer-internal-shared-types.js @@ -155,4 +155,11 @@ let PathInfo; * parentModel: (boolean | undefined) * }} */ -let TemplatizeOptions; \ No newline at end of file +let TemplatizeOptions; + +/** @record */ +function AsyncInterface(){} +/** @type {function(!Function, number=): number} */ +AsyncInterface.prototype.run; +/** @type {function(number)} */ +AsyncInterface.prototype.cancel; \ No newline at end of file diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index 7145adc0c4..8c26892f02 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -1424,7 +1424,7 @@ } /** - * Overrides the `PropertyAccessors` implementation to introduce special + * Overrides the `PropertiesChanged` implementation to introduce special * dirty check logic depending on the property & value being set: * * 1. Any value set to a path (e.g. 'obj.prop': 42 or 'obj.prop': {...}) @@ -1451,12 +1451,12 @@ * user code); we could introduce a "fixup" for temporarily cached array * paths if needed: https://github.com/Polymer/polymer/issues/4227 * + * @override * @param {string} property Name of the property * @param {*} value Value to set * @param {boolean=} shouldNotify True if property should fire notification * event (applies only for `notify: true` properties) * @return {boolean} Returns true if the property changed - * @override */ _setPendingProperty(property, value, shouldNotify) { let isPath = this.__dataHasPaths && Polymer.Path.isPath(property); diff --git a/lib/utils/async.html b/lib/utils/async.html index 9d0f201dec..0a6fdd0527 100644 --- a/lib/utils/async.html +++ b/lib/utils/async.html @@ -65,11 +65,11 @@ * * @memberof Polymer.Async.timeOut * @param {number=} delay Time to wait before calling callbacks in ms - * @return {AsyncInterface} An async timeout interface + * @return {!AsyncInterface} An async timeout interface */ after(delay) { return { - run(fn) { return setTimeout(fn, delay); }, + run(fn) { return window.setTimeout(fn, delay); }, cancel(handle) { window.clearTimeout(handle); } @@ -123,7 +123,7 @@ * Cancels a previously enqueued `animationFrame` callback. * * @function - * @memberof Polymer.Async.timeOut + * @memberof Polymer.Async.animationFrame * @param {number} handle Handle returned from `run` of callback to cancel * @return {void} */