Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: ToInteger: fix spec bug from #1827 that allows (-1,0) to produce -0 #1871

Merged
merged 1 commit into from
Feb 15, 2020

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Feb 15, 2020

@ljharb ljharb added normative change Affects behavior required to correctly evaluate some ECMAScript source text spec bug labels Feb 15, 2020
@ljharb ljharb requested review from syg, michaelficarra, bakkot, devsnek and a team February 15, 2020 04:01
ljharb added a commit to ljharb/ecma262 that referenced this pull request Feb 15, 2020
@ljharb ljharb force-pushed the to_integer_spec_bug branch from d4f4652 to b221da8 Compare February 15, 2020 04:02
spec.html Show resolved Hide resolved
Copy link
Contributor

@bakkot bakkot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me (with @devsnek's change), though I would phrase it as

1. Let _integer_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)).
1. If _integer_ is  *-0*, return *+0*.
1. Return _integer_.

ljharb added a commit to ljharb/ecma262 that referenced this pull request Feb 15, 2020
@ljharb ljharb force-pushed the to_integer_spec_bug branch from b221da8 to b09fb0e Compare February 15, 2020 05:49
spec.html Show resolved Hide resolved
@ljharb ljharb force-pushed the to_integer_spec_bug branch from b09fb0e to 8e5ae7b Compare February 15, 2020 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
normative change Affects behavior required to correctly evaluate some ECMAScript source text spec bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants