WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 4263
11579
Fix test script error when checking the correct result.
https://bugs.webkit.org/show_bug.cgi?id=11579
Summary
Fix test script error when checking the correct result.
digdog
Reported
2006-11-12 00:59:48 PST
in tests/mozilla/js1_2/version120/boolean-001.js, the test script check the Bollean object by using RelationalExpression directly: object = new Bollean(false); if (object) { // is true } else { // is false } Though the object value is false, but the IF statement will apply ToBollean operator (ECMA 9.3) with Object, and return true always. To fix this, simply use "EqualityExpression == RelationalExpression" in the IF statement instead: object = new Bollean(false); if (object == true) { // is true } else { // is false }
Attachments
patch.txt
(76.57 KB, patch)
2006-11-12 01:03 PST
,
digdog
no flags
Details
Formatted Diff
Diff
patch.txt
(43.65 KB, patch)
2006-11-12 09:10 PST
,
digdog
ap
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
digdog
Comment 1
2006-11-12 01:03:28 PST
Created
attachment 11492
[details]
patch.txt
digdog
Comment 2
2006-11-12 09:09:38 PST
Comment on
attachment 11492
[details]
patch.txt remove patch due non-PST timezone regression appeared (
http://bugs.webkit.org/show_bug.cgi?id=4930
)
digdog
Comment 3
2006-11-12 09:10:52 PST
Created
attachment 11498
[details]
patch.txt correct the expected results
Darin Adler
Comment 4
2006-11-18 17:44:45 PST
Is this really a mistake in the test, or a bug in our engine? I'm wondering why this test passed in Spider Monkey and Rhino.
digdog
Comment 5
2006-11-18 18:23:30 PST
huh, I tried SpiderMonkey before, it's failed. Here's the result of SpiderMonkey (lastest cvs build) boolean-001.js new Boolean(false) should evaluate to false new Boolean(true) = true PASSED! new Boolean(false) = true FAILED! expected: false true = true PASSED! false = false PASSED! At least based on ECMA spec., the ToBoolean(Object) will always return true, and we are acting same with SpiderMonkey on this.
Alexey Proskuryakov
Comment 6
2006-11-24 12:00:02 PST
Is this the same as
bug 4263
? Please note the difference between this test and js1_3/Boolean/boolean-001.js.
digdog
Comment 7
2006-11-24 21:52:27 PST
Yes, same with
bug 4263
, but what they are talking about is not the cause, ther really cause that failed the test was the comment I described on the top. And if you check js1_3/Boolean/boolean-001.js, you will note that they were expected "new Boolean(false)" to return true when using RelationalExpression directly (js1.6 does same way): BooleanTest( "new Boolean(false)", new Boolean(false), true ); Since JavaScriptCore is not planning on support the early specification, we would suggest to ignore and disable this js1.2 test.
Alexey Proskuryakov
Comment 8
2006-11-24 23:05:13 PST
(In reply to
comment #7
)
> Since JavaScriptCore is not planning on support the early specification, we > would suggest to ignore and disable this js1.2 test.
OK, so I'm r-'ing the attached patch, as it does something different. *** This bug has been marked as a duplicate of
4263
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug