Skip to content

google closure compiler got error on leaking arguments checking #26

Description

@dunght160387

In the file
https://github.com/MailOnline/VPAIDHTML5Client/blob/master/js/VPAIDAdUnit.js
line 65-69

...
var ariaty = IVPAIDAdUnit.prototype[method].length;
// TODO avoid leaking arguments
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
var args = Array.prototype.slice.call(arguments);
var callback = (ariaty === args.length) ? args.pop() : undefined;
...

if my application use google closure compiler in ADVANCED mode (and offcource i'm sure i marked this file as extern), the value of ariaty always is 0. This makes the handshakeVersion cannot do the callback, so that the timeout occurs, then my application will get fail.

So, do you have any recommendations to use closure compiler correctly without this error?
Or would you change to use another way to avoid leaking-arguments?

I see that the IVPAIDAdUnit.prototype[method] always is function () {}, so the call IVPAIDAdUnit.prototype[method].length always is 0. In case of handshakeVersion, the IVPAIDAdUnit.prototype[method] should be function (version, callback) {}

Thank you!

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions