assigning certain properties to constructor will fail #22

Open
neonstalwart opened this Issue Jan 4, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Owner

neonstalwart commented Jan 4, 2012

in FacetedStore there is a for loop to copy properties from facetSchema to constructor. if facetSchema contains certain properties (name, caller, length, etc) an error will be thrown in strict mode.

    for(i in facetSchema){
        constructor[i] = facetSchema[i];
    }

most of these properties are unlikely to be in a schema except that i came across this because i was using name in my schemas. should we just wrap that assignment in a try/catch to silence the errors?

    for(i in facetSchema){
        try {
            constructor[i] = facetSchema[i];
        }
        catch (e) {}
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment