ClojureScript

let scoping broken inside loop/recur with async calls

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

The let scope is not set correctly when making an async call inside a loop. Below is the test case showing the issue.

(doseq [x (range 1 20)] (let [y x] (js/setTimeout #(.log js/console y))))

This will log 19 over and over.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: