Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Android napi (quickjs-ng): assigning to a Java/Kotlin bean property does not call the setter

Offen
#78 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
47/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
android, javascript, kotlin
Bereich
backend, mobile

Rechercherichtung

Start by tracing how @nativescript/android-quickjs-ng exposes Kotlin bean properties and handles JavaScript property assignment; the issue names no source files or tests. Compare assignment to handler.enabled with the working handler.setEnabled(false) call, then check whether nullable object properties behave the same way. Done means assignment invokes the native setter and updates the value; the report says other napi engines are untested.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Version: @nativescript/android-quickjs-ng 9.0.0-alpha.5 (also seen with 9.1.0-alpha.0). The previous V8 runtime (@akylas/nativescript-android-runtime 8.9.2) called the setter.

Kotlin class:

class AutoScanHandler(...) {
    var enabled: Boolean = true
        set(value) { field = value; Log.d(TAG, "set enabled:$value") }
}

JS:

const handler = new com.akylas.documentscanner.AutoScanHandler(context, cropView, callback);
typeof handler.enabled;     // "boolean"
typeof handler.setEnabled;  // "function"
handler.enabled = false;    // no error, no "set enabled" log
handler.enabled;            // still true
handler.setEnabled(false);  // works

Object.getOwnPropertyNames(Object.getPrototypeOf(handler)) lists both setEnabled and enabled, so the accessor is defined, but assignment does not reach the native setter. Same for a Kotlin property with a nullable object type: processor.autoScanHandler = handler reads back null. Reads work.

Impact: silent failure, no exception. It broke auto capture in a released app (https://github.com/ossappscollective/OSS-DocumentScanner/issues/740).

Not tested on the other napi engines (V8/Hermes/JSC).

Vorherrschende Sprache
C++
Sterne
27
Forks
4
Ø Merge
16 Std. 48 Min.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NativeScript/runtimes

Alle Issues in NativeScript/runtimes

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.