apache / cordova-common
Showing 1 of 1 files from the diff.

@@ -311,13 +311,18 @@
Loading
311 311
312 312
                // Check if the edit target will resolve to an existing target
313 313
                if (!target || target.length === 0) {
314 -
                    const file_xml = this.config_keeper.get(this.project_dir, this.platform, editchange.file).data;
315 -
                    const resolveEditTarget = xml_helpers.resolveParent(file_xml, editchange.target);
316 -
                    let resolveTarget;
314 +
                    const targetFile = this.config_keeper.get(this.project_dir, this.platform, editchange.file);
317 315
316 +
                    // For non-XML files (e.g. plist), the selector in editchange.target uniquely identifies its target.
317 +
                    // Thus we already know that we have no conflict if we are not dealing with an XML file here.
318 +
                    if (targetFile.type !== 'xml') return;
319 +
320 +
                    // For XML files, the selector does NOT uniquely identify its target. So we resolve editchange.target
321 +
                    // and any existing selectors to their matched elements and compare those for equality.
322 +
                    const resolveEditTarget = xml_helpers.resolveParent(targetFile.data, editchange.target);
318 323
                    if (resolveEditTarget) {
319 324
                        for (const parent in parents) {
320 -
                            resolveTarget = xml_helpers.resolveParent(file_xml, parent);
325 +
                            const resolveTarget = xml_helpers.resolveParent(targetFile.data, parent);
321 326
                            if (resolveEditTarget === resolveTarget) {
322 327
                                conflictingParent = parent;
323 328
                                target = parents[parent];
Files Coverage
src 89.55%
cordova-common.js 0.00%
Project Totals (20 files) 88.26%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading