There is at least one place (in the SMIL.parse case) where the callback call is asynchronous, therefore all calls must be asynchronous too or we could have strange bugs. Therefore you need to call the callback in a setTimeout here.