ClojureScript

ClojureScript breaks goog.fx.dom.BgColorTransform

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

The following JS snippet in Google Closure works. (It animates the background color of the elem):

var transform = new goog.fx.dom.BgColorTransform(elem, start, end, 2000);
return transform.play();

The following CLJS code:

(ns bgcolor
(:require [goog.fx.dom :as fx-dom]))

(defn ^:export animate [elem start end]
(let [anim (fx-dom/BgColorTransform. elem start end 2000)]
(.play anim)))

gets compiled to (the final part in whitespace mode)

goog.provide("bgcolor");goog.require("cljs.core");goog.require("goog.fx.dom");bgcolor.animate=function animate(elem,start,end){var anim__1960=new goog.fx.dom.BgColorTransform(elem,start,end,2E3);return anim__1960.play};goog.exportSymbol("bgcolor.animate",bgcolor.animate);

and looks ok but does not work neither in whitespace mode nor in advanced mode

See the attached files for full examples.

  1. bg-color.cljs
    01/Aug/11 5:44 AM
    0.3 kB
    Sergey Didenko
  2. bg-color.html
    01/Aug/11 5:44 AM
    0.3 kB
    Sergey Didenko
  3. test.tar.gz
    01/Aug/11 5:44 AM
    0.5 kB
    Sergey Didenko

Activity

Hide
Sergey Didenko added a comment -

I used the wrong syntax for calling function without args.

Must be (.play anim ()) or (. anim (play))

Show
Sergey Didenko added a comment - I used the wrong syntax for calling function without args. Must be (.play anim ()) or (. anim (play))
Hide
Sergey Didenko added a comment -

Please close this, I can't find the way to do it.

Show
Sergey Didenko added a comment - Please close this, I can't find the way to do it.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: