Skip to content

Unleashes zalgo #10

@ForbesLindesay

Description

@ForbesLindesay

Because it doesn't call setImmediate before calling the callback function it is possible to unleash zalgo. e.g.

var delay = thunkify(function (time, callback) {
  setTimeout(callback, time);
});

var result = delay(100);
setTimeout(function () {
  console.log('a');
  result(function () {
    console.log('c');
  });
  console.log('b');
}, 500);

Expected:

a
b
c

Actual:

a
c
b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions