diff --git a/src/TemplateBinding.js b/src/TemplateBinding.js
index 374561a..c2e8d1c 100644
--- a/src/TemplateBinding.js
+++ b/src/TemplateBinding.js
@@ -670,7 +670,15 @@
terminator = ']]';
}
- endIndex = startIndex < 0 ? -1 : s.indexOf(terminator, startIndex + 2);
+ if (startIndex >= 0) {
+ endIndex = s.indexOf(terminator, startIndex + 2);
+ // Handle this case [[foo['bar']]] and others like it.
+ while (s.length > endIndex + 2 && s[endIndex + 2] == terminator[0]) {
+ endIndex++;
+ }
+ } else {
+ endIndex = -1;
+ }
if (endIndex < 0) {
if (!tokens)
diff --git a/test/tests.js b/test/tests.js
index f450db4..ed1f31d 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -634,6 +634,22 @@ suite('Template Instantiation', function() {
});
});
+ test('OneTime - list/map', function(done) {
+ var div = createTestHtml(
+ '' +
+ '' +
+ '');
+ var template = div.firstChild;
+ var m = { foo: {'bar': 'baz'}, zap: ['zip'] };
+ template.model = m;
+
+ then(function() {
+ assert.strictEqual(2, div.childNodes.length);
+ assert.strictEqual('baz:zip', div.lastChild.getAttribute('foo'));
+ done();
+ });
+ });
+
test('OneTime/Dynamic Mixed - compound attribute', function(done) {
var div = createTestHtml(
'' +