Files
bun.sh/src/bun.js/builtins
Jarred Sumner aeb3bb949b Upgrade WebKit (#2643)
* Missing export

* Regenerate builtins

* Fix crash in require()

* Various breaking JSC changes

* hopefully speed up C++ compilation a little

* Skip failing test fo rnow

* Update WebKit

* Add a comment

* Fix error in postinstall

* Update WebKit

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-13 04:11:12 -07:00
..
2023-04-13 04:11:12 -07:00
2023-04-04 16:49:33 -07:00
2023-03-19 14:08:20 -07:00
2022-12-17 15:41:47 -08:00

JavaScript Builtins

TLDR:

# Delete the built files
make clean-bindings generate-bindings && \
    # Compile all the C++ files which live in ../bindings
    make bindings -j10 && \
    # Re-link the binary without compiling zig (so it's faster)
    make bun-link-lld-debug

JavaScript files in ./js use JavaScriptCore's builtins syntax

@getter
function foo() {
    return @getByIdDirectPrivate(this, "superSecret");
}

It looks kind of like decorators but they're not. They let you directly call engine intrinsics and help with avoiding prototype pollution issues.

V8 has a similar feature (they use % instead of @)

They usually are accompanied by a C++ file.

The js directory is necessary for the bindings generator to work.

To regenerate the builtins, run this from Bun's project root (where the Makefile is)

make builtins

You'll want to also rebuild all the C++ bindings or you will get strange crashes on start

make clean-bindings