Skip to content

Commit bc94d52

Browse files
authored
Merge pull request #108 from posthtml/milestone-1.6.2
Milestone 1.6.2
2 parents 5a88331 + 94d2bde commit bc94d52

File tree

6 files changed

+385
-135
lines changed

6 files changed

+385
-135
lines changed

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [1.6.2](https://github.com/posthtml/posthtml-expressions/compare/v1.6.1...v1.6.2) (2020-11-12)
2+
3+
4+
### Bug Fixes
5+
6+
* items is not defined in each, close [#107](https://github.com/posthtml/posthtml-expressions/issues/107) ([d14fbbb](https://github.com/posthtml/posthtml-expressions/commit/d14fbbb683460fad4f8b2edb649f9ef759b89038))
7+
8+
9+
110
## [1.6.1](https://github.com/posthtml/posthtml-expressions/compare/v1.6.0...v1.6.1) (2020-11-09)
211

312

lib/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,14 @@ function walk (opts, nodes) {
341341

342342
// parse the "loop" param
343343
const loopParams = parseLoopStatement(node.attrs.loop)
344-
const target = vm.runInContext(loopParams.expression, ctx)
344+
let target = {}
345+
try {
346+
target = vm.runInContext(loopParams.expression, ctx)
347+
} catch (error) {
348+
if (opts.strictMode) {
349+
throw new SyntaxError(error)
350+
}
351+
}
345352

346353
// handle additional syntax errors
347354
if (typeof target !== 'object') {

0 commit comments

Comments
 (0)