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

fs: fix confusing flags TypeError msg #2902

Closed

Commits on Sep 16, 2015

  1. fs: fix confusing flags TypeError msg

    File open flags must be an int when passed to the binding layer, but
    they must be a string when passed to the fs module (numbers are
    permitted, though undocumented). The module used to do no type checking,
    so the binding layer error would be thrown, and it was wrong:
    
        > fs.openSync('_')
        TypeError: flags must be an int
            at TypeError (native)
            at Object.fs.openSync (fs.js:549:18)
    
    It is now:
    
        > fs.openSync('_')
        TypeError: flag must be a string
    
    PR-URL: nodejs#2902
    Reviewed-By: Ben Noordhuis <[email protected]>
    sam-github committed Sep 16, 2015
    Configuration menu
    Copy the full SHA
    493864a View commit details
    Browse the repository at this point in the history