Skip to content

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

Closed
@kpreisser

Description

@kpreisser

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions