[ALOY-1276] Alloy's deepExtend is broken
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2015-06-02T03:08:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.6.0 |
Components | Runtime |
Labels | defect |
Reporter | Xavier Lacot |
Assignee | Ingo Muschenetz |
Created | 2015-05-27T21:25:00.000+0000 |
Updated | 2015-06-02T03:08:23.000+0000 |
Description
Since [this commit](https://github.com/appcelerator/alloy/commit/84c9470d9932a5ad762f8220db79802d91ec4c86), the
deepExtend()
method present in Alloy is broken, as deeply merged properties get overwritten three line below.
The method should not state:
target[name] = deepExtend(deep, clone, copy);
}
target[name] = copy;
but:
target[name] = deepExtend(deep, clone, copy);
} else {
target[name] = copy;
}
As a consequence, this method is purely useless.
A PR has been added: https://github.com/appcelerator/alloy/pull/692
Though I'm the first to admit
deepExtend
is broken, we've had a lot of issues with this for different use cases. Titanium proxies, Date objects, 2D/3D matrixes, Fonts.. all those need to be double-checked.Please checkout the last change that I added this afternoon - I guess it could fix LOTS of bugs which deepExtend usage involved before.
PR merged.