Reintroduce builtin decorator so these can appear anywhere in stdlib again

Avoids wrapping an undocumented function within 'memory.size' for example.
This commit is contained in:
dcodeIO
2018-07-19 02:10:04 +02:00
parent 96411c7398
commit 26e46f6f86
80 changed files with 6889 additions and 7157 deletions

View File

@ -86,8 +86,6 @@ import {
nodeIsGenericCallable
} from "./ast";
const builtinsFile = LIBRARY_PREFIX + "builtins.ts";
/** Parser interface. */
export class Parser extends DiagnosticEmitter {
@ -135,11 +133,6 @@ export class Parser extends DiagnosticEmitter {
var program = this.program;
program.sources.push(source);
// mark the special builtins library file
if (source.normalizedPath == builtinsFile) {
source.set(CommonFlags.BUILTIN);
}
// tokenize and parse
var tn = new Tokenizer(source, program.diagnostics);
tn.onComment = this.onComment;
@ -176,9 +169,6 @@ export class Parser extends DiagnosticEmitter {
decorators.push(decorator);
}
// mark builtins
flags |= (tn.source.flags & CommonFlags.BUILTIN);
// check modifiers
var exportStart: i32 = 0;
var exportEnd: i32 = 0;