Skip to content

Disallow old style octal literal types #13016

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

Merged

Conversation

arusakov
Copy link
Contributor

@arusakov arusakov commented Dec 19, 2016

Fixes #10101

@arusakov
Copy link
Contributor Author

Waiting for master green build

@ghost
Copy link

ghost commented Dec 19, 2016

Will need to rebase onto #13025 (when it's merged) to fix tests.

@mhegazy mhegazy closed this Dec 19, 2016
@mhegazy mhegazy reopened this Dec 19, 2016
@mhegazy mhegazy merged commit 8ae0376 into microsoft:master Dec 19, 2016
Copy link
Contributor

@mihailik mihailik left a comment

Choose a reason for hiding this comment

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

Misleading error message for negative octals.

var n = 0x1;
var n = -1;
var n = -1.0;
var n = -1e-4;
var n = -003; // Error in ES5
~~~
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o3'.
Copy link
Contributor

Choose a reason for hiding this comment

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

0o3 is not the same as -003.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mihailik
Thank you for review. I can improve reporting asap.

@arusakov arusakov deleted the disallow_old_style_octal_literal_types branch December 20, 2016 12:34
@mhegazy mhegazy mentioned this pull request Dec 21, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants