Skip to content

Commit

Permalink
Better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Dec 2, 2018
1 parent 17a600f commit 118950b
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/babel-parser/src/tokenizer/index.js
Expand Up @@ -982,7 +982,7 @@ export default class Tokenizer extends LocationParser {
this.input.charCodeAt(start) === charCodes.digit0;
if (octal) {
if (this.state.strict) {
this.raise(start, "Invalid number");
this.raise(start, "Octal literals are not allowed in strict mode");
}
if (/[89]/.test(this.input.slice(start, this.state.pos))) {
octal = false;
Expand Down
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"throws": "Invalid number (1:0)"
"throws": "Octal literals are not allowed in strict mode (1:0)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:33)"
"throws": "Octal literals are not allowed in strict mode (1:33)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:36)"
"throws": "Octal literals are not allowed in strict mode (1:36)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:65)"
"throws": "Octal literals are not allowed in strict mode (1:65)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (2:10)"
"throws": "Octal literals are not allowed in strict mode (2:10)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (2:10)"
"throws": "Octal literals are not allowed in strict mode (2:10)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:21)"
"throws": "Octal literals are not allowed in strict mode (1:21)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:21)"
"throws": "Octal literals are not allowed in strict mode (1:21)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:33)"
"throws": "Octal literals are not allowed in strict mode (1:33)"
}
@@ -1,3 +1,3 @@
{
"throws": "Invalid number (1:36)"
"throws": "Octal literals are not allowed in strict mode (1:36)"
}

0 comments on commit 118950b

Please sign in to comment.