Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: functions in nested objects should be bound to that object (#1860) #1861

Draft
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions spec/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@ describe('basic context', function() {
})
.withMessage('functions are bound to the context')
.toCompileTo('More awesome');

expectTemplate('{{nested.awesome}}')
.withInput({
nested: {
awesome: function() {
return this.more;
},
more: 'Deeply awesome'
},
more: 'More awesome'
})
.withMessage(
'functions in nested objects are bound to that object, consistent with JS spec'
)
.toCompileTo('Deeply awesome');
});

it('functions with context argument', function() {
Expand Down