NativeScript / NativeScript/ios
Metadata-generator creates enums with incorrect values
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 150
- Fork
- 43
- Merge medio
- 3g 10h
- PR unite (30g)
- 22
Descrizione
There is the case of metadata-generator creating enums with wrong values if the original value is unsigned.
This became apparent with UIRectCornerAllCorners case where value is an unsigned long in obj-c.
UIRectCornerAllCorners = ~0UL
See: https://developer.apple.com/documentation/uikit/uirectcorner/uirectcornerallcorners?language=objc
Unfortunately, generator converts the value into a signed value resulting in -1 and when it's used as a function parameter, it brings unexpected results.
In JavaScript, the proper value would probably be 0xffffffff or 4294967295 to match the unsigned value.
I found this part of generator that looks suspicious: https://github.com/NativeScript/ios/blob/main/metadata-generator/src/Meta/MetaFactory.cpp#L321
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da metadata-generator/src/Meta/MetaFactory.cpp intorno alla riga 321 e verifica come viene convertito il valore unsigned Objective-C UIRectCornerAllCorners = ~0UL. Verifica che il JavaScript generato conservi il valore unsigned come 0xffffffff o 4294967295, anche quando viene passato come parametro di una funzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, javascript, objective-c
- Ambito
- mobile, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100