cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <>
Subject [jira] [Created] (CB-11535) Logic error in uninstall frameworks in iOS
Date Tue, 05 Jul 2016 06:07:10 GMT
Shazron Abdullah created CB-11535:

             Summary: Logic error in uninstall frameworks in iOS
                 Key: CB-11535
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
            Reporter: Shazron Abdullah

This is reference counting code.


project.frameworks[src] -= (project.frameworks[src] || 1) - 1;

which expands to:
project.frameworks[src] = project.frameworks[src] - (project.frameworks[src] || 1) - 1;

project.frameworks[src] would contain a number, or undefined.

My guess is that the intent of this line is to decrement the reference count by 1. If the
count was not set, the resulting count value should be negative, according to the next conditional
"if (project.frameworks[src] < 1) {" where it would delete the entry in the object.

The correct line should be:
project.frameworks[src] = (project.frameworks[src] || 1) - 1;

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message