mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
This reverts commit e976b3e041
.
There is nothing technically wrong with this commit, but it's adding
complexity to a big refactor (native ES modules #975). Since it's not
necessary and simply a philosophical preference, I will revert for now
and try to bring it back later.
This commit is contained in:
parent
6be1164d89
commit
ea6c9f2f36
7 changed files with 88 additions and 97 deletions
11
js/os.ts
11
js/os.ts
|
@ -4,7 +4,6 @@ import { assert } from "./util";
|
|||
import * as util from "./util";
|
||||
import * as flatbuffers from "./flatbuffers";
|
||||
import { sendSync } from "./dispatch";
|
||||
import { TextDecoder } from "./text_encoding";
|
||||
|
||||
interface CodeInfo {
|
||||
moduleName: string | undefined;
|
||||
|
@ -46,17 +45,13 @@ export function codeFetch(specifier: string, referrer: string): CodeInfo {
|
|||
assert(baseRes!.inner(codeFetchRes) != null);
|
||||
// flatbuffers returns `null` for an empty value, this does not fit well with
|
||||
// idiomatic TypeScript under strict null checks, so converting to `undefined`
|
||||
const sourceCode = codeFetchRes.sourceCodeArray() || undefined;
|
||||
const outputCode = codeFetchRes.outputCodeArray() || undefined;
|
||||
const sourceMap = codeFetchRes.sourceMapArray() || undefined;
|
||||
const decoder = new TextDecoder();
|
||||
return {
|
||||
moduleName: codeFetchRes.moduleName() || undefined,
|
||||
filename: codeFetchRes.filename() || undefined,
|
||||
mediaType: codeFetchRes.mediaType(),
|
||||
sourceCode: sourceCode && decoder.decode(sourceCode),
|
||||
outputCode: outputCode && decoder.decode(outputCode),
|
||||
sourceMap: sourceMap && decoder.decode(sourceMap)
|
||||
sourceCode: codeFetchRes.sourceCode() || undefined,
|
||||
outputCode: codeFetchRes.outputCode() || undefined,
|
||||
sourceMap: codeFetchRes.sourceMap() || undefined
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue