paiq / blackcoffee

CoffeeScript + hygienic macros
MIT License
105 stars 9 forks source link

.toString() breaks variable substitution #10

Closed ngn closed 10 years ago

ngn commented 10 years ago
macro m (f) ->
  f.subst a: macro.csToNode 'b'

a = 123
b = 456
m -> console.info a.toString()

results in

/home/nick/temp/node_modules/blackcoffee/lib/coffee-script/macro.js:43
        throw e;
              ^
/home/nick/temp/a.coffee:8:20: error: substitution is not an identifier
m -> console.info a.toString()

The macro works fine if any other method is called in lieu of .toString()