[ClojureScript] Re: ANN: ClojureScript 1.9.493, another bugfix release

2017-02-26 Thread Rangel Spasov
I did some digging/manual shrinking. 

It seems that any core.async code with the latest version of ClojureScript does 
not compile under :advanced. I suspect the problem lies with the bump of Google 
Closure dependency and/or core.async.

I made a repo showing a minimal case:

https://github.com/raspasov/cljs-1.9.494-core-async-broken

On Friday, February 24, 2017 at 8:51:10 PM UTC-8, Rangel Spasov wrote:
> Forgot to add: this is my :compiler settings map. 
> 
> {:output-to  "index.ios.js"
>  :main   "env.ios.main"
>  :output-dir "target/ios"
>  :static-fns true
>  :optimize-constants true
>  :parallel-build true
>  ;:pretty-print   true
>  ;:pseudo-names   true
>  :source-map "cljs-source-map.js"
>  :optimizations  :advanced
>  :externs["externs/externs.js"]
>  :closure-defines{"goog.DEBUG" false}}
> 
> On Friday, February 24, 2017 at 8:46:03 PM UTC-8, Rangel Spasov wrote:
> > Hey guys,
> > 
> > I'm getting this error. It seems that it's happening inside the transpiled 
> > core.async sources. The error carrot at line 1444 points at the semicolon, 
> > pretty strange.
> > 
> > 
> > Feb 24, 2017 8:38:19 PM com.google.javascript.jscomp.LoggerErrorManager 
> > println
> > SEVERE: 
> > /Users/raspasov/projects/project123/target/ios/cljs/core/async.js:1444: 
> > ERROR - Parse error. No newline allowed before '=>'
> > var inst_33727 = async(inst_33726); (^ points at the semicolon)
> > 
> > 
> > Feb 24, 2017 8:38:19 PM com.google.javascript.jscomp.LoggerErrorManager 
> > printSummary
> > WARNING: 1 error(s), 4 warning(s)
> > ERROR: JSC_PARSE_ERROR. Parse error. No newline allowed before '=>' at 
> > /Users/raspasov/projects/project123/target/ios/cljs/core/async.js line 1444 
> > : 34
> > 
> > I tried both :parallel-build true/false but it doesn't make a difference. 
> > It works fine on [org.clojure/clojurescript "1.9.473"]
> > 
> > 
> > Here's how the async.js source looks like around line 1444.
> > 
> > return cljs.core.cst$kw$recur;
> > } else {
> > if((state_val_33738 === (2))){
> > var state_33737__$1 = state_33737;
> > return 
> > cljs.core.async.impl.ioc_helpers.take_BANG_(state_33737__$1,(4),jobs);
> > } else {
> > if((state_val_33738 === (3))){
> > var inst_33735 = (state_33737[(2)]);
> > var state_33737__$1 = state_33737;
> > return 
> > cljs.core.async.impl.ioc_helpers.return_chan(state_33737__$1,inst_33735);
> > } else {
> > if((state_val_33738 === (4))){
> > var inst_33726 = (state_33737[(2)]);
> > var inst_33727 = async(inst_33726);  This is the error line 
> > number 1444
> > var state_33737__$1 = state_33737;
> > if(cljs.core.truth_(inst_33727)){
> > var statearr_33743_33989 = state_33737__$1;
> > (statearr_33743_33989[(1)] = (5));
> > 
> > } else {
> > var statearr_33744_33990 = state_33737__$1;
> > (statearr_33744_33990[(1)] = (6));
> > 
> > }
> > 
> > return cljs.core.cst$kw$recur;
> > } else {
> > if((state_val_33738 === (5))){
> > var state_33737__$1 = state_33737;
> > var statearr_33745_33992 = state_33737__$1;
> > (statearr_33745_33992[(2)] = null);
> > 
> > (statearr_33745_33992[(1)] = (2));
> > 
> > 
> > return cljs.core.cst$kw$recur;
> > } else {
> > if((state_val_33738 === (6))){
> > var state_33737__$1 = state_33737;
> > var statearr_33746_33993 = state_33737__$1;
> > (statearr_33746_33993[(2)] = null);
> > 
> > (statearr_33746_33993[(1)] = (7));
> > 
> > 
> > return cljs.core.cst$kw$recur;
> > } else {
> > if((state_val_33738 === (7))){
> > var inst_33733 = (state_33737[(2)]);
> > var state_33737__$1 = state_33737;
> > var statearr_33747_33994 = state_33737__$1;
> > (statearr_33747_33994[(2)] = inst_33733);
> > 
> > (statearr_33747_33994[(1)] = (3));
> > 
> > 
> > return cljs.core.cst$kw$recur;
> > } else {
> > return null;
> > }
> > }
> > }
> > }
> > }
> > }
> > }
> > 
> > 
> > On Friday, February 24, 2017 at 4:21:35 PM UTC-8, David Nolen wrote:
> > > Just cut 1.9.494 to back out some macros that were made unintentionally 
> > > private.
> > > 
> > > 
> > > On Fri, Feb 24, 2017 at 4:47 PM, David Nolen  wrote:
> > > 
> > > 
> > > ClojureScript, the Clojure compiler that emits JavaScript source code.
> > > 
> > > 
> > > README and source code: https://github.com/clojure/clojurescript
> > > 
> > > 
> > > Leiningen dependency information:
> > > 
> > > 
> > > [org.clojure/clojurescript "1.9.493"]
> > > 
> > > 
> > > This is a bugfix release.
> > > 
> > > 
> > > As always, feedback welcome!
> > > 
> > > 
> > > ### Fixes
> > > * CLJS-1948: Possible race condition in compiler w/ parallel-build true
> > > * CLJS-1941: `cljs.compiler/cljs-files-in` shouldn't return `.cljc` files 
> > > if a `.cljs` file exists for the namespace
> > > * CLJS-1940: Undeclared var warning when invoking a protocol method on a 
> > > `js` interop form
> > > * CLJS-1951: Missing 0 and 1 arity versions of interleave
> > > * CLJS-1952: Bump Closure Compiler to Feb 2017 

