refactor: use assert, fix: respect to express settings.views, close #16

This commit is contained in:
harttle
2016-11-03 00:43:23 +08:00
parent ce99bb56eb
commit f70b2ee203
25 changed files with 135 additions and 95 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
const operators = require('./operators.js');
const lexical = require('./lexical.js');
const assert = require('../src/util/assert.js');
function evalExp(exp, scope) {
if (!scope) throw new Error('unable to evalExp: scope undefined');
assert(scope, 'unable to evalExp: scope undefined');
var operatorREs = lexical.operators,
match;
for (var i = 0; i < operatorREs.length; i++) {