mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
Implement CodeCache
This commit is contained in:
parent
1f093c12f8
commit
4d386e9e1c
7 changed files with 514 additions and 263 deletions
8
js/os.ts
8
js/os.ts
|
@ -71,7 +71,13 @@ export function codeCache(
|
|||
fbs.Base.addMsgType(builder, fbs.Any.CodeCache);
|
||||
builder.finish(fbs.Base.endBase(builder));
|
||||
const resBuf = deno.send(builder.asUint8Array());
|
||||
assert(resBuf == null);
|
||||
// Expect null or error.
|
||||
if (resBuf != null) {
|
||||
const bb = new flatbuffers.ByteBuffer(new Uint8Array(resBuf));
|
||||
const baseRes = fbs.Base.getRootAsBase(bb);
|
||||
assert(fbs.Any.NONE === baseRes.msgType());
|
||||
throw Error(baseRes.error());
|
||||
}
|
||||
}
|
||||
|
||||
export function readFileSync(filename: string): Uint8Array {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue