Skip to content

No error shown when using LegacyOctalEscapeSequence in string literal with Strict Mode #15949

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

Closed
kpreisser opened this issue May 19, 2017 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@kpreisser
Copy link
Contributor

kpreisser commented May 19, 2017

Hi, sorry if this is a duplicate.
I found that TypeScript is not reporting an error when using LegacyOctalEscapeSequence in a string literal when using Script Mode (according to ES2015 11.8.4):

TypeScript Version: 2.3.1-insiders.20170416

Code

function foo() {
    "use strict";    
    var s = "\04";
}

Expected behavior:
SyntaxError: Octal literals are not allowed in strict mode.

octal-sequence

Actual behavior:
No error.

Thanks!

@kpreisser kpreisser changed the title No error shown when using _LegacyOctalEscapeSequence_ in string literal with Strict Mode No error shown when using LegacyOctalEscapeSequence in string literal with Strict Mode May 19, 2017
@mhegazy
Copy link
Contributor

mhegazy commented May 19, 2017

Duplicate of #396. PRs are welcomed for that one by the way.

@mhegazy mhegazy added the Duplicate An existing issue was already created label May 19, 2017
@mhegazy mhegazy closed this as completed May 19, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants