Skip to content

Determination of _subscribable/_addNode ('A' and 'wb' in minified version) need to be replaced. #20

@vamp

Description

@vamp

Next solution works well:

            function findProperty(object, regex) {
                for(var key in object){
                    if (regex.test(object[key])){
                        return key;
                    }
                }
            }

            function findInSingleLine(source, regex){
                return [].slice.call(String(source).split('\n').join(' ').match(regex) || []);
            }

            // Uglify2 creates "2!=arguments.length"
            var storedBindingRegex = /arguments\.length\s*(?:[!=]=+)\s*2|2\s*(?:[!=]=+)\s*arguments\.length/,
                storedBindingContextForNode = findProperty(ko, storedBindingRegex),
                names = findInSingleLine(ko[storedBindingContextForNode], /\.set\(.*?\).*?(\w+\.(\w+)).*?\2\.(\w+)\(/),
                subscribableName = names[2],
                addNodeName = names[3];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions