Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #154 from timoxley/bug/undefined-binding-delegate
Browse files Browse the repository at this point in the history
Enable bindingDelegate getter without bind attr
  • Loading branch information
rafaelw committed Jan 23, 2014
2 parents 270abde + 4ead88f commit a07d1c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/TemplateBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
},

get bindingDelegate() {
return this.delegate_.raw;
return this.delegate_ && this.delegate_.raw;
},

setDelegate_: function(delegate) {
Expand Down
7 changes: 7 additions & 0 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ suite('Template Instantiation', function() {
target.dispatchEvent(event);
}

test('accessing bindingDelegate getter without Bind', function(done) {
var div = createTestHtml('<template></template>');
var template = div.firstChild;
assert.strictEqual(template.bindingDelegate, undefined);
done();
});

test('Bind', function(done) {
var div = createTestHtml(
'<template bind={{}}>text</template>');
Expand Down

0 comments on commit a07d1c6

Please sign in to comment.