mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
fec1b2a5a4
- Improves op performance. - Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs per op-encoding (aka: out-of-payload). - Remove shared queue & custom "asyncHandlers", all async values are returned in batches via js_recv_cb. - The op-layer should be thought of as simple function calls with little indirection or translation besides the conceptually straightforward serde_v8 bijections. - Preserve concepts of json/bin/min as semantic groups of their inputs/outputs instead of their op-encoding strategy, preserving these groups will also facilitate partial transitions over to v8 Fast API for the "min" and "bin" groups
34 lines
723 B
TypeScript
34 lines
723 B
TypeScript
import {
|
|
assert,
|
|
assertEquals,
|
|
assertMatch,
|
|
unitTest,
|
|
unreachable,
|
|
} from "./test_util.ts";
|
|
|
|
const readErrorStackPattern = new RegExp(
|
|
`^.*
|
|
at processErr \\(.*core\\.js:.*\\)
|
|
at opAsyncHandler \\(.*core\\.js:.*\\)
|
|
at handleAsyncMsgFromRust \\(.*core\\.js:.*\\).*$`,
|
|
"ms",
|
|
);
|
|
|
|
unitTest(async function sendAsyncStackTrace(): Promise<void> {
|
|
const buf = new Uint8Array(10);
|
|
const rid = 10;
|
|
try {
|
|
await Deno.read(rid, buf);
|
|
unreachable();
|
|
} catch (error) {
|
|
assertMatch(error.stack, readErrorStackPattern);
|
|
}
|
|
});
|
|
|
|
declare global {
|
|
// deno-lint-ignore no-namespace
|
|
namespace Deno {
|
|
// deno-lint-ignore no-explicit-any
|
|
var core: any; // eslint-disable-line no-var
|
|
}
|
|
}
|