Skip to content

Different casting rules in setTimeout/setInterval in nativescript #7567

@miiihi

Description

@miiihi

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.0.2
  • Cross-platform modules: 6.0.1
  • Android Runtime: 6.0.0
  • iOS Runtime:
  • Plugin(s):

Describe the bug

Nativescript has different casting rules compared to browser javascript. (at least in timer.setTimeout and timer.setInterval functions).

To Reproduce

setTimeout(() => console.log("Hello"), false);

Fails in nativescript, but suceeds in js.

Expected behavior
Casting rules should be the same.

Sample project

Additional context

Many libraries out there are using code like

setTimeout(callback, false);

which fails and is usually hard to debug. Was bitten by redux-perist lib.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions