fix(compiler): reject dynamic api access in client functions
Usage-driven emission can only see api.<name> calls. api["name"]() or passing api to a helper is invisible to it, silently drops the block from the browser bundle, and fails at runtime instead of build time. Detect that dynamic/indirect use (masking strings and comments first, reusing the tokenizer's skipLiteralOrComment) and refuse to compile instead, naming the offending function.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export { Lexer, LexError } from "./tokenizer.ts";
|
||||
export { Lexer, LexError, skipLiteralOrComment } from "./tokenizer.ts";
|
||||
export { formatWrn } from "./formatter.ts";
|
||||
export type { FormatWrnOptions } from "./formatter.ts";
|
||||
export { parse, parseHtmlView, ParseError, VOID_ELEMENTS } from "./parser.ts";
|
||||
|
||||
Reference in New Issue
Block a user