Closed
Bug 1113718
Opened 10 years ago
Closed 10 years ago
Uint8ClampedArray constructor rounds wrong
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla38
| Tracking | Status | |
|---|---|---|
| firefox38 | --- | fixed |
People
(Reporter: evilpies, Assigned: evilpies)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
1.26 KB,
patch
|
lth
:
review+
|
Details | Diff | Splinter Review |
new Uint8ClampedArray([2.6])
>> [2]
x = new Uint8ClampedArray([0])
x[0] = 2.6
x
>> [3]
Comment 1•10 years ago
|
||
Memo to self: need to check whether this affects SharedUint8ClampedArray too.
Blocks: shared-array-buffer
Comment 2•10 years ago
|
||
Tom, note that the bug here is really the opposite of what you reported. ToUint8Clamp is supposed to round, not to truncate: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp.
Ergo it's the conversion from the array-element (the first case in your test) that is buggy, not the conversion of assignment (the second case).
(SharedTypedArray does not allow the construction from array literal, and the assignment case behaves correctly. Removing dependency.)
No longer blocks: shared-array-buffer
| Assignee | ||
Comment 3•10 years ago
|
||
Sorry Lars, but I think you might be confused somehow. Like I said "Uint8ClampedArray constructor rounds wrong", which is the first case.
Comment 4•10 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #3)
> Sorry Lars, but I think you might be confused somehow. Like I said
> "Uint8ClampedArray constructor rounds wrong", which is the first case.
Indeed I misinterpreted the Summary.
| Assignee | ||
Comment 5•10 years ago
|
||
Updated•10 years ago
|
Attachment #8560436 -
Flags: review?(lhansen) → review+
| Assignee | ||
Comment 6•10 years ago
|
||
Comment 7•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox38:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•