Skip to content

clearTimeout not defined in all environments #130

Open

Description

@ShawnTalbert

The lazy.js getCancelCallback() function can return clearTimeout .

In NetSuite (which uses a Rhino based javascript backend) clearTimeout() is not defined, and hence throws an error just loading the script.

In general, the *Timeout() functions are not there in NetSuite, but lazy.js is still otherwise awesome in that environment!

Activity

  1. dtao commented on Jan 29, 2015

    @dtao
    Owner

    OK! Sounds like the fix is pretty straightforward: don't assume the existence of clearTimeout on all platforms.

    I must admit I've never heard of NetSuite, and I've done virtually no work in Rhino before. I'll do a little research and (hopefully) come up with a solution that makes sense. I've been meaning to get a version 0.4.1 out the door soonish anyway.

  2. ShawnTalbert commented on Jan 30, 2015

    @ShawnTalbert
    Author

    My workaround was to just define clearTimeout(){} in some code before including lazy.js.

    Look forward to 0.4.1 - Lazy is slowly replacing my previous favorite (lodash)!

  3. mjwong commented on Jun 23, 2015

    @mjwong

    You can try this:
    https://gist.github.com/nbeloglazov/9633318
    Works for me.

  4. ShawnTalbert commented on Nov 6, 2015

    @ShawnTalbert
    Author

    @mjwong thanks for the link, but unfortunately we don't get access to the underlying Rhino in NetSuite code. :(

    @dtao is this resolved in 0.4.1 or 0.4.2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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