Bug 11579 - Fix test script error when checking the correct result.
Summary: Fix test script error when checking the correct result.
Status: RESOLVED DUPLICATE of bug 4263
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-12 00:59 PST by digdog
Modified: 2006-11-24 23:05 PST (History)
1 user (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description digdog 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
}
Comment 1 digdog 2006-11-12 01:03:28 PST
Created attachment 11492 [details]
patch.txt
Comment 2 digdog 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)
Comment 3 digdog 2006-11-12 09:10:52 PST
Created attachment 11498 [details]
patch.txt

correct the expected results
Comment 4 Darin Adler 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.
Comment 5 digdog 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.
Comment 6 Alexey Proskuryakov 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.
Comment 7 digdog 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.
Comment 8 Alexey Proskuryakov 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 ***