ClojureScript

`binding` doesn't work with vars from :require'd namespaces

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    clojurescript-0.0.1-329708bdd0.jar
    closure-compiler-r1592.jar
    closure-library-r1376.jar

Description

Compiling main.js from src-cljs...Exception in thread "main" java.lang.RuntimeException: java.lang.AssertionError: Assert failed: Invalid local name: vars/*slot-text*2884
(not (or (namespace name) (.contains (str name) ".")))
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.lang.AssertionError: Assert failed: Invalid local name: vars/*slot-text*2884
(not (or (namespace name) (.contains (str name) ".")))
at cljs.compiler$analyze_let$fn__1110.invoke(compiler.clj:730)
at cljs.compiler$analyze_let.invoke(compiler.clj:724)
at cljs.compiler$eval1119$fn__1120.invoke(compiler.clj:746)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:958)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze.invoke(compiler.clj:1004)
at cljs.compiler$analyze_block.invoke(compiler.clj:595)
at cljs.compiler$analyze_fn_method$fn__1086.invoke(compiler.clj:691)
at cljs.compiler$analyze_fn_method.invoke(compiler.clj:690)
at cljs.compiler$eval1091$fn_1093$fn_1096.invoke(compiler.clj:706)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__3811.invoke(core.clj:2424)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$apply.invoke(core.clj:600)
at cljs.compiler$eval1091$fn__1093.invoke(compiler.clj:707)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:958)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze.invoke(compiler.clj:1004)
at cljs.compiler$analyze_block.invoke(compiler.clj:595)
at cljs.compiler$analyze_let$fn__1115.invoke(compiler.clj:740)
at cljs.compiler$analyze_let.invoke(compiler.clj:739)
at cljs.compiler$eval1119$fn__1120.invoke(compiler.clj:746)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:958)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze.invoke(compiler.clj:1004)
at cljs.compiler$analyze_let$fn__1110.invoke(compiler.clj:731)
at cljs.compiler$analyze_let.invoke(compiler.clj:724)
at cljs.compiler$eval1119$fn__1120.invoke(compiler.clj:746)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:958)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze.invoke(compiler.clj:1004)
at cljs.compiler$analyze_block.invoke(compiler.clj:596)
at cljs.compiler$analyze_fn_method$fn__1086.invoke(compiler.clj:691)
at cljs.compiler$analyze_fn_method.invoke(compiler.clj:690)
at cljs.compiler$eval1091$fn_1093$fn_1096.invoke(compiler.clj:706)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__3811.invoke(core.clj:2424)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$apply.invoke(core.clj:600)
at cljs.compiler$eval1091$fn__1093.invoke(compiler.clj:707)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:958)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$eval1068$fn_1069$fn_1072.invoke(compiler.clj:662)
at cljs.compiler$eval1068$fn__1069.invoke(compiler.clj:661)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:958)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze_seq.invoke(compiler.clj:960)
at cljs.compiler$analyze.invoke(compiler.clj:1011)
at cljs.compiler$analyze.invoke(compiler.clj:1004)
at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:1071)
at cljs.compiler$compile_file.invoke(compiler.clj:1109)
at cljs.compiler$compile_root.invoke(compiler.clj:1169)
at cljs.closure$compile_dir.invoke(closure.clj:304)
at cljs.closure$eval1653$fn__1654.invoke(closure.clj:336)
at cljs.closure$eval1584$fn_1585$G1575_1592.invoke(closure.clj:215)
at cljs.closure$eval1640$fn__1641.invoke(closure.clj:350)
at cljs.closure$eval1584$fn_1585$G1575_1592.invoke(closure.clj:215)
at cljs.closure$build.invoke(closure.clj:785)
at cljsbuild.core$compile_cljs.invoke(core.clj:37)
at cljsbuild.core$run_compiler.invoke(core.clj:123)
at user$eval1925.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
... 12 more

Activity

Hide
Shantanu Kumar added a comment -

I accidentally pressed Submit before I could fill in all details. This exception occurs when I execute some code rebinding a var from a :require'd namespace. The scenario is below:

(ns foo
(:require [foo.vars :as vars]))

(binding [vars/*slot-text* :some-value]
...)

Show
Shantanu Kumar added a comment - I accidentally pressed Submit before I could fill in all details. This exception occurs when I execute some code rebinding a var from a :require'd namespace. The scenario is below: (ns foo (:require [foo.vars :as vars])) (binding [vars/*slot-text* :some-value] ...)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: