Skip to content

Easeljs and requireJS: performance is not defined #758

Open

Description

@skroink

When I load Easel with RequireJS I get an error at line 1381:
var now = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);

performance is not defined

What is the cause of this? Am I forgetting to load another dependency?

Activity

  1. lannymcnie commented on Apr 16, 2016

    @lannymcnie
    Member

    The performance class is a standard API in all modern browsers. What browser/system are you using that causes this error?

    It is possible that RequireJS is wrapping EaselJS in a closure, that it doesn't have access to performance when it is not defined as window.performance. Can you modify the EaselJS source to always say window.performance, and see if it still happens? If that solves it, we can make a fix in EaselJS. We are also welcome to pull-requests :)

  2. skroink commented on Apr 16, 2016

    @skroink
    Author

    With my current project, I'm working in Node-webkit, which is based on Chromium. So by all accords it should be working (I guess). But I fixed it, by adding window. on the perfomance instances, as you suggested. Thanks for the help :) !

  3. lannymcnie commented on Apr 16, 2016

    @lannymcnie
    Member

    Cool. Sounds like something that should be added to EaselJS.
    Cheers.

  4. gskinner commented on Apr 6, 2017

    @gskinner
    Member

    Looks like your find/replace got a little too aggressive. I've fixed this for Ticker (performance), but looking at your pull request it appears this is also an issue for document, which is a more extensive change. I'll leave this open and come back to it shortly.

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

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