Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
27162ef
feat: improve Bufffer API
TopchetoEU Nov 26, 2023
1902e41
feat: make typescript output mappings
TopchetoEU Nov 26, 2023
b59a003
feat: implement VLQ parsing
TopchetoEU Nov 26, 2023
6b1cb85
fix: arrays wrongly stringified in JSONLib
TopchetoEU Nov 26, 2023
e8a7ac8
refactor: reorganize assets
TopchetoEU Nov 26, 2023
977701e
feat: implement source maps
TopchetoEU Nov 26, 2023
f193291
fix: move debugger assets to correct location
TopchetoEU Nov 27, 2023
6c57e0e
fix: properly handle wrapper function
TopchetoEU Nov 28, 2023
8defd93
fix: use proper name for native constructors
TopchetoEU Nov 28, 2023
1243419
fix: simplify source map API
TopchetoEU Nov 28, 2023
7334506
feat: implement new API with source maps
TopchetoEU Nov 28, 2023
d5e6edf
refactor: replace .locate with argument
TopchetoEU Nov 29, 2023
fe86123
refactor: improve function statement
TopchetoEU Nov 29, 2023
3443496
cant be fucked to split this one up
TopchetoEU Dec 14, 2023
60b1762
refactor: remove printf
TopchetoEU Dec 14, 2023
60bbaac
fix: some issues with try-catch
TopchetoEU Dec 14, 2023
8cffcff
refactor: remove unused instructions
TopchetoEU Dec 14, 2023
0b5178e
fix: return minified typescript
TopchetoEU Dec 14, 2023
773bc72
refactor: rename compileWithDebug to compile
TopchetoEU Dec 14, 2023
42f4435
fix: how the hell did i fix this (it was the cache all along)
TopchetoEU Dec 18, 2023
76c3d37
feat: use mappings in stack traces
TopchetoEU Dec 18, 2023
380a5c7
feat: make environment hidable from stack trace
TopchetoEU Dec 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(function (_arguments) {
var ts = _arguments[0];
(function (ts, env, libs) {
var src = '', version = 0;
var lib = _arguments[2].concat([
'declare const exit: never; declare const go: any;',
var lib = libs.concat([
'declare function exit(): never;',
'declare function go(): any;',
'declare function getTsDeclarations(): string[];'
]).join('');
var libSnapshot = ts.ScriptSnapshot.fromString(lib);
Expand All @@ -21,6 +21,7 @@
forceConsistentCasingInFileNames: true,
experimentalDecorators: true,
strict: true,
sourceMap: true,
};

var reg = ts.createDocumentRegistry();
Expand Down Expand Up @@ -55,6 +56,8 @@
service.getEmitOutput("/lib.d.ts");
log("Loaded libraries!");

var oldCompile = env.compile;

function compile(code, filename, env) {
src = code;
version++;
Expand Down Expand Up @@ -82,21 +85,20 @@
throw new SyntaxError(diagnostics.join("\n"));
}

var result = emit.outputFiles[0].text;
var declaration = emit.outputFiles[1].text;

var map = JSON.parse(emit.outputFiles[0].text);
var result = emit.outputFiles[1].text;
var declaration = emit.outputFiles[2].text;

var compiled = oldCompile(result, filename, env);

return {
source: result,
runner: function(func) {
return function() {
var val = func.apply(this, arguments);
if (declaration !== '') {
declSnapshots.push(ts.ScriptSnapshot.fromString(declaration));
}
return val;
}
}
function: function () {
var val = compiled.function.apply(this, arguments);
if (declaration !== '') declSnapshots.push(ts.ScriptSnapshot.fromString(declaration));
return val;
},
breakpoints: compiled.breakpoints,
mapChain: compiled.mapChain.concat(map.mappings),
};
}

Expand All @@ -107,5 +109,5 @@
}
}

apply(_arguments[1]);
})(arguments);
apply(env);
})(arguments[0], arguments[1], arguments[2]);
Loading