From 404bff5bcff1f7ea1e0fe459c1cd44d2d7c1388d Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Sat, 26 Mar 2016 22:35:46 +0000 Subject: [PATCH] error parameters for formatMaximum/formatMinimum, #151 --- lib/dot/errors.def | 2 +- lib/dot/v5/_formatLimit.jst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dot/errors.def b/lib/dot/errors.def index 5373d91..4e1127a 100644 --- a/lib/dot/errors.def +++ b/lib/dot/errors.def @@ -180,6 +180,6 @@ patternRequired: "{ missingPattern: '{{=$missingPattern}}' }", switch: "{ caseIndex: {{=$caseIndex}} }", constant: "{}", - _formatLimit: "{ limit: {{#def.schemaValueQS}} }", + _formatLimit: "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }", _exclusiveFormatLimit: "{}" } #}} diff --git a/lib/dot/v5/_formatLimit.jst b/lib/dot/v5/_formatLimit.jst index 8653e09..f309d7e 100644 --- a/lib/dot/v5/_formatLimit.jst +++ b/lib/dot/v5/_formatLimit.jst @@ -85,15 +85,15 @@ var {{=$valid}} = undefined; {{# def.elseIfValid }} {{# def.compareFormat }} - var exclusive{{=$lvl}} = {{=$schemaValueExcl}} === true; + var {{=$exclusive}} = {{=$schemaValueExcl}} === true; if ({{=$valid}} === undefined) { - {{=$valid}} = exclusive{{=$lvl}} + {{=$valid}} = {{=$exclusive}} ? {{=$result}} {{=$op}} 0 : {{=$result}} {{=$op}}= 0; } - if (!{{=$valid}}) var op{{=$lvl}} = exclusive{{=$lvl}} ? '{{=$op}}' : '{{=$op}}='; + if (!{{=$valid}}) var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; {{??}} {{ var $exclusive = $schemaExcl === true