Skip to content

Commit 658ab23

Browse files
committed
Still include builtins when compiling with --noLib, fixes AssemblyScript#190
1 parent d0085ad commit 658ab23

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

cli/asc.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ exports.main = function main(argv, options, callback) {
230230
var parser = null;
231231

232232
// Include library files
233-
if (!args.noLib) { // bundled
233+
if (!args.noLib) {
234234
Object.keys(exports.libraryFiles).forEach(libPath => {
235235
if (libPath.indexOf("/") >= 0) return; // in sub-directory: imported on demand
236236
stats.parseCount++;
@@ -243,6 +243,16 @@ exports.main = function main(argv, options, callback) {
243243
);
244244
});
245245
});
246+
} else { // always include builtins
247+
stats.parseCount++;
248+
stats.parseTime += measure(() => {
249+
parser = assemblyscript.parseFile(
250+
exports.libraryFiles["builtins"],
251+
exports.libraryPrefix + "builtins.ts",
252+
false,
253+
parser
254+
);
255+
});
246256
}
247257
const customLibDirs = [];
248258
if (args.lib) {

dist/asc.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)