kiranlm / score-library

Automatically exported from code.google.com/p/score-library
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 pgi...@gmail.com on 18 Aug 2013 at 8:44