You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/11/02 21:36:43 UTC

[2/2] git commit: Properly default memo.translated to memo.value when it is undefined

Properly default memo.translated to memo.value when it is undefined


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/33ace582
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/33ace582
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/33ace582

Branch: refs/heads/5.4-js-rewrite
Commit: 33ace582c0d7f49d30c0c4484c1f014fc07ffa4c
Parents: b33dba0
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Fri Nov 2 13:34:42 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Fri Nov 2 13:34:42 2012 -0700

----------------------------------------------------------------------
 .../META-INF/modules/core/fields.coffee            |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/33ace582/tapestry-core/src/main/coffeescript/META-INF/modules/core/fields.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/fields.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/fields.coffee
index 141b6de..cb5382b 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/fields.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/fields.coffee
@@ -115,11 +115,13 @@ define ["_", "core/events", "core/spi", "core/builder", "core/utils", "core/form
           if memo.error
             failure = true
           else
-            memo.translated |= memo.value
+            if _.isUndefined memo.translated
+              memo.translated = memo.value
 
             this.trigger events.field.validate, memo
 
-            failure |= memo.error
+            if memo.error
+              failure = true
 
       if failure
         formMemo.error = true