mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixed error reporting
This commit is contained in:
parent
0a3cb07a42
commit
8f171379bb
@ -25,7 +25,7 @@ function isEmpty(o) {
|
||||
if (!o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
for (var k in o) {
|
||||
if (o.hasOwnProperty(k)) {
|
||||
return false;
|
||||
@ -107,9 +107,9 @@ ElementNode.prototype = {
|
||||
if (this.attributesByNS[namespace]) {
|
||||
forEachEntry(this.attributesByNS[namespace], function (name, attr) {
|
||||
attributes.push(attr);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return attributes;
|
||||
},
|
||||
getAttribute: function (name) {
|
||||
@ -208,6 +208,9 @@ ElementNode.prototype = {
|
||||
if (preserveWhitespace) {
|
||||
this.removePreserveSpaceAttr();
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
|
||||
template.text('<' + name);
|
||||
this.forEachAttributeAnyNS(function (attr) {
|
||||
var prefix = attr.prefix;
|
||||
@ -243,10 +246,10 @@ ElementNode.prototype = {
|
||||
},
|
||||
error: function (message) {
|
||||
invalidAttr = true;
|
||||
this.addError('Invalid expression found in attribute "' + name + '". ' + message);
|
||||
_this.addError('Invalid expression found in attribute "' + name + '". ' + message);
|
||||
}
|
||||
}, this);
|
||||
|
||||
});
|
||||
|
||||
if (invalidAttr) {
|
||||
template.text(name + '="' + escapeXmlAttr(attr.value) + '"');
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user