Bug 34847

Summary: [Qt] QScriptValue::toIntXX returns incorrect values
Product: WebKit Reporter: Jędrzej Nowacki <jedrzej.nowacki>
Component: JavaScriptCoreAssignee: Jędrzej Nowacki <jedrzej.nowacki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 31863    
Attachments:
Description Flags
test cases
none
Fix v1 none

Jędrzej Nowacki
Reported 2010-02-11 08:44:14 PST
Created attachment 48568 [details] test cases Functions; QScriptValue::toInteger(), QScriptValue::toInt32, QScriptValue::toUInt32, QScriptValue::toUInt16 don't compliance ECMA Script standard. There are a few edge cases that they return incorrect value. Examples are in the attachment.
Attachments
test cases (23.92 KB, text/plain)
2010-02-11 08:44 PST, Jędrzej Nowacki
no flags
Fix v1 (32.22 KB, patch)
2010-02-11 09:18 PST, Jędrzej Nowacki
no flags
Jędrzej Nowacki
Comment 1 2010-02-11 09:18:42 PST
Simon Hausmann
Comment 2 2010-02-15 03:47:29 PST
Comment on attachment 48571 [details] Fix v1 > + return (result > 0) ? qFloor(result) : -1 * qFloor(-result); I'd leave out the first pair of parentheses. The rest looks good to me.
WebKit Commit Bot
Comment 3 2010-02-15 04:08:49 PST
Comment on attachment 48571 [details] Fix v1 Clearing flags on attachment: 48571 Committed r54773: <http://trac.webkit.org/changeset/54773>
WebKit Commit Bot
Comment 4 2010-02-15 04:08:54 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.