Skip to content

Commit 293a16d

Browse files
committed
reverse directive compile order to be consistent with markup #202
1 parent 6dc5985 commit 293a16d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/compiler.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,12 @@ CompilerProto.compileElement = function (node, root) {
506506
return
507507
}
508508

509+
var i, l, j, k
510+
509511
// check priority directives.
510512
// if any of them are present, it will take over the node with a childVM
511513
// so we can skip the rest
512-
for (var i = 0, l = priorityDirectives.length; i < l; i++) {
514+
for (i = 0, l = priorityDirectives.length; i < l; i++) {
513515
if (this.checkPriorityDir(priorityDirectives[i], node, root)) {
514516
return
515517
}
@@ -525,8 +527,7 @@ CompilerProto.compileElement = function (node, root) {
525527
params = this.options.paramAttributes,
526528
attr, isDirective, exps, exp, directive, dirname
527529

528-
i = attrs.length
529-
while (i--) {
530+
for (i = 0, l = attrs.length; i < l; i++) {
530531

531532
attr = attrs[i]
532533
isDirective = false
@@ -537,9 +538,8 @@ CompilerProto.compileElement = function (node, root) {
537538
exps = Directive.split(attr.value)
538539
// loop through clauses (separated by ",")
539540
// inside each attribute
540-
l = exps.length
541-
while (l--) {
542-
exp = exps[l]
541+
for (j = 0, k = exps.length; j < k; j++) {
542+
exp = exps[j]
543543
dirname = attr.name.slice(prefix.length)
544544
directive = Directive.build(dirname, exp, this, node)
545545

0 commit comments

Comments
 (0)