graphicore / ufoJS

Javascript API for the Unified Font Object
lib.ufojs.org
GNU General Public License v3.0
52 stars 10 forks source link

FIX: rmDirRecursive lost its binding to `this` when in deeper recursion ... #52

Closed graphicore closed 9 years ago

graphicore commented 9 years ago

...depths

found by @felipesanches

Cause was a noteworthy javascript syntax fauxpas where essentially in the call (true ? this.myMethod : this:otherMethod)() the conditional would return the bare method without a binding to this in the subsequent call :-)

Pomax commented 9 years ago

alternatively, calling the functions that roll out of an fn.bind(this) also solves that problem

graphicore commented 9 years ago

yeah, also .call(this, does the job.