Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object #<Object> has no method 'apply' #7

Open
GoogleCodeExporter opened this issue Mar 16, 2016 · 0 comments
Open

Object #<Object> has no method 'apply' #7

GoogleCodeExporter opened this issue Mar 16, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

HI,

I've download the example and also the code from svn, when using chrome i get 
this error randomly (the stachtrace is shown below), i get it using the 
example, or using the version i've compiled using closure compiler. I'm trying 
to figure it out , the problem is localized in scorediv.js when calling 
functor.apply

ScoreLibrary.delegate = function(target, source) {

    ScoreLibrary.aggregate(target, ScoreLibrary.Delegate);

    var functor_generator = function(functor) {

        return function() {

            return functor.apply(
                this.getDelegate(), arguments);
        };
    };

    var tgt_proto = target.prototype;
    var src_proto = source.prototype;

    for (var prop in src_proto) {

        var property = src_proto[prop];

        if (typeof property === 'function' && prop !== 'constructor') {

            tgt_proto[prop] = functor_generator(property);
        }
    }
};


the last function in the stack trace changes randomly for example i've got 
these error in the following calls :
ScoreLibrary.DurationMapper.save
ScoreLibrary.DurationMapper.restore
ScoreLibrary.DurationKeyGenerator.generate

someone could help or give some hints in order to let me keep going with 
investigation? I'm trying to get into delegating mechanism to understand the 
problem



Stacktrace
-----------
Uncaught TypeError: Object #<Object> has no method 'apply' 
scorediv-nocompiled.js:15212
(anonymous function) scorediv-nocompiled.js:15212
ScoreLibrary.DurationMapper.setInformation scorediv-nocompiled.js:35203
(anonymous function) scorediv-nocompiled.js:15212
ScoreLibrary.Renderer.DurationPacker.recordPackStyles 
scorediv-nocompiled.js:35600
ScoreLibrary.Renderer.PaintablePacker.pack scorediv-nocompiled.js:26842
ScoreLibrary.Renderer.DurationPacker.pack scorediv-nocompiled.js:35552
ScoreLibrary.Engraver.Note.engraveStemPlaceHolder scorediv-nocompiled.js:40579
ScoreLibrary.Score.Beam.StemLengthPolicy.applyToNote 
scorediv-nocompiled.js:42796
(anonymous function) scorediv-nocompiled.js:30008
(anonymous function) scorediv-nocompiled.js:30004
ScoreLibrary.Score.Connector.applyPolicesToNotes scorediv-nocompiled.js:30000
ScoreLibrary.Score.Beam.prepareEngrave scorediv-nocompiled.js:43007
(anonymous function) scorediv-nocompiled.js:51517
ScoreLibrary.Engraver.Part.engraveConnectors scorediv-nocompiled.js:51479
(anonymous function) scorediv-nocompiled.js:51407
ScoreLibrary.Engraver.Part.engrave scorediv-nocompiled.js:51376
ScoreLibrary.Engraver.Liner.SystemListLazyIter.lazyNext 
scorediv-nocompiled.js:52182
ScoreLibrary.Engraver.Liner.SystemListLazyIter.next scorediv-nocompiled.js:52078
ScoreLibrary.Engraver.Pager.PageListLazyIter.lazyNext 
scorediv-nocompiled.js:52361
ScoreLibrary.Engraver.Pager.PageListLazyIter.next scorediv-nocompiled.js:52334
ScoreLibrary.ScoreDiv.hasNextPage scorediv-nocompiled.js:53348
ScoreLibrary.ScoreDiv.showToolbar scorediv-nocompiled.js:53029
ScoreLibrary.ScoreDiv.callbackScore scorediv-nocompiled.js:53610
ScoreLibrary.MusicXMLLoader.callbackSuccess scorediv-nocompiled.js:52749
fire jquery-1.7.1.js:1046
self.fireWith jquery-1.7.1.js:1164
done jquery-1.7.1.js:7399
callback jquery-1.7.1.js:8180

Original issue reported on code.google.com by [email protected] on 18 Aug 2013 at 8:44

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

No branches or pull requests

1 participant