Skip to content

Commit

Permalink
[[FIX]] change escape-sequence handler for double quotes (\") (#3566)
Browse files Browse the repository at this point in the history
* [[FIX]] change escape-sequence handler for double quotes

* remove the 'case' for backslash escape-sequence handling

* add a unit test for backslash escape-sequence handling

* rename test
  • Loading branch information
emonmeena committed Sep 12, 2021
1 parent 4a681b9 commit 75e48b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/lex.js
Expand Up @@ -1114,9 +1114,6 @@ Lexer.prototype = {
case "\\":
char = "\\\\";
break;
case "\"":
char = "\\\"";
break;
case "/":
break;
case "":
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/core.js
Expand Up @@ -2312,6 +2312,17 @@ exports.duplicateProto = function (test) {
//.addError(3, 23232323, "Duplicate key '__proto__'.")
.test(src, { proto: true });

src = [
"void {",
" '\"': null,",
" \"\\\"\": null",
"};"
];

TestRun(test, "Duplicate keys (backslash)")
.addError(3, 7, "Duplicate key '\"'.")
.test(src);

src = [
"void {",
" __proto__: null,",
Expand Down

0 comments on commit 75e48b7

Please sign in to comment.