Skip to content

Raven.wrap doesn't preserve prototype #401

Closed
@jlfwong

Description

@jlfwong
Contributor

The following alerts with jQuery vanilla, and errors out when jQuery gets wrapped by Raven with a Uncaught TypeError: (intermediate value).foo is not a function(…).

var x = function() {};
x.prototype.foo = function() { alert("hi"); };
var d = $.Deferred();
d.then(function(z) { (new z).foo(); });
d.resolve(x);

This bit us in production, and we've had to disable Raven until this is fixed.

We use the jQuery wrappers for Raven too.

Activity

jlfwong

jlfwong commented on Oct 31, 2015

@jlfwong
ContributorAuthor

For more context, this was causing real problems for us because we async load react components. If you do a deferred.resolve(SomeComponent), then try to render SomeComponent later, it won't have SomeComponent.prototype.render defined.

added this to the 1.3 milestone on Nov 4, 2015
mattrobenolt

mattrobenolt commented on Nov 4, 2015

@mattrobenolt
Contributor

This was fixed with #402 and will be in 1.3.

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

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jlfwong@mattrobenolt

        Issue actions

          Raven.wrap doesn't preserve prototype · Issue #401 · getsentry/sentry-javascript