Skip to content

Commit

Permalink
ometa: fix predicates extension in applyNext
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Jun 14, 2012
1 parent 2792a03 commit c5d3dfd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/xjst/ometa/xjst.ometajs
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@ ometa XJSTParser <: BSJSParser {
-> [#template, this.predicates, b],

applyNextFlag = {
var flag = ~~(Math.random() * 1e9);
this.predicates = [
var flag = ~~(Math.random() * 1e9),
predicate = [
'binop', '!==',
['getp', ['string', '__$anflg'], ['this']],
['number', flag]
];

this.predicates = this.predicates.length ? [
'binop', '&&',
this.predicates,
[
'binop', '!==',
['getp', ['string', '__$anflg'], ['this']],
['number', flag]
]
];
predicate
] : predicate;

['set', ['getp', ['string', '__$anflg'], ['this']], ['number', flag]]
},
Expand Down

0 comments on commit c5d3dfd

Please sign in to comment.