propChanged() uses undefined variables #248

Closed
ghost opened this Issue Oct 24, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@ghost

ghost commented Oct 24, 2012

"var i, len = renderers.length, renderer;" have to after IFs, because in some cases renderers is null => "renderers.length" is error.

Correct code:
function propChanged() {
var e = event;
if( !destroyed && !( e && e.propertyName in ignorePropertyNames ) ) {
if( initialized ) {
var i, len = renderers.length, renderer;
lockAll();
for( i = 0; i < len; i++ ) {
renderers[i].prepareUpdate();
}
for( i = 0; i < len; i++ ) {
renderer = renderers[i];
if( !renderer.isPositioned ) {
renderer.updatePos();
}
if( renderer.needsUpdate() ) {
renderer.updateProps();
}
}
rootRenderer.finishUpdate();
unlockAll();
}
else if( !initializing ) {
init();
}
}

}

Can anyone change it? I don't know how to use GitHub :)

Owner

lojjic commented Oct 24, 2012

Please provide a test case that demonstrates the issue this is trying to fix.

Owner

lojjic commented Jan 22, 2013

I'm closing this issue because there is no test case associated, and it patches code that is way out of date with master. If you can provide a testcase demonstrating the bug, and update the changes to match the master code, then feel free to reopen it.

@lojjic lojjic closed this Jan 22, 2013

dsherret commented Apr 3, 2013

I had this issue in v1.0.0. I solved it by changing the following code...

function propChanged() {
    var len = (typeof renderers !== "undefined" && renderers !== null) ? renderers.length : 0;
    var i, renderer, e = event;

at the top of the function. Everything seems to be working fine.

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