fix null on if
This commit is contained in:
parent
b4a63ac701
commit
e74bcd0860
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
# 2.1.0
|
||||||
|
* Fixed handling of `if` in non-strict mode.
|
||||||
|
*
|
||||||
|
|
||||||
# 2.0.1
|
# 2.0.1
|
||||||
* Fixed bug where the `textarea` name check would never return `true`.
|
* Fixed bug where the `textarea` name check would never return `true`.
|
||||||
|
|
||||||
|
|
|
@ -211,12 +211,14 @@ class Renderer {
|
||||||
Element element, CodeBuffer buffer, SymbolTable scope, bool html5) {
|
Element element, CodeBuffer buffer, SymbolTable scope, bool html5) {
|
||||||
var attribute = element.attributes.singleWhere((a) => a.name == 'if');
|
var attribute = element.attributes.singleWhere((a) => a.name == 'if');
|
||||||
|
|
||||||
var v = attribute.value.compute(scope) as bool;
|
var vv = attribute.value.compute(scope);
|
||||||
|
|
||||||
if (scope.resolve('!strict!')?.value == false) {
|
if (scope.resolve('!strict!')?.value == false) {
|
||||||
v = v == true;
|
vv = vv == true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var v = vv as bool;
|
||||||
|
|
||||||
if (!v) return;
|
if (!v) return;
|
||||||
|
|
||||||
var otherAttributes = element.attributes.where((a) => a.name != 'if');
|
var otherAttributes = element.attributes.where((a) => a.name != 'if');
|
||||||
|
|
Loading…
Reference in a new issue