In KeypathParer.parse, iterate over the keypath string with 'in' instead of 'of'.
Showing
3 changed files
with
4 additions
and
4 deletions
... | @@ -637,14 +637,14 @@ | ... | @@ -637,14 +637,14 @@ |
637 | function KeypathParser() {} | 637 | function KeypathParser() {} |
638 | 638 | ||
639 | KeypathParser.parse = function(keypath, interfaces, root) { | 639 | KeypathParser.parse = function(keypath, interfaces, root) { |
640 | var char, current, index, tokens; | 640 | var char, current, tokens, _i, _len; |
641 | tokens = []; | 641 | tokens = []; |
642 | current = { | 642 | current = { |
643 | "interface": root, | 643 | "interface": root, |
644 | path: '' | 644 | path: '' |
645 | }; | 645 | }; |
646 | for (index in keypath) { | 646 | for (_i = 0, _len = keypath.length; _i < _len; _i++) { |
647 | char = keypath[index]; | 647 | char = keypath[_i]; |
648 | if (__indexOf.call(interfaces, char) >= 0) { | 648 | if (__indexOf.call(interfaces, char) >= 0) { |
649 | tokens.push(current); | 649 | tokens.push(current); |
650 | current = { | 650 | current = { | ... | ... |
This diff is collapsed.
Click to expand it.
... | @@ -8,7 +8,7 @@ class Rivets.KeypathParser | ... | @@ -8,7 +8,7 @@ class Rivets.KeypathParser |
8 | tokens = [] | 8 | tokens = [] |
9 | current = {interface: root, path: ''} | 9 | current = {interface: root, path: ''} |
10 | 10 | ||
11 | for index, char of keypath | 11 | for char in keypath |
12 | if char in interfaces | 12 | if char in interfaces |
13 | tokens.push current | 13 | tokens.push current |
14 | current = {interface: char, path: ''} | 14 | current = {interface: char, path: ''} | ... | ... |
-
Please register or sign in to post a comment