fix: pass drops directly to filters/tags

This commit is contained in:
harttle
2019-05-12 20:03:32 +08:00
parent 4282accaa2
commit bef290923c
15 changed files with 93 additions and 42 deletions
+6
View File
@@ -49,6 +49,12 @@ describe('filter', function () {
expect(await new Filter('add', ['2', '"c"'], false).render(3, ctx)).to.equal('5c')
})
it('should pass Objects/Drops as it is', async function () {
Filter.register('name', a => a.constructor.name)
class Foo {}
expect(await new Filter('name', [], false).render(new Foo(), ctx)).to.equal('Foo')
})
it('should not throw when filter name illegal', function () {
expect(function () {
new Filter('/', [], false)