FieldDB API overwrites _.bind (line 51552 of fielddb.js); raises TypeError
jrwdunham opened this issue · comments
@cesine Is it necessary that the FieldDB API overwrite _.bind ? This seems to be causing issues. See screenshots.
Can you rename this or do you have a solution on my end?
its probably the frb library... i'll take a look :(
... i scrolled up and found it was underscore. i guess this means we just need to use the same version of underscore as you?
// Underscore.js 1.8.3
// http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license
(function() {
i switched it to use the same version of lodash as you and now its even more wierd, fielddb is actually lodash upon page load. i guess we need to use lodash v4 when it comes out... lodash/lodash#223 i might not be able to figure this out before i have to go to work...
FieldDB
lodash(value) {
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor
return (value && typeof value == 'object' && !isArray(value) && hasOwnPropert…
@jrwdunham i removed the dependancy since we only used underscore in some sections of the code that came from the backbone app.
I don't get the same error that you mentioned when I run dative (basically all i can do is log in because my other pull requests involving map reduces havent been accepted so i cant load a corpus or a form) on my machine, i'm guessing it should show anytime backbone tries to bind so maybe i've successfully reproduced it :)
Are you able to checkout the branch cesine:fix/bindoverwrite
and build, or how can you test to see if this fixes it before we go ahead and merge this...
@cesine thanks for merging this. I don't know how to recreate the _.bind
bug. It occurred sporadically. But if you use Dative for any length of time you would have seen it cropping up.