manually convert Timer to defineProp
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f2e09a41 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f2e09a41 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f2e09a41 Branch: refs/heads/develop Commit: f2e09a410b2afa6bd59dd8d1fc1c6bc23444e53b Parents: f7f0f20 Author: Alex Harui <aha...@apache.org> Authored: Tue Feb 17 14:55:26 2015 -0800 Committer: Alex Harui <aha...@apache.org> Committed: Tue Feb 17 14:55:26 2015 -0800 ---------------------------------------------------------------------- .../FlexJS/src/org/apache/flex/utils/Timer.js | 81 +++++++------------- 1 file changed, 28 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2e09a41/frameworks/js/FlexJS/src/org/apache/flex/utils/Timer.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/Timer.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/Timer.js index 57815c1..455020c 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Timer.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Timer.js @@ -107,56 +107,31 @@ org_apache_flex_utils_Timer.prototype.timerHandler = }; - -/** - * @expose - * @return {number} The currentCount. - */ -org_apache_flex_utils_Timer.prototype.get_currentCount = function() { - return this._currentCount; -}; - - -/** - * @expose - * @return {boolean} True if the timer is running. - */ -org_apache_flex_utils_Timer.prototype.get_running = function() { - return this.timerInterval !== -1; -}; - - -/** - * @expose - * @return {number} The number of milliseconds between events. - */ -org_apache_flex_utils_Timer.prototype.get_delay = function() { - return this._delay; -}; - - -/** - * @expose - * @param {number} value The number of milliseconds between events. - */ -org_apache_flex_utils_Timer.prototype.set_delay = function(value) { - this._delay = value; -}; - - -/** - * @expose - * @return {number} The repeat count. - */ -org_apache_flex_utils_Timer.prototype.get_repeatCount = function() { - return this._repeatCount; -}; - - -/** - * @expose - * @param {number} value The repeat count. - */ -org_apache_flex_utils_Timer.prototype.set_repeatCount = function(value) { - this._repeatCount = value; -}; +Object.defineProperties(org_apache_flex_utils_Timer.prototype, { + "currentCount": { + get: function() { + return this._currentCount; + } + }, + "running": { + get: function() { + return this.timerInterval !== -1; + } + }, + "delay": { + get: function() { + return this._delay; + }, + set: function(value) { + this._delay = value; + } + }, + "repeatCount": { + get: function() { + return this._repeatCount; + }, + set: function(value) { + this._repeatCount = value; + } + } +});