feat(pipes): support arguments in transform function

This commit is contained in:
Pouria Alimirzaei
2015-06-26 00:22:06 +04:30
committed by vsavkin
parent f0e962c55e
commit 600d53c68e
19 changed files with 74 additions and 41 deletions

View File

@ -304,6 +304,8 @@ class _CodegenState {
String _genPipeCheck(ProtoRecord r) {
var context = _localNames[r.contextIndex];
var argString = r.args.map((arg) => this._localNames[arg]).join(", ");
var oldValue = _fieldNames[r.selfIndex];
var newValue = _localNames[r.selfIndex];
var change = _changeNames[r.selfIndex];
@ -322,7 +324,7 @@ class _CodegenState {
$pipe = $_PIPE_REGISTRY_ACCESSOR.get('$pipeType', $context, $cdRef);
}
$newValue = $pipe.transform($context);
$newValue = $pipe.transform($context, [$argString]);
if (!$_IDENTICAL_CHECK_FN($oldValue, $newValue)) {
$newValue = $_UTIL.unwrapValue($newValue);
$change = true;