Skip to content

Commit

Permalink
fixup! src: add Realm document in the src README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed May 10, 2023
1 parent f0da57c commit 136cf14
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ heap. Node.js exposes this ability through the [`vm` module][].
V8 refers to each of these global objects and their associated builtins as a
`Context`.
Currently, in Node.js there is one main `Context` associated with an
Currently, in Node.js there is one main `Context` associated with a
[`Realm`][] instance, and most Node.js features will only work inside
that context. (The only exception at the time of writing are
[`MessagePort`][] objects.) This restriction is not inherent to the design of
Expand All @@ -278,7 +278,7 @@ Typical ways of accessing the current `Context` in the Node.js code are:
* Given an [`Isolate`][], using `isolate->GetCurrentContext()`.
* Given an [`Environment`][], using `env->context()` to get the `Environment`'s
principal [`Realm`][]'s context.
* Given an [`Realm`][], using `realm->context()` to get the `Realm`'s
* Given a [`Realm`][], using `realm->context()` to get the `Realm`'s
context.
<a id="event-loop"></a>
Expand Down Expand Up @@ -329,15 +329,15 @@ Typical ways of accessing the current `Environment` in the Node.js code are:
### `Realm`
The `Realm` class is a container for a set of JavaScript objects and functions
that associated with a particular ECMAScript global environment.
that are associated with a particular ECMAScript global environment.
Every `Realm` instance is associated with a [`Context`][].
A `Realm` can be a principal realm or a synthetic realm. A principal realm is
created with an `Environment` as its principal global environment to evaluate
scripts. A synthetic realm is created with JS APIs like `ShadowRealm`.
Native bindings and builtin modules can be evaluated in either a principal
Native bindings and built-in modules can be evaluated in either a principal
realm or a synthetic realm.
The `Realm` class contains a large number of different fields for
Expand Down Expand Up @@ -744,7 +744,7 @@ any resources owned by it, e.g. memory or libuv requests/handles.
#### Cleanup hooks

Cleanup hooks are provided that run before the [`Environment`][] or the
[`Realm`][] is destroyed. They can be added and removed through by using
[`Realm`][] is destroyed. They can be added and removed by using
`env->AddCleanupHook(callback, hint);` and
`env->RemoveCleanupHook(callback, hint);`, or
`realm->AddCleanupHook(callback, hint);` and
Expand Down

0 comments on commit 136cf14

Please sign in to comment.