diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-19 07:06:23 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-19 07:06:23 -0400 |
commit | 2c65292119d13b880ad57783dda434147b6f6980 (patch) | |
tree | b090637789548dd61f98f4c1774f03f8802caccb /main.ts | |
parent | ca8eb1d421cbe4dbe6f80312b9cc6e1f9ed4a47c (diff) |
Source map support. Partially working.
Diffstat (limited to 'main.ts')
-rw-r--r-- | main.ts | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -3,6 +3,29 @@ import "./util"; import * as runtime from "./runtime"; import * as timers from "./timers"; import * as util from "./util"; +import * as sourceMap from "source-map-support"; + +function retrieveFileForSourceMap(path: string): string { + util.log("retrieveFileForSourceMap", path); + throw Error("implemtn me"); +} + +function retrieveSourceMap(source: string): sourceMap.UrlAndMap { + util.log("retrieveSourceMap", source); + throw Error("implemtn me"); + //return { url, map } +} + +// TODO handleUncaughtExceptions +sourceMap.install({ + //handleUncaughtExceptions: true, + environment: "node", + retrieveFile: retrieveFileForSourceMap, + hookRequire: false, + overrideRetrieveSourceMap: true, + overrideRetrieveFile: true, + retrieveSourceMap +}); // To control internal logging output // Set with the -debug command-line flag. @@ -11,6 +34,7 @@ export let debug = false; function start(cwd: string, argv: string[], debugFlag: boolean): void { debug = debugFlag; util.log("start", { cwd, argv, debugFlag }); + const inputFn = argv[0]; const mod = runtime.resolveModule(inputFn, cwd + "/"); mod.compileAndRun(); |