Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

messed up args in setInterval / setTimeout in fakeAsyncZones #1032

@e-hein

Description

@e-hein

this._setInterval(task.invoke, task.data['delay'], (task.data as any)['args']);

The genuine args-Array in a setInterval or setTimeout call contains the function to be called and the delay. The arguments for the function start at the third position. By passing the arguments like this, the function invoked will get an array as argument that contains the function itself and the delay and the expected needed arguments.

Sample:
setInterval((name) => console.log('my name:', name), 100, 'Emanuel')
expected call:
('Emanuel') => console.log('my name:', 'Emanuel')
actual call:
([function, 100, 'Emanuel') => console.log('my name:', [function, 100, 'Emanuel'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions