[TIMOB-25069] Hyperloop: iOS - Inheritance issues when casting objects
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Hyperloop 2.1.3 |
| Fix Version/s | n/a |
| Components | Hyperloop, iOS |
| Labels | n/a |
| Reporter | Jan Vennemann |
| Assignee | Unknown |
| Created | 2017-08-07T16:06:08.000+0000 |
| Updated | 2018-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
| File | Date | Size |
|---|---|---|
| hl-cast-issue-timob25069.zip | 2017-08-07T17:06:49.000+0000 | 7833049 |
No comments