QuickJS Node-API conformance defects

Đang mở
#2,128 0 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
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, javascript
Lĩnh vực
backend, testing

Hướng nghiên cứu

Start with Dependencies/JsRuntimeHost/Core/Node-API/Source/js_native_api_quickjs.cc and the exclusions in Dependencies/JsRuntimeHost/Tests/NodeApi/test_main.cpp. Run the named conformance tests under test_general/, test_constructor/, test_number/, test_conversions/, and test_new_target/ to inspect the listed QuickJS failures. Fix the affected Node-API behavior and remove each corresponding exclusion once its test passes.

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

Mô tả

[Filed by Copilot on behalf of @bghgary]

The Node-API conformance suite added in #2097 skips these tests on QuickJS. Their exclusions in Dependencies/JsRuntimeHost/Tests/NodeApi/test_main.cpp link here; the implementation is Dependencies/JsRuntimeHost/Core/Node-API/Source/js_native_api_quickjs.cc. Remove an exclusion when its item is fixed, so the test guards the fix.

  • There is no napi_add_finalizer or napi_adjust_external_memory, so the test_general addon cannot load and is not built. Skips test_general/.
  • napi_define_class dereferences a NULL properties array and crashes. Skips test_constructor/test.js and test_constructor/test_null.js.
  • Read-only assignment errors use different message text from V8's, which test_constructor/test.js also asserts.
  • napi_get_value_int64 casts out-of-range doubles instead of saturating. Skips test_number/test.js.
  • Number getters coerce non-numbers instead of returning napi_number_expected, and string getters accept a NULL buf and result. Skips test_conversions/test.js.
  • napi_create_function creates the function with JS_NewCFunctionData, which is not a constructor, so a class cannot extend it. Skips test_new_target/test.js.
  • napi_define_class constructors record the function itself as new.target and take the instance's prototype from it, so napi_get_new_target returns the wrong value and subclass instances lose their methods. test_new_target/test.js also needs this fixed.
Ngôn ngữ chính
C++
Star
931
Fork
169
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
66

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 BabylonJS/BabylonNative

Tất cả issue của BabylonJS/BabylonNative

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.