Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns: Use object without protoype for map #5843

Commits on Mar 22, 2016

  1. dns: Use object without protoype for map

    Currently we use `{}` for the `lookup` function to find the relevant
    resolver to the dns.resolve function. It is preferable to use an
    object without a Object.prototype, currently for example you can do
    something like:
    
    ```js
    dns.resolve("google.com", "toString", console.log);
    ```
    
    And get `[Object undefined]` logged and the callback would never be
    called. This is unexpected and strange behavior in my opinion.
    In addition, if someone adds a property to `Object.prototype` might
    also create unexpected results.
    
    This pull request fixes it, with it an appropriate error is thrown.
    benjamingr committed Mar 22, 2016
    Configuration menu
    Copy the full SHA
    6f584af View commit details
    Browse the repository at this point in the history
  2. add test

    benjamingr committed Mar 22, 2016
    Configuration menu
    Copy the full SHA
    606fe5f View commit details
    Browse the repository at this point in the history