Remove some reserved word errors identified by YUICompressor
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/300494b8 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/300494b8 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/300494b8 Branch: refs/heads/5.4-js-rewrite Commit: 300494b827bf6c5b256594c046bca0a56ae11abc Parents: 821a5d9 Author: Howard M. Lewis Ship <hls...@apache.org> Authored: Mon Aug 20 10:39:37 2012 -0700 Committer: Howard M. Lewis Ship <hls...@apache.org> Committed: Mon Aug 20 10:39:37 2012 -0700 ---------------------------------------------------------------------- .../coffeescript/META-INF/modules/core/spi.coffee | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/300494b8/tapestry-core/src/main/coffeescript/META-INF/modules/core/spi.coffee ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/spi.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/spi.coffee index 9a52bad..c0aaaab 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/spi.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/spi.coffee @@ -56,15 +56,15 @@ define ["_", "prototype"], (_) -> throw new Error "Provided value <#{content}> is not valid as DOM element content." # _internal_: Currently don't want to rely on Scriptaculous, since our needs are pretty minor. - animate = (element, styleName, initial, final, duration, callbacks) -> + animate = (element, styleName, initialValue, finalValue, duration, callbacks) -> styles = {} - range = final - initial + range = finalValue - initialValue initialTime = Date.now() first = true animator = -> elapsed = Date.now() - initialTime if elapsed >= duration - styles[styleName] = final + styles[styleName] = finalValue element.setStyle styles window.clearInterval timeoutID callbacks.oncomplete and callbacks.oncomplete() @@ -81,7 +81,7 @@ define ["_", "prototype"], (_) -> timeoutID = window.setInterval animator - styles[styleName] = initial + styles[styleName] = initialValue element.setStyle styles # Generic view of an DOM event that is passed to a handler function. @@ -98,11 +98,10 @@ define ["_", "prototype"], (_) -> constructor: (event) -> @nativeEvent = event - @memo = event.memo - @type = event.type - @char = event.char - @key = event.key + # This is to satisfy YUICompressor which doesn't seem to like 'char', even + # though it doesn't appear to be a reserved word. + this[name] = event[name] for name in ["memo", "type", "char", "key"] # Stops the event which prevents further propagation of the DOM event, # as well as DOM event bubbling.