Commit c4fadbc1 authored by Sakthipriyan Vairamani's avatar Sakthipriyan Vairamani
Browse files

fs: execute mkdtemp's callback with no context

All the callback functions in `fs` module are supposed to be executed
with no context (`this` value should not be a valid object). But
`mkdtemp`'s callback will have the `FSReqWrap` object as the context.

Sample code to reproduce the problem

    'use strict';

    const fs = require('fs');
    fs.mkdtemp('/tmp/abcd', null, function() {
      console.log(this);
    });

This would print

    FSReqWrap { oncomplete: [Function] }

But that should have printed `null` and this patch fixes that.

PR-URL: https://github.com/nodejs/node/pull/7068


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 1a21524b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment