Parse non-octals with leading zeros in non strict mode correctly (#9114)

* Parse non-octals with leading zeros in non strict mode correctly

* Better error message
This commit is contained in:
Daniel Tschinder
2018-12-03 00:04:37 -08:00
committed by GitHub
parent 07eaa3c63f
commit 3932830535
16 changed files with 104 additions and 23 deletions

View File

@@ -0,0 +1,4 @@
{
"sourceType": "module",
"throws": "Legacy octal literals are not allowed in strict mode (1:0)"
}

View File

@@ -0,0 +1 @@
09.5

View File

@@ -0,0 +1,70 @@
{
"type": "File",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"program": {
"type": "Program",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"expression": {
"type": "NumericLiteral",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"extra": {
"rawValue": 9.5,
"raw": "09.5"
},
"value": 9.5
}
}
],
"directives": []
}
}

View File

@@ -0,0 +1 @@
07.5

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token, expected \";\" (1:2)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:33)"
"throws": "Legacy octal literals are not allowed in strict mode (1:33)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:36)"
"throws": "Legacy octal literals are not allowed in strict mode (1:36)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:65)"
"throws": "Legacy octal literals are not allowed in strict mode (1:65)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (2:10)"
"throws": "Legacy octal literals are not allowed in strict mode (2:10)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (2:10)"
"throws": "Legacy octal literals are not allowed in strict mode (2:10)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:21)"
"throws": "Legacy octal literals are not allowed in strict mode (1:21)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:21)"
"throws": "Legacy octal literals are not allowed in strict mode (1:21)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:33)"
"throws": "Legacy octal literals are not allowed in strict mode (1:33)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:36)"
"throws": "Legacy octal literals are not allowed in strict mode (1:36)"
}