Skip to content

Commit

Permalink
Update torque-builtins.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rluvaton committed Apr 22, 2024
1 parent eb3aa11 commit 6e3e0f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/docs/torque-builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ namespace math {
Builtin objects such as `Math` are set up mostly in [`src/init/bootstrapper.cc`](https://cs.chromium.org/chromium/src/v8/src/init/bootstrapper.cc?q=src/init/bootstrapper.cc+package:%5Echromium$&l=1) (with some setup occurring in `.js` files). Attaching our new builtin is simple:

```cpp
// Existing code to set up Math, included here for clarity.
// -- M a t h
Handle<JSObject> math = factory->NewJSObject(isolate_->object_function(), AllocationType::kOld);
JSObject::AddProperty(global, "Math", math, DONT_ENUM);
Expand Down

0 comments on commit 6e3e0f4

Please sign in to comment.