russplaysguitar / UnderscoreCF

An UnderscoreJS port for Coldfusion. Functional programming library.
http://russplaysguitar.github.com/UnderscoreCF/
MIT License
89 stars 38 forks source link

toArray() uses for-in loop on a list variable which is not supported #39

Closed advrider closed 10 years ago

advrider commented 10 years ago

I tried using the code in toArray() function for a query and found out it is using cfscript for-in loop on a list !!! This produces an error.

"for (var colName in arguments.obj.columnList) {..."

from CF ref: "Note: Unlike the cfloop tag, CFScript for-in loops do not provide built-in support for looping over queries and lists."

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a0e0-7fdf.html#WSc3ff6d0ea77859461172e0811cbec0a0e0-7fe8

russplaysguitar commented 10 years ago

Thanks for making the report. Are you using CF 10? The doc you referenced is for CF 9, but Underscore only works with CF 10+ or Railo 4+.

advrider commented 10 years ago

Reference for CF10 is the same for-in loop.

The issue is corrected on the version available on gethub main page. (the master zip file) (see line 687) But the download that I originally used on this page https://github.com/russplaysguitar/UnderscoreCF points to a version that is different and has the issue I pointed out.

russplaysguitar commented 10 years ago

Oh ok, great, sounds like its past time for a new release!

russplaysguitar commented 10 years ago

fixed with release 2.4