Skip to content

timer.setTimeout causes Illegal Invocation error in a limited execution environment #1519

@schmuli

Description

@schmuli

I am writing an Atom plugin for running Karma, which currently uses the Atom process to start the Karma server. I believe that Atom runs its plugins in a limited execution environment (I had a similar issue when loading the karma plugin, but found an Atom-specific workaround).

However, I keep getting an Illegal Invocation exception in lib/launchers/capture_timeout.js on line 15, when trying to set a timeout. It appears that the exception is caused by setTimeout being called as a method of the timer object.

Changing the timer definition in lib/server.js to delegate to the setTimeout/clearTimeout functions, rather than pass by reference, eliminates the exception.

Is this a valid use-case for making a change in Karma's code base?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions