Resolve string instances to the program's string class

This commit is contained in:
dcodeIO
2018-04-06 00:19:45 +02:00
parent 70a0123554
commit 6268b92eba
13 changed files with 103 additions and 31 deletions

View File

@ -1994,6 +1994,17 @@ export class Program extends DiagnosticEmitter {
case NodeKind.IDENTIFIER: {
return this.resolveIdentifier(<IdentifierExpression>expression, contextualFunction);
}
case NodeKind.LITERAL: {
switch ((<LiteralExpression>expression).literalKind) {
case LiteralKind.STRING: {
this.resolvedThisExpression = expression;
this.resolvedElementExpression = null;
return this.stringInstance;
}
// case LiteralKind.ARRAY: // TODO
}
break;
}
case NodeKind.PROPERTYACCESS: {
return this.resolvePropertyAccess(
<PropertyAccessExpression>expression,