Skip to content

Commit c31935c

Browse files
authored
explainer.md: miscellaneous grammatical updates (#388)
No functional change.
1 parent 5392ab3 commit c31935c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

explainer.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
The ShadowRealm proposal provides a new mechanism to execute JavaScript code within the context of a new global object and set of JavaScript built-ins.
3737

38-
The API enables control over the execution of different programs within a Realm, providing a proper mechanism for virtualization. This is not possible in the Web Platform today and the proposed API is aimed to a seamless solution for all JS enviroments.
38+
The API enables control over the execution of different programs within a Realm, providing a proper mechanism for virtualization. This is not possible in the Web Platform today and the proposed API is aimed to a seamless solution for all JS environments.
3939

4040
There are various examples where the ShadowRealm API can be well applied to:
4141

@@ -53,7 +53,7 @@ As detailed in the [Security](#Security) section, the ShadowRealm API is not a f
5353

5454
## <a name='APITypeScriptFormat'></a>API (TypeScript Format)
5555

56-
This is The ShadowRealm API description in TypeScript format:
56+
This is the ShadowRealm API description in TypeScript format:
5757

5858
```ts
5959
declare class ShadowRealm {
@@ -75,12 +75,12 @@ The proposed specification defines:
7575
```javascript
7676
const red = new ShadowRealm();
7777

78-
// realms can import modules that will execute within it's own environment.
78+
// realms can import modules that will execute within its own environment.
7979
// When the module is resolved, it captured the binding value, or creates a new
8080
// wrapped function that is connected to the callable binding.
8181
const redAdd = await red.importValue('./inside-code.js', 'add');
8282

83-
// redAdd is a wrapped function exotic object that chains it's call to the
83+
// redAdd is a wrapped function exotic object that chains its call to the
8484
// respective imported binding.
8585
let result = redAdd(2, 3);
8686

@@ -106,11 +106,11 @@ console.assert(result === 16); // yields true
106106

107107
## <a name='Motivations'></a>Motivations
108108

109-
It's quite common for applications to contain programs from multiple sources, whether from different teams, vendors, package managers, etc, or just programs with different set of requirements from the environment.
109+
It's quite common for applications to contain programs from multiple sources, whether from different teams, vendors, package managers, etc., or just programs with different set of requirements from the environment.
110110

111111
These programs must currently contend for the global shared resources, specifically, the shared global object, and the side effect of executing those programs are often hard to observe, causing conflicts between the different programs, and potentially affecting the integrity of the app itself.
112112

113-
Attempting to solve these problems with existing DOM APIs will require to implement an asynchronous communication protocol, which is often a deal-breaker for many use cases. It usually just adds complexity for cases where a same-process Realm is sufficient. It's also very important that values can be immediately shared. Other communications require data to be serialized before it's sent back and forth.
113+
Attempting to solve these problems with existing DOM APIs will require implementing an asynchronous communication protocol, which is often a deal-breaker for many use cases. It usually just adds complexity for cases where a same-process Realm is sufficient. It's also very important that values can be immediately shared. Other communications require data to be serialized before it's sent back and forth.
114114

115115
__The primary goal of this proposal is to provide a proper mechanism to control the execution of a program, providing a new global object, a new set of intrinsics, no access to objects cross-realms, a separate module graph and synchronous communication between both realms__.
116116

0 commit comments

Comments
 (0)