Skip to content
Kitbay
Skill

implementing-jsc-classes-cpp

NOASSERTIONUpdated on Nov 11, 202696,758GitHub stars

A contributor guide in the Bun repository for writing JavaScript classes backed by C++ on JavaScriptCore, the engine Bun uses.

What the skill teaches

A contributor guide in the Bun repository for writing JavaScript classes backed by C++ on JavaScriptCore, the engine Bun uses. It explains which C++ classes a new JavaScript class needs (an object class, a prototype and, if public, a constructor), how to declare properties and methods in a static hash table, how to write getters, setters and functions with JavaScriptCore macros and type checks, where to register isolated memory subspaces, how to cache the class structure on Bun's global object so the garbage collector tracks it, and how to expose the class to Bun's Zig code. It is only useful when changing Bun's own source.

Capabilities

Not stated in its documentation