Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1276] Alloy's deepExtend is broken

GitHub Issuen/a
TypeBug
PriorityCritical
StatusResolved
ResolutionFixed
Resolution Date2015-06-02T03:08:23.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.6.0
ComponentsRuntime
Labelsdefect
ReporterXavier Lacot
AssigneeIngo Muschenetz
Created2015-05-27T21:25:00.000+0000
Updated2015-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.

Comments

  1. Xavier Lacot 2015-05-27

    A PR has been added: https://github.com/appcelerator/alloy/pull/692
  2. Fokke Zandbergen 2015-05-28

    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.
  3. Xavier Lacot 2015-05-29

    Please checkout the last change that I added this afternoon - I guess it could fix LOTS of bugs which deepExtend usage involved before.
  4. Feon Sua Xin Miao 2015-06-02

    PR merged.

JSON Source