Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25069] Hyperloop: iOS - Inheritance issues when casting objects

GitHub Issuen/a
TypeBug
PriorityCritical
StatusOpen
ResolutionUnresolved
Affected Version/sHyperloop 2.1.3
Fix Version/sn/a
ComponentsHyperloop, iOS
Labelsn/a
ReporterJan Vennemann
AssigneeUnknown
Created2017-08-07T16:06:08.000+0000
Updated2018-03-21T11:17:03.000+0000

Description

Casting an object to change their prototype introduces an issue with the prototype chain, so that certain methods and properties are not available anymore. *Steps to reproduce the behavior*

Run the attached app which contains a minimal working example for this issue

*Actual behavior* The log shows the following output:
[INFO]  CBService.UUID: undefined
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: Test1
[INFO]  CBService.isPrimary: undefined
[INFO]  CBService.UUID: Test2
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: Test2
[INFO]  CBService.isPrimary: undefined
[INFO]  CBAttribute.UUID: <HyperloopClass: 0x608000423020>
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: null
[INFO]  CBService.isPrimary: undefined
*Expected behavior* The following correct debug output should be printed:
[INFO]  CBService.UUID: Test1
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: Test1
[INFO]  CBService.isPrimary: 0
[INFO]  CBService.UUID: Test2
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: Test2
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: Test3
[INFO]  CBService.isPrimary: 0
[INFO]  CBAttribute.UUID: Test3
[INFO]  CBService.isPrimary: 0

Attachments

FileDateSize
hl-cast-issue-timob25069.zip2017-08-07T17:06:49.000+00007833049

Comments

No comments

JSON Source