sirlantis/liquid-node — pull request #14 by dotnil (2014-01-12 07:43:31+00:00)
Title: Remove prototype assigning in custom error

In Variable#render method https://github.com/sirlantis/liquid-node/blob/master/src/liquid/variable.coffee#L47 checks the thrown error to see if it's an instance of FilterNotFound. If it is, then liquid-node will notify the user that the very filter he asks is not defined.

But there's a bug in the method that creates FilterNotFound class. https://github.com/sirlantis/liquid-node/blob/master/src/index.coffee#L14 assigning prototype directly confuses `instanceof`, makes it returning `true` even if the sub class is absolutely not the class or parent class of that error.

See this gist for a demo: https://gist.github.com/dotnil/8381942