cloudhead/less.js — Issue #553: Best way to override error handling?
Author: matthewdl
Created: 2012-01-09 17:35:36+00:00
State: open

I'm struggling to figure out how to override private functions and methods. For past versions of Crunch, I've simply altered the code to raise an error that can be consumed by the UI. (I found the reason I had to do this was because an error wasn't returned to the less.Parser call if the error occurred in an imported file.)

The process of modifying each release of LESS is time-consuming, so I'm wondering what's the best way to override error-handling, or interrupt the error call, without changing the code in the released JavaScript file. I did a bunch of research on accessing private methods / variables, but apparently private is private, even in JavaScript. Is it possible that a future release could have more of the methods and objects exposed somewhere in the less object? I don't think this would affect performance.