ClojureScript

(keyword 'symbol) broken

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
  • Patch:
    Code and Test

Description

Looks like keyword's support for accepting symbols was missed when cljs.core.Symbol was introduced:

cljs.user=> (keyword "x")
:x
cljs.user=> (keyword "x" "y")
:x/y
cljs.user=> (keyword 'x)
"Error evaluating:" (keyword (quote x)) :as "cljs.core.keyword.call(null,new cljs.core.Symbol(null,\"x\",\"x\",-1640531407,null));\n"
#<TypeError: Object [object Object] has no method 'substring'>
TypeError: Object [object Object] has no method 'substring'
    at subs__2 (http://localhost:52199/1530/repl/start:479:80)
    at subs (http://localhost:52199/1530/repl/start:479:237)
    at keyword__1 (http://localhost:52199/1530/repl/start:482:239)
    at keyword (http://localhost:52199/1530/repl/start:482:533)
    at eval (eval at <anonymous> (http://localhost:52199/1530/repl/start:1917:224), <anonymous>:1:83)
    at eval (eval at <anonymous> (http://localhost:52199/1530/repl/start:1917:224), <anonymous>:6:3)
    at http://localhost:52199/1530/repl/start:1917:219
    at evaluate_javascript (http://localhost:52199/1530/repl/start:1918:88)
    at Object.callback (http://localhost:52199/1530/repl/start:1926:42)
    at goog.messaging.AbstractChannel.deliver (http://localhost:52199/1530/repl/start:1741:343)
nil
cljs.user=> (keyword 'x 'y)
:x/y

Activity

Hide
Chas Emerick added a comment -

Patch attached.

Show
Chas Emerick added a comment - Patch attached.
Hide
David Nolen added a comment -

This patch segfaults JavaScriptCore when running the tests on my machine when using advanced compilation. I've seen JSC act up before so perhaps this is not a real issue but I'd like to hear from at least a couple of other people first running against the WebKit Nightlies.

Show
David Nolen added a comment - This patch segfaults JavaScriptCore when running the tests on my machine when using advanced compilation. I've seen JSC act up before so perhaps this is not a real issue but I'd like to hear from at least a couple of other people first running against the WebKit Nightlies.
Hide
Chas Emerick added a comment - - edited

FWIW, looks good here with latest webkit nightly (r151197) on OS X 10.7.x.

Show
Chas Emerick added a comment - - edited FWIW, looks good here with latest webkit nightly (r151197) on OS X 10.7.x.
Hide
David Nolen added a comment -

Good to hear. I'd like to hear one more confirmation. I'm running on 10.8.

Show
David Nolen added a comment - Good to hear. I'd like to hear one more confirmation. I'm running on 10.8.
Hide
Matjaz Gregoric added a comment -

This change seems to cause the compiler to print the following warning:

WARNING: Use of undeclared Var cljs.core/name at line 1765 /Users/gremat/Code/cljs/clojurescript/src/cljs/cljs/core.cljs
Show
Matjaz Gregoric added a comment - This change seems to cause the compiler to print the following warning:
WARNING: Use of undeclared Var cljs.core/name at line 1765 /Users/gremat/Code/cljs/clojurescript/src/cljs/cljs/core.cljs
Hide
David Nolen added a comment -

Thanks for the report, should be fixed in master.

Show
David Nolen added a comment - Thanks for the report, should be fixed in master.
Hide
Chas Emerick added a comment -

Bizarre, I hadn't/haven't seen that at all...? Sorry for the noise.

Show
Chas Emerick added a comment - Bizarre, I hadn't/haven't seen that at all...? Sorry for the noise.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: