Skip to content

Commit fcc4e8c

Browse files
authored
Merge pull request #75 from jsoref/spelling
Spelling
2 parents 7e8cd97 + 57143f5 commit fcc4e8c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ The basic principle is: **The caller is responsible for disposing all stubs.** T
355355
* Stubs passed in the params of a call remain property of the caller, and must be disposed by the caller, not by the callee.
356356
* Stubs returned in the result of a call have their ownership transferred from the callee to the caller, and must be disposed by the caller.
357357

358-
In practice, though, the callee and caller do not actually share the same stubs. When stubs are passed over RPC, they are _duplicated_, and the the target object is only disposed when all duplicates of the stub are disposed. Thus, to achieve the rule that only the caller needs to dispose stubs, the RPC system implicitly disposes the callee's duplicates of all stubs when the call completes. That is:
358+
In practice, though, the callee and caller do not actually share the same stubs. When stubs are passed over RPC, they are _duplicated_, and the target object is only disposed when all duplicates of the stub are disposed. Thus, to achieve the rule that only the caller needs to dispose stubs, the RPC system implicitly disposes the callee's duplicates of all stubs when the call completes. That is:
359359
* Any stubs the callee receives in the parameters are implicitly disposed when the call completes.
360360
* Any stubs returned in the results are implicitly disposed some time after the call completes. (Specifically, the RPC system will dispose them once it knows there will be no more pipelined calls.)
361361

@@ -382,7 +382,7 @@ Note that if you pass the same `RpcTarget` instance to RPC multiple times -- thu
382382

383383
### Listening for disconnect
384384

385-
You can monitor any stub for "brokennness" with its `onRpcBroken()` method:
385+
You can monitor any stub for "brokenness" with its `onRpcBroken()` method:
386386

387387
```ts
388388
stub.onRpcBroken((error: any) => {

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ https://www.cloudflare.com/disclosure
77
* https://hackerone.com/cloudflare
88
* All Cloudflare products are in scope for reporting. If you submit a valid report on bounty-eligible assets through our disclosure program, we will transfer your report to our private bug bounty program and invite you as a participant.
99
10-
* If you'd like to encrypt your message, please do so within the the body of the message. Our email system doesn't handle PGP-MIME well.
10+
* If you'd like to encrypt your message, please do so within the body of the message. Our email system doesn't handle PGP-MIME well.
1111
* https://www.cloudflare.com/gpg/security-at-cloudflare-pubkey-06A67236.txt
1212

1313
All abuse reports should be submitted to our Trust & Safety team through our dedicated page: https://www.cloudflare.com/abuse/

__tests__/index.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,20 @@ describe("local stub", () => {
270270
expect(await outerStub.innerTarget.square(3)).toBe(9);
271271
});
272272

273-
it("returns undefined when accessing non-existent properties", async () => {
273+
it("returns undefined when accessing nonexistent properties", async () => {
274274
let objectStub = new RpcStub({foo: "bar"});
275275
let arrayStub = new RpcStub([1, 2, 3]);
276276
let targetStub = new RpcStub(new TestTarget());
277277

278-
expect(await (objectStub as any).nonExistent).toBe(undefined);
279-
expect(await (arrayStub as any).nonExistent).toBe(undefined);
280-
expect(await (targetStub as any).nonExistent).toBe(undefined);
278+
expect(await (objectStub as any).nonexistent).toBe(undefined);
279+
expect(await (arrayStub as any).nonexistent).toBe(undefined);
280+
expect(await (targetStub as any).nonexistent).toBe(undefined);
281281

282282
// Accessing a property of undefined should throw TypeError (but the error message differs
283283
// across runtimes).
284-
await expect(() => (objectStub as any).nonExistent.foo).rejects.toThrow(TypeError);
285-
await expect(() => (arrayStub as any).nonExistent.foo).rejects.toThrow(TypeError);
286-
await expect(() => (targetStub as any).nonExistent.foo).rejects.toThrow(TypeError);
284+
await expect(() => (objectStub as any).nonexistent.foo).rejects.toThrow(TypeError);
285+
await expect(() => (arrayStub as any).nonexistent.foo).rejects.toThrow(TypeError);
286+
await expect(() => (targetStub as any).nonexistent.foo).rejects.toThrow(TypeError);
287287
});
288288

289289
it("exposes only prototype properties for RpcTarget, not instance properties", async () => {

__tests__/workerd.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe("workerd compatibility", () => {
217217
}
218218
})
219219

220-
it("can wrap a SerivceStub in an RpcStub", async () => {
220+
it("can wrap a ServiceStub in an RpcStub", async () => {
221221
let result = await new RpcStub((<any>env).testServer).greet("World");
222222
expect(result).toBe("Hello, World!");
223223
});

0 commit comments

Comments
 (0)