Re: [ClojureScript] Re: js->clj keywords

2017-02-26 Thread Daniel Compton
What version of CLJS are you using? The patch was introduced in CLJS
1.9.183. Running on Planck this seems to work:

cljs.user=> (js->clj (clj->js {"a" 1}) :keywordize-keys true)
{:a 1}

I have a vague memory that some of the types in the DOM API behave like JS
objects, but aren’t actually JS primitives (strings, arrays), so js->clj
doesn’t work as expected on them. From memory ClientRect

(or something like it) was one of these. That could possibly be the issue?

On Mon, Feb 27, 2017 at 6:07 AM Varga Radu 
wrote:

> On Thursday, 7 January 2016 18:10:22 UTC+1, Nicolás Berger  wrote:
> > Pretty old thread, but it turns out there's a bug in the 1-arity version
> of js->clj: it passes a map instead of keyword arguments to set the default
> of :keywordize-keys false. It works fine, because keywordize-keys ends as
> nil by default, which is falsey of course... But when you (or me, like I
> did a few minutes ago :) ) try to do the same but passing {:keywordize-keys
> true} you find that it doesn't work as you expect.
> >
> > Just sent a patch to fix this:
> http://dev.clojure.org/jira/browse/CLJS-1540
>
> The option ":keywordize-keys" still doesn't work for me.
> Usage: (js->clj response :keywordize-keys true))
> I still get the stringed-key array-map.
> Any ideas why?
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.
>
-- 

Daniel

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: js->clj keywords

2017-02-26 Thread Varga Radu
On Thursday, 7 January 2016 18:10:22 UTC+1, Nicolás Berger  wrote:
> Pretty old thread, but it turns out there's a bug in the 1-arity version of 
> js->clj: it passes a map instead of keyword arguments to set the default of 
> :keywordize-keys false. It works fine, because keywordize-keys ends as nil by 
> default, which is falsey of course... But when you (or me, like I did a few 
> minutes ago :) ) try to do the same but passing {:keywordize-keys true} you 
> find that it doesn't work as you expect.
> 
> Just sent a patch to fix this: http://dev.clojure.org/jira/browse/CLJS-1540

The option ":keywordize-keys" still doesn't work for me. 
Usage: (js->clj response :keywordize-keys true))
I still get the stringed-key array-map.
Any ideas why?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.