Thank's for the tip Ray. Unfortunately I'm not seeing the desired results
with Boolean, while Number works fine. However .valueOf() does return the
correct result.
Boolean.apply(null, [Object(false)])
true
Number.apply(null, [Object(5)])
5
(Object(false)).valueOf()
false
Reviewers: jat,
Description:
Direction estimators are simple classes which estimate a string's
direction using various heuristics.
This is useful for automatically setting the direction of an element
that contains text.
Please review this at http://gwt-code-reviews.appspot.com/338801/show
Mostly LGTM.
Aside from individuaal comments, can you clarify how these different
estimators will be used? It seems like most code is just going to use
the default.
http://gwt-code-reviews.appspot.com/338801/diff/1/4
File user/src/com/google/gwt/i18n/shared/DirectionEstimator.java
(right):
http://gwt-code-reviews.appspot.com/338801/show
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
Different estimation heuristics may be needed for different use cases.
For example, for a short input box where the direction behavior should
be clear, the first-strong heuristic is generally preferable (it is
used, for example, in Google.co.il). For long paragraphs the word-count
is better since
I assume you have run the tests including checkstyle?
http://gwt-code-reviews.appspot.com/338801/diff/1/9
File
user/test/com/google/gwt/i18n/shared/AnyRtlDirectionEstimatorTest.java
(right):
http://gwt-code-reviews.appspot.com/338801/diff/1/9#newcode25
Interesting, which browser? I just tried this in the Chrome console:
x = Object(true)
typeof(x) = object
y = Boolean.apply(null, [x]);
typeof(y) = boolean
-Ray
On Sun, Apr 11, 2010 at 6:32 AM, Sanjiv Jivan sanjiv.ji...@gmail.com wrote:
Thank's for the tip Ray. Unfortunately I'm not seeing the
I had originally tried on Safari 4.0.4 on OSX but just tried on Chrome (win)
and FF and got the same results.
So what you have is fine, the type returned on calling Boolean.apply(null,
[Object(true)] ) is indeed boolean.
The issue is that the value returned is incorrect when the original val is
Doh, you've right, boy do I love Javascript.
If you specify any object, including a Boolean object whose value is
false, as the initial value of a Boolean object, the new Boolean
object has a value of true.
-Ray
On Sun, Apr 11, 2010 at 4:24 PM, Sanjiv Jivan sanjiv.ji...@gmail.com wrote:
I had