Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#78 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
47/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, javascript, kotlin
Lĩnh vực
backend, mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
C++
Star
27
Fork
4
Merge trung bình
16 giờ 48 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NativeScript/runtimes

Tất cả issue của NativeScript/runtimes

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.