RESOLVED WORKSFORME4263
Version bug: js1_2/version120/boolean-001.js
https://bugs.webkit.org/show_bug.cgi?id=4263
Summary Version bug: js1_2/version120/boolean-001.js
Geoffrey Garen
Reported 2005-08-01 22:40:55 PDT
This test fails because it expects new Boolean(false) to return false, as it did in JS 1.2.
Attachments
Justin Haygood
Comment 1 2006-02-28 21:20:39 PST
Comparison to other JS engines without having a version set: JS 1.6 (Firefox 1.5.0.1 / Windows) * Returns False JScript 5.6 (Internet Explorer 6 SP2 / Windows) * Returns False Should we follow this old behavior since JScript and JS both do this?
Geoffrey Garen
Comment 2 2006-03-01 09:36:06 PST
It looks like new Boolean(false) is supposed to return false in JS 1.5: 15.6.2.1 new Boolean(value) The [[Prototype]] property of the newly constructed object is set to the original Boolean prototype object, the one that is the initial value of Boolean.prototype (15.6.3.1). The [[Class]] property of the newly constructed Boolean object is set to "Boolean". The [[Value]] property of the newly constructed Boolean object is set to ToBoolean(value).
Alexey Proskuryakov
Comment 3 2006-11-24 23:05:13 PST
*** Bug 11579 has been marked as a duplicate of this bug. ***
digdog
Comment 4 2006-11-26 00:50:43 PST
The real cause that failed the test was IF statement. var variable = new Boolean(false); if (variable == false) print("EqualityExpression == RelationalExpression will be true"); if (variable) print("RelationalExpression will apply ToBollean operator on this Boolean 'object'"); // js1.2 sample use this, and expect the result of IF statement will be 'false' In the sample above, JSCore and other JS engines are acting the same, both these two IF statements will be true, since 'variable' is a Boolean 'object' not a 'boolean' value, so the second IF statement will apply ToBollean(Object) and return true. If you check js1_3/Boolean/boolean-001.js, you will see they already fixed this issue. (http://bugs.webkit.org/show_bug.cgi?id=11579#c7)
Gavin Barraclough
Comment 5 2011-06-13 17:10:54 PDT
We don't support language versions in JSC (other than strict / non-strict), and al behaviour seems ES5 compliant. I don't think we need change anything here - the test documents our deliberate non-compliance with JS1.2.
Note You need to log in before you can comment on or make changes to this bug.