| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ec18131 commit 6a6112a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -240,7 +240,7 @@ function resolver(bindingName) { | |||
| 240 | 240 | } | |
| 241 | 241 | ||
| 242 | 242 | ||
| 243 | - var resolveMap = {}; | ||
| 243 | + var resolveMap = Object.create(null); | ||
| 244 | 244 | exports.resolve4 = resolveMap.A = resolver('queryA'); | |
| 245 | 245 | exports.resolve6 = resolveMap.AAAA = resolver('queryAaaa'); | |
| 246 | 246 | exports.resolveCname = resolveMap.CNAME = resolver('queryCname'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,11 @@ assert.throws(function() { | |||
| 27 | 27 | dns.resolve('www.google.com', 'HI'); | |
| 28 | 28 | }, /Unknown type/); | |
| 29 | 29 | ||
| 30 | + // Try calling resolve with an unsupported type that's an object key | ||
| 31 | + assert.throws(function() { | ||
| 32 | + dns.resolve('www.google.com', 'toString'); | ||
| 33 | + }, /Unknown type/); | ||
| 34 | + | ||
| 30 | 35 | // Windows doesn't usually have an entry for localhost 127.0.0.1 in | |
| 31 | 36 | // C:\Windows\System32\drivers\etc\hosts | |
| 32 | 37 | // so we disable this test on Windows. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments