Organize dispatch a bit (#2796)

Just some clean up reorganization around flatbuffer/minimal dispatch
code. This is prep for adding a JSON dispatcher.
This commit is contained in:
Ryan Dahl 2019-08-21 20:42:48 -04:00 committed by GitHub
parent b764d1b8ff
commit bdc97b3976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 663 additions and 754 deletions

View file

@ -2,9 +2,7 @@
// Some of the code here is adapted directly from V8 and licensed under a BSD
// style license available here: https://github.com/v8/v8/blob/24886f2d1c565287d33d71e4109a53bf0b54b75c/LICENSE.v8
import * as msg from "gen/cli/msg_generated";
import * as flatbuffers from "./flatbuffers";
import * as dispatch from "./dispatch";
import { sendSync, msg, flatbuffers } from "./dispatch_flatbuffers";
import { assert } from "./util";
export interface Location {
@ -77,7 +75,7 @@ function res(baseRes: msg.Base | null): Location {
*/
export function applySourceMap(location: Location): Location {
const { filename, line, column } = location;
return res(dispatch.sendSync(...req(filename, line, column)));
return res(sendSync(...req(filename, line, column)));
}
/** Mutate the call site so that it returns the location, instead of its