Chakra Node-API conformance defects

Open
#2,127 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Start with the exclusions in Dependencies/JsRuntimeHost/Tests/NodeApi/test_main.cpp and the Chakra implementation at Dependencies/JsRuntimeHost/Core/Node-API/Source/js_native_api_chakra.cc; inspect the listed Node-API tests for each defect. Fixing this spans multiple APIs and behaviors, so take one checklist item at a time and remove its exclusion when fixed. Done means the corresponding conformance test runs and passes on Chakra.

Written by the indexing model from the issue text.

Description

[Filed by Copilot on behalf of @bghgary]

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

  • There is no napi_create_date, napi_is_date or napi_get_date_value, so the test_date addon cannot load and is not built. Skips test_date/.
  • 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.
  • A successful call does not clear the last error, and string getters check the length pointer before the value type. Skips test_conversions/test.js.
  • napi_get_dataview_info accepts only DataViews created by napi_create_dataview. Skips test_dataview/test.js.
  • napi_create_function accepts a NULL callback, and returning from a callback with an exception pending crashes. Skips test_function/test.js.
  • napi_add_finalizer is not implemented. Skips test_general/testFinalizer.js.
  • napi_instanceof ignores Symbol.hasInstance. Skips test_general/testInstanceOf.js.
  • napi_run_script returns napi_invalid_arg instead of napi_string_expected for a non-string script. Skips test_general/testNapiRun.js.
Dominant language
C++
Stars
931
Forks
169
Avg merge
2d 17h
Merged PRs (30d)
66

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BabylonJS/BabylonNative

All issues in BabylonJS/BabylonNative

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.