This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Issues minifying ts2dart #40
Copy link
Copy link
Open
Labels
Description
- TypeScript objects not being typed to classes/interfaces defined in
typescript.d.ts(in want of more generic/flexible types)- ie:
n: ts.ModifiersArrayvsn: {flags: number}inbase.tsline 61
- ie:
- Typing problems - if
maybeVisitTypeArgumentstakes a type not externally declared,typeArgumentsget renamed, but adding a more strict typing likets.ExpressionWithTypeArgumentsbrings up an error when passed something like an object of typets.CallExpressionerror TS2345: Argument of type 'CallExpression' is not assignable to parameter of type 'ExpressionWithTypeArguments'.
Breakage, in cases like these:
return {fileName, qname};function getFileAndName(): { fileName: string, qname: string } // rename properties here? {
var fileName = 'hello';
var qname = 'world';
return { fileName, qname }; // ShortPropertyAssignment
}A TypeLiteral node is comprised of
First PunctuationSyntaxListCloseBraceToken
SyntaxListis where the interesting bit could happen:
PropertySignatureIdentifierColonTokenStringKeyword
Another scenario:
function getFileAndName(): { fileName: string, qname: string } {
var fileName = 'hello';
var blah = 'world';
return { fileName, qname: blah };
}The current algorithm contextEmit will rename qname and blah because they are both identifiers, when we only want to rename qname.