Repository: jshint/jshint (js)

Issue:
`"` and `\"` are considered as different keys
JsHint version: 2.9.6

Code:
```
var x = {
  '"': 10,
  '\"': 20,
};
```

Configuration: default

Result: no warnings

Expected result: W075: Duplicate key

Pull request description:
[[FIX]] change escape-sequence handler for double quotes (\")
Changes the handling of escape sequence case for `\"` in the **lex.js** file. Earlier, it converted `\"` into `\\\"`, which is not the correct js equivalent for the case as it should be `"` only. This was causing issue #3315 as `\" != "` that is why jshint considers them different strings.

Fixes and Closes #3315

Patch:
diff --git a/src/lex.js b/src/lex.js
index 8113baba..7e5b5cdf 100644
--- a/src/lex.js
+++ b/src/lex.js
@@ -1114,9 +1114,6 @@ Lexer.prototype = {
     case "\\":
       char = "\\\\";
       break;
-    case "\"":
-      char = "\\\"";
-      break;
     case "/":
       break;
     case "":


Test patch:
diff --git a/tests/unit/core.js b/tests/unit/core.js
index b0e8a4b1..80ae889b 100644
--- a/tests/unit/core.js
+++ b/tests/unit/core.js
@@ -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,",