Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Benjamin, Assigned: Benjamin)

Tracking

({dev-doc-complete})

unspecified
mozilla33
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [DocArea=JS])

Attachments

(1 attachment)

Assignee

Description

5 years ago
When I implemented Number.toInteger in bug 761495, it was part of the ES6 draft spec. It has since been removed. No other engine implements it and according to DXR, its use in Gecko is limited to its own testsuite. Therefore, let's remove it.
Assignee

Comment 1

5 years ago
Posted patch rm-nti.patchSplinter Review
Attachment #8436538 - Flags: review?(jorendorff)
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Comment on attachment 8436538 [details] [diff] [review]
rm-nti.patch

Review of attachment 8436538 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you!
Attachment #8436538 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/fc1936b69cbf
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla33

Comment 6

5 years ago
Since it is being removed, what is the recommended alternative?
Why not just write it out by hand?

function ToInteger(v)
{
  var n = +v;
  if (!n)
    return n;
  return n < 0 ? Math.ceil(n) : Math.floor(n);
}
You need to log in before you can comment on or make changes to this bug.