Stop relying on group split matching to keep separators
"string.path".split(/\./) should return: ["string", ".", "path"] This is not the case in IE8. IE returns: ["string", "path"] Instead do the split discarding the separators, get model and keypath from this array. Check unsplit path to se if the string has a bypass separator to set the option flag. This should probably be tested.
Showing
1 changed file
with
5 additions
and
4 deletions
... | @@ -122,11 +122,12 @@ class Rivets.View | ... | @@ -122,11 +122,12 @@ class Rivets.View |
122 | type = attribute.name.replace bindingRegExp, '' | 122 | type = attribute.name.replace bindingRegExp, '' |
123 | pipes = (pipe.trim() for pipe in attribute.value.split '|') | 123 | pipes = (pipe.trim() for pipe in attribute.value.split '|') |
124 | context = (ctx.trim() for ctx in pipes.shift().split '>') | 124 | context = (ctx.trim() for ctx in pipes.shift().split '>') |
125 | path = context.shift().split /(\.|:)/ | 125 | path = context.shift() |
126 | splitPath = path.split /\.|:/ | ||
126 | options.formatters = pipes | 127 | options.formatters = pipes |
127 | model = @models[path.shift()] | 128 | model = @models[splitPath.shift()] |
128 | options.bypass = path.shift() is ':' | 129 | options.bypass = path.indexOf(":") != -1 |
129 | keypath = path.join() | 130 | keypath = splitPath.join() |
130 | 131 | ||
131 | if dependencies = context.shift() | 132 | if dependencies = context.shift() |
132 | options.dependencies = dependencies.split /\s+/ | 133 | options.dependencies = dependencies.split /\s+/ | ... | ... |
-
Please register or sign in to post a comment