fix: correctly understand variables with question marks

Fixes #77
This commit is contained in:
Ryan Kennedy
2018-07-18 10:15:43 +08:00
committed by Jun Yang
parent 6755462056
commit c79700ef1a
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -17,7 +17,8 @@ describe('expression', function () {
empty: '',
x: 'XXX',
y: undefined,
z: null
z: null,
'has_value?': true
})
})
@@ -30,6 +31,7 @@ describe('expression', function () {
it('should eval variables', function () {
expect(evalValue('23', scope)).to.equal(23)
expect(evalValue('one', scope)).to.equal(1)
expect(evalValue('has_value?', scope)).to.equal(true)
expect(evalValue('x', scope)).to.equal('XXX')
})