Normalize string / No interpolation
Inline assignments
``` Dart``
_componentName0 = _gen.ChangeDetectionUtil.uninitialized();
_interpolate1 = _gen.ChangeDetectionUtil.uninitialized();
_directive_1_0 = _gen.ChangeDetectionUtil.uninitialized();
_directive_2_0 = _gen.ChangeDetectionUtil.uninitialized();
becomes:
``` Dart
_componentName0 = _interpolate1 = _directive_1_0 = _directive_2_0
= _gen.ChangeDetectionUtil.uninitialized;
Inline assignments and usages
_dispatcher.notifyOnBinding(currentProto.bindingRecord, interpolate1);
_interpolate1 = interpolate1;
becomes
_dispatcher.notifyOnBinding(currentProto.bindingRecord, _interpolate1 = interpolate1);
have notifyOnBinding helper
currentProto = _protos[1]
...
change_interpolate1 = true;
_dispatcher.notifyOnBinding(currentProto.bindingRecord, interpolate1);
_interpolate1 = interpolate1;
becomes
change_interpolate1 = viewSet(1, _interpolate1 = interpolate1);
which requires this method on superclass
boolean viewSet(int index, dynamic value) {
_view.notifyOnBinding(protos[index].bindingRecord, value);
return true;
}
looseNotIdentical
inline context assignment
var context = null;
context = _context;
should be
Unused change_context
var change_context = false;
but is never read.
change uninitialized() method call to uninitialized static field
Normalize string / No interpolation
interpolate1 = "" "${componentName0 == null ? "" : componentName0}" ""withinterpolate1 = " " + stringify(componentName0) + " ";NOTE: will require import ofstringifymethod. I think${}creates extra unneeded checks, so simple string concat+should be better in this case.Inline assignments
``` Dart``
_componentName0 = _gen.ChangeDetectionUtil.uninitialized();
_interpolate1 = _gen.ChangeDetectionUtil.uninitialized();
_directive_1_0 = _gen.ChangeDetectionUtil.uninitialized();
_directive_2_0 = _gen.ChangeDetectionUtil.uninitialized();
dehydrateDirectives()from constructor so that we don't have to duplicate the code in the constructor.Inline assignments and usages
becomes
have
notifyOnBindinghelperviewSetin super. Notice that_dispatcheris always a View. This code is no longer abstract so we should use concrete names.becomes
which requires this method on superclass
looseNotIdenticalloseNotIdenticalwhich will allow us to changeif (!_gen.looseIdentical(...))toif (_gen.looseNotIdentical(...)). (its only one char, but it is everywhere)inline context assignment
should be
Unused
change_contextbut is never read.
change
uninitialized()method call touninitializedstatic field