You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Axel Nennker <ig...@gmail.com> on 2014/05/14 12:14:42 UTC

cordova-lib: ConfigParser

Hi,

I think here is an error
https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/ConfigParser.js#L47

function findOrCreate(doc, name) {
    var ret = doc.find(name);
    if (!ret) {
        ret = new et.Element(name);
        doc.getroot().append(content);
    }
    return ret;
}

Should that read "doc.getroot().append(ret);"? Small change so I think
no issue needed, right?

-----------

finddOrCreate is called for the "name" and "description" elements of
config.xml
So this implementation is too simple because name and description elements
can occur several times in config.xml with different xml:lang attributes
but only once for the same lang.

-Axel

Re: cordova-lib: ConfigParser

Posted by Andrew Grieve <ag...@chromium.org>.
Looks like a bug to me. Seems it would throw an exception for a tag that
doesn't exist. Probably no need for a JIRA, but would be good to add a test
for the offending case.


On Wed, May 14, 2014 at 6:14 AM, Axel Nennker <ig...@gmail.com> wrote:

> Hi,
>
> I think here is an error
>
> https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/ConfigParser.js#L47
>
> function findOrCreate(doc, name) {
>     var ret = doc.find(name);
>     if (!ret) {
>         ret = new et.Element(name);
>         doc.getroot().append(content);
>     }
>     return ret;
> }
>
> Should that read "doc.getroot().append(ret);"? Small change so I think
> no issue needed, right?
>
> -----------
>
> finddOrCreate is called for the "name" and "description" elements of
> config.xml
> So this implementation is too simple because name and description elements
> can occur several times in config.xml with different xml:lang attributes
> but only once for the same lang.
>
> -Axel
>