a4f9bf0fce
* Create type aliases for unresolved type symbols * Accept new baselines * Update fourslash tests * Unresolved import aliases create tagged unresolved symbols * Add comments * Accept new baselines * Add fourslash tests
11198 lines
292 KiB
Plaintext
11198 lines
292 KiB
Plaintext
=== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts ===
|
|
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
|
|
// See LICENSE.txt in the project root for complete license information.
|
|
|
|
///<reference path='typescript.ts' />
|
|
|
|
module TypeScript {
|
|
>TypeScript : typeof TypeScript
|
|
|
|
export class ASTSpan {
|
|
>ASTSpan : ASTSpan
|
|
|
|
public minChar: number = -1; // -1 = "undefined" or "compiler generated"
|
|
>minChar : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
|
|
public limChar: number = -1; // -1 = "undefined" or "compiler generated"
|
|
>limChar : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
}
|
|
|
|
export class AST extends ASTSpan {
|
|
>AST : AST
|
|
>ASTSpan : ASTSpan
|
|
|
|
public type: Type = null;
|
|
>type : Type
|
|
>null : null
|
|
|
|
public flags = ASTFlags.Writeable;
|
|
>flags : any
|
|
>ASTFlags.Writeable : any
|
|
>ASTFlags : any
|
|
>Writeable : any
|
|
|
|
// REVIEW: for diagnostic purposes
|
|
public passCreated: number = CompilerDiagnostics.analysisPass;
|
|
>passCreated : number
|
|
>CompilerDiagnostics.analysisPass : any
|
|
>CompilerDiagnostics : any
|
|
>analysisPass : any
|
|
|
|
public preComments: Comment[] = null;
|
|
>preComments : Comment[]
|
|
>null : null
|
|
|
|
public postComments: Comment[] = null;
|
|
>postComments : Comment[]
|
|
>null : null
|
|
|
|
public isParenthesized = false;
|
|
>isParenthesized : boolean
|
|
>false : false
|
|
|
|
constructor (public nodeType: NodeType) {
|
|
>nodeType : NodeType
|
|
|
|
super();
|
|
>super() : void
|
|
>super : typeof ASTSpan
|
|
}
|
|
|
|
public isExpression() { return false; }
|
|
>isExpression : () => boolean
|
|
>false : false
|
|
|
|
public isStatementOrExpression() { return false; }
|
|
>isStatementOrExpression : () => boolean
|
|
>false : false
|
|
|
|
public isCompoundStatement() { return false; }
|
|
>isCompoundStatement : () => boolean
|
|
>false : false
|
|
|
|
public isLeaf() { return this.isStatementOrExpression() && (!this.isCompoundStatement()); }
|
|
>isLeaf : () => boolean
|
|
>this.isStatementOrExpression() && (!this.isCompoundStatement()) : boolean
|
|
>this.isStatementOrExpression() : boolean
|
|
>this.isStatementOrExpression : () => boolean
|
|
>this : this
|
|
>isStatementOrExpression : () => boolean
|
|
>(!this.isCompoundStatement()) : boolean
|
|
>!this.isCompoundStatement() : boolean
|
|
>this.isCompoundStatement() : boolean
|
|
>this.isCompoundStatement : () => boolean
|
|
>this : this
|
|
>isCompoundStatement : () => boolean
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
switch (this.nodeType) {
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
case NodeType.Error:
|
|
>NodeType.Error : any
|
|
>NodeType : any
|
|
>Error : any
|
|
|
|
case NodeType.EmptyExpr:
|
|
>NodeType.EmptyExpr : any
|
|
>NodeType : any
|
|
>EmptyExpr : any
|
|
|
|
this.type = typeFlow.anyType;
|
|
>this.type = typeFlow.anyType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.anyType : any
|
|
>typeFlow : TypeFlow
|
|
>anyType : any
|
|
|
|
break;
|
|
case NodeType.This:
|
|
>NodeType.This : any
|
|
>NodeType : any
|
|
>This : any
|
|
|
|
return typeFlow.typeCheckThis(this);
|
|
>typeFlow.typeCheckThis(this) : any
|
|
>typeFlow.typeCheckThis : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckThis : any
|
|
>this : this
|
|
|
|
case NodeType.Null:
|
|
>NodeType.Null : any
|
|
>NodeType : any
|
|
>Null : any
|
|
|
|
this.type = typeFlow.nullType;
|
|
>this.type = typeFlow.nullType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.nullType : any
|
|
>typeFlow : TypeFlow
|
|
>nullType : any
|
|
|
|
break;
|
|
case NodeType.False:
|
|
>NodeType.False : any
|
|
>NodeType : any
|
|
>False : any
|
|
|
|
case NodeType.True:
|
|
>NodeType.True : any
|
|
>NodeType : any
|
|
>True : any
|
|
|
|
this.type = typeFlow.booleanType;
|
|
>this.type = typeFlow.booleanType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.booleanType : any
|
|
>typeFlow : TypeFlow
|
|
>booleanType : any
|
|
|
|
break;
|
|
case NodeType.Super:
|
|
>NodeType.Super : any
|
|
>NodeType : any
|
|
>Super : any
|
|
|
|
return typeFlow.typeCheckSuper(this);
|
|
>typeFlow.typeCheckSuper(this) : any
|
|
>typeFlow.typeCheckSuper : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckSuper : any
|
|
>this : this
|
|
|
|
case NodeType.EndCode:
|
|
>NodeType.EndCode : any
|
|
>NodeType : any
|
|
>EndCode : any
|
|
|
|
case NodeType.Empty:
|
|
>NodeType.Empty : any
|
|
>NodeType : any
|
|
>Empty : any
|
|
|
|
case NodeType.Void:
|
|
>NodeType.Void : any
|
|
>NodeType : any
|
|
>Void : any
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
break;
|
|
default:
|
|
throw new Error("please implement in derived class");
|
|
>new Error("please implement in derived class") : Error
|
|
>Error : ErrorConstructor
|
|
>"please implement in derived class" : "please implement in derived class"
|
|
}
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
switch (this.nodeType) {
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
case NodeType.This:
|
|
>NodeType.This : any
|
|
>NodeType : any
|
|
>This : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (emitter.thisFnc && (hasFlag(emitter.thisFnc.fncFlags, FncFlags.IsFatArrowFunction))) {
|
|
>emitter.thisFnc && (hasFlag(emitter.thisFnc.fncFlags, FncFlags.IsFatArrowFunction)) : any
|
|
>emitter.thisFnc : any
|
|
>emitter : Emitter
|
|
>thisFnc : any
|
|
>(hasFlag(emitter.thisFnc.fncFlags, FncFlags.IsFatArrowFunction)) : any
|
|
>hasFlag(emitter.thisFnc.fncFlags, FncFlags.IsFatArrowFunction) : any
|
|
>hasFlag : any
|
|
>emitter.thisFnc.fncFlags : any
|
|
>emitter.thisFnc : any
|
|
>emitter : Emitter
|
|
>thisFnc : any
|
|
>fncFlags : any
|
|
>FncFlags.IsFatArrowFunction : any
|
|
>FncFlags : any
|
|
>IsFatArrowFunction : any
|
|
|
|
emitter.writeToOutput("_this");
|
|
>emitter.writeToOutput("_this") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"_this" : "_this"
|
|
}
|
|
else {
|
|
emitter.writeToOutput("this");
|
|
>emitter.writeToOutput("this") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"this" : "this"
|
|
}
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
case NodeType.Null:
|
|
>NodeType.Null : any
|
|
>NodeType : any
|
|
>Null : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("null");
|
|
>emitter.writeToOutput("null") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"null" : "null"
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
case NodeType.False:
|
|
>NodeType.False : any
|
|
>NodeType : any
|
|
>False : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("false");
|
|
>emitter.writeToOutput("false") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"false" : "false"
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
case NodeType.True:
|
|
>NodeType.True : any
|
|
>NodeType : any
|
|
>True : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("true");
|
|
>emitter.writeToOutput("true") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"true" : "true"
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
case NodeType.Super:
|
|
>NodeType.Super : any
|
|
>NodeType : any
|
|
>Super : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitSuperReference();
|
|
>emitter.emitSuperReference() : any
|
|
>emitter.emitSuperReference : any
|
|
>emitter : Emitter
|
|
>emitSuperReference : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
case NodeType.EndCode:
|
|
>NodeType.EndCode : any
|
|
>NodeType : any
|
|
>EndCode : any
|
|
|
|
break;
|
|
case NodeType.Error:
|
|
>NodeType.Error : any
|
|
>NodeType : any
|
|
>Error : any
|
|
|
|
case NodeType.EmptyExpr:
|
|
>NodeType.EmptyExpr : any
|
|
>NodeType : any
|
|
>EmptyExpr : any
|
|
|
|
break;
|
|
|
|
case NodeType.Empty:
|
|
>NodeType.Empty : any
|
|
>NodeType : any
|
|
>Empty : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("; ");
|
|
>emitter.writeToOutput("; ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"; " : "; "
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
case NodeType.Void:
|
|
>NodeType.Void : any
|
|
>NodeType : any
|
|
>Void : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("void ");
|
|
>emitter.writeToOutput("void ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"void " : "void "
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
break;
|
|
default:
|
|
throw new Error("please implement in derived class");
|
|
>new Error("please implement in derived class") : Error
|
|
>Error : ErrorConstructor
|
|
>"please implement in derived class" : "please implement in derived class"
|
|
}
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public print(context: PrintContext) {
|
|
>print : (context: PrintContext) => void
|
|
>context : PrintContext
|
|
|
|
context.startLine();
|
|
>context.startLine() : any
|
|
>context.startLine : any
|
|
>context : PrintContext
|
|
>startLine : any
|
|
|
|
var lineCol = { line: -1, col: -1 };
|
|
>lineCol : { line: number; col: number; }
|
|
>{ line: -1, col: -1 } : { line: number; col: number; }
|
|
>line : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
>col : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
|
|
var limLineCol = { line: -1, col: -1 };
|
|
>limLineCol : { line: number; col: number; }
|
|
>{ line: -1, col: -1 } : { line: number; col: number; }
|
|
>line : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
>col : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
|
|
if (context.parser !== null) {
|
|
>context.parser !== null : boolean
|
|
>context.parser : any
|
|
>context : PrintContext
|
|
>parser : any
|
|
>null : null
|
|
|
|
context.parser.getSourceLineCol(lineCol, this.minChar);
|
|
>context.parser.getSourceLineCol(lineCol, this.minChar) : any
|
|
>context.parser.getSourceLineCol : any
|
|
>context.parser : any
|
|
>context : PrintContext
|
|
>parser : any
|
|
>getSourceLineCol : any
|
|
>lineCol : { line: number; col: number; }
|
|
>this.minChar : number
|
|
>this : this
|
|
>minChar : number
|
|
|
|
context.parser.getSourceLineCol(limLineCol, this.limChar);
|
|
>context.parser.getSourceLineCol(limLineCol, this.limChar) : any
|
|
>context.parser.getSourceLineCol : any
|
|
>context.parser : any
|
|
>context : PrintContext
|
|
>parser : any
|
|
>getSourceLineCol : any
|
|
>limLineCol : { line: number; col: number; }
|
|
>this.limChar : number
|
|
>this : this
|
|
>limChar : number
|
|
|
|
context.write("(" + lineCol.line + "," + lineCol.col + ")--" +
|
|
>context.write("(" + lineCol.line + "," + lineCol.col + ")--" + "(" + limLineCol.line + "," + limLineCol.col + "): ") : any
|
|
>context.write : any
|
|
>context : PrintContext
|
|
>write : any
|
|
>"(" + lineCol.line + "," + lineCol.col + ")--" + "(" + limLineCol.line + "," + limLineCol.col + "): " : string
|
|
>"(" + lineCol.line + "," + lineCol.col + ")--" + "(" + limLineCol.line + "," + limLineCol.col : string
|
|
>"(" + lineCol.line + "," + lineCol.col + ")--" + "(" + limLineCol.line + "," : string
|
|
>"(" + lineCol.line + "," + lineCol.col + ")--" + "(" + limLineCol.line : string
|
|
>"(" + lineCol.line + "," + lineCol.col + ")--" + "(" : string
|
|
>"(" + lineCol.line + "," + lineCol.col + ")--" : string
|
|
>"(" + lineCol.line + "," + lineCol.col : string
|
|
>"(" + lineCol.line + "," : string
|
|
>"(" + lineCol.line : string
|
|
>"(" : "("
|
|
>lineCol.line : number
|
|
>lineCol : { line: number; col: number; }
|
|
>line : number
|
|
>"," : ","
|
|
>lineCol.col : number
|
|
>lineCol : { line: number; col: number; }
|
|
>col : number
|
|
>")--" : ")--"
|
|
|
|
"(" + limLineCol.line + "," + limLineCol.col + "): ");
|
|
>"(" : "("
|
|
>limLineCol.line : number
|
|
>limLineCol : { line: number; col: number; }
|
|
>line : number
|
|
>"," : ","
|
|
>limLineCol.col : number
|
|
>limLineCol : { line: number; col: number; }
|
|
>col : number
|
|
>"): " : "): "
|
|
}
|
|
var lab = this.printLabel();
|
|
>lab : any
|
|
>this.printLabel() : any
|
|
>this.printLabel : () => any
|
|
>this : this
|
|
>printLabel : () => any
|
|
|
|
if (hasFlag(this.flags, ASTFlags.Error)) {
|
|
>hasFlag(this.flags, ASTFlags.Error) : any
|
|
>hasFlag : any
|
|
>this.flags : any
|
|
>this : this
|
|
>flags : any
|
|
>ASTFlags.Error : any
|
|
>ASTFlags : any
|
|
>Error : any
|
|
|
|
lab += " (Error)";
|
|
>lab += " (Error)" : string
|
|
>lab : any
|
|
>" (Error)" : " (Error)"
|
|
}
|
|
context.writeLine(lab);
|
|
>context.writeLine(lab) : any
|
|
>context.writeLine : any
|
|
>context : PrintContext
|
|
>writeLine : any
|
|
>lab : any
|
|
}
|
|
|
|
public printLabel() {
|
|
>printLabel : () => any
|
|
|
|
if (nodeTypeTable[this.nodeType] !== undefined) {
|
|
>nodeTypeTable[this.nodeType] !== undefined : boolean
|
|
>nodeTypeTable[this.nodeType] : any
|
|
>nodeTypeTable : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>undefined : undefined
|
|
|
|
return nodeTypeTable[this.nodeType];
|
|
>nodeTypeTable[this.nodeType] : any
|
|
>nodeTypeTable : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
}
|
|
else {
|
|
return (<any>NodeType)._map[this.nodeType];
|
|
>(<any>NodeType)._map[this.nodeType] : any
|
|
>(<any>NodeType)._map : any
|
|
>(<any>NodeType) : any
|
|
><any>NodeType : any
|
|
>NodeType : any
|
|
>_map : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
}
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
// by default, AST adds itself to current basic block and does not check its children
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
|
|
context.addContent(this);
|
|
>context.addContent(this) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this : this
|
|
}
|
|
|
|
public netFreeUses(container: Symbol, freeUses: StringHashTable) {
|
|
>netFreeUses : (container: Symbol, freeUses: StringHashTable) => void
|
|
>container : Symbol
|
|
>freeUses : StringHashTable
|
|
}
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => any
|
|
|
|
return (<any>NodeType)._map[this.nodeType];
|
|
>(<any>NodeType)._map[this.nodeType] : any
|
|
>(<any>NodeType)._map : any
|
|
>(<any>NodeType) : any
|
|
><any>NodeType : any
|
|
>NodeType : any
|
|
>_map : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
}
|
|
|
|
public static getResolvedIdentifierName(name: string): string {
|
|
>getResolvedIdentifierName : (name: string) => string
|
|
>name : string
|
|
|
|
if (!name) return "";
|
|
>!name : boolean
|
|
>name : string
|
|
>"" : ""
|
|
|
|
var resolved = "";
|
|
>resolved : string
|
|
>"" : ""
|
|
|
|
var start = 0;
|
|
>start : number
|
|
>0 : 0
|
|
|
|
var i = 0;
|
|
>i : number
|
|
>0 : 0
|
|
|
|
while(i <= name.length - 6) {
|
|
>i <= name.length - 6 : boolean
|
|
>i : number
|
|
>name.length - 6 : number
|
|
>name.length : number
|
|
>name : string
|
|
>length : number
|
|
>6 : 6
|
|
|
|
// Look for escape sequence \uxxxx
|
|
if (name.charAt(i) == '\\' && name.charAt(i+1) == 'u') {
|
|
>name.charAt(i) == '\\' && name.charAt(i+1) == 'u' : boolean
|
|
>name.charAt(i) == '\\' : boolean
|
|
>name.charAt(i) : string
|
|
>name.charAt : (pos: number) => string
|
|
>name : string
|
|
>charAt : (pos: number) => string
|
|
>i : number
|
|
>'\\' : "\\"
|
|
>name.charAt(i+1) == 'u' : boolean
|
|
>name.charAt(i+1) : string
|
|
>name.charAt : (pos: number) => string
|
|
>name : string
|
|
>charAt : (pos: number) => string
|
|
>i+1 : number
|
|
>i : number
|
|
>1 : 1
|
|
>'u' : "u"
|
|
|
|
var charCode = parseInt(name.substr(i + 2, 4), 16);
|
|
>charCode : number
|
|
>parseInt(name.substr(i + 2, 4), 16) : number
|
|
>parseInt : (string: string, radix?: number) => number
|
|
>name.substr(i + 2, 4) : string
|
|
>name.substr : (from: number, length?: number) => string
|
|
>name : string
|
|
>substr : (from: number, length?: number) => string
|
|
>i + 2 : number
|
|
>i : number
|
|
>2 : 2
|
|
>4 : 4
|
|
>16 : 16
|
|
|
|
resolved += name.substr(start, i - start);
|
|
>resolved += name.substr(start, i - start) : string
|
|
>resolved : string
|
|
>name.substr(start, i - start) : string
|
|
>name.substr : (from: number, length?: number) => string
|
|
>name : string
|
|
>substr : (from: number, length?: number) => string
|
|
>start : number
|
|
>i - start : number
|
|
>i : number
|
|
>start : number
|
|
|
|
resolved += String.fromCharCode(charCode);
|
|
>resolved += String.fromCharCode(charCode) : string
|
|
>resolved : string
|
|
>String.fromCharCode(charCode) : string
|
|
>String.fromCharCode : (...codes: number[]) => string
|
|
>String : StringConstructor
|
|
>fromCharCode : (...codes: number[]) => string
|
|
>charCode : number
|
|
|
|
i += 6;
|
|
>i += 6 : number
|
|
>i : number
|
|
>6 : 6
|
|
|
|
start = i;
|
|
>start = i : number
|
|
>start : number
|
|
>i : number
|
|
|
|
continue;
|
|
}
|
|
i++;
|
|
>i++ : number
|
|
>i : number
|
|
}
|
|
// Append remaining string
|
|
resolved += name.substring(start);
|
|
>resolved += name.substring(start) : string
|
|
>resolved : string
|
|
>name.substring(start) : string
|
|
>name.substring : (start: number, end?: number) => string
|
|
>name : string
|
|
>substring : (start: number, end?: number) => string
|
|
>start : number
|
|
|
|
return resolved;
|
|
>resolved : string
|
|
}
|
|
}
|
|
|
|
export class IncompleteAST extends AST {
|
|
>IncompleteAST : IncompleteAST
|
|
>AST : AST
|
|
|
|
constructor (min: number, lim: number) {
|
|
>min : number
|
|
>lim : number
|
|
|
|
super(NodeType.Error);
|
|
>super(NodeType.Error) : void
|
|
>super : typeof AST
|
|
>NodeType.Error : any
|
|
>NodeType : any
|
|
>Error : any
|
|
|
|
this.minChar = min;
|
|
>this.minChar = min : number
|
|
>this.minChar : number
|
|
>this : this
|
|
>minChar : number
|
|
>min : number
|
|
|
|
this.limChar = lim;
|
|
>this.limChar = lim : number
|
|
>this.limChar : number
|
|
>this : this
|
|
>limChar : number
|
|
>lim : number
|
|
}
|
|
}
|
|
|
|
export class ASTList extends AST {
|
|
>ASTList : ASTList
|
|
>AST : AST
|
|
|
|
public enclosingScope: SymbolScope = null;
|
|
>enclosingScope : SymbolScope
|
|
>null : null
|
|
|
|
public members: AST[] = new AST[];
|
|
>members : AST[]
|
|
>new AST[] : any
|
|
>AST[] : any
|
|
>AST : typeof AST
|
|
> : any
|
|
|
|
constructor () {
|
|
super(NodeType.List);
|
|
>super(NodeType.List) : void
|
|
>super : typeof AST
|
|
>NodeType.List : any
|
|
>NodeType : any
|
|
>List : any
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var len = this.members.length;
|
|
>len : number
|
|
>this.members.length : number
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>length : number
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>i < len : boolean
|
|
>i : number
|
|
>len : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
if (context.noContinuation) {
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
context.addUnreachable(this.members[i]);
|
|
>context.addUnreachable(this.members[i]) : any
|
|
>context.addUnreachable : any
|
|
>context : ControlFlowContext
|
|
>addUnreachable : any
|
|
>this.members[i] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>i : number
|
|
|
|
break;
|
|
}
|
|
else {
|
|
this.members[i] = context.walk(this.members[i], this);
|
|
>this.members[i] = context.walk(this.members[i], this) : any
|
|
>this.members[i] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>i : number
|
|
>context.walk(this.members[i], this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.members[i] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>i : number
|
|
>this : this
|
|
}
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
|
|
public append(ast: AST) {
|
|
>append : (ast: AST) => this
|
|
>ast : AST
|
|
|
|
this.members[this.members.length] = ast;
|
|
>this.members[this.members.length] = ast : AST
|
|
>this.members[this.members.length] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>this.members.length : number
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>length : number
|
|
>ast : AST
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public appendAll(ast: AST) {
|
|
>appendAll : (ast: AST) => this
|
|
>ast : AST
|
|
|
|
if (ast.nodeType == NodeType.List) {
|
|
>ast.nodeType == NodeType.List : boolean
|
|
>ast.nodeType : NodeType
|
|
>ast : AST
|
|
>nodeType : NodeType
|
|
>NodeType.List : any
|
|
>NodeType : any
|
|
>List : any
|
|
|
|
var list = <ASTList>ast;
|
|
>list : ASTList
|
|
><ASTList>ast : ASTList
|
|
>ast : AST
|
|
|
|
for (var i = 0, len = list.members.length; i < len; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>len : number
|
|
>list.members.length : number
|
|
>list.members : AST[]
|
|
>list : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>i < len : boolean
|
|
>i : number
|
|
>len : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
this.append(list.members[i]);
|
|
>this.append(list.members[i]) : this
|
|
>this.append : (ast: AST) => this
|
|
>this : this
|
|
>append : (ast: AST) => this
|
|
>list.members[i] : AST
|
|
>list.members : AST[]
|
|
>list : ASTList
|
|
>members : AST[]
|
|
>i : number
|
|
}
|
|
}
|
|
else {
|
|
this.append(ast);
|
|
>this.append(ast) : this
|
|
>this.append : (ast: AST) => this
|
|
>this : this
|
|
>append : (ast: AST) => this
|
|
>ast : AST
|
|
}
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitJavascriptList(this, null, TokenID.Semicolon, startLine, false, false);
|
|
>emitter.emitJavascriptList(this, null, TokenID.Semicolon, startLine, false, false) : any
|
|
>emitter.emitJavascriptList : any
|
|
>emitter : Emitter
|
|
>emitJavascriptList : any
|
|
>this : this
|
|
>null : null
|
|
>TokenID.Semicolon : any
|
|
>TokenID : any
|
|
>Semicolon : any
|
|
>startLine : boolean
|
|
>false : false
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
var len = this.members.length;
|
|
>len : number
|
|
>this.members.length : number
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>length : number
|
|
|
|
typeFlow.nestingLevel++;
|
|
>typeFlow.nestingLevel++ : number
|
|
>typeFlow.nestingLevel : any
|
|
>typeFlow : TypeFlow
|
|
>nestingLevel : any
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>i < len : boolean
|
|
>i : number
|
|
>len : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
if (this.members[i]) {
|
|
>this.members[i] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>i : number
|
|
|
|
this.members[i] = this.members[i].typeCheck(typeFlow);
|
|
>this.members[i] = this.members[i].typeCheck(typeFlow) : any
|
|
>this.members[i] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>i : number
|
|
>this.members[i].typeCheck(typeFlow) : any
|
|
>this.members[i].typeCheck : (typeFlow: TypeFlow) => any
|
|
>this.members[i] : AST
|
|
>this.members : AST[]
|
|
>this : this
|
|
>members : AST[]
|
|
>i : number
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
}
|
|
}
|
|
typeFlow.nestingLevel--;
|
|
>typeFlow.nestingLevel-- : number
|
|
>typeFlow.nestingLevel : any
|
|
>typeFlow : TypeFlow
|
|
>nestingLevel : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class Identifier extends AST {
|
|
>Identifier : Identifier
|
|
>AST : AST
|
|
|
|
public sym: Symbol = null;
|
|
>sym : Symbol
|
|
>null : null
|
|
|
|
public cloId = -1;
|
|
>cloId : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
|
|
public text: string;
|
|
>text : string
|
|
|
|
// 'actualText' is the text that the user has entered for the identifier. the text might
|
|
// include any Unicode escape sequences (e.g.: \u0041 for 'A'). 'text', however, contains
|
|
// the resolved value of any escape sequences in the actual text; so in the previous
|
|
// example, actualText = '\u0041', text = 'A'.
|
|
//
|
|
// For purposes of finding a symbol, use text, as this will allow you to match all
|
|
// variations of the variable text. For full-fidelity translation of the user input, such
|
|
// as emitting, use the actualText field.
|
|
//
|
|
// Note:
|
|
// To change text, and to avoid running into a situation where 'actualText' does not
|
|
// match 'text', always use setText.
|
|
constructor (public actualText: string, public hasEscapeSequence?: boolean) {
|
|
>actualText : string
|
|
>hasEscapeSequence : boolean
|
|
|
|
super(NodeType.Name);
|
|
>super(NodeType.Name) : void
|
|
>super : typeof AST
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
this.setText(actualText, hasEscapeSequence);
|
|
>this.setText(actualText, hasEscapeSequence) : void
|
|
>this.setText : (actualText: string, hasEscapeSequence?: boolean) => void
|
|
>this : this
|
|
>setText : (actualText: string, hasEscapeSequence?: boolean) => void
|
|
>actualText : string
|
|
>hasEscapeSequence : boolean
|
|
}
|
|
|
|
public setText(actualText: string, hasEscapeSequence?: boolean) {
|
|
>setText : (actualText: string, hasEscapeSequence?: boolean) => void
|
|
>actualText : string
|
|
>hasEscapeSequence : boolean
|
|
|
|
this.actualText = actualText;
|
|
>this.actualText = actualText : string
|
|
>this.actualText : string
|
|
>this : this
|
|
>actualText : string
|
|
>actualText : string
|
|
|
|
if (hasEscapeSequence) {
|
|
>hasEscapeSequence : boolean
|
|
|
|
this.text = AST.getResolvedIdentifierName(actualText);
|
|
>this.text = AST.getResolvedIdentifierName(actualText) : string
|
|
>this.text : string
|
|
>this : this
|
|
>text : string
|
|
>AST.getResolvedIdentifierName(actualText) : string
|
|
>AST.getResolvedIdentifierName : (name: string) => string
|
|
>AST : typeof AST
|
|
>getResolvedIdentifierName : (name: string) => string
|
|
>actualText : string
|
|
}
|
|
else {
|
|
this.text = actualText;
|
|
>this.text = actualText : string
|
|
>this.text : string
|
|
>this : this
|
|
>text : string
|
|
>actualText : string
|
|
}
|
|
}
|
|
|
|
public isMissing() { return false; }
|
|
>isMissing : () => boolean
|
|
>false : false
|
|
|
|
public isLeaf() { return true; }
|
|
>isLeaf : () => boolean
|
|
>true : true
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
return "id: " + this.actualText;
|
|
>"id: " + this.actualText : string
|
|
>"id: " : "id: "
|
|
>this.actualText : string
|
|
>this : this
|
|
>actualText : string
|
|
}
|
|
|
|
public printLabel() {
|
|
>printLabel : () => string
|
|
|
|
if (this.actualText) {
|
|
>this.actualText : string
|
|
>this : this
|
|
>actualText : string
|
|
|
|
return "id: " + this.actualText;
|
|
>"id: " + this.actualText : string
|
|
>"id: " : "id: "
|
|
>this.actualText : string
|
|
>this : this
|
|
>actualText : string
|
|
}
|
|
else {
|
|
return "name node";
|
|
>"name node" : "name node"
|
|
}
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckName(this);
|
|
>typeFlow.typeCheckName(this) : any
|
|
>typeFlow.typeCheckName : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckName : any
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitJavascriptName(this, true);
|
|
>emitter.emitJavascriptName(this, true) : any
|
|
>emitter.emitJavascriptName : any
|
|
>emitter : Emitter
|
|
>emitJavascriptName : any
|
|
>this : this
|
|
>true : true
|
|
}
|
|
|
|
public static fromToken(token: Token): Identifier {
|
|
>fromToken : (token: Token) => Identifier
|
|
>token : Token
|
|
|
|
return new Identifier(token.getText(), (<IdentifierToken>token).hasEscapeSequence);
|
|
>new Identifier(token.getText(), (<IdentifierToken>token).hasEscapeSequence) : Identifier
|
|
>Identifier : typeof Identifier
|
|
>token.getText() : any
|
|
>token.getText : any
|
|
>token : Token
|
|
>getText : any
|
|
>(<IdentifierToken>token).hasEscapeSequence : any
|
|
>(<IdentifierToken>token) : IdentifierToken
|
|
><IdentifierToken>token : IdentifierToken
|
|
>token : Token
|
|
>hasEscapeSequence : any
|
|
}
|
|
}
|
|
|
|
export class MissingIdentifier extends Identifier {
|
|
>MissingIdentifier : MissingIdentifier
|
|
>Identifier : Identifier
|
|
|
|
constructor () {
|
|
super("__missing");
|
|
>super("__missing") : void
|
|
>super : typeof Identifier
|
|
>"__missing" : "__missing"
|
|
}
|
|
|
|
public isMissing() {
|
|
>isMissing : () => boolean
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
// Emit nothing for a missing ID
|
|
}
|
|
}
|
|
|
|
export class Label extends AST {
|
|
>Label : Label
|
|
>AST : AST
|
|
|
|
constructor (public id: Identifier) {
|
|
>id : Identifier
|
|
|
|
super(NodeType.Label);
|
|
>super(NodeType.Label) : void
|
|
>super : typeof AST
|
|
>NodeType.Label : any
|
|
>NodeType : any
|
|
>Label : any
|
|
}
|
|
|
|
public printLabel() { return this.id.actualText + ":"; }
|
|
>printLabel : () => string
|
|
>this.id.actualText + ":" : string
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
>":" : ":"
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.recordSourceMappingStart(this.id);
|
|
>emitter.recordSourceMappingStart(this.id) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
|
|
emitter.writeToOutput(this.id.actualText);
|
|
>emitter.writeToOutput(this.id.actualText) : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
|
|
emitter.recordSourceMappingEnd(this.id);
|
|
>emitter.recordSourceMappingEnd(this.id) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
|
|
emitter.writeLineToOutput(":");
|
|
>emitter.writeLineToOutput(":") : any
|
|
>emitter.writeLineToOutput : any
|
|
>emitter : Emitter
|
|
>writeLineToOutput : any
|
|
>":" : ":"
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class Expression extends AST {
|
|
>Expression : Expression
|
|
>AST : AST
|
|
|
|
constructor (nodeType: NodeType) {
|
|
>nodeType : NodeType
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof AST
|
|
>nodeType : NodeType
|
|
}
|
|
|
|
public isExpression() { return true; }
|
|
>isExpression : () => boolean
|
|
>true : true
|
|
|
|
public isStatementOrExpression() { return true; }
|
|
>isStatementOrExpression : () => boolean
|
|
>true : true
|
|
}
|
|
|
|
export class UnaryExpression extends Expression {
|
|
>UnaryExpression : UnaryExpression
|
|
>Expression : Expression
|
|
|
|
public targetType: Type = null; // Target type for an object literal (null if no target type)
|
|
>targetType : Type
|
|
>null : null
|
|
|
|
public castTerm: AST = null;
|
|
>castTerm : AST
|
|
>null : null
|
|
|
|
constructor (nodeType: NodeType, public operand: AST) {
|
|
>nodeType : NodeType
|
|
>operand : AST
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof Expression
|
|
>nodeType : NodeType
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
super.addToControlFlow(context);
|
|
>super.addToControlFlow(context) : void
|
|
>super.addToControlFlow : (context: ControlFlowContext) => void
|
|
>super : Expression
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
// TODO: add successor as catch block/finally block if present
|
|
if (this.nodeType == NodeType.Throw) {
|
|
>this.nodeType == NodeType.Throw : boolean
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>NodeType.Throw : any
|
|
>NodeType : any
|
|
>Throw : any
|
|
|
|
context.returnStmt();
|
|
>context.returnStmt() : any
|
|
>context.returnStmt : any
|
|
>context : ControlFlowContext
|
|
>returnStmt : any
|
|
}
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
switch (this.nodeType) {
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
case NodeType.Not:
|
|
>NodeType.Not : any
|
|
>NodeType : any
|
|
>Not : any
|
|
|
|
return typeFlow.typeCheckBitNot(this);
|
|
>typeFlow.typeCheckBitNot(this) : any
|
|
>typeFlow.typeCheckBitNot : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckBitNot : any
|
|
>this : this
|
|
|
|
case NodeType.LogNot:
|
|
>NodeType.LogNot : any
|
|
>NodeType : any
|
|
>LogNot : any
|
|
|
|
return typeFlow.typeCheckLogNot(this);
|
|
>typeFlow.typeCheckLogNot(this) : any
|
|
>typeFlow.typeCheckLogNot : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckLogNot : any
|
|
>this : this
|
|
|
|
case NodeType.Pos:
|
|
>NodeType.Pos : any
|
|
>NodeType : any
|
|
>Pos : any
|
|
|
|
case NodeType.Neg:
|
|
>NodeType.Neg : any
|
|
>NodeType : any
|
|
>Neg : any
|
|
|
|
return typeFlow.typeCheckUnaryNumberOperator(this);
|
|
>typeFlow.typeCheckUnaryNumberOperator(this) : any
|
|
>typeFlow.typeCheckUnaryNumberOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckUnaryNumberOperator : any
|
|
>this : this
|
|
|
|
case NodeType.IncPost:
|
|
>NodeType.IncPost : any
|
|
>NodeType : any
|
|
>IncPost : any
|
|
|
|
case NodeType.IncPre:
|
|
>NodeType.IncPre : any
|
|
>NodeType : any
|
|
>IncPre : any
|
|
|
|
case NodeType.DecPost:
|
|
>NodeType.DecPost : any
|
|
>NodeType : any
|
|
>DecPost : any
|
|
|
|
case NodeType.DecPre:
|
|
>NodeType.DecPre : any
|
|
>NodeType : any
|
|
>DecPre : any
|
|
|
|
return typeFlow.typeCheckIncOrDec(this);
|
|
>typeFlow.typeCheckIncOrDec(this) : any
|
|
>typeFlow.typeCheckIncOrDec : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckIncOrDec : any
|
|
>this : this
|
|
|
|
case NodeType.ArrayLit:
|
|
>NodeType.ArrayLit : any
|
|
>NodeType : any
|
|
>ArrayLit : any
|
|
|
|
typeFlow.typeCheckArrayLit(this);
|
|
>typeFlow.typeCheckArrayLit(this) : any
|
|
>typeFlow.typeCheckArrayLit : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckArrayLit : any
|
|
>this : this
|
|
|
|
return this;
|
|
>this : this
|
|
|
|
case NodeType.ObjectLit:
|
|
>NodeType.ObjectLit : any
|
|
>NodeType : any
|
|
>ObjectLit : any
|
|
|
|
typeFlow.typeCheckObjectLit(this);
|
|
>typeFlow.typeCheckObjectLit(this) : any
|
|
>typeFlow.typeCheckObjectLit : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckObjectLit : any
|
|
>this : this
|
|
|
|
return this;
|
|
>this : this
|
|
|
|
case NodeType.Throw:
|
|
>NodeType.Throw : any
|
|
>NodeType : any
|
|
>Throw : any
|
|
|
|
this.operand = typeFlow.typeCheck(this.operand);
|
|
>this.operand = typeFlow.typeCheck(this.operand) : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>typeFlow.typeCheck(this.operand) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
|
|
case NodeType.Typeof:
|
|
>NodeType.Typeof : any
|
|
>NodeType : any
|
|
>Typeof : any
|
|
|
|
this.operand = typeFlow.typeCheck(this.operand);
|
|
>this.operand = typeFlow.typeCheck(this.operand) : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>typeFlow.typeCheck(this.operand) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
this.type = typeFlow.stringType;
|
|
>this.type = typeFlow.stringType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.stringType : any
|
|
>typeFlow : TypeFlow
|
|
>stringType : any
|
|
|
|
return this;
|
|
>this : this
|
|
|
|
case NodeType.Delete:
|
|
>NodeType.Delete : any
|
|
>NodeType : any
|
|
>Delete : any
|
|
|
|
this.operand = typeFlow.typeCheck(this.operand);
|
|
>this.operand = typeFlow.typeCheck(this.operand) : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>typeFlow.typeCheck(this.operand) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
this.type = typeFlow.booleanType;
|
|
>this.type = typeFlow.booleanType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.booleanType : any
|
|
>typeFlow : TypeFlow
|
|
>booleanType : any
|
|
|
|
break;
|
|
|
|
case NodeType.TypeAssertion:
|
|
>NodeType.TypeAssertion : any
|
|
>NodeType : any
|
|
>TypeAssertion : any
|
|
|
|
this.castTerm = typeFlow.typeCheck(this.castTerm);
|
|
>this.castTerm = typeFlow.typeCheck(this.castTerm) : any
|
|
>this.castTerm : AST
|
|
>this : this
|
|
>castTerm : AST
|
|
>typeFlow.typeCheck(this.castTerm) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.castTerm : AST
|
|
>this : this
|
|
>castTerm : AST
|
|
|
|
var applyTargetType = !this.operand.isParenthesized;
|
|
>applyTargetType : boolean
|
|
>!this.operand.isParenthesized : boolean
|
|
>this.operand.isParenthesized : boolean
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>isParenthesized : boolean
|
|
|
|
var targetType = applyTargetType ? this.castTerm.type : null;
|
|
>targetType : any
|
|
>applyTargetType ? this.castTerm.type : null : any
|
|
>applyTargetType : boolean
|
|
>this.castTerm.type : Type
|
|
>this.castTerm : AST
|
|
>this : this
|
|
>castTerm : AST
|
|
>type : Type
|
|
>null : null
|
|
|
|
typeFlow.checker.typeCheckWithContextualType(targetType, typeFlow.checker.inProvisionalTypecheckMode(), true, this.operand);
|
|
>typeFlow.checker.typeCheckWithContextualType(targetType, typeFlow.checker.inProvisionalTypecheckMode(), true, this.operand) : any
|
|
>typeFlow.checker.typeCheckWithContextualType : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>typeCheckWithContextualType : any
|
|
>targetType : any
|
|
>typeFlow.checker.inProvisionalTypecheckMode() : any
|
|
>typeFlow.checker.inProvisionalTypecheckMode : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>inProvisionalTypecheckMode : any
|
|
>true : true
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
typeFlow.castWithCoercion(this.operand, this.castTerm.type, false, true);
|
|
>typeFlow.castWithCoercion(this.operand, this.castTerm.type, false, true) : any
|
|
>typeFlow.castWithCoercion : any
|
|
>typeFlow : TypeFlow
|
|
>castWithCoercion : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>this.castTerm.type : Type
|
|
>this.castTerm : AST
|
|
>this : this
|
|
>castTerm : AST
|
|
>type : Type
|
|
>false : false
|
|
>true : true
|
|
|
|
this.type = this.castTerm.type;
|
|
>this.type = this.castTerm.type : Type
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>this.castTerm.type : Type
|
|
>this.castTerm : AST
|
|
>this : this
|
|
>castTerm : AST
|
|
>type : Type
|
|
|
|
return this;
|
|
>this : this
|
|
|
|
case NodeType.Void:
|
|
>NodeType.Void : any
|
|
>NodeType : any
|
|
>Void : any
|
|
|
|
// REVIEW - Although this is good to do for completeness's sake,
|
|
// this shouldn't be strictly necessary from the void operator's
|
|
// point of view
|
|
this.operand = typeFlow.typeCheck(this.operand);
|
|
>this.operand = typeFlow.typeCheck(this.operand) : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>typeFlow.typeCheck(this.operand) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
this.type = typeFlow.checker.undefinedType;
|
|
>this.type = typeFlow.checker.undefinedType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.checker.undefinedType : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>undefinedType : any
|
|
|
|
break;
|
|
|
|
default:
|
|
throw new Error("please implement in derived class");
|
|
>new Error("please implement in derived class") : Error
|
|
>Error : ErrorConstructor
|
|
>"please implement in derived class" : "please implement in derived class"
|
|
}
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
switch (this.nodeType) {
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
case NodeType.IncPost:
|
|
>NodeType.IncPost : any
|
|
>NodeType : any
|
|
>IncPost : any
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.PlusPlus, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.PlusPlus, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.PlusPlus : any
|
|
>TokenID : any
|
|
>PlusPlus : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput("++");
|
|
>emitter.writeToOutput("++") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"++" : "++"
|
|
|
|
break;
|
|
case NodeType.LogNot:
|
|
>NodeType.LogNot : any
|
|
>NodeType : any
|
|
>LogNot : any
|
|
|
|
emitter.writeToOutput("!");
|
|
>emitter.writeToOutput("!") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"!" : "!"
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Exclamation, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Exclamation, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Exclamation : any
|
|
>TokenID : any
|
|
>Exclamation : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.DecPost:
|
|
>NodeType.DecPost : any
|
|
>NodeType : any
|
|
>DecPost : any
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.MinusMinus, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.MinusMinus, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.MinusMinus : any
|
|
>TokenID : any
|
|
>MinusMinus : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput("--");
|
|
>emitter.writeToOutput("--") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"--" : "--"
|
|
|
|
break;
|
|
case NodeType.ObjectLit:
|
|
>NodeType.ObjectLit : any
|
|
>NodeType : any
|
|
>ObjectLit : any
|
|
|
|
emitter.emitObjectLiteral(<ASTList>this.operand);
|
|
>emitter.emitObjectLiteral(<ASTList>this.operand) : any
|
|
>emitter.emitObjectLiteral : any
|
|
>emitter : Emitter
|
|
>emitObjectLiteral : any
|
|
><ASTList>this.operand : ASTList
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
break;
|
|
case NodeType.ArrayLit:
|
|
>NodeType.ArrayLit : any
|
|
>NodeType : any
|
|
>ArrayLit : any
|
|
|
|
emitter.emitArrayLiteral(<ASTList>this.operand);
|
|
>emitter.emitArrayLiteral(<ASTList>this.operand) : any
|
|
>emitter.emitArrayLiteral : any
|
|
>emitter : Emitter
|
|
>emitArrayLiteral : any
|
|
><ASTList>this.operand : ASTList
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
|
|
break;
|
|
case NodeType.Not:
|
|
>NodeType.Not : any
|
|
>NodeType : any
|
|
>Not : any
|
|
|
|
emitter.writeToOutput("~");
|
|
>emitter.writeToOutput("~") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"~" : "~"
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Neg:
|
|
>NodeType.Neg : any
|
|
>NodeType : any
|
|
>Neg : any
|
|
|
|
emitter.writeToOutput("-");
|
|
>emitter.writeToOutput("-") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"-" : "-"
|
|
|
|
if (this.operand.nodeType == NodeType.Neg) {
|
|
>this.operand.nodeType == NodeType.Neg : boolean
|
|
>this.operand.nodeType : NodeType
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Neg : any
|
|
>NodeType : any
|
|
>Neg : any
|
|
|
|
this.operand.isParenthesized = true;
|
|
>this.operand.isParenthesized = true : true
|
|
>this.operand.isParenthesized : boolean
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>isParenthesized : boolean
|
|
>true : true
|
|
}
|
|
emitter.emitJavascript(this.operand, TokenID.Minus, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Minus, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Minus : any
|
|
>TokenID : any
|
|
>Minus : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Pos:
|
|
>NodeType.Pos : any
|
|
>NodeType : any
|
|
>Pos : any
|
|
|
|
emitter.writeToOutput("+");
|
|
>emitter.writeToOutput("+") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"+" : "+"
|
|
|
|
if (this.operand.nodeType == NodeType.Pos) {
|
|
>this.operand.nodeType == NodeType.Pos : boolean
|
|
>this.operand.nodeType : NodeType
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Pos : any
|
|
>NodeType : any
|
|
>Pos : any
|
|
|
|
this.operand.isParenthesized = true;
|
|
>this.operand.isParenthesized = true : true
|
|
>this.operand.isParenthesized : boolean
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>isParenthesized : boolean
|
|
>true : true
|
|
}
|
|
emitter.emitJavascript(this.operand, TokenID.Plus, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Plus, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Plus : any
|
|
>TokenID : any
|
|
>Plus : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.IncPre:
|
|
>NodeType.IncPre : any
|
|
>NodeType : any
|
|
>IncPre : any
|
|
|
|
emitter.writeToOutput("++");
|
|
>emitter.writeToOutput("++") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"++" : "++"
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.PlusPlus, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.PlusPlus, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.PlusPlus : any
|
|
>TokenID : any
|
|
>PlusPlus : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.DecPre:
|
|
>NodeType.DecPre : any
|
|
>NodeType : any
|
|
>DecPre : any
|
|
|
|
emitter.writeToOutput("--");
|
|
>emitter.writeToOutput("--") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"--" : "--"
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.MinusMinus, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.MinusMinus, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.MinusMinus : any
|
|
>TokenID : any
|
|
>MinusMinus : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Throw:
|
|
>NodeType.Throw : any
|
|
>NodeType : any
|
|
>Throw : any
|
|
|
|
emitter.writeToOutput("throw ");
|
|
>emitter.writeToOutput("throw ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"throw " : "throw "
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(";");
|
|
>emitter.writeToOutput(";") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>";" : ";"
|
|
|
|
break;
|
|
case NodeType.Typeof:
|
|
>NodeType.Typeof : any
|
|
>NodeType : any
|
|
>Typeof : any
|
|
|
|
emitter.writeToOutput("typeof ");
|
|
>emitter.writeToOutput("typeof ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"typeof " : "typeof "
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Delete:
|
|
>NodeType.Delete : any
|
|
>NodeType : any
|
|
>Delete : any
|
|
|
|
emitter.writeToOutput("delete ");
|
|
>emitter.writeToOutput("delete ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"delete " : "delete "
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Void:
|
|
>NodeType.Void : any
|
|
>NodeType : any
|
|
>Void : any
|
|
|
|
emitter.writeToOutput("void ");
|
|
>emitter.writeToOutput("void ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"void " : "void "
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.TypeAssertion:
|
|
>NodeType.TypeAssertion : any
|
|
>NodeType : any
|
|
>TypeAssertion : any
|
|
|
|
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.operand, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand : AST
|
|
>this : this
|
|
>operand : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
break;
|
|
default:
|
|
throw new Error("please implement in derived class");
|
|
>new Error("please implement in derived class") : Error
|
|
>Error : ErrorConstructor
|
|
>"please implement in derived class" : "please implement in derived class"
|
|
}
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class CallExpression extends Expression {
|
|
>CallExpression : CallExpression
|
|
>Expression : Expression
|
|
|
|
constructor (nodeType: NodeType,
|
|
>nodeType : NodeType
|
|
|
|
public target: AST,
|
|
>target : AST
|
|
|
|
public arguments: ASTList) {
|
|
>arguments : ASTList
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof Expression
|
|
>nodeType : NodeType
|
|
|
|
this.minChar = this.target.minChar;
|
|
>this.minChar = this.target.minChar : number
|
|
>this.minChar : number
|
|
>this : this
|
|
>minChar : number
|
|
>this.target.minChar : number
|
|
>this.target : AST
|
|
>this : this
|
|
>target : AST
|
|
>minChar : number
|
|
}
|
|
|
|
public signature: Signature = null;
|
|
>signature : Signature
|
|
>null : null
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
if (this.nodeType == NodeType.New) {
|
|
>this.nodeType == NodeType.New : boolean
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>NodeType.New : any
|
|
>NodeType : any
|
|
>New : any
|
|
|
|
return typeFlow.typeCheckNew(this);
|
|
>typeFlow.typeCheckNew(this) : any
|
|
>typeFlow.typeCheckNew : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckNew : any
|
|
>this : this
|
|
}
|
|
else {
|
|
return typeFlow.typeCheckCall(this);
|
|
>typeFlow.typeCheckCall(this) : any
|
|
>typeFlow.typeCheckCall : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckCall : any
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (this.nodeType == NodeType.New) {
|
|
>this.nodeType == NodeType.New : boolean
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>NodeType.New : any
|
|
>NodeType : any
|
|
>New : any
|
|
|
|
emitter.emitNew(this.target, this.arguments);
|
|
>emitter.emitNew(this.target, this.arguments) : any
|
|
>emitter.emitNew : any
|
|
>emitter : Emitter
|
|
>emitNew : any
|
|
>this.target : AST
|
|
>this : this
|
|
>target : AST
|
|
>this.arguments : ASTList
|
|
>this : this
|
|
>arguments : ASTList
|
|
}
|
|
else {
|
|
emitter.emitCall(this, this.target, this.arguments);
|
|
>emitter.emitCall(this, this.target, this.arguments) : any
|
|
>emitter.emitCall : any
|
|
>emitter : Emitter
|
|
>emitCall : any
|
|
>this : this
|
|
>this.target : AST
|
|
>this : this
|
|
>target : AST
|
|
>this.arguments : ASTList
|
|
>this : this
|
|
>arguments : ASTList
|
|
}
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class BinaryExpression extends Expression {
|
|
>BinaryExpression : BinaryExpression
|
|
>Expression : Expression
|
|
|
|
constructor (nodeType: NodeType, public operand1: AST, public operand2: AST) {
|
|
>nodeType : NodeType
|
|
>operand1 : AST
|
|
>operand2 : AST
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof Expression
|
|
>nodeType : NodeType
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
switch (this.nodeType) {
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
case NodeType.Dot:
|
|
>NodeType.Dot : any
|
|
>NodeType : any
|
|
>Dot : any
|
|
|
|
return typeFlow.typeCheckDotOperator(this);
|
|
>typeFlow.typeCheckDotOperator(this) : any
|
|
>typeFlow.typeCheckDotOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckDotOperator : any
|
|
>this : this
|
|
|
|
case NodeType.Asg:
|
|
>NodeType.Asg : any
|
|
>NodeType : any
|
|
>Asg : any
|
|
|
|
return typeFlow.typeCheckAsgOperator(this);
|
|
>typeFlow.typeCheckAsgOperator(this) : any
|
|
>typeFlow.typeCheckAsgOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckAsgOperator : any
|
|
>this : this
|
|
|
|
case NodeType.Add:
|
|
>NodeType.Add : any
|
|
>NodeType : any
|
|
>Add : any
|
|
|
|
case NodeType.Sub:
|
|
>NodeType.Sub : any
|
|
>NodeType : any
|
|
>Sub : any
|
|
|
|
case NodeType.Mul:
|
|
>NodeType.Mul : any
|
|
>NodeType : any
|
|
>Mul : any
|
|
|
|
case NodeType.Div:
|
|
>NodeType.Div : any
|
|
>NodeType : any
|
|
>Div : any
|
|
|
|
case NodeType.Mod:
|
|
>NodeType.Mod : any
|
|
>NodeType : any
|
|
>Mod : any
|
|
|
|
case NodeType.Or:
|
|
>NodeType.Or : any
|
|
>NodeType : any
|
|
>Or : any
|
|
|
|
case NodeType.And:
|
|
>NodeType.And : any
|
|
>NodeType : any
|
|
>And : any
|
|
|
|
return typeFlow.typeCheckArithmeticOperator(this, false);
|
|
>typeFlow.typeCheckArithmeticOperator(this, false) : any
|
|
>typeFlow.typeCheckArithmeticOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckArithmeticOperator : any
|
|
>this : this
|
|
>false : false
|
|
|
|
case NodeType.Xor:
|
|
>NodeType.Xor : any
|
|
>NodeType : any
|
|
>Xor : any
|
|
|
|
return typeFlow.typeCheckBitwiseOperator(this, false);
|
|
>typeFlow.typeCheckBitwiseOperator(this, false) : any
|
|
>typeFlow.typeCheckBitwiseOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckBitwiseOperator : any
|
|
>this : this
|
|
>false : false
|
|
|
|
case NodeType.Ne:
|
|
>NodeType.Ne : any
|
|
>NodeType : any
|
|
>Ne : any
|
|
|
|
case NodeType.Eq:
|
|
>NodeType.Eq : any
|
|
>NodeType : any
|
|
>Eq : any
|
|
|
|
var text: string;
|
|
>text : string
|
|
|
|
if (typeFlow.checker.styleSettings.eqeqeq) {
|
|
>typeFlow.checker.styleSettings.eqeqeq : any
|
|
>typeFlow.checker.styleSettings : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>styleSettings : any
|
|
>eqeqeq : any
|
|
|
|
text = nodeTypeTable[this.nodeType];
|
|
>text = nodeTypeTable[this.nodeType] : any
|
|
>text : string
|
|
>nodeTypeTable[this.nodeType] : any
|
|
>nodeTypeTable : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
typeFlow.checker.errorReporter.styleError(this, "use of " + text);
|
|
>typeFlow.checker.errorReporter.styleError(this, "use of " + text) : any
|
|
>typeFlow.checker.errorReporter.styleError : any
|
|
>typeFlow.checker.errorReporter : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>errorReporter : any
|
|
>styleError : any
|
|
>this : this
|
|
>"use of " + text : string
|
|
>"use of " : "use of "
|
|
>text : string
|
|
}
|
|
else if (typeFlow.checker.styleSettings.eqnull) {
|
|
>typeFlow.checker.styleSettings.eqnull : any
|
|
>typeFlow.checker.styleSettings : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>styleSettings : any
|
|
>eqnull : any
|
|
|
|
text = nodeTypeTable[this.nodeType];
|
|
>text = nodeTypeTable[this.nodeType] : any
|
|
>text : string
|
|
>nodeTypeTable[this.nodeType] : any
|
|
>nodeTypeTable : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
if ((this.operand2 !== null) && (this.operand2.nodeType == NodeType.Null)) {
|
|
>(this.operand2 !== null) && (this.operand2.nodeType == NodeType.Null) : boolean
|
|
>(this.operand2 !== null) : boolean
|
|
>this.operand2 !== null : boolean
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>null : null
|
|
>(this.operand2.nodeType == NodeType.Null) : boolean
|
|
>this.operand2.nodeType == NodeType.Null : boolean
|
|
>this.operand2.nodeType : NodeType
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Null : any
|
|
>NodeType : any
|
|
>Null : any
|
|
|
|
typeFlow.checker.errorReporter.styleError(this, "use of " + text + " to compare with null");
|
|
>typeFlow.checker.errorReporter.styleError(this, "use of " + text + " to compare with null") : any
|
|
>typeFlow.checker.errorReporter.styleError : any
|
|
>typeFlow.checker.errorReporter : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>errorReporter : any
|
|
>styleError : any
|
|
>this : this
|
|
>"use of " + text + " to compare with null" : string
|
|
>"use of " + text : string
|
|
>"use of " : "use of "
|
|
>text : string
|
|
>" to compare with null" : " to compare with null"
|
|
}
|
|
}
|
|
case NodeType.Eqv:
|
|
>NodeType.Eqv : any
|
|
>NodeType : any
|
|
>Eqv : any
|
|
|
|
case NodeType.NEqv:
|
|
>NodeType.NEqv : any
|
|
>NodeType : any
|
|
>NEqv : any
|
|
|
|
case NodeType.Lt:
|
|
>NodeType.Lt : any
|
|
>NodeType : any
|
|
>Lt : any
|
|
|
|
case NodeType.Le:
|
|
>NodeType.Le : any
|
|
>NodeType : any
|
|
>Le : any
|
|
|
|
case NodeType.Ge:
|
|
>NodeType.Ge : any
|
|
>NodeType : any
|
|
>Ge : any
|
|
|
|
case NodeType.Gt:
|
|
>NodeType.Gt : any
|
|
>NodeType : any
|
|
>Gt : any
|
|
|
|
return typeFlow.typeCheckBooleanOperator(this);
|
|
>typeFlow.typeCheckBooleanOperator(this) : any
|
|
>typeFlow.typeCheckBooleanOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckBooleanOperator : any
|
|
>this : this
|
|
|
|
case NodeType.Index:
|
|
>NodeType.Index : any
|
|
>NodeType : any
|
|
>Index : any
|
|
|
|
return typeFlow.typeCheckIndex(this);
|
|
>typeFlow.typeCheckIndex(this) : any
|
|
>typeFlow.typeCheckIndex : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckIndex : any
|
|
>this : this
|
|
|
|
case NodeType.Member:
|
|
>NodeType.Member : any
|
|
>NodeType : any
|
|
>Member : any
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
|
|
case NodeType.LogOr:
|
|
>NodeType.LogOr : any
|
|
>NodeType : any
|
|
>LogOr : any
|
|
|
|
return typeFlow.typeCheckLogOr(this);
|
|
>typeFlow.typeCheckLogOr(this) : any
|
|
>typeFlow.typeCheckLogOr : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckLogOr : any
|
|
>this : this
|
|
|
|
case NodeType.LogAnd:
|
|
>NodeType.LogAnd : any
|
|
>NodeType : any
|
|
>LogAnd : any
|
|
|
|
return typeFlow.typeCheckLogAnd(this);
|
|
>typeFlow.typeCheckLogAnd(this) : any
|
|
>typeFlow.typeCheckLogAnd : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckLogAnd : any
|
|
>this : this
|
|
|
|
case NodeType.AsgAdd:
|
|
>NodeType.AsgAdd : any
|
|
>NodeType : any
|
|
>AsgAdd : any
|
|
|
|
case NodeType.AsgSub:
|
|
>NodeType.AsgSub : any
|
|
>NodeType : any
|
|
>AsgSub : any
|
|
|
|
case NodeType.AsgMul:
|
|
>NodeType.AsgMul : any
|
|
>NodeType : any
|
|
>AsgMul : any
|
|
|
|
case NodeType.AsgDiv:
|
|
>NodeType.AsgDiv : any
|
|
>NodeType : any
|
|
>AsgDiv : any
|
|
|
|
case NodeType.AsgMod:
|
|
>NodeType.AsgMod : any
|
|
>NodeType : any
|
|
>AsgMod : any
|
|
|
|
case NodeType.AsgOr:
|
|
>NodeType.AsgOr : any
|
|
>NodeType : any
|
|
>AsgOr : any
|
|
|
|
case NodeType.AsgAnd:
|
|
>NodeType.AsgAnd : any
|
|
>NodeType : any
|
|
>AsgAnd : any
|
|
|
|
return typeFlow.typeCheckArithmeticOperator(this, true);
|
|
>typeFlow.typeCheckArithmeticOperator(this, true) : any
|
|
>typeFlow.typeCheckArithmeticOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckArithmeticOperator : any
|
|
>this : this
|
|
>true : true
|
|
|
|
case NodeType.AsgXor:
|
|
>NodeType.AsgXor : any
|
|
>NodeType : any
|
|
>AsgXor : any
|
|
|
|
return typeFlow.typeCheckBitwiseOperator(this, true);
|
|
>typeFlow.typeCheckBitwiseOperator(this, true) : any
|
|
>typeFlow.typeCheckBitwiseOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckBitwiseOperator : any
|
|
>this : this
|
|
>true : true
|
|
|
|
case NodeType.Lsh:
|
|
>NodeType.Lsh : any
|
|
>NodeType : any
|
|
>Lsh : any
|
|
|
|
case NodeType.Rsh:
|
|
>NodeType.Rsh : any
|
|
>NodeType : any
|
|
>Rsh : any
|
|
|
|
case NodeType.Rs2:
|
|
>NodeType.Rs2 : any
|
|
>NodeType : any
|
|
>Rs2 : any
|
|
|
|
return typeFlow.typeCheckShift(this, false);
|
|
>typeFlow.typeCheckShift(this, false) : any
|
|
>typeFlow.typeCheckShift : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckShift : any
|
|
>this : this
|
|
>false : false
|
|
|
|
case NodeType.AsgLsh:
|
|
>NodeType.AsgLsh : any
|
|
>NodeType : any
|
|
>AsgLsh : any
|
|
|
|
case NodeType.AsgRsh:
|
|
>NodeType.AsgRsh : any
|
|
>NodeType : any
|
|
>AsgRsh : any
|
|
|
|
case NodeType.AsgRs2:
|
|
>NodeType.AsgRs2 : any
|
|
>NodeType : any
|
|
>AsgRs2 : any
|
|
|
|
return typeFlow.typeCheckShift(this, true);
|
|
>typeFlow.typeCheckShift(this, true) : any
|
|
>typeFlow.typeCheckShift : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckShift : any
|
|
>this : this
|
|
>true : true
|
|
|
|
case NodeType.Comma:
|
|
>NodeType.Comma : any
|
|
>NodeType : any
|
|
>Comma : any
|
|
|
|
return typeFlow.typeCheckCommaOperator(this);
|
|
>typeFlow.typeCheckCommaOperator(this) : any
|
|
>typeFlow.typeCheckCommaOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckCommaOperator : any
|
|
>this : this
|
|
|
|
case NodeType.InstOf:
|
|
>NodeType.InstOf : any
|
|
>NodeType : any
|
|
>InstOf : any
|
|
|
|
return typeFlow.typeCheckInstOf(this);
|
|
>typeFlow.typeCheckInstOf(this) : any
|
|
>typeFlow.typeCheckInstOf : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckInstOf : any
|
|
>this : this
|
|
|
|
case NodeType.In:
|
|
>NodeType.In : any
|
|
>NodeType : any
|
|
>In : any
|
|
|
|
return typeFlow.typeCheckInOperator(this);
|
|
>typeFlow.typeCheckInOperator(this) : any
|
|
>typeFlow.typeCheckInOperator : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckInOperator : any
|
|
>this : this
|
|
|
|
case NodeType.From:
|
|
>NodeType.From : any
|
|
>NodeType : any
|
|
>From : any
|
|
|
|
typeFlow.checker.errorReporter.simpleError(this, "Illegal use of 'from' keyword in binary expression");
|
|
>typeFlow.checker.errorReporter.simpleError(this, "Illegal use of 'from' keyword in binary expression") : any
|
|
>typeFlow.checker.errorReporter.simpleError : any
|
|
>typeFlow.checker.errorReporter : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>errorReporter : any
|
|
>simpleError : any
|
|
>this : this
|
|
>"Illegal use of 'from' keyword in binary expression" : "Illegal use of 'from' keyword in binary expression"
|
|
|
|
break;
|
|
default:
|
|
throw new Error("please implement in derived class");
|
|
>new Error("please implement in derived class") : Error
|
|
>Error : ErrorConstructor
|
|
>"please implement in derived class" : "please implement in derived class"
|
|
}
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
var binTokenId = nodeTypeToTokTable[this.nodeType];
|
|
>binTokenId : any
|
|
>nodeTypeToTokTable[this.nodeType] : any
|
|
>nodeTypeToTokTable : any
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (binTokenId != undefined) {
|
|
>binTokenId != undefined : boolean
|
|
>binTokenId : any
|
|
>undefined : undefined
|
|
|
|
emitter.emitJavascript(this.operand1, binTokenId, false);
|
|
>emitter.emitJavascript(this.operand1, binTokenId, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>binTokenId : any
|
|
>false : false
|
|
|
|
if (tokenTable[binTokenId].text == "instanceof") {
|
|
>tokenTable[binTokenId].text == "instanceof" : boolean
|
|
>tokenTable[binTokenId].text : any
|
|
>tokenTable[binTokenId] : any
|
|
>tokenTable : any
|
|
>binTokenId : any
|
|
>text : any
|
|
>"instanceof" : "instanceof"
|
|
|
|
emitter.writeToOutput(" instanceof ");
|
|
>emitter.writeToOutput(" instanceof ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" instanceof " : " instanceof "
|
|
}
|
|
else if (tokenTable[binTokenId].text == "in") {
|
|
>tokenTable[binTokenId].text == "in" : boolean
|
|
>tokenTable[binTokenId].text : any
|
|
>tokenTable[binTokenId] : any
|
|
>tokenTable : any
|
|
>binTokenId : any
|
|
>text : any
|
|
>"in" : "in"
|
|
|
|
emitter.writeToOutput(" in ");
|
|
>emitter.writeToOutput(" in ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" in " : " in "
|
|
}
|
|
else {
|
|
emitter.writeToOutputTrimmable(" " + tokenTable[binTokenId].text + " ");
|
|
>emitter.writeToOutputTrimmable(" " + tokenTable[binTokenId].text + " ") : any
|
|
>emitter.writeToOutputTrimmable : any
|
|
>emitter : Emitter
|
|
>writeToOutputTrimmable : any
|
|
>" " + tokenTable[binTokenId].text + " " : string
|
|
>" " + tokenTable[binTokenId].text : string
|
|
>" " : " "
|
|
>tokenTable[binTokenId].text : any
|
|
>tokenTable[binTokenId] : any
|
|
>tokenTable : any
|
|
>binTokenId : any
|
|
>text : any
|
|
>" " : " "
|
|
}
|
|
|
|
emitter.emitJavascript(this.operand2, binTokenId, false);
|
|
>emitter.emitJavascript(this.operand2, binTokenId, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>binTokenId : any
|
|
>false : false
|
|
}
|
|
else {
|
|
switch (this.nodeType) {
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
|
|
case NodeType.Dot:
|
|
>NodeType.Dot : any
|
|
>NodeType : any
|
|
>Dot : any
|
|
|
|
if (!emitter.tryEmitConstant(this)) {
|
|
>!emitter.tryEmitConstant(this) : boolean
|
|
>emitter.tryEmitConstant(this) : any
|
|
>emitter.tryEmitConstant : any
|
|
>emitter : Emitter
|
|
>tryEmitConstant : any
|
|
>this : this
|
|
|
|
emitter.emitJavascript(this.operand1, TokenID.Dot, false);
|
|
>emitter.emitJavascript(this.operand1, TokenID.Dot, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>TokenID.Dot : any
|
|
>TokenID : any
|
|
>Dot : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(".");
|
|
>emitter.writeToOutput(".") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"." : "."
|
|
|
|
emitter.emitJavascriptName(<Identifier>this.operand2, false);
|
|
>emitter.emitJavascriptName(<Identifier>this.operand2, false) : any
|
|
>emitter.emitJavascriptName : any
|
|
>emitter : Emitter
|
|
>emitJavascriptName : any
|
|
><Identifier>this.operand2 : Identifier
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>false : false
|
|
}
|
|
break;
|
|
case NodeType.Index:
|
|
>NodeType.Index : any
|
|
>NodeType : any
|
|
>Index : any
|
|
|
|
emitter.emitIndex(this.operand1, this.operand2);
|
|
>emitter.emitIndex(this.operand1, this.operand2) : any
|
|
>emitter.emitIndex : any
|
|
>emitter : Emitter
|
|
>emitIndex : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
|
|
break;
|
|
|
|
case NodeType.Member:
|
|
>NodeType.Member : any
|
|
>NodeType : any
|
|
>Member : any
|
|
|
|
if (this.operand2.nodeType == NodeType.FuncDecl && (<FuncDecl>this.operand2).isAccessor()) {
|
|
>this.operand2.nodeType == NodeType.FuncDecl && (<FuncDecl>this.operand2).isAccessor() : any
|
|
>this.operand2.nodeType == NodeType.FuncDecl : boolean
|
|
>this.operand2.nodeType : NodeType
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>nodeType : NodeType
|
|
>NodeType.FuncDecl : any
|
|
>NodeType : any
|
|
>FuncDecl : any
|
|
>(<FuncDecl>this.operand2).isAccessor() : any
|
|
>(<FuncDecl>this.operand2).isAccessor : () => any
|
|
>(<FuncDecl>this.operand2) : FuncDecl
|
|
><FuncDecl>this.operand2 : FuncDecl
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>isAccessor : () => any
|
|
|
|
var funcDecl = <FuncDecl>this.operand2;
|
|
>funcDecl : FuncDecl
|
|
><FuncDecl>this.operand2 : FuncDecl
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
|
|
if (hasFlag(funcDecl.fncFlags, FncFlags.GetAccessor)) {
|
|
>hasFlag(funcDecl.fncFlags, FncFlags.GetAccessor) : any
|
|
>hasFlag : any
|
|
>funcDecl.fncFlags : any
|
|
>funcDecl : FuncDecl
|
|
>fncFlags : any
|
|
>FncFlags.GetAccessor : any
|
|
>FncFlags : any
|
|
>GetAccessor : any
|
|
|
|
emitter.writeToOutput("get ");
|
|
>emitter.writeToOutput("get ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"get " : "get "
|
|
}
|
|
else {
|
|
emitter.writeToOutput("set ");
|
|
>emitter.writeToOutput("set ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"set " : "set "
|
|
}
|
|
emitter.emitJavascript(this.operand1, TokenID.Colon, false);
|
|
>emitter.emitJavascript(this.operand1, TokenID.Colon, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>TokenID.Colon : any
|
|
>TokenID : any
|
|
>Colon : any
|
|
>false : false
|
|
}
|
|
else {
|
|
emitter.emitJavascript(this.operand1, TokenID.Colon, false);
|
|
>emitter.emitJavascript(this.operand1, TokenID.Colon, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>TokenID.Colon : any
|
|
>TokenID : any
|
|
>Colon : any
|
|
>false : false
|
|
|
|
emitter.writeToOutputTrimmable(": ");
|
|
>emitter.writeToOutputTrimmable(": ") : any
|
|
>emitter.writeToOutputTrimmable : any
|
|
>emitter : Emitter
|
|
>writeToOutputTrimmable : any
|
|
>": " : ": "
|
|
}
|
|
emitter.emitJavascript(this.operand2, TokenID.Comma, false);
|
|
>emitter.emitJavascript(this.operand2, TokenID.Comma, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>TokenID.Comma : any
|
|
>TokenID : any
|
|
>Comma : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Comma:
|
|
>NodeType.Comma : any
|
|
>NodeType : any
|
|
>Comma : any
|
|
|
|
emitter.emitJavascript(this.operand1, TokenID.Comma, false);
|
|
>emitter.emitJavascript(this.operand1, TokenID.Comma, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>TokenID.Comma : any
|
|
>TokenID : any
|
|
>Comma : any
|
|
>false : false
|
|
|
|
if (emitter.emitState.inObjectLiteral) {
|
|
>emitter.emitState.inObjectLiteral : any
|
|
>emitter.emitState : any
|
|
>emitter : Emitter
|
|
>emitState : any
|
|
>inObjectLiteral : any
|
|
|
|
emitter.writeLineToOutput(", ");
|
|
>emitter.writeLineToOutput(", ") : any
|
|
>emitter.writeLineToOutput : any
|
|
>emitter : Emitter
|
|
>writeLineToOutput : any
|
|
>", " : ", "
|
|
}
|
|
else {
|
|
emitter.writeToOutput(",");
|
|
>emitter.writeToOutput(",") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"," : ","
|
|
}
|
|
emitter.emitJavascript(this.operand2, TokenID.Comma, false);
|
|
>emitter.emitJavascript(this.operand2, TokenID.Comma, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>TokenID.Comma : any
|
|
>TokenID : any
|
|
>Comma : any
|
|
>false : false
|
|
|
|
break;
|
|
case NodeType.Is:
|
|
>NodeType.Is : any
|
|
>NodeType : any
|
|
>Is : any
|
|
|
|
throw new Error("should be de-sugared during type check");
|
|
>new Error("should be de-sugared during type check") : Error
|
|
>Error : ErrorConstructor
|
|
>"should be de-sugared during type check" : "should be de-sugared during type check"
|
|
|
|
default:
|
|
throw new Error("please implement in derived class");
|
|
>new Error("please implement in derived class") : Error
|
|
>Error : ErrorConstructor
|
|
>"please implement in derived class" : "please implement in derived class"
|
|
}
|
|
}
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class ConditionalExpression extends Expression {
|
|
>ConditionalExpression : ConditionalExpression
|
|
>Expression : Expression
|
|
|
|
constructor (public operand1: AST,
|
|
>operand1 : AST
|
|
|
|
public operand2: AST,
|
|
>operand2 : AST
|
|
|
|
public operand3: AST) {
|
|
>operand3 : AST
|
|
|
|
super(NodeType.ConditionalExpression);
|
|
>super(NodeType.ConditionalExpression) : void
|
|
>super : typeof Expression
|
|
>NodeType.ConditionalExpression : any
|
|
>NodeType : any
|
|
>ConditionalExpression : any
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckQMark(this);
|
|
>typeFlow.typeCheckQMark(this) : any
|
|
>typeFlow.typeCheckQMark : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckQMark : any
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitJavascript(this.operand1, TokenID.Question, false);
|
|
>emitter.emitJavascript(this.operand1, TokenID.Question, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand1 : AST
|
|
>this : this
|
|
>operand1 : AST
|
|
>TokenID.Question : any
|
|
>TokenID : any
|
|
>Question : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(" ? ");
|
|
>emitter.writeToOutput(" ? ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" ? " : " ? "
|
|
|
|
emitter.emitJavascript(this.operand2, TokenID.Question, false);
|
|
>emitter.emitJavascript(this.operand2, TokenID.Question, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand2 : AST
|
|
>this : this
|
|
>operand2 : AST
|
|
>TokenID.Question : any
|
|
>TokenID : any
|
|
>Question : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(" : ");
|
|
>emitter.writeToOutput(" : ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" : " : " : "
|
|
|
|
emitter.emitJavascript(this.operand3, TokenID.Question, false);
|
|
>emitter.emitJavascript(this.operand3, TokenID.Question, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.operand3 : AST
|
|
>this : this
|
|
>operand3 : AST
|
|
>TokenID.Question : any
|
|
>TokenID : any
|
|
>Question : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class NumberLiteral extends Expression {
|
|
>NumberLiteral : NumberLiteral
|
|
>Expression : Expression
|
|
|
|
constructor (public value: number, public hasEmptyFraction?: boolean) {
|
|
>value : number
|
|
>hasEmptyFraction : boolean
|
|
|
|
super(NodeType.NumberLit);
|
|
>super(NodeType.NumberLit) : void
|
|
>super : typeof Expression
|
|
>NodeType.NumberLit : any
|
|
>NodeType : any
|
|
>NumberLit : any
|
|
}
|
|
|
|
public isNegativeZero = false;
|
|
>isNegativeZero : boolean
|
|
>false : false
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.type = typeFlow.doubleType;
|
|
>this.type = typeFlow.doubleType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.doubleType : any
|
|
>typeFlow : TypeFlow
|
|
>doubleType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
return "num: " + this.printLabel();
|
|
>"num: " + this.printLabel() : string
|
|
>"num: " : "num: "
|
|
>this.printLabel() : string
|
|
>this.printLabel : () => string
|
|
>this : this
|
|
>printLabel : () => string
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (this.isNegativeZero) {
|
|
>this.isNegativeZero : boolean
|
|
>this : this
|
|
>isNegativeZero : boolean
|
|
|
|
emitter.writeToOutput("-");
|
|
>emitter.writeToOutput("-") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"-" : "-"
|
|
}
|
|
|
|
emitter.writeToOutput(this.value.toString());
|
|
>emitter.writeToOutput(this.value.toString()) : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>this.value.toString() : string
|
|
>this.value.toString : (radix?: number) => string
|
|
>this.value : number
|
|
>this : this
|
|
>value : number
|
|
>toString : (radix?: number) => string
|
|
|
|
if (this.hasEmptyFraction)
|
|
>this.hasEmptyFraction : boolean
|
|
>this : this
|
|
>hasEmptyFraction : boolean
|
|
|
|
emitter.writeToOutput(".0");
|
|
>emitter.writeToOutput(".0") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>".0" : ".0"
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public printLabel() {
|
|
>printLabel : () => string
|
|
|
|
if (Math.floor(this.value) != this.value) {
|
|
>Math.floor(this.value) != this.value : boolean
|
|
>Math.floor(this.value) : number
|
|
>Math.floor : (x: number) => number
|
|
>Math : Math
|
|
>floor : (x: number) => number
|
|
>this.value : number
|
|
>this : this
|
|
>value : number
|
|
>this.value : number
|
|
>this : this
|
|
>value : number
|
|
|
|
return this.value.toFixed(2).toString();
|
|
>this.value.toFixed(2).toString() : string
|
|
>this.value.toFixed(2).toString : () => string
|
|
>this.value.toFixed(2) : string
|
|
>this.value.toFixed : (fractionDigits?: number) => string
|
|
>this.value : number
|
|
>this : this
|
|
>value : number
|
|
>toFixed : (fractionDigits?: number) => string
|
|
>2 : 2
|
|
>toString : () => string
|
|
}
|
|
else if (this.hasEmptyFraction) {
|
|
>this.hasEmptyFraction : boolean
|
|
>this : this
|
|
>hasEmptyFraction : boolean
|
|
|
|
return this.value.toString() + ".0";
|
|
>this.value.toString() + ".0" : string
|
|
>this.value.toString() : string
|
|
>this.value.toString : (radix?: number) => string
|
|
>this.value : number
|
|
>this : this
|
|
>value : number
|
|
>toString : (radix?: number) => string
|
|
>".0" : ".0"
|
|
}
|
|
else {
|
|
return this.value.toString();
|
|
>this.value.toString() : string
|
|
>this.value.toString : (radix?: number) => string
|
|
>this.value : number
|
|
>this : this
|
|
>value : number
|
|
>toString : (radix?: number) => string
|
|
}
|
|
}
|
|
}
|
|
|
|
export class RegexLiteral extends Expression {
|
|
>RegexLiteral : RegexLiteral
|
|
>Expression : Expression
|
|
|
|
constructor (public regex) {
|
|
>regex : any
|
|
|
|
super(NodeType.Regex);
|
|
>super(NodeType.Regex) : void
|
|
>super : typeof Expression
|
|
>NodeType.Regex : any
|
|
>NodeType : any
|
|
>Regex : any
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.type = typeFlow.regexType;
|
|
>this.type = typeFlow.regexType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.regexType : any
|
|
>typeFlow : TypeFlow
|
|
>regexType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput(this.regex.toString());
|
|
>emitter.writeToOutput(this.regex.toString()) : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>this.regex.toString() : any
|
|
>this.regex.toString : any
|
|
>this.regex : any
|
|
>this : this
|
|
>regex : any
|
|
>toString : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class StringLiteral extends Expression {
|
|
>StringLiteral : StringLiteral
|
|
>Expression : Expression
|
|
|
|
constructor (public text: string) {
|
|
>text : string
|
|
|
|
super(NodeType.QString);
|
|
>super(NodeType.QString) : void
|
|
>super : typeof Expression
|
|
>NodeType.QString : any
|
|
>NodeType : any
|
|
>QString : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitStringLiteral(this.text);
|
|
>emitter.emitStringLiteral(this.text) : any
|
|
>emitter.emitStringLiteral : any
|
|
>emitter : Emitter
|
|
>emitStringLiteral : any
|
|
>this.text : string
|
|
>this : this
|
|
>text : string
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.type = typeFlow.stringType;
|
|
>this.type = typeFlow.stringType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.stringType : any
|
|
>typeFlow : TypeFlow
|
|
>stringType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
return "st: " + this.text;
|
|
>"st: " + this.text : string
|
|
>"st: " : "st: "
|
|
>this.text : string
|
|
>this : this
|
|
>text : string
|
|
}
|
|
|
|
public printLabel() {
|
|
>printLabel : () => string
|
|
|
|
return this.text;
|
|
>this.text : string
|
|
>this : this
|
|
>text : string
|
|
}
|
|
}
|
|
|
|
export class ModuleElement extends AST {
|
|
>ModuleElement : ModuleElement
|
|
>AST : AST
|
|
|
|
constructor (nodeType: NodeType) {
|
|
>nodeType : NodeType
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof AST
|
|
>nodeType : NodeType
|
|
}
|
|
}
|
|
|
|
export class ImportDeclaration extends ModuleElement {
|
|
>ImportDeclaration : ImportDeclaration
|
|
>ModuleElement : ModuleElement
|
|
|
|
public isStatementOrExpression() { return true; }
|
|
>isStatementOrExpression : () => boolean
|
|
>true : true
|
|
|
|
public varFlags = VarFlags.None;
|
|
>varFlags : any
|
|
>VarFlags.None : any
|
|
>VarFlags : any
|
|
>None : any
|
|
|
|
public isDynamicImport = false;
|
|
>isDynamicImport : boolean
|
|
>false : false
|
|
|
|
constructor (public id: Identifier, public alias: AST) {
|
|
>id : Identifier
|
|
>alias : AST
|
|
|
|
super(NodeType.ImportDeclaration);
|
|
>super(NodeType.ImportDeclaration) : void
|
|
>super : typeof ModuleElement
|
|
>NodeType.ImportDeclaration : any
|
|
>NodeType : any
|
|
>ImportDeclaration : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
var mod = <ModuleType>this.alias.type;
|
|
>mod : ModuleType
|
|
><ModuleType>this.alias.type : ModuleType
|
|
>this.alias.type : Type
|
|
>this.alias : AST
|
|
>this : this
|
|
>alias : AST
|
|
>type : Type
|
|
|
|
// REVIEW: Only modules may be aliased for now, though there's no real
|
|
// restriction on what the type symbol may be
|
|
if (!this.isDynamicImport || (this.id.sym && !(<TypeSymbol>this.id.sym).onlyReferencedAsTypeRef)) {
|
|
>!this.isDynamicImport || (this.id.sym && !(<TypeSymbol>this.id.sym).onlyReferencedAsTypeRef) : boolean
|
|
>!this.isDynamicImport : boolean
|
|
>this.isDynamicImport : boolean
|
|
>this : this
|
|
>isDynamicImport : boolean
|
|
>(this.id.sym && !(<TypeSymbol>this.id.sym).onlyReferencedAsTypeRef) : boolean
|
|
>this.id.sym && !(<TypeSymbol>this.id.sym).onlyReferencedAsTypeRef : boolean
|
|
>this.id.sym : Symbol
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>sym : Symbol
|
|
>!(<TypeSymbol>this.id.sym).onlyReferencedAsTypeRef : boolean
|
|
>(<TypeSymbol>this.id.sym).onlyReferencedAsTypeRef : any
|
|
>(<TypeSymbol>this.id.sym) : TypeSymbol
|
|
><TypeSymbol>this.id.sym : TypeSymbol
|
|
>this.id.sym : Symbol
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>sym : Symbol
|
|
>onlyReferencedAsTypeRef : any
|
|
|
|
var prevModAliasId = emitter.modAliasId;
|
|
>prevModAliasId : any
|
|
>emitter.modAliasId : any
|
|
>emitter : Emitter
|
|
>modAliasId : any
|
|
|
|
var prevFirstModAlias = emitter.firstModAlias;
|
|
>prevFirstModAlias : any
|
|
>emitter.firstModAlias : any
|
|
>emitter : Emitter
|
|
>firstModAlias : any
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.writeToOutput("var " + this.id.actualText + " = ");
|
|
>emitter.writeToOutput("var " + this.id.actualText + " = ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"var " + this.id.actualText + " = " : string
|
|
>"var " + this.id.actualText : string
|
|
>"var " : "var "
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
>" = " : " = "
|
|
|
|
emitter.modAliasId = this.id.actualText;
|
|
>emitter.modAliasId = this.id.actualText : string
|
|
>emitter.modAliasId : any
|
|
>emitter : Emitter
|
|
>modAliasId : any
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
|
|
emitter.firstModAlias = this.firstAliasedModToString();
|
|
>emitter.firstModAlias = this.firstAliasedModToString() : string
|
|
>emitter.firstModAlias : any
|
|
>emitter : Emitter
|
|
>firstModAlias : any
|
|
>this.firstAliasedModToString() : string
|
|
>this.firstAliasedModToString : () => string
|
|
>this : this
|
|
>firstAliasedModToString : () => string
|
|
|
|
emitter.emitJavascript(this.alias, TokenID.Tilde, false);
|
|
>emitter.emitJavascript(this.alias, TokenID.Tilde, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.alias : AST
|
|
>this : this
|
|
>alias : AST
|
|
>TokenID.Tilde : any
|
|
>TokenID : any
|
|
>Tilde : any
|
|
>false : false
|
|
|
|
// the dynamic import case will insert the semi-colon automatically
|
|
if (!this.isDynamicImport) {
|
|
>!this.isDynamicImport : boolean
|
|
>this.isDynamicImport : boolean
|
|
>this : this
|
|
>isDynamicImport : boolean
|
|
|
|
emitter.writeToOutput(";");
|
|
>emitter.writeToOutput(";") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>";" : ";"
|
|
}
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.modAliasId = prevModAliasId;
|
|
>emitter.modAliasId = prevModAliasId : any
|
|
>emitter.modAliasId : any
|
|
>emitter : Emitter
|
|
>modAliasId : any
|
|
>prevModAliasId : any
|
|
|
|
emitter.firstModAlias = prevFirstModAlias;
|
|
>emitter.firstModAlias = prevFirstModAlias : any
|
|
>emitter.firstModAlias : any
|
|
>emitter : Emitter
|
|
>firstModAlias : any
|
|
>prevFirstModAlias : any
|
|
}
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckImportDecl(this);
|
|
>typeFlow.typeCheckImportDecl(this) : any
|
|
>typeFlow.typeCheckImportDecl : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckImportDecl : any
|
|
>this : this
|
|
}
|
|
|
|
public getAliasName(aliasAST?: AST = this.alias) : string {
|
|
>getAliasName : (aliasAST?: AST) => string
|
|
>aliasAST : AST
|
|
>this.alias : AST
|
|
>this : this
|
|
>alias : AST
|
|
|
|
if (aliasAST.nodeType == NodeType.Name) {
|
|
>aliasAST.nodeType == NodeType.Name : boolean
|
|
>aliasAST.nodeType : NodeType
|
|
>aliasAST : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
return (<Identifier>aliasAST).actualText;
|
|
>(<Identifier>aliasAST).actualText : string
|
|
>(<Identifier>aliasAST) : Identifier
|
|
><Identifier>aliasAST : Identifier
|
|
>aliasAST : AST
|
|
>actualText : string
|
|
|
|
} else {
|
|
var dotExpr = <BinaryExpression>aliasAST;
|
|
>dotExpr : BinaryExpression
|
|
><BinaryExpression>aliasAST : BinaryExpression
|
|
>aliasAST : AST
|
|
|
|
return this.getAliasName(dotExpr.operand1) + "." + this.getAliasName(dotExpr.operand2);
|
|
>this.getAliasName(dotExpr.operand1) + "." + this.getAliasName(dotExpr.operand2) : string
|
|
>this.getAliasName(dotExpr.operand1) + "." : string
|
|
>this.getAliasName(dotExpr.operand1) : string
|
|
>this.getAliasName : (aliasAST?: AST) => string
|
|
>this : this
|
|
>getAliasName : (aliasAST?: AST) => string
|
|
>dotExpr.operand1 : AST
|
|
>dotExpr : BinaryExpression
|
|
>operand1 : AST
|
|
>"." : "."
|
|
>this.getAliasName(dotExpr.operand2) : string
|
|
>this.getAliasName : (aliasAST?: AST) => string
|
|
>this : this
|
|
>getAliasName : (aliasAST?: AST) => string
|
|
>dotExpr.operand2 : AST
|
|
>dotExpr : BinaryExpression
|
|
>operand2 : AST
|
|
}
|
|
}
|
|
|
|
public firstAliasedModToString() {
|
|
>firstAliasedModToString : () => string
|
|
|
|
if (this.alias.nodeType == NodeType.Name) {
|
|
>this.alias.nodeType == NodeType.Name : boolean
|
|
>this.alias.nodeType : NodeType
|
|
>this.alias : AST
|
|
>this : this
|
|
>alias : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
return (<Identifier>this.alias).actualText;
|
|
>(<Identifier>this.alias).actualText : string
|
|
>(<Identifier>this.alias) : Identifier
|
|
><Identifier>this.alias : Identifier
|
|
>this.alias : AST
|
|
>this : this
|
|
>alias : AST
|
|
>actualText : string
|
|
}
|
|
else {
|
|
var dotExpr = <BinaryExpression>this.alias;
|
|
>dotExpr : BinaryExpression
|
|
><BinaryExpression>this.alias : BinaryExpression
|
|
>this.alias : AST
|
|
>this : this
|
|
>alias : AST
|
|
|
|
var firstMod = <Identifier>dotExpr.operand1;
|
|
>firstMod : Identifier
|
|
><Identifier>dotExpr.operand1 : Identifier
|
|
>dotExpr.operand1 : AST
|
|
>dotExpr : BinaryExpression
|
|
>operand1 : AST
|
|
|
|
return firstMod.actualText;
|
|
>firstMod.actualText : string
|
|
>firstMod : Identifier
|
|
>actualText : string
|
|
}
|
|
}
|
|
}
|
|
|
|
export class BoundDecl extends AST {
|
|
>BoundDecl : BoundDecl
|
|
>AST : AST
|
|
|
|
public init: AST = null;
|
|
>init : AST
|
|
>null : null
|
|
|
|
public typeExpr: AST = null;
|
|
>typeExpr : AST
|
|
>null : null
|
|
|
|
public varFlags = VarFlags.None;
|
|
>varFlags : any
|
|
>VarFlags.None : any
|
|
>VarFlags : any
|
|
>None : any
|
|
|
|
public sym: Symbol = null;
|
|
>sym : Symbol
|
|
>null : null
|
|
|
|
constructor (public id: Identifier, nodeType: NodeType, public nestingLevel: number) {
|
|
>id : Identifier
|
|
>nodeType : NodeType
|
|
>nestingLevel : number
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof AST
|
|
>nodeType : NodeType
|
|
}
|
|
|
|
public isStatementOrExpression() { return true; }
|
|
>isStatementOrExpression : () => boolean
|
|
>true : true
|
|
|
|
public isPrivate() { return hasFlag(this.varFlags, VarFlags.Private); }
|
|
>isPrivate : () => any
|
|
>hasFlag(this.varFlags, VarFlags.Private) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Private : any
|
|
>VarFlags : any
|
|
>Private : any
|
|
|
|
public isPublic() { return hasFlag(this.varFlags, VarFlags.Public); }
|
|
>isPublic : () => any
|
|
>hasFlag(this.varFlags, VarFlags.Public) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Public : any
|
|
>VarFlags : any
|
|
>Public : any
|
|
|
|
public isProperty() { return hasFlag(this.varFlags, VarFlags.Property); }
|
|
>isProperty : () => any
|
|
>hasFlag(this.varFlags, VarFlags.Property) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Property : any
|
|
>VarFlags : any
|
|
>Property : any
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckBoundDecl(this);
|
|
>typeFlow.typeCheckBoundDecl(this) : any
|
|
>typeFlow.typeCheckBoundDecl : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckBoundDecl : any
|
|
>this : this
|
|
}
|
|
|
|
public printLabel() {
|
|
>printLabel : () => any
|
|
|
|
return this.treeViewLabel();
|
|
>this.treeViewLabel() : any
|
|
>this.treeViewLabel : () => any
|
|
>this : this
|
|
>treeViewLabel : () => any
|
|
}
|
|
}
|
|
|
|
export class VarDecl extends BoundDecl {
|
|
>VarDecl : VarDecl
|
|
>BoundDecl : BoundDecl
|
|
|
|
constructor (id: Identifier, nest: number) {
|
|
>id : Identifier
|
|
>nest : number
|
|
|
|
super(id, NodeType.VarDecl, nest);
|
|
>super(id, NodeType.VarDecl, nest) : void
|
|
>super : typeof BoundDecl
|
|
>id : Identifier
|
|
>NodeType.VarDecl : any
|
|
>NodeType : any
|
|
>VarDecl : any
|
|
>nest : number
|
|
}
|
|
|
|
public isAmbient() { return hasFlag(this.varFlags, VarFlags.Ambient); }
|
|
>isAmbient : () => any
|
|
>hasFlag(this.varFlags, VarFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Ambient : any
|
|
>VarFlags : any
|
|
>Ambient : any
|
|
|
|
public isExported() { return hasFlag(this.varFlags, VarFlags.Exported); }
|
|
>isExported : () => any
|
|
>hasFlag(this.varFlags, VarFlags.Exported) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Exported : any
|
|
>VarFlags : any
|
|
>Exported : any
|
|
|
|
public isStatic() { return hasFlag(this.varFlags, VarFlags.Static); }
|
|
>isStatic : () => any
|
|
>hasFlag(this.varFlags, VarFlags.Static) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Static : any
|
|
>VarFlags : any
|
|
>Static : any
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitJavascriptVarDecl(this, tokenId);
|
|
>emitter.emitJavascriptVarDecl(this, tokenId) : any
|
|
>emitter.emitJavascriptVarDecl : any
|
|
>emitter : Emitter
|
|
>emitJavascriptVarDecl : any
|
|
>this : this
|
|
>tokenId : TokenID
|
|
}
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
return "var " + this.id.actualText;
|
|
>"var " + this.id.actualText : string
|
|
>"var " : "var "
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
}
|
|
}
|
|
|
|
export class ArgDecl extends BoundDecl {
|
|
>ArgDecl : ArgDecl
|
|
>BoundDecl : BoundDecl
|
|
|
|
constructor (id: Identifier) {
|
|
>id : Identifier
|
|
|
|
super(id, NodeType.ArgDecl, 0);
|
|
>super(id, NodeType.ArgDecl, 0) : void
|
|
>super : typeof BoundDecl
|
|
>id : Identifier
|
|
>NodeType.ArgDecl : any
|
|
>NodeType : any
|
|
>ArgDecl : any
|
|
>0 : 0
|
|
}
|
|
|
|
public isOptional = false;
|
|
>isOptional : boolean
|
|
>false : false
|
|
|
|
public isOptionalArg() { return this.isOptional || this.init; }
|
|
>isOptionalArg : () => true | AST
|
|
>this.isOptional || this.init : true | AST
|
|
>this.isOptional : boolean
|
|
>this : this
|
|
>isOptional : boolean
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
return "arg: " + this.id.actualText;
|
|
>"arg: " + this.id.actualText : string
|
|
>"arg: " : "arg: "
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
}
|
|
|
|
public parameterPropertySym: FieldSymbol = null;
|
|
>parameterPropertySym : FieldSymbol
|
|
>null : null
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput(this.id.actualText);
|
|
>emitter.writeToOutput(this.id.actualText) : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>this.id.actualText : string
|
|
>this.id : Identifier
|
|
>this : this
|
|
>id : Identifier
|
|
>actualText : string
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
var internalId = 0;
|
|
>internalId : number
|
|
>0 : 0
|
|
|
|
export class FuncDecl extends AST {
|
|
>FuncDecl : FuncDecl
|
|
>AST : AST
|
|
|
|
public hint: string = null;
|
|
>hint : string
|
|
>null : null
|
|
|
|
public fncFlags = FncFlags.None;
|
|
>fncFlags : any
|
|
>FncFlags.None : any
|
|
>FncFlags : any
|
|
>None : any
|
|
|
|
public returnTypeAnnotation: AST = null;
|
|
>returnTypeAnnotation : AST
|
|
>null : null
|
|
|
|
public symbols: IHashTable;
|
|
>symbols : IHashTable
|
|
|
|
public variableArgList = false;
|
|
>variableArgList : boolean
|
|
>false : false
|
|
|
|
public signature: Signature;
|
|
>signature : Signature
|
|
|
|
public envids: Identifier[];
|
|
>envids : Identifier[]
|
|
|
|
public jumpRefs: Identifier[] = null;
|
|
>jumpRefs : Identifier[]
|
|
>null : null
|
|
|
|
public internalNameCache: string = null;
|
|
>internalNameCache : string
|
|
>null : null
|
|
|
|
public tmp1Declared = false;
|
|
>tmp1Declared : boolean
|
|
>false : false
|
|
|
|
public enclosingFnc: FuncDecl = null;
|
|
>enclosingFnc : FuncDecl
|
|
>null : null
|
|
|
|
public freeVariables: Symbol[] = [];
|
|
>freeVariables : Symbol[]
|
|
>[] : undefined[]
|
|
|
|
public unitIndex = -1;
|
|
>unitIndex : number
|
|
>-1 : -1
|
|
>1 : 1
|
|
|
|
public classDecl: NamedDeclaration = null;
|
|
>classDecl : NamedDeclaration
|
|
>null : null
|
|
|
|
public boundToProperty: VarDecl = null;
|
|
>boundToProperty : VarDecl
|
|
>null : null
|
|
|
|
public isOverload = false;
|
|
>isOverload : boolean
|
|
>false : false
|
|
|
|
public innerStaticFuncs: FuncDecl[] = [];
|
|
>innerStaticFuncs : FuncDecl[]
|
|
>[] : undefined[]
|
|
|
|
public isTargetTypedAsMethod = false;
|
|
>isTargetTypedAsMethod : boolean
|
|
>false : false
|
|
|
|
public isInlineCallLiteral = false;
|
|
>isInlineCallLiteral : boolean
|
|
>false : false
|
|
|
|
public accessorSymbol: Symbol = null;
|
|
>accessorSymbol : Symbol
|
|
>null : null
|
|
|
|
public leftCurlyCount = 0;
|
|
>leftCurlyCount : number
|
|
>0 : 0
|
|
|
|
public rightCurlyCount = 0;
|
|
>rightCurlyCount : number
|
|
>0 : 0
|
|
|
|
public returnStatementsWithExpressions: ReturnStatement[] = [];
|
|
>returnStatementsWithExpressions : ReturnStatement[]
|
|
>[] : undefined[]
|
|
|
|
public scopeType: Type = null; // Type of the FuncDecl, before target typing
|
|
>scopeType : Type
|
|
>null : null
|
|
|
|
public endingToken: ASTSpan = null;
|
|
>endingToken : ASTSpan
|
|
>null : null
|
|
|
|
constructor (public name: Identifier, public bod: ASTList, public isConstructor: boolean,
|
|
>name : Identifier
|
|
>bod : ASTList
|
|
>isConstructor : boolean
|
|
|
|
public arguments: ASTList, public vars: ASTList, public scopes: ASTList, public statics: ASTList,
|
|
>arguments : ASTList
|
|
>vars : ASTList
|
|
>scopes : ASTList
|
|
>statics : ASTList
|
|
|
|
nodeType: number) {
|
|
>nodeType : number
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof AST
|
|
>nodeType : number
|
|
}
|
|
|
|
public internalName(): string {
|
|
>internalName : () => string
|
|
|
|
if (this.internalNameCache == null) {
|
|
>this.internalNameCache == null : boolean
|
|
>this.internalNameCache : string
|
|
>this : this
|
|
>internalNameCache : string
|
|
>null : null
|
|
|
|
var extName = this.getNameText();
|
|
>extName : string
|
|
>this.getNameText() : string
|
|
>this.getNameText : () => string
|
|
>this : this
|
|
>getNameText : () => string
|
|
|
|
if (extName) {
|
|
>extName : string
|
|
|
|
this.internalNameCache = "_internal_" + extName;
|
|
>this.internalNameCache = "_internal_" + extName : string
|
|
>this.internalNameCache : string
|
|
>this : this
|
|
>internalNameCache : string
|
|
>"_internal_" + extName : string
|
|
>"_internal_" : "_internal_"
|
|
>extName : string
|
|
}
|
|
else {
|
|
this.internalNameCache = "_internal_" + internalId++;
|
|
>this.internalNameCache = "_internal_" + internalId++ : string
|
|
>this.internalNameCache : string
|
|
>this : this
|
|
>internalNameCache : string
|
|
>"_internal_" + internalId++ : string
|
|
>"_internal_" : "_internal_"
|
|
>internalId++ : number
|
|
>internalId : number
|
|
}
|
|
}
|
|
return this.internalNameCache;
|
|
>this.internalNameCache : string
|
|
>this : this
|
|
>internalNameCache : string
|
|
}
|
|
|
|
public hasSelfReference() { return hasFlag(this.fncFlags, FncFlags.HasSelfReference); }
|
|
>hasSelfReference : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.HasSelfReference) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.HasSelfReference : any
|
|
>FncFlags : any
|
|
>HasSelfReference : any
|
|
|
|
public setHasSelfReference() { this.fncFlags |= FncFlags.HasSelfReference; }
|
|
>setHasSelfReference : () => void
|
|
>this.fncFlags |= FncFlags.HasSelfReference : number
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.HasSelfReference : any
|
|
>FncFlags : any
|
|
>HasSelfReference : any
|
|
|
|
public addCloRef(id: Identifier, sym: Symbol): number {
|
|
>addCloRef : (id: Identifier, sym: Symbol) => number
|
|
>id : Identifier
|
|
>sym : Symbol
|
|
|
|
if (this.envids == null) {
|
|
>this.envids == null : boolean
|
|
>this.envids : Identifier[]
|
|
>this : this
|
|
>envids : Identifier[]
|
|
>null : null
|
|
|
|
this.envids = new Identifier[];
|
|
>this.envids = new Identifier[] : any
|
|
>this.envids : Identifier[]
|
|
>this : this
|
|
>envids : Identifier[]
|
|
>new Identifier[] : any
|
|
>Identifier[] : any
|
|
>Identifier : typeof Identifier
|
|
> : any
|
|
}
|
|
this.envids[this.envids.length] = id;
|
|
>this.envids[this.envids.length] = id : Identifier
|
|
>this.envids[this.envids.length] : Identifier
|
|
>this.envids : Identifier[]
|
|
>this : this
|
|
>envids : Identifier[]
|
|
>this.envids.length : number
|
|
>this.envids : Identifier[]
|
|
>this : this
|
|
>envids : Identifier[]
|
|
>length : number
|
|
>id : Identifier
|
|
|
|
var outerFnc = this.enclosingFnc;
|
|
>outerFnc : FuncDecl
|
|
>this.enclosingFnc : FuncDecl
|
|
>this : this
|
|
>enclosingFnc : FuncDecl
|
|
|
|
if (sym) {
|
|
>sym : Symbol
|
|
|
|
while (outerFnc && (outerFnc.type.symbol != sym.container)) {
|
|
>outerFnc && (outerFnc.type.symbol != sym.container) : boolean
|
|
>outerFnc : FuncDecl
|
|
>(outerFnc.type.symbol != sym.container) : boolean
|
|
>outerFnc.type.symbol != sym.container : boolean
|
|
>outerFnc.type.symbol : any
|
|
>outerFnc.type : Type
|
|
>outerFnc : FuncDecl
|
|
>type : Type
|
|
>symbol : any
|
|
>sym.container : any
|
|
>sym : Symbol
|
|
>container : any
|
|
|
|
outerFnc.addJumpRef(sym);
|
|
>outerFnc.addJumpRef(sym) : void
|
|
>outerFnc.addJumpRef : (sym: Symbol) => void
|
|
>outerFnc : FuncDecl
|
|
>addJumpRef : (sym: Symbol) => void
|
|
>sym : Symbol
|
|
|
|
outerFnc = outerFnc.enclosingFnc;
|
|
>outerFnc = outerFnc.enclosingFnc : FuncDecl
|
|
>outerFnc : FuncDecl
|
|
>outerFnc.enclosingFnc : FuncDecl
|
|
>outerFnc : FuncDecl
|
|
>enclosingFnc : FuncDecl
|
|
}
|
|
}
|
|
return this.envids.length - 1;
|
|
>this.envids.length - 1 : number
|
|
>this.envids.length : number
|
|
>this.envids : Identifier[]
|
|
>this : this
|
|
>envids : Identifier[]
|
|
>length : number
|
|
>1 : 1
|
|
}
|
|
|
|
public addJumpRef(sym: Symbol): void {
|
|
>addJumpRef : (sym: Symbol) => void
|
|
>sym : Symbol
|
|
|
|
if (this.jumpRefs == null) {
|
|
>this.jumpRefs == null : boolean
|
|
>this.jumpRefs : Identifier[]
|
|
>this : this
|
|
>jumpRefs : Identifier[]
|
|
>null : null
|
|
|
|
this.jumpRefs = new Identifier[];
|
|
>this.jumpRefs = new Identifier[] : any
|
|
>this.jumpRefs : Identifier[]
|
|
>this : this
|
|
>jumpRefs : Identifier[]
|
|
>new Identifier[] : any
|
|
>Identifier[] : any
|
|
>Identifier : typeof Identifier
|
|
> : any
|
|
}
|
|
var id = new Identifier(sym.name);
|
|
>id : Identifier
|
|
>new Identifier(sym.name) : Identifier
|
|
>Identifier : typeof Identifier
|
|
>sym.name : any
|
|
>sym : Symbol
|
|
>name : any
|
|
|
|
this.jumpRefs[this.jumpRefs.length] = id;
|
|
>this.jumpRefs[this.jumpRefs.length] = id : Identifier
|
|
>this.jumpRefs[this.jumpRefs.length] : Identifier
|
|
>this.jumpRefs : Identifier[]
|
|
>this : this
|
|
>jumpRefs : Identifier[]
|
|
>this.jumpRefs.length : number
|
|
>this.jumpRefs : Identifier[]
|
|
>this : this
|
|
>jumpRefs : Identifier[]
|
|
>length : number
|
|
>id : Identifier
|
|
|
|
id.sym = sym;
|
|
>id.sym = sym : Symbol
|
|
>id.sym : Symbol
|
|
>id : Identifier
|
|
>sym : Symbol
|
|
>sym : Symbol
|
|
|
|
id.cloId = this.addCloRef(id, null);
|
|
>id.cloId = this.addCloRef(id, null) : number
|
|
>id.cloId : number
|
|
>id : Identifier
|
|
>cloId : number
|
|
>this.addCloRef(id, null) : number
|
|
>this.addCloRef : (id: Identifier, sym: Symbol) => number
|
|
>this : this
|
|
>addCloRef : (id: Identifier, sym: Symbol) => number
|
|
>id : Identifier
|
|
>null : null
|
|
}
|
|
|
|
public buildControlFlow(): ControlFlowContext {
|
|
>buildControlFlow : () => ControlFlowContext
|
|
|
|
var entry = new BasicBlock();
|
|
>entry : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var exit = new BasicBlock();
|
|
>exit : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var context = new ControlFlowContext(entry, exit);
|
|
>context : any
|
|
>new ControlFlowContext(entry, exit) : any
|
|
>ControlFlowContext : any
|
|
>entry : any
|
|
>exit : any
|
|
|
|
var controlFlowPrefix = (ast: AST, parent: AST, walker: IAstWalker) => {
|
|
>controlFlowPrefix : (ast: AST, parent: AST, walker: IAstWalker) => AST
|
|
>(ast: AST, parent: AST, walker: IAstWalker) => { ast.addToControlFlow(walker.state); return ast; } : (ast: AST, parent: AST, walker: IAstWalker) => AST
|
|
>ast : AST
|
|
>parent : AST
|
|
>walker : IAstWalker
|
|
|
|
ast.addToControlFlow(walker.state);
|
|
>ast.addToControlFlow(walker.state) : void
|
|
>ast.addToControlFlow : (context: ControlFlowContext) => void
|
|
>ast : AST
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>walker.state : any
|
|
>walker : IAstWalker
|
|
>state : any
|
|
|
|
return ast;
|
|
>ast : AST
|
|
}
|
|
|
|
var walker = getAstWalkerFactory().getWalker(controlFlowPrefix, null, null, context);
|
|
>walker : any
|
|
>getAstWalkerFactory().getWalker(controlFlowPrefix, null, null, context) : any
|
|
>getAstWalkerFactory().getWalker : any
|
|
>getAstWalkerFactory() : any
|
|
>getAstWalkerFactory : any
|
|
>getWalker : any
|
|
>controlFlowPrefix : (ast: AST, parent: AST, walker: IAstWalker) => AST
|
|
>null : null
|
|
>null : null
|
|
>context : any
|
|
|
|
context.walker = walker;
|
|
>context.walker = walker : any
|
|
>context.walker : any
|
|
>context : any
|
|
>walker : any
|
|
>walker : any
|
|
|
|
walker.walk(this.bod, this);
|
|
>walker.walk(this.bod, this) : any
|
|
>walker.walk : any
|
|
>walker : any
|
|
>walk : any
|
|
>this.bod : ASTList
|
|
>this : this
|
|
>bod : ASTList
|
|
>this : this
|
|
|
|
return context;
|
|
>context : any
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckFunction(this);
|
|
>typeFlow.typeCheckFunction(this) : any
|
|
>typeFlow.typeCheckFunction : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckFunction : any
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitJavascriptFunction(this);
|
|
>emitter.emitJavascriptFunction(this) : any
|
|
>emitter.emitJavascriptFunction : any
|
|
>emitter : Emitter
|
|
>emitJavascriptFunction : any
|
|
>this : this
|
|
}
|
|
|
|
public getNameText() {
|
|
>getNameText : () => string
|
|
|
|
if (this.name) {
|
|
>this.name : Identifier
|
|
>this : this
|
|
>name : Identifier
|
|
|
|
return this.name.actualText;
|
|
>this.name.actualText : string
|
|
>this.name : Identifier
|
|
>this : this
|
|
>name : Identifier
|
|
>actualText : string
|
|
}
|
|
else {
|
|
return this.hint;
|
|
>this.hint : string
|
|
>this : this
|
|
>hint : string
|
|
}
|
|
}
|
|
|
|
public isMethod() {
|
|
>isMethod : () => boolean
|
|
|
|
return (this.fncFlags & FncFlags.Method) != FncFlags.None;
|
|
>(this.fncFlags & FncFlags.Method) != FncFlags.None : boolean
|
|
>(this.fncFlags & FncFlags.Method) : number
|
|
>this.fncFlags & FncFlags.Method : number
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Method : any
|
|
>FncFlags : any
|
|
>Method : any
|
|
>FncFlags.None : any
|
|
>FncFlags : any
|
|
>None : any
|
|
}
|
|
|
|
public isCallMember() { return hasFlag(this.fncFlags, FncFlags.CallMember); }
|
|
>isCallMember : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.CallMember) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.CallMember : any
|
|
>FncFlags : any
|
|
>CallMember : any
|
|
|
|
public isConstructMember() { return hasFlag(this.fncFlags, FncFlags.ConstructMember); }
|
|
>isConstructMember : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.ConstructMember) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.ConstructMember : any
|
|
>FncFlags : any
|
|
>ConstructMember : any
|
|
|
|
public isIndexerMember() { return hasFlag(this.fncFlags, FncFlags.IndexerMember); }
|
|
>isIndexerMember : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.IndexerMember) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.IndexerMember : any
|
|
>FncFlags : any
|
|
>IndexerMember : any
|
|
|
|
public isSpecialFn() { return this.isCallMember() || this.isIndexerMember() || this.isConstructMember(); }
|
|
>isSpecialFn : () => any
|
|
>this.isCallMember() || this.isIndexerMember() || this.isConstructMember() : any
|
|
>this.isCallMember() || this.isIndexerMember() : any
|
|
>this.isCallMember() : any
|
|
>this.isCallMember : () => any
|
|
>this : this
|
|
>isCallMember : () => any
|
|
>this.isIndexerMember() : any
|
|
>this.isIndexerMember : () => any
|
|
>this : this
|
|
>isIndexerMember : () => any
|
|
>this.isConstructMember() : any
|
|
>this.isConstructMember : () => any
|
|
>this : this
|
|
>isConstructMember : () => any
|
|
|
|
public isAnonymousFn() { return this.name === null; }
|
|
>isAnonymousFn : () => boolean
|
|
>this.name === null : boolean
|
|
>this.name : Identifier
|
|
>this : this
|
|
>name : Identifier
|
|
>null : null
|
|
|
|
public isAccessor() { return hasFlag(this.fncFlags, FncFlags.GetAccessor) || hasFlag(this.fncFlags, FncFlags.SetAccessor); }
|
|
>isAccessor : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.GetAccessor) || hasFlag(this.fncFlags, FncFlags.SetAccessor) : any
|
|
>hasFlag(this.fncFlags, FncFlags.GetAccessor) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.GetAccessor : any
|
|
>FncFlags : any
|
|
>GetAccessor : any
|
|
>hasFlag(this.fncFlags, FncFlags.SetAccessor) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.SetAccessor : any
|
|
>FncFlags : any
|
|
>SetAccessor : any
|
|
|
|
public isGetAccessor() { return hasFlag(this.fncFlags, FncFlags.GetAccessor); }
|
|
>isGetAccessor : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.GetAccessor) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.GetAccessor : any
|
|
>FncFlags : any
|
|
>GetAccessor : any
|
|
|
|
public isSetAccessor() { return hasFlag(this.fncFlags, FncFlags.SetAccessor); }
|
|
>isSetAccessor : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.SetAccessor) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.SetAccessor : any
|
|
>FncFlags : any
|
|
>SetAccessor : any
|
|
|
|
public isAmbient() { return hasFlag(this.fncFlags, FncFlags.Ambient); }
|
|
>isAmbient : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Ambient : any
|
|
>FncFlags : any
|
|
>Ambient : any
|
|
|
|
public isExported() { return hasFlag(this.fncFlags, FncFlags.Exported); }
|
|
>isExported : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.Exported) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Exported : any
|
|
>FncFlags : any
|
|
>Exported : any
|
|
|
|
public isPrivate() { return hasFlag(this.fncFlags, FncFlags.Private); }
|
|
>isPrivate : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.Private) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Private : any
|
|
>FncFlags : any
|
|
>Private : any
|
|
|
|
public isPublic() { return hasFlag(this.fncFlags, FncFlags.Public); }
|
|
>isPublic : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.Public) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Public : any
|
|
>FncFlags : any
|
|
>Public : any
|
|
|
|
public isStatic() { return hasFlag(this.fncFlags, FncFlags.Static); }
|
|
>isStatic : () => any
|
|
>hasFlag(this.fncFlags, FncFlags.Static) : any
|
|
>hasFlag : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Static : any
|
|
>FncFlags : any
|
|
>Static : any
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
if (this.name == null) {
|
|
>this.name == null : boolean
|
|
>this.name : Identifier
|
|
>this : this
|
|
>name : Identifier
|
|
>null : null
|
|
|
|
return "funcExpr";
|
|
>"funcExpr" : "funcExpr"
|
|
}
|
|
else {
|
|
return "func: " + this.name.actualText
|
|
>"func: " + this.name.actualText : string
|
|
>"func: " : "func: "
|
|
>this.name.actualText : string
|
|
>this.name : Identifier
|
|
>this : this
|
|
>name : Identifier
|
|
>actualText : string
|
|
}
|
|
}
|
|
|
|
public ClearFlags(): void {
|
|
>ClearFlags : () => void
|
|
|
|
this.fncFlags = FncFlags.None;
|
|
>this.fncFlags = FncFlags.None : any
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.None : any
|
|
>FncFlags : any
|
|
>None : any
|
|
}
|
|
|
|
public isSignature() { return (this.fncFlags & FncFlags.Signature) != FncFlags.None; }
|
|
>isSignature : () => boolean
|
|
>(this.fncFlags & FncFlags.Signature) != FncFlags.None : boolean
|
|
>(this.fncFlags & FncFlags.Signature) : number
|
|
>this.fncFlags & FncFlags.Signature : number
|
|
>this.fncFlags : any
|
|
>this : this
|
|
>fncFlags : any
|
|
>FncFlags.Signature : any
|
|
>FncFlags : any
|
|
>Signature : any
|
|
>FncFlags.None : any
|
|
>FncFlags : any
|
|
>None : any
|
|
|
|
public hasStaticDeclarations() { return (!this.isConstructor && (this.statics.members.length > 0 || this.innerStaticFuncs.length > 0)); }
|
|
>hasStaticDeclarations : () => boolean
|
|
>(!this.isConstructor && (this.statics.members.length > 0 || this.innerStaticFuncs.length > 0)) : boolean
|
|
>!this.isConstructor && (this.statics.members.length > 0 || this.innerStaticFuncs.length > 0) : boolean
|
|
>!this.isConstructor : boolean
|
|
>this.isConstructor : boolean
|
|
>this : this
|
|
>isConstructor : boolean
|
|
>(this.statics.members.length > 0 || this.innerStaticFuncs.length > 0) : boolean
|
|
>this.statics.members.length > 0 || this.innerStaticFuncs.length > 0 : boolean
|
|
>this.statics.members.length > 0 : boolean
|
|
>this.statics.members.length : number
|
|
>this.statics.members : AST[]
|
|
>this.statics : ASTList
|
|
>this : this
|
|
>statics : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>0 : 0
|
|
>this.innerStaticFuncs.length > 0 : boolean
|
|
>this.innerStaticFuncs.length : number
|
|
>this.innerStaticFuncs : FuncDecl[]
|
|
>this : this
|
|
>innerStaticFuncs : FuncDecl[]
|
|
>length : number
|
|
>0 : 0
|
|
}
|
|
|
|
export class LocationInfo {
|
|
>LocationInfo : LocationInfo
|
|
|
|
constructor (public filename: string, public lineMap: number[], public unitIndex) { }
|
|
>filename : string
|
|
>lineMap : number[]
|
|
>unitIndex : any
|
|
}
|
|
|
|
export var unknownLocationInfo = new LocationInfo("unknown", null, -1);
|
|
>unknownLocationInfo : LocationInfo
|
|
>new LocationInfo("unknown", null, -1) : LocationInfo
|
|
>LocationInfo : typeof LocationInfo
|
|
>"unknown" : "unknown"
|
|
>null : null
|
|
>-1 : -1
|
|
>1 : 1
|
|
|
|
export class Script extends FuncDecl {
|
|
>Script : Script
|
|
>FuncDecl : FuncDecl
|
|
|
|
public locationInfo: LocationInfo = null;
|
|
>locationInfo : LocationInfo
|
|
>null : null
|
|
|
|
public referencedFiles: IFileReference[] = [];
|
|
>referencedFiles : IFileReference[]
|
|
>[] : undefined[]
|
|
|
|
public requiresGlobal = false;
|
|
>requiresGlobal : boolean
|
|
>false : false
|
|
|
|
public requiresInherits = false;
|
|
>requiresInherits : boolean
|
|
>false : false
|
|
|
|
public isResident = false;
|
|
>isResident : boolean
|
|
>false : false
|
|
|
|
public isDeclareFile = false;
|
|
>isDeclareFile : boolean
|
|
>false : false
|
|
|
|
public hasBeenTypeChecked = false;
|
|
>hasBeenTypeChecked : boolean
|
|
>false : false
|
|
|
|
public topLevelMod: ModuleDeclaration = null;
|
|
>topLevelMod : ModuleDeclaration
|
|
>null : null
|
|
|
|
public leftCurlyCount = 0;
|
|
>leftCurlyCount : number
|
|
>0 : 0
|
|
|
|
public rightCurlyCount = 0;
|
|
>rightCurlyCount : number
|
|
>0 : 0
|
|
|
|
public vars: ASTList;
|
|
>vars : ASTList
|
|
|
|
public scopes: ASTList;
|
|
>scopes : ASTList
|
|
|
|
// Remember if the script contains Unicode chars, that is needed when generating code for this script object to decide the output file correct encoding.
|
|
public containsUnicodeChar = false;
|
|
>containsUnicodeChar : boolean
|
|
>false : false
|
|
|
|
public containsUnicodeCharInComment = false;
|
|
>containsUnicodeCharInComment : boolean
|
|
>false : false
|
|
|
|
constructor (vars: ASTList, scopes: ASTList) {
|
|
>vars : ASTList
|
|
>scopes : ASTList
|
|
|
|
super(new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script);
|
|
>super(new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script) : void
|
|
>super : typeof FuncDecl
|
|
>new Identifier("script") : Identifier
|
|
>Identifier : typeof Identifier
|
|
>"script" : "script"
|
|
>null : null
|
|
>false : false
|
|
>null : null
|
|
>vars : ASTList
|
|
>scopes : ASTList
|
|
>null : null
|
|
>NodeType.Script : any
|
|
>NodeType : any
|
|
>Script : any
|
|
|
|
this.vars = vars;
|
|
>this.vars = vars : ASTList
|
|
>this.vars : ASTList
|
|
>this : this
|
|
>vars : ASTList
|
|
>vars : ASTList
|
|
|
|
this.scopes = scopes;
|
|
>this.scopes = scopes : ASTList
|
|
>this.scopes : ASTList
|
|
>this : this
|
|
>scopes : ASTList
|
|
>scopes : ASTList
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckScript(this);
|
|
>typeFlow.typeCheckScript(this) : any
|
|
>typeFlow.typeCheckScript : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckScript : any
|
|
>this : this
|
|
}
|
|
|
|
public treeViewLabel() {
|
|
>treeViewLabel : () => string
|
|
|
|
return "Script";
|
|
>"Script" : "Script"
|
|
}
|
|
|
|
public emitRequired() {
|
|
>emitRequired : () => boolean
|
|
|
|
if (!this.isDeclareFile && !this.isResident && this.bod) {
|
|
>!this.isDeclareFile && !this.isResident && this.bod : ASTList
|
|
>!this.isDeclareFile && !this.isResident : boolean
|
|
>!this.isDeclareFile : boolean
|
|
>this.isDeclareFile : boolean
|
|
>this : this
|
|
>isDeclareFile : boolean
|
|
>!this.isResident : boolean
|
|
>this.isResident : boolean
|
|
>this : this
|
|
>isResident : boolean
|
|
>this.bod : ASTList
|
|
>this : this
|
|
>bod : ASTList
|
|
|
|
for (var i = 0, len = this.bod.members.length; i < len; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>len : number
|
|
>this.bod.members.length : number
|
|
>this.bod.members : AST[]
|
|
>this.bod : ASTList
|
|
>this : this
|
|
>bod : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>i < len : boolean
|
|
>i : number
|
|
>len : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
var stmt = this.bod.members[i];
|
|
>stmt : AST
|
|
>this.bod.members[i] : AST
|
|
>this.bod.members : AST[]
|
|
>this.bod : ASTList
|
|
>this : this
|
|
>bod : ASTList
|
|
>members : AST[]
|
|
>i : number
|
|
|
|
if (stmt.nodeType == NodeType.ModuleDeclaration) {
|
|
>stmt.nodeType == NodeType.ModuleDeclaration : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : AST
|
|
>nodeType : NodeType
|
|
>NodeType.ModuleDeclaration : any
|
|
>NodeType : any
|
|
>ModuleDeclaration : any
|
|
|
|
if (!hasFlag((<ModuleDeclaration>stmt).modFlags, ModuleFlags.ShouldEmitModuleDecl | ModuleFlags.Ambient)) {
|
|
>!hasFlag((<ModuleDeclaration>stmt).modFlags, ModuleFlags.ShouldEmitModuleDecl | ModuleFlags.Ambient) : boolean
|
|
>hasFlag((<ModuleDeclaration>stmt).modFlags, ModuleFlags.ShouldEmitModuleDecl | ModuleFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>(<ModuleDeclaration>stmt).modFlags : any
|
|
>(<ModuleDeclaration>stmt) : ModuleDeclaration
|
|
><ModuleDeclaration>stmt : ModuleDeclaration
|
|
>stmt : AST
|
|
>modFlags : any
|
|
>ModuleFlags.ShouldEmitModuleDecl | ModuleFlags.Ambient : number
|
|
>ModuleFlags.ShouldEmitModuleDecl : any
|
|
>ModuleFlags : any
|
|
>ShouldEmitModuleDecl : any
|
|
>ModuleFlags.Ambient : any
|
|
>ModuleFlags : any
|
|
>Ambient : any
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
}
|
|
else if (stmt.nodeType == NodeType.ClassDeclaration) {
|
|
>stmt.nodeType == NodeType.ClassDeclaration : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : AST
|
|
>nodeType : NodeType
|
|
>NodeType.ClassDeclaration : any
|
|
>NodeType : any
|
|
>ClassDeclaration : any
|
|
|
|
if (!hasFlag((<InterfaceDeclaration>stmt).varFlags, VarFlags.Ambient)) {
|
|
>!hasFlag((<InterfaceDeclaration>stmt).varFlags, VarFlags.Ambient) : boolean
|
|
>hasFlag((<InterfaceDeclaration>stmt).varFlags, VarFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>(<InterfaceDeclaration>stmt).varFlags : any
|
|
>(<InterfaceDeclaration>stmt) : InterfaceDeclaration
|
|
><InterfaceDeclaration>stmt : InterfaceDeclaration
|
|
>stmt : AST
|
|
>varFlags : any
|
|
>VarFlags.Ambient : any
|
|
>VarFlags : any
|
|
>Ambient : any
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
}
|
|
else if (stmt.nodeType == NodeType.VarDecl) {
|
|
>stmt.nodeType == NodeType.VarDecl : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : AST
|
|
>nodeType : NodeType
|
|
>NodeType.VarDecl : any
|
|
>NodeType : any
|
|
>VarDecl : any
|
|
|
|
if (!hasFlag((<VarDecl>stmt).varFlags, VarFlags.Ambient)) {
|
|
>!hasFlag((<VarDecl>stmt).varFlags, VarFlags.Ambient) : boolean
|
|
>hasFlag((<VarDecl>stmt).varFlags, VarFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>(<VarDecl>stmt).varFlags : any
|
|
>(<VarDecl>stmt) : VarDecl
|
|
><VarDecl>stmt : VarDecl
|
|
>stmt : AST
|
|
>varFlags : any
|
|
>VarFlags.Ambient : any
|
|
>VarFlags : any
|
|
>Ambient : any
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
}
|
|
else if (stmt.nodeType == NodeType.FuncDecl) {
|
|
>stmt.nodeType == NodeType.FuncDecl : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : AST
|
|
>nodeType : NodeType
|
|
>NodeType.FuncDecl : any
|
|
>NodeType : any
|
|
>FuncDecl : any
|
|
|
|
if (!(<FuncDecl>stmt).isSignature()) {
|
|
>!(<FuncDecl>stmt).isSignature() : boolean
|
|
>(<FuncDecl>stmt).isSignature() : boolean
|
|
>(<FuncDecl>stmt).isSignature : () => boolean
|
|
>(<FuncDecl>stmt) : FuncDecl
|
|
><FuncDecl>stmt : FuncDecl
|
|
>stmt : AST
|
|
>isSignature : () => boolean
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
}
|
|
else if (stmt.nodeType != NodeType.InterfaceDeclaration && stmt.nodeType != NodeType.Empty) {
|
|
>stmt.nodeType != NodeType.InterfaceDeclaration && stmt.nodeType != NodeType.Empty : boolean
|
|
>stmt.nodeType != NodeType.InterfaceDeclaration : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : AST
|
|
>nodeType : NodeType
|
|
>NodeType.InterfaceDeclaration : any
|
|
>NodeType : any
|
|
>InterfaceDeclaration : any
|
|
>stmt.nodeType != NodeType.Empty : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Empty : any
|
|
>NodeType : any
|
|
>Empty : any
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
>false : false
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
if (this.emitRequired()) {
|
|
>this.emitRequired() : boolean
|
|
>this.emitRequired : () => boolean
|
|
>this : this
|
|
>emitRequired : () => boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitJavascriptList(this.bod, null, TokenID.Semicolon, true, false, false, true, this.requiresInherits);
|
|
>emitter.emitJavascriptList(this.bod, null, TokenID.Semicolon, true, false, false, true, this.requiresInherits) : any
|
|
>emitter.emitJavascriptList : any
|
|
>emitter : Emitter
|
|
>emitJavascriptList : any
|
|
>this.bod : ASTList
|
|
>this : this
|
|
>bod : ASTList
|
|
>null : null
|
|
>TokenID.Semicolon : any
|
|
>TokenID : any
|
|
>Semicolon : any
|
|
>true : true
|
|
>false : false
|
|
>false : false
|
|
>true : true
|
|
>this.requiresInherits : boolean
|
|
>this : this
|
|
>requiresInherits : boolean
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
}
|
|
|
|
export class NamedDeclaration extends ModuleElement {
|
|
>NamedDeclaration : NamedDeclaration
|
|
>ModuleElement : ModuleElement
|
|
|
|
public leftCurlyCount = 0;
|
|
>leftCurlyCount : number
|
|
>0 : 0
|
|
|
|
public rightCurlyCount = 0;
|
|
>rightCurlyCount : number
|
|
>0 : 0
|
|
|
|
constructor (nodeType: NodeType,
|
|
>nodeType : NodeType
|
|
|
|
public name: Identifier,
|
|
>name : Identifier
|
|
|
|
public members: ASTList) {
|
|
>members : ASTList
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof ModuleElement
|
|
>nodeType : NodeType
|
|
}
|
|
}
|
|
|
|
export class ModuleDeclaration extends NamedDeclaration {
|
|
>ModuleDeclaration : ModuleDeclaration
|
|
>NamedDeclaration : NamedDeclaration
|
|
|
|
public modFlags = ModuleFlags.ShouldEmitModuleDecl;
|
|
>modFlags : any
|
|
>ModuleFlags.ShouldEmitModuleDecl : any
|
|
>ModuleFlags : any
|
|
>ShouldEmitModuleDecl : any
|
|
|
|
public mod: ModuleType;
|
|
>mod : ModuleType
|
|
|
|
public prettyName: string;
|
|
>prettyName : string
|
|
|
|
public amdDependencies: string[] = [];
|
|
>amdDependencies : string[]
|
|
>[] : undefined[]
|
|
|
|
public vars: ASTList;
|
|
>vars : ASTList
|
|
|
|
public scopes: ASTList;
|
|
>scopes : ASTList
|
|
|
|
// Remember if the module contains Unicode chars, that is needed for dynamic module as we will generate a file for each.
|
|
public containsUnicodeChar = false;
|
|
>containsUnicodeChar : boolean
|
|
>false : false
|
|
|
|
public containsUnicodeCharInComment = false;
|
|
>containsUnicodeCharInComment : boolean
|
|
>false : false
|
|
|
|
constructor (name: Identifier, members: ASTList, vars: ASTList, scopes: ASTList, public endingToken: ASTSpan) {
|
|
>name : Identifier
|
|
>members : ASTList
|
|
>vars : ASTList
|
|
>scopes : ASTList
|
|
>endingToken : ASTSpan
|
|
|
|
super(NodeType.ModuleDeclaration, name, members);
|
|
>super(NodeType.ModuleDeclaration, name, members) : void
|
|
>super : typeof NamedDeclaration
|
|
>NodeType.ModuleDeclaration : any
|
|
>NodeType : any
|
|
>ModuleDeclaration : any
|
|
>name : Identifier
|
|
>members : ASTList
|
|
|
|
this.vars = vars;
|
|
>this.vars = vars : ASTList
|
|
>this.vars : ASTList
|
|
>this : this
|
|
>vars : ASTList
|
|
>vars : ASTList
|
|
|
|
this.scopes = scopes;
|
|
>this.scopes = scopes : ASTList
|
|
>this.scopes : ASTList
|
|
>this : this
|
|
>scopes : ASTList
|
|
>scopes : ASTList
|
|
|
|
this.prettyName = this.name.actualText;
|
|
>this.prettyName = this.name.actualText : string
|
|
>this.prettyName : string
|
|
>this : this
|
|
>prettyName : string
|
|
>this.name.actualText : string
|
|
>this.name : Identifier
|
|
>this : this
|
|
>name : Identifier
|
|
>actualText : string
|
|
}
|
|
|
|
public isExported() { return hasFlag(this.modFlags, ModuleFlags.Exported); }
|
|
>isExported : () => any
|
|
>hasFlag(this.modFlags, ModuleFlags.Exported) : any
|
|
>hasFlag : any
|
|
>this.modFlags : any
|
|
>this : this
|
|
>modFlags : any
|
|
>ModuleFlags.Exported : any
|
|
>ModuleFlags : any
|
|
>Exported : any
|
|
|
|
public isAmbient() { return hasFlag(this.modFlags, ModuleFlags.Ambient); }
|
|
>isAmbient : () => any
|
|
>hasFlag(this.modFlags, ModuleFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>this.modFlags : any
|
|
>this : this
|
|
>modFlags : any
|
|
>ModuleFlags.Ambient : any
|
|
>ModuleFlags : any
|
|
>Ambient : any
|
|
|
|
public isEnum() { return hasFlag(this.modFlags, ModuleFlags.IsEnum); }
|
|
>isEnum : () => any
|
|
>hasFlag(this.modFlags, ModuleFlags.IsEnum) : any
|
|
>hasFlag : any
|
|
>this.modFlags : any
|
|
>this : this
|
|
>modFlags : any
|
|
>ModuleFlags.IsEnum : any
|
|
>ModuleFlags : any
|
|
>IsEnum : any
|
|
|
|
public recordNonInterface() {
|
|
>recordNonInterface : () => void
|
|
|
|
this.modFlags &= ~ModuleFlags.ShouldEmitModuleDecl;
|
|
>this.modFlags &= ~ModuleFlags.ShouldEmitModuleDecl : number
|
|
>this.modFlags : any
|
|
>this : this
|
|
>modFlags : any
|
|
>~ModuleFlags.ShouldEmitModuleDecl : number
|
|
>ModuleFlags.ShouldEmitModuleDecl : any
|
|
>ModuleFlags : any
|
|
>ShouldEmitModuleDecl : any
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckModule(this);
|
|
>typeFlow.typeCheckModule(this) : any
|
|
>typeFlow.typeCheckModule : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckModule : any
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
if (!hasFlag(this.modFlags, ModuleFlags.ShouldEmitModuleDecl)) {
|
|
>!hasFlag(this.modFlags, ModuleFlags.ShouldEmitModuleDecl) : boolean
|
|
>hasFlag(this.modFlags, ModuleFlags.ShouldEmitModuleDecl) : any
|
|
>hasFlag : any
|
|
>this.modFlags : any
|
|
>this : this
|
|
>modFlags : any
|
|
>ModuleFlags.ShouldEmitModuleDecl : any
|
|
>ModuleFlags : any
|
|
>ShouldEmitModuleDecl : any
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitJavascriptModule(this);
|
|
>emitter.emitJavascriptModule(this) : any
|
|
>emitter.emitJavascriptModule : any
|
|
>emitter : Emitter
|
|
>emitJavascriptModule : any
|
|
>this : this
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
}
|
|
|
|
export class TypeDeclaration extends NamedDeclaration {
|
|
>TypeDeclaration : TypeDeclaration
|
|
>NamedDeclaration : NamedDeclaration
|
|
|
|
public varFlags = VarFlags.None;
|
|
>varFlags : any
|
|
>VarFlags.None : any
|
|
>VarFlags : any
|
|
>None : any
|
|
|
|
constructor (nodeType: NodeType,
|
|
>nodeType : NodeType
|
|
|
|
name: Identifier,
|
|
>name : Identifier
|
|
|
|
public extendsList: ASTList,
|
|
>extendsList : ASTList
|
|
|
|
public implementsList: ASTList,
|
|
>implementsList : ASTList
|
|
|
|
members: ASTList) {
|
|
>members : ASTList
|
|
|
|
super(nodeType, name, members);
|
|
>super(nodeType, name, members) : void
|
|
>super : typeof NamedDeclaration
|
|
>nodeType : NodeType
|
|
>name : Identifier
|
|
>members : ASTList
|
|
}
|
|
|
|
public isExported() {
|
|
>isExported : () => any
|
|
|
|
return hasFlag(this.varFlags, VarFlags.Exported);
|
|
>hasFlag(this.varFlags, VarFlags.Exported) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Exported : any
|
|
>VarFlags : any
|
|
>Exported : any
|
|
}
|
|
|
|
public isAmbient() {
|
|
>isAmbient : () => any
|
|
|
|
return hasFlag(this.varFlags, VarFlags.Ambient);
|
|
>hasFlag(this.varFlags, VarFlags.Ambient) : any
|
|
>hasFlag : any
|
|
>this.varFlags : any
|
|
>this : this
|
|
>varFlags : any
|
|
>VarFlags.Ambient : any
|
|
>VarFlags : any
|
|
>Ambient : any
|
|
}
|
|
}
|
|
|
|
export class ClassDeclaration extends TypeDeclaration {
|
|
>ClassDeclaration : ClassDeclaration
|
|
>TypeDeclaration : TypeDeclaration
|
|
|
|
public knownMemberNames: any = {};
|
|
>knownMemberNames : any
|
|
>{} : {}
|
|
|
|
public constructorDecl: FuncDecl = null;
|
|
>constructorDecl : FuncDecl
|
|
>null : null
|
|
|
|
public constructorNestingLevel = 0;
|
|
>constructorNestingLevel : number
|
|
>0 : 0
|
|
|
|
public endingToken: ASTSpan = null;
|
|
>endingToken : ASTSpan
|
|
>null : null
|
|
|
|
constructor (name: Identifier,
|
|
>name : Identifier
|
|
|
|
members: ASTList,
|
|
>members : ASTList
|
|
|
|
extendsList: ASTList,
|
|
>extendsList : ASTList
|
|
|
|
implementsList: ASTList) {
|
|
>implementsList : ASTList
|
|
|
|
super(NodeType.ClassDeclaration, name, extendsList, implementsList, members);
|
|
>super(NodeType.ClassDeclaration, name, extendsList, implementsList, members) : void
|
|
>super : typeof TypeDeclaration
|
|
>NodeType.ClassDeclaration : any
|
|
>NodeType : any
|
|
>ClassDeclaration : any
|
|
>name : Identifier
|
|
>extendsList : ASTList
|
|
>implementsList : ASTList
|
|
>members : ASTList
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckClass(this);
|
|
>typeFlow.typeCheckClass(this) : any
|
|
>typeFlow.typeCheckClass : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckClass : any
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitJavascriptClass(this);
|
|
>emitter.emitJavascriptClass(this) : any
|
|
>emitter.emitJavascriptClass : any
|
|
>emitter : Emitter
|
|
>emitJavascriptClass : any
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class InterfaceDeclaration extends TypeDeclaration {
|
|
>InterfaceDeclaration : InterfaceDeclaration
|
|
>TypeDeclaration : TypeDeclaration
|
|
|
|
constructor (name: Identifier,
|
|
>name : Identifier
|
|
|
|
members: ASTList,
|
|
>members : ASTList
|
|
|
|
extendsList: ASTList,
|
|
>extendsList : ASTList
|
|
|
|
implementsList: ASTList) {
|
|
>implementsList : ASTList
|
|
|
|
super(NodeType.InterfaceDeclaration, name, extendsList, implementsList, members);
|
|
>super(NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) : void
|
|
>super : typeof TypeDeclaration
|
|
>NodeType.InterfaceDeclaration : any
|
|
>NodeType : any
|
|
>InterfaceDeclaration : any
|
|
>name : Identifier
|
|
>extendsList : ASTList
|
|
>implementsList : ASTList
|
|
>members : ASTList
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckInterface(this);
|
|
>typeFlow.typeCheckInterface(this) : any
|
|
>typeFlow.typeCheckInterface : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckInterface : any
|
|
>this : this
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
}
|
|
}
|
|
|
|
export class Statement extends ModuleElement {
|
|
>Statement : Statement
|
|
>ModuleElement : ModuleElement
|
|
|
|
constructor (nodeType: NodeType) {
|
|
>nodeType : NodeType
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof ModuleElement
|
|
>nodeType : NodeType
|
|
|
|
this.flags |= ASTFlags.IsStatement;
|
|
>this.flags |= ASTFlags.IsStatement : number
|
|
>this.flags : any
|
|
>this : this
|
|
>flags : any
|
|
>ASTFlags.IsStatement : any
|
|
>ASTFlags : any
|
|
>IsStatement : any
|
|
}
|
|
|
|
public isLoop() { return false; }
|
|
>isLoop : () => boolean
|
|
>false : false
|
|
|
|
public isStatementOrExpression() { return true; }
|
|
>isStatementOrExpression : () => boolean
|
|
>true : true
|
|
|
|
public isCompoundStatement() { return this.isLoop(); }
|
|
>isCompoundStatement : () => boolean
|
|
>this.isLoop() : boolean
|
|
>this.isLoop : () => boolean
|
|
>this : this
|
|
>isLoop : () => boolean
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class LabeledStatement extends Statement {
|
|
>LabeledStatement : LabeledStatement
|
|
>Statement : Statement
|
|
|
|
constructor (public labels: ASTList, public stmt: AST) {
|
|
>labels : ASTList
|
|
>stmt : AST
|
|
|
|
super(NodeType.LabeledStatement);
|
|
>super(NodeType.LabeledStatement) : void
|
|
>super : typeof Statement
|
|
>NodeType.LabeledStatement : any
|
|
>NodeType : any
|
|
>LabeledStatement : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (this.labels) {
|
|
>this.labels : ASTList
|
|
>this : this
|
|
>labels : ASTList
|
|
|
|
var labelsLen = this.labels.members.length;
|
|
>labelsLen : number
|
|
>this.labels.members.length : number
|
|
>this.labels.members : AST[]
|
|
>this.labels : ASTList
|
|
>this : this
|
|
>labels : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
|
|
for (var i = 0; i < labelsLen; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>i < labelsLen : boolean
|
|
>i : number
|
|
>labelsLen : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
this.labels.members[i].emit(emitter, tokenId, startLine);
|
|
>this.labels.members[i].emit(emitter, tokenId, startLine) : void
|
|
>this.labels.members[i].emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>this.labels.members[i] : AST
|
|
>this.labels.members : AST[]
|
|
>this.labels : ASTList
|
|
>this : this
|
|
>labels : ASTList
|
|
>members : AST[]
|
|
>i : number
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
}
|
|
}
|
|
this.stmt.emit(emitter, tokenId, true);
|
|
>this.stmt.emit(emitter, tokenId, true) : void
|
|
>this.stmt.emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>this.stmt : AST
|
|
>this : this
|
|
>stmt : AST
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
typeFlow.typeCheck(this.labels);
|
|
>typeFlow.typeCheck(this.labels) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.labels : ASTList
|
|
>this : this
|
|
>labels : ASTList
|
|
|
|
this.stmt = this.stmt.typeCheck(typeFlow);
|
|
>this.stmt = this.stmt.typeCheck(typeFlow) : any
|
|
>this.stmt : AST
|
|
>this : this
|
|
>stmt : AST
|
|
>this.stmt.typeCheck(typeFlow) : any
|
|
>this.stmt.typeCheck : (typeFlow: TypeFlow) => any
|
|
>this.stmt : AST
|
|
>this : this
|
|
>stmt : AST
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var beforeBB = context.current;
|
|
>beforeBB : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var bb = new BasicBlock();
|
|
>bb : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.current = bb;
|
|
>context.current = bb : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>bb : any
|
|
|
|
beforeBB.addSuccessor(bb);
|
|
>beforeBB.addSuccessor(bb) : any
|
|
>beforeBB.addSuccessor : any
|
|
>beforeBB : any
|
|
>addSuccessor : any
|
|
>bb : any
|
|
}
|
|
}
|
|
|
|
export class Block extends Statement {
|
|
>Block : Block
|
|
>Statement : Statement
|
|
|
|
constructor (public statements: ASTList,
|
|
>statements : ASTList
|
|
|
|
public isStatementBlock: boolean) {
|
|
>isStatementBlock : boolean
|
|
|
|
super(NodeType.Block);
|
|
>super(NodeType.Block) : void
|
|
>super : typeof Statement
|
|
>NodeType.Block : any
|
|
>NodeType : any
|
|
>Block : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (this.isStatementBlock) {
|
|
>this.isStatementBlock : boolean
|
|
>this : this
|
|
>isStatementBlock : boolean
|
|
|
|
emitter.writeLineToOutput(" {");
|
|
>emitter.writeLineToOutput(" {") : any
|
|
>emitter.writeLineToOutput : any
|
|
>emitter : Emitter
|
|
>writeLineToOutput : any
|
|
>" {" : " {"
|
|
|
|
emitter.indenter.increaseIndent();
|
|
>emitter.indenter.increaseIndent() : any
|
|
>emitter.indenter.increaseIndent : any
|
|
>emitter.indenter : any
|
|
>emitter : Emitter
|
|
>indenter : any
|
|
>increaseIndent : any
|
|
|
|
} else {
|
|
emitter.setInVarBlock(this.statements.members.length);
|
|
>emitter.setInVarBlock(this.statements.members.length) : any
|
|
>emitter.setInVarBlock : any
|
|
>emitter : Emitter
|
|
>setInVarBlock : any
|
|
>this.statements.members.length : number
|
|
>this.statements.members : AST[]
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
}
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
if (this.statements) {
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
|
|
emitter.emitJavascriptList(this.statements, null, TokenID.Semicolon, true, false, false);
|
|
>emitter.emitJavascriptList(this.statements, null, TokenID.Semicolon, true, false, false) : any
|
|
>emitter.emitJavascriptList : any
|
|
>emitter : Emitter
|
|
>emitJavascriptList : any
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
>null : null
|
|
>TokenID.Semicolon : any
|
|
>TokenID : any
|
|
>Semicolon : any
|
|
>true : true
|
|
>false : false
|
|
>false : false
|
|
}
|
|
if (this.isStatementBlock) {
|
|
>this.isStatementBlock : boolean
|
|
>this : this
|
|
>isStatementBlock : boolean
|
|
|
|
emitter.indenter.decreaseIndent();
|
|
>emitter.indenter.decreaseIndent() : any
|
|
>emitter.indenter.decreaseIndent : any
|
|
>emitter.indenter : any
|
|
>emitter : Emitter
|
|
>indenter : any
|
|
>decreaseIndent : any
|
|
|
|
emitter.emitIndent();
|
|
>emitter.emitIndent() : any
|
|
>emitter.emitIndent : any
|
|
>emitter : Emitter
|
|
>emitIndent : any
|
|
|
|
emitter.writeToOutput("}");
|
|
>emitter.writeToOutput("}") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"}" : "}"
|
|
}
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var afterIfNeeded = new BasicBlock();
|
|
>afterIfNeeded : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.pushStatement(this, context.current, afterIfNeeded);
|
|
>context.pushStatement(this, context.current, afterIfNeeded) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterIfNeeded : any
|
|
|
|
if (this.statements) {
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
|
|
context.walk(this.statements, this);
|
|
>context.walk(this.statements, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
>this : this
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
|
|
context.popStatement();
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
|
|
if (afterIfNeeded.predecessors.length > 0) {
|
|
>afterIfNeeded.predecessors.length > 0 : boolean
|
|
>afterIfNeeded.predecessors.length : any
|
|
>afterIfNeeded.predecessors : any
|
|
>afterIfNeeded : any
|
|
>predecessors : any
|
|
>length : any
|
|
>0 : 0
|
|
|
|
context.current.addSuccessor(afterIfNeeded);
|
|
>context.current.addSuccessor(afterIfNeeded) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>afterIfNeeded : any
|
|
|
|
context.current = afterIfNeeded;
|
|
>context.current = afterIfNeeded : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterIfNeeded : any
|
|
}
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
if (!typeFlow.checker.styleSettings.emptyBlocks) {
|
|
>!typeFlow.checker.styleSettings.emptyBlocks : boolean
|
|
>typeFlow.checker.styleSettings.emptyBlocks : any
|
|
>typeFlow.checker.styleSettings : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>styleSettings : any
|
|
>emptyBlocks : any
|
|
|
|
if ((this.statements === null) || (this.statements.members.length == 0)) {
|
|
>(this.statements === null) || (this.statements.members.length == 0) : boolean
|
|
>(this.statements === null) : boolean
|
|
>this.statements === null : boolean
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
>null : null
|
|
>(this.statements.members.length == 0) : boolean
|
|
>this.statements.members.length == 0 : boolean
|
|
>this.statements.members.length : number
|
|
>this.statements.members : AST[]
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>0 : 0
|
|
|
|
typeFlow.checker.errorReporter.styleError(this, "empty block");
|
|
>typeFlow.checker.errorReporter.styleError(this, "empty block") : any
|
|
>typeFlow.checker.errorReporter.styleError : any
|
|
>typeFlow.checker.errorReporter : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>errorReporter : any
|
|
>styleError : any
|
|
>this : this
|
|
>"empty block" : "empty block"
|
|
}
|
|
}
|
|
|
|
typeFlow.typeCheck(this.statements);
|
|
>typeFlow.typeCheck(this.statements) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.statements : ASTList
|
|
>this : this
|
|
>statements : ASTList
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class Jump extends Statement {
|
|
>Jump : Jump
|
|
>Statement : Statement
|
|
|
|
public target: string = null;
|
|
>target : string
|
|
>null : null
|
|
|
|
public hasExplicitTarget() { return (this.target); }
|
|
>hasExplicitTarget : () => string
|
|
>(this.target) : string
|
|
>this.target : string
|
|
>this : this
|
|
>target : string
|
|
|
|
public resolvedTarget: Statement = null;
|
|
>resolvedTarget : Statement
|
|
>null : null
|
|
|
|
constructor (nodeType: NodeType) {
|
|
>nodeType : NodeType
|
|
|
|
super(nodeType);
|
|
>super(nodeType) : void
|
|
>super : typeof Statement
|
|
>nodeType : NodeType
|
|
}
|
|
|
|
public setResolvedTarget(parser: Parser, stmt: Statement): boolean {
|
|
>setResolvedTarget : (parser: Parser, stmt: Statement) => boolean
|
|
>parser : Parser
|
|
>stmt : Statement
|
|
|
|
if (stmt.isLoop()) {
|
|
>stmt.isLoop() : boolean
|
|
>stmt.isLoop : () => boolean
|
|
>stmt : Statement
|
|
>isLoop : () => boolean
|
|
|
|
this.resolvedTarget = stmt;
|
|
>this.resolvedTarget = stmt : Statement
|
|
>this.resolvedTarget : Statement
|
|
>this : this
|
|
>resolvedTarget : Statement
|
|
>stmt : Statement
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
if (this.nodeType === NodeType.Continue) {
|
|
>this.nodeType === NodeType.Continue : boolean
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>NodeType.Continue : any
|
|
>NodeType : any
|
|
>Continue : any
|
|
|
|
parser.reportParseError("continue statement applies only to loops");
|
|
>parser.reportParseError("continue statement applies only to loops") : any
|
|
>parser.reportParseError : any
|
|
>parser : Parser
|
|
>reportParseError : any
|
|
>"continue statement applies only to loops" : "continue statement applies only to loops"
|
|
|
|
return false;
|
|
>false : false
|
|
}
|
|
else {
|
|
if ((stmt.nodeType == NodeType.Switch) || this.hasExplicitTarget()) {
|
|
>(stmt.nodeType == NodeType.Switch) || this.hasExplicitTarget() : string | true
|
|
>(stmt.nodeType == NodeType.Switch) : boolean
|
|
>stmt.nodeType == NodeType.Switch : boolean
|
|
>stmt.nodeType : NodeType
|
|
>stmt : Statement
|
|
>nodeType : NodeType
|
|
>NodeType.Switch : any
|
|
>NodeType : any
|
|
>Switch : any
|
|
>this.hasExplicitTarget() : string
|
|
>this.hasExplicitTarget : () => string
|
|
>this : this
|
|
>hasExplicitTarget : () => string
|
|
|
|
this.resolvedTarget = stmt;
|
|
>this.resolvedTarget = stmt : Statement
|
|
>this.resolvedTarget : Statement
|
|
>this : this
|
|
>resolvedTarget : Statement
|
|
>stmt : Statement
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
else {
|
|
parser.reportParseError("break statement with no label can apply only to a loop or switch statement");
|
|
>parser.reportParseError("break statement with no label can apply only to a loop or switch statement") : any
|
|
>parser.reportParseError : any
|
|
>parser : Parser
|
|
>reportParseError : any
|
|
>"break statement with no label can apply only to a loop or switch statement" : "break statement with no label can apply only to a loop or switch statement"
|
|
|
|
return false;
|
|
>false : false
|
|
}
|
|
}
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
super.addToControlFlow(context);
|
|
>super.addToControlFlow(context) : void
|
|
>super.addToControlFlow : (context: ControlFlowContext) => void
|
|
>super : Statement
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
context.unconditionalBranch(this.resolvedTarget, (this.nodeType == NodeType.Continue));
|
|
>context.unconditionalBranch(this.resolvedTarget, (this.nodeType == NodeType.Continue)) : any
|
|
>context.unconditionalBranch : any
|
|
>context : ControlFlowContext
|
|
>unconditionalBranch : any
|
|
>this.resolvedTarget : Statement
|
|
>this : this
|
|
>resolvedTarget : Statement
|
|
>(this.nodeType == NodeType.Continue) : boolean
|
|
>this.nodeType == NodeType.Continue : boolean
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>NodeType.Continue : any
|
|
>NodeType : any
|
|
>Continue : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (this.nodeType == NodeType.Break) {
|
|
>this.nodeType == NodeType.Break : boolean
|
|
>this.nodeType : NodeType
|
|
>this : this
|
|
>nodeType : NodeType
|
|
>NodeType.Break : any
|
|
>NodeType : any
|
|
>Break : any
|
|
|
|
emitter.writeToOutput("break");
|
|
>emitter.writeToOutput("break") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"break" : "break"
|
|
}
|
|
else {
|
|
emitter.writeToOutput("continue");
|
|
>emitter.writeToOutput("continue") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"continue" : "continue"
|
|
}
|
|
if (this.hasExplicitTarget()) {
|
|
>this.hasExplicitTarget() : string
|
|
>this.hasExplicitTarget : () => string
|
|
>this : this
|
|
>hasExplicitTarget : () => string
|
|
|
|
emitter.writeToOutput(" " + this.target);
|
|
>emitter.writeToOutput(" " + this.target) : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" " + this.target : string
|
|
>" " : " "
|
|
>this.target : string
|
|
>this : this
|
|
>target : string
|
|
}
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput(";");
|
|
>emitter.writeToOutput(";") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>";" : ";"
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class WhileStatement extends Statement {
|
|
>WhileStatement : WhileStatement
|
|
>Statement : Statement
|
|
|
|
public body: AST = null;
|
|
>body : AST
|
|
>null : null
|
|
|
|
constructor (public cond: AST) {
|
|
>cond : AST
|
|
|
|
super(NodeType.While);
|
|
>super(NodeType.While) : void
|
|
>super : typeof Statement
|
|
>NodeType.While : any
|
|
>NodeType : any
|
|
>While : any
|
|
}
|
|
|
|
public isLoop() { return true; }
|
|
>isLoop : () => boolean
|
|
>true : true
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput("while(");
|
|
>emitter.writeToOutput("while(") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"while(" : "while("
|
|
|
|
emitter.emitJavascript(this.cond, TokenID.While, false);
|
|
>emitter.emitJavascript(this.cond, TokenID.While, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
>TokenID.While : any
|
|
>TokenID : any
|
|
>While : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.emitJavascriptStatements(this.body, false, false);
|
|
>emitter.emitJavascriptStatements(this.body, false, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>false : false
|
|
>false : false
|
|
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckWhile(this);
|
|
>typeFlow.typeCheckWhile(this) : any
|
|
>typeFlow.typeCheckWhile : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckWhile : any
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var loopHeader = context.current;
|
|
>loopHeader : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var loopStart = new BasicBlock();
|
|
>loopStart : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var afterLoop = new BasicBlock();
|
|
>afterLoop : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
loopHeader.addSuccessor(loopStart);
|
|
>loopHeader.addSuccessor(loopStart) : any
|
|
>loopHeader.addSuccessor : any
|
|
>loopHeader : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
|
|
context.current = loopStart;
|
|
>context.current = loopStart : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>loopStart : any
|
|
|
|
context.addContent(this.cond);
|
|
>context.addContent(this.cond) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
|
|
var condBlock = context.current;
|
|
>condBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var targetInfo: ITargetInfo = null;
|
|
>targetInfo : ITargetInfo
|
|
>null : null
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.current = new BasicBlock();
|
|
>context.current = new BasicBlock() : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
condBlock.addSuccessor(context.current);
|
|
>condBlock.addSuccessor(context.current) : any
|
|
>condBlock.addSuccessor : any
|
|
>condBlock : any
|
|
>addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.pushStatement(this, loopStart, afterLoop);
|
|
>context.pushStatement(this, loopStart, afterLoop) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>loopStart : any
|
|
>afterLoop : any
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
|
|
targetInfo = context.popStatement();
|
|
>targetInfo = context.popStatement() : any
|
|
>targetInfo : ITargetInfo
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
}
|
|
if (!(context.noContinuation)) {
|
|
>!(context.noContinuation) : boolean
|
|
>(context.noContinuation) : any
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
var loopEnd = context.current;
|
|
>loopEnd : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
loopEnd.addSuccessor(loopStart);
|
|
>loopEnd.addSuccessor(loopStart) : any
|
|
>loopEnd.addSuccessor : any
|
|
>loopEnd : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
}
|
|
context.current = afterLoop;
|
|
>context.current = afterLoop : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterLoop : any
|
|
|
|
condBlock.addSuccessor(afterLoop);
|
|
>condBlock.addSuccessor(afterLoop) : any
|
|
>condBlock.addSuccessor : any
|
|
>condBlock : any
|
|
>addSuccessor : any
|
|
>afterLoop : any
|
|
|
|
// TODO: check for while (true) and then only continue if afterLoop has predecessors
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class DoWhileStatement extends Statement {
|
|
>DoWhileStatement : DoWhileStatement
|
|
>Statement : Statement
|
|
|
|
public body: AST = null;
|
|
>body : AST
|
|
>null : null
|
|
|
|
public whileAST: AST = null;
|
|
>whileAST : AST
|
|
>null : null
|
|
|
|
public cond: AST = null;
|
|
>cond : AST
|
|
>null : null
|
|
|
|
public isLoop() { return true; }
|
|
>isLoop : () => boolean
|
|
>true : true
|
|
|
|
constructor () {
|
|
super(NodeType.DoWhile);
|
|
>super(NodeType.DoWhile) : void
|
|
>super : typeof Statement
|
|
>NodeType.DoWhile : any
|
|
>NodeType : any
|
|
>DoWhile : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput("do");
|
|
>emitter.writeToOutput("do") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"do" : "do"
|
|
|
|
emitter.emitJavascriptStatements(this.body, true, false);
|
|
>emitter.emitJavascriptStatements(this.body, true, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>true : true
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingStart(this.whileAST);
|
|
>emitter.recordSourceMappingStart(this.whileAST) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this.whileAST : AST
|
|
>this : this
|
|
>whileAST : AST
|
|
|
|
emitter.writeToOutput("while");
|
|
>emitter.writeToOutput("while") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"while" : "while"
|
|
|
|
emitter.recordSourceMappingEnd(this.whileAST);
|
|
>emitter.recordSourceMappingEnd(this.whileAST) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this.whileAST : AST
|
|
>this : this
|
|
>whileAST : AST
|
|
|
|
emitter.writeToOutput('(');
|
|
>emitter.writeToOutput('(') : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>'(' : "("
|
|
|
|
emitter.emitJavascript(this.cond, TokenID.CloseParen, false);
|
|
>emitter.emitJavascript(this.cond, TokenID.CloseParen, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
>TokenID.CloseParen : any
|
|
>TokenID : any
|
|
>CloseParen : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckDoWhile(this);
|
|
>typeFlow.typeCheckDoWhile(this) : any
|
|
>typeFlow.typeCheckDoWhile : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckDoWhile : any
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var loopHeader = context.current;
|
|
>loopHeader : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var loopStart = new BasicBlock();
|
|
>loopStart : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var afterLoop = new BasicBlock();
|
|
>afterLoop : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
loopHeader.addSuccessor(loopStart);
|
|
>loopHeader.addSuccessor(loopStart) : any
|
|
>loopHeader.addSuccessor : any
|
|
>loopHeader : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
|
|
context.current = loopStart;
|
|
>context.current = loopStart : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>loopStart : any
|
|
|
|
var targetInfo: ITargetInfo = null;
|
|
>targetInfo : ITargetInfo
|
|
>null : null
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.pushStatement(this, loopStart, afterLoop);
|
|
>context.pushStatement(this, loopStart, afterLoop) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>loopStart : any
|
|
>afterLoop : any
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
|
|
targetInfo = context.popStatement();
|
|
>targetInfo = context.popStatement() : any
|
|
>targetInfo : ITargetInfo
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
}
|
|
if (!(context.noContinuation)) {
|
|
>!(context.noContinuation) : boolean
|
|
>(context.noContinuation) : any
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
var loopEnd = context.current;
|
|
>loopEnd : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
loopEnd.addSuccessor(loopStart);
|
|
>loopEnd.addSuccessor(loopStart) : any
|
|
>loopEnd.addSuccessor : any
|
|
>loopEnd : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
|
|
context.addContent(this.cond);
|
|
>context.addContent(this.cond) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
|
|
// TODO: check for while (true)
|
|
context.current = afterLoop;
|
|
>context.current = afterLoop : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterLoop : any
|
|
|
|
loopEnd.addSuccessor(afterLoop);
|
|
>loopEnd.addSuccessor(afterLoop) : any
|
|
>loopEnd.addSuccessor : any
|
|
>loopEnd : any
|
|
>addSuccessor : any
|
|
>afterLoop : any
|
|
}
|
|
else {
|
|
context.addUnreachable(this.cond);
|
|
>context.addUnreachable(this.cond) : any
|
|
>context.addUnreachable : any
|
|
>context : ControlFlowContext
|
|
>addUnreachable : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class IfStatement extends Statement {
|
|
>IfStatement : IfStatement
|
|
>Statement : Statement
|
|
|
|
public thenBod: AST;
|
|
>thenBod : AST
|
|
|
|
public elseBod: AST = null;
|
|
>elseBod : AST
|
|
>null : null
|
|
|
|
public statement: ASTSpan = new ASTSpan();
|
|
>statement : ASTSpan
|
|
>new ASTSpan() : ASTSpan
|
|
>ASTSpan : typeof ASTSpan
|
|
|
|
constructor (public cond: AST) {
|
|
>cond : AST
|
|
|
|
super(NodeType.If);
|
|
>super(NodeType.If) : void
|
|
>super : typeof Statement
|
|
>NodeType.If : any
|
|
>NodeType : any
|
|
>If : any
|
|
}
|
|
|
|
public isCompoundStatement() { return true; }
|
|
>isCompoundStatement : () => boolean
|
|
>true : true
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingStart(this.statement);
|
|
>emitter.recordSourceMappingStart(this.statement) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.writeToOutput("if(");
|
|
>emitter.writeToOutput("if(") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"if(" : "if("
|
|
|
|
emitter.emitJavascript(this.cond, TokenID.If, false);
|
|
>emitter.emitJavascript(this.cond, TokenID.If, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
>TokenID.If : any
|
|
>TokenID : any
|
|
>If : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.recordSourceMappingEnd(this.statement);
|
|
>emitter.recordSourceMappingEnd(this.statement) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.emitJavascriptStatements(this.thenBod, true, false);
|
|
>emitter.emitJavascriptStatements(this.thenBod, true, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.thenBod : AST
|
|
>this : this
|
|
>thenBod : AST
|
|
>true : true
|
|
>false : false
|
|
|
|
if (this.elseBod) {
|
|
>this.elseBod : AST
|
|
>this : this
|
|
>elseBod : AST
|
|
|
|
emitter.writeToOutput(" else");
|
|
>emitter.writeToOutput(" else") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" else" : " else"
|
|
|
|
emitter.emitJavascriptStatements(this.elseBod, true, true);
|
|
>emitter.emitJavascriptStatements(this.elseBod, true, true) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.elseBod : AST
|
|
>this : this
|
|
>elseBod : AST
|
|
>true : true
|
|
>true : true
|
|
}
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckIf(this);
|
|
>typeFlow.typeCheckIf(this) : any
|
|
>typeFlow.typeCheckIf : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckIf : any
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
this.cond.addToControlFlow(context);
|
|
>this.cond.addToControlFlow(context) : void
|
|
>this.cond.addToControlFlow : (context: ControlFlowContext) => void
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var afterIf = new BasicBlock();
|
|
>afterIf : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var beforeIf = context.current;
|
|
>beforeIf : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.pushStatement(this, beforeIf, afterIf);
|
|
>context.pushStatement(this, beforeIf, afterIf) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>beforeIf : any
|
|
>afterIf : any
|
|
|
|
var hasContinuation = false;
|
|
>hasContinuation : boolean
|
|
>false : false
|
|
|
|
context.current = new BasicBlock();
|
|
>context.current = new BasicBlock() : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
beforeIf.addSuccessor(context.current);
|
|
>beforeIf.addSuccessor(context.current) : any
|
|
>beforeIf.addSuccessor : any
|
|
>beforeIf : any
|
|
>addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.walk(this.thenBod, this);
|
|
>context.walk(this.thenBod, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.thenBod : AST
|
|
>this : this
|
|
>thenBod : AST
|
|
>this : this
|
|
|
|
if (!context.noContinuation) {
|
|
>!context.noContinuation : boolean
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
hasContinuation = true;
|
|
>hasContinuation = true : true
|
|
>hasContinuation : boolean
|
|
>true : true
|
|
|
|
context.current.addSuccessor(afterIf);
|
|
>context.current.addSuccessor(afterIf) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>afterIf : any
|
|
}
|
|
if (this.elseBod) {
|
|
>this.elseBod : AST
|
|
>this : this
|
|
>elseBod : AST
|
|
|
|
// current block will be thenBod
|
|
context.current = new BasicBlock();
|
|
>context.current = new BasicBlock() : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
beforeIf.addSuccessor(context.current);
|
|
>beforeIf.addSuccessor(context.current) : any
|
|
>beforeIf.addSuccessor : any
|
|
>beforeIf : any
|
|
>addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.walk(this.elseBod, this);
|
|
>context.walk(this.elseBod, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.elseBod : AST
|
|
>this : this
|
|
>elseBod : AST
|
|
>this : this
|
|
|
|
if (!context.noContinuation) {
|
|
>!context.noContinuation : boolean
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
hasContinuation = true;
|
|
>hasContinuation = true : true
|
|
>hasContinuation : boolean
|
|
>true : true
|
|
|
|
context.current.addSuccessor(afterIf);
|
|
>context.current.addSuccessor(afterIf) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>afterIf : any
|
|
}
|
|
else {
|
|
// thenBod created continuation for if statement
|
|
if (hasContinuation) {
|
|
>hasContinuation : boolean
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
beforeIf.addSuccessor(afterIf);
|
|
>beforeIf.addSuccessor(afterIf) : any
|
|
>beforeIf.addSuccessor : any
|
|
>beforeIf : any
|
|
>addSuccessor : any
|
|
>afterIf : any
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
hasContinuation = true;
|
|
>hasContinuation = true : true
|
|
>hasContinuation : boolean
|
|
>true : true
|
|
}
|
|
var targetInfo = context.popStatement();
|
|
>targetInfo : any
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
|
|
if (afterIf.predecessors.length > 0) {
|
|
>afterIf.predecessors.length > 0 : boolean
|
|
>afterIf.predecessors.length : any
|
|
>afterIf.predecessors : any
|
|
>afterIf : any
|
|
>predecessors : any
|
|
>length : any
|
|
>0 : 0
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
hasContinuation = true;
|
|
>hasContinuation = true : true
|
|
>hasContinuation : boolean
|
|
>true : true
|
|
}
|
|
if (hasContinuation) {
|
|
>hasContinuation : boolean
|
|
|
|
context.current = afterIf;
|
|
>context.current = afterIf : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterIf : any
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class ReturnStatement extends Statement {
|
|
>ReturnStatement : ReturnStatement
|
|
>Statement : Statement
|
|
|
|
public returnExpression: AST = null;
|
|
>returnExpression : AST
|
|
>null : null
|
|
|
|
constructor () {
|
|
super(NodeType.Return);
|
|
>super(NodeType.Return) : void
|
|
>super : typeof Statement
|
|
>NodeType.Return : any
|
|
>NodeType : any
|
|
>Return : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
if (this.returnExpression) {
|
|
>this.returnExpression : AST
|
|
>this : this
|
|
>returnExpression : AST
|
|
|
|
emitter.writeToOutput("return ");
|
|
>emitter.writeToOutput("return ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"return " : "return "
|
|
|
|
emitter.emitJavascript(this.returnExpression, TokenID.Semicolon, false);
|
|
>emitter.emitJavascript(this.returnExpression, TokenID.Semicolon, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.returnExpression : AST
|
|
>this : this
|
|
>returnExpression : AST
|
|
>TokenID.Semicolon : any
|
|
>TokenID : any
|
|
>Semicolon : any
|
|
>false : false
|
|
}
|
|
else {
|
|
emitter.writeToOutput("return;");
|
|
>emitter.writeToOutput("return;") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"return;" : "return;"
|
|
}
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
super.addToControlFlow(context);
|
|
>super.addToControlFlow(context) : void
|
|
>super.addToControlFlow : (context: ControlFlowContext) => void
|
|
>super : Statement
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
context.returnStmt();
|
|
>context.returnStmt() : any
|
|
>context.returnStmt : any
|
|
>context : ControlFlowContext
|
|
>returnStmt : any
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckReturn(this);
|
|
>typeFlow.typeCheckReturn(this) : any
|
|
>typeFlow.typeCheckReturn : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckReturn : any
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class EndCode extends AST {
|
|
>EndCode : EndCode
|
|
>AST : AST
|
|
|
|
constructor () {
|
|
super(NodeType.EndCode);
|
|
>super(NodeType.EndCode) : void
|
|
>super : typeof AST
|
|
>NodeType.EndCode : any
|
|
>NodeType : any
|
|
>EndCode : any
|
|
}
|
|
}
|
|
|
|
export class ForInStatement extends Statement {
|
|
>ForInStatement : ForInStatement
|
|
>Statement : Statement
|
|
|
|
constructor (public lval: AST, public obj: AST) {
|
|
>lval : AST
|
|
>obj : AST
|
|
|
|
super(NodeType.ForIn);
|
|
>super(NodeType.ForIn) : void
|
|
>super : typeof Statement
|
|
>NodeType.ForIn : any
|
|
>NodeType : any
|
|
>ForIn : any
|
|
|
|
if (this.lval && (this.lval.nodeType == NodeType.VarDecl)) {
|
|
>this.lval && (this.lval.nodeType == NodeType.VarDecl) : boolean
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
>(this.lval.nodeType == NodeType.VarDecl) : boolean
|
|
>this.lval.nodeType == NodeType.VarDecl : boolean
|
|
>this.lval.nodeType : NodeType
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
>nodeType : NodeType
|
|
>NodeType.VarDecl : any
|
|
>NodeType : any
|
|
>VarDecl : any
|
|
|
|
(<BoundDecl>this.lval).varFlags |= VarFlags.AutoInit;
|
|
>(<BoundDecl>this.lval).varFlags |= VarFlags.AutoInit : number
|
|
>(<BoundDecl>this.lval).varFlags : any
|
|
>(<BoundDecl>this.lval) : BoundDecl
|
|
><BoundDecl>this.lval : BoundDecl
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
>varFlags : any
|
|
>VarFlags.AutoInit : any
|
|
>VarFlags : any
|
|
>AutoInit : any
|
|
}
|
|
}
|
|
public statement: ASTSpan = new ASTSpan();
|
|
>statement : ASTSpan
|
|
>new ASTSpan() : ASTSpan
|
|
>ASTSpan : typeof ASTSpan
|
|
|
|
public body: AST;
|
|
>body : AST
|
|
|
|
public isLoop() { return true; }
|
|
>isLoop : () => boolean
|
|
>true : true
|
|
|
|
public isFiltered() {
|
|
>isFiltered : () => boolean
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
var singleItem: AST = null;
|
|
>singleItem : AST
|
|
>null : null
|
|
|
|
if (this.body.nodeType == NodeType.List) {
|
|
>this.body.nodeType == NodeType.List : boolean
|
|
>this.body.nodeType : NodeType
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>nodeType : NodeType
|
|
>NodeType.List : any
|
|
>NodeType : any
|
|
>List : any
|
|
|
|
var stmts = <ASTList>this.body;
|
|
>stmts : ASTList
|
|
><ASTList>this.body : ASTList
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
if (stmts.members.length == 1) {
|
|
>stmts.members.length == 1 : boolean
|
|
>stmts.members.length : number
|
|
>stmts.members : AST[]
|
|
>stmts : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>1 : 1
|
|
|
|
singleItem = stmts.members[0];
|
|
>singleItem = stmts.members[0] : AST
|
|
>singleItem : AST
|
|
>stmts.members[0] : AST
|
|
>stmts.members : AST[]
|
|
>stmts : ASTList
|
|
>members : AST[]
|
|
>0 : 0
|
|
}
|
|
}
|
|
else {
|
|
singleItem = this.body;
|
|
>singleItem = this.body : AST
|
|
>singleItem : AST
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
}
|
|
// match template for filtering 'own' properties from obj
|
|
if (singleItem !== null) {
|
|
>singleItem !== null : boolean
|
|
>singleItem : AST
|
|
>null : null
|
|
|
|
if (singleItem.nodeType == NodeType.Block) {
|
|
>singleItem.nodeType == NodeType.Block : boolean
|
|
>singleItem.nodeType : NodeType
|
|
>singleItem : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Block : any
|
|
>NodeType : any
|
|
>Block : any
|
|
|
|
var block = <Block>singleItem;
|
|
>block : Block
|
|
><Block>singleItem : Block
|
|
>singleItem : AST
|
|
|
|
if ((block.statements !== null) && (block.statements.members.length == 1)) {
|
|
>(block.statements !== null) && (block.statements.members.length == 1) : boolean
|
|
>(block.statements !== null) : boolean
|
|
>block.statements !== null : boolean
|
|
>block.statements : ASTList
|
|
>block : Block
|
|
>statements : ASTList
|
|
>null : null
|
|
>(block.statements.members.length == 1) : boolean
|
|
>block.statements.members.length == 1 : boolean
|
|
>block.statements.members.length : number
|
|
>block.statements.members : AST[]
|
|
>block.statements : ASTList
|
|
>block : Block
|
|
>statements : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>1 : 1
|
|
|
|
singleItem = block.statements.members[0];
|
|
>singleItem = block.statements.members[0] : AST
|
|
>singleItem : AST
|
|
>block.statements.members[0] : AST
|
|
>block.statements.members : AST[]
|
|
>block.statements : ASTList
|
|
>block : Block
|
|
>statements : ASTList
|
|
>members : AST[]
|
|
>0 : 0
|
|
}
|
|
}
|
|
if (singleItem.nodeType == NodeType.If) {
|
|
>singleItem.nodeType == NodeType.If : boolean
|
|
>singleItem.nodeType : NodeType
|
|
>singleItem : AST
|
|
>nodeType : NodeType
|
|
>NodeType.If : any
|
|
>NodeType : any
|
|
>If : any
|
|
|
|
var cond = (<IfStatement>singleItem).cond;
|
|
>cond : AST
|
|
>(<IfStatement>singleItem).cond : AST
|
|
>(<IfStatement>singleItem) : IfStatement
|
|
><IfStatement>singleItem : IfStatement
|
|
>singleItem : AST
|
|
>cond : AST
|
|
|
|
if (cond.nodeType == NodeType.Call) {
|
|
>cond.nodeType == NodeType.Call : boolean
|
|
>cond.nodeType : NodeType
|
|
>cond : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Call : any
|
|
>NodeType : any
|
|
>Call : any
|
|
|
|
var target = (<CallExpression>cond).target;
|
|
>target : AST
|
|
>(<CallExpression>cond).target : AST
|
|
>(<CallExpression>cond) : CallExpression
|
|
><CallExpression>cond : CallExpression
|
|
>cond : AST
|
|
>target : AST
|
|
|
|
if (target.nodeType == NodeType.Dot) {
|
|
>target.nodeType == NodeType.Dot : boolean
|
|
>target.nodeType : NodeType
|
|
>target : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Dot : any
|
|
>NodeType : any
|
|
>Dot : any
|
|
|
|
var binex = <BinaryExpression>target;
|
|
>binex : BinaryExpression
|
|
><BinaryExpression>target : BinaryExpression
|
|
>target : AST
|
|
|
|
if ((binex.operand1.nodeType == NodeType.Name) &&
|
|
>(binex.operand1.nodeType == NodeType.Name) && (this.obj.nodeType == NodeType.Name) && ((<Identifier>binex.operand1).actualText == (<Identifier>this.obj).actualText) : boolean
|
|
>(binex.operand1.nodeType == NodeType.Name) && (this.obj.nodeType == NodeType.Name) : boolean
|
|
>(binex.operand1.nodeType == NodeType.Name) : boolean
|
|
>binex.operand1.nodeType == NodeType.Name : boolean
|
|
>binex.operand1.nodeType : NodeType
|
|
>binex.operand1 : AST
|
|
>binex : BinaryExpression
|
|
>operand1 : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
(this.obj.nodeType == NodeType.Name) &&
|
|
>(this.obj.nodeType == NodeType.Name) : boolean
|
|
>this.obj.nodeType == NodeType.Name : boolean
|
|
>this.obj.nodeType : NodeType
|
|
>this.obj : AST
|
|
>this : this
|
|
>obj : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
((<Identifier>binex.operand1).actualText == (<Identifier>this.obj).actualText)) {
|
|
>((<Identifier>binex.operand1).actualText == (<Identifier>this.obj).actualText) : boolean
|
|
>(<Identifier>binex.operand1).actualText == (<Identifier>this.obj).actualText : boolean
|
|
>(<Identifier>binex.operand1).actualText : string
|
|
>(<Identifier>binex.operand1) : Identifier
|
|
><Identifier>binex.operand1 : Identifier
|
|
>binex.operand1 : AST
|
|
>binex : BinaryExpression
|
|
>operand1 : AST
|
|
>actualText : string
|
|
>(<Identifier>this.obj).actualText : string
|
|
>(<Identifier>this.obj) : Identifier
|
|
><Identifier>this.obj : Identifier
|
|
>this.obj : AST
|
|
>this : this
|
|
>obj : AST
|
|
>actualText : string
|
|
|
|
var prop = <Identifier>binex.operand2;
|
|
>prop : Identifier
|
|
><Identifier>binex.operand2 : Identifier
|
|
>binex.operand2 : AST
|
|
>binex : BinaryExpression
|
|
>operand2 : AST
|
|
|
|
if (prop.actualText == "hasOwnProperty") {
|
|
>prop.actualText == "hasOwnProperty" : boolean
|
|
>prop.actualText : string
|
|
>prop : Identifier
|
|
>actualText : string
|
|
>"hasOwnProperty" : "hasOwnProperty"
|
|
|
|
var args = (<CallExpression>cond).arguments;
|
|
>args : ASTList
|
|
>(<CallExpression>cond).arguments : ASTList
|
|
>(<CallExpression>cond) : CallExpression
|
|
><CallExpression>cond : CallExpression
|
|
>cond : AST
|
|
>arguments : ASTList
|
|
|
|
if ((args !== null) && (args.members.length == 1)) {
|
|
>(args !== null) && (args.members.length == 1) : boolean
|
|
>(args !== null) : boolean
|
|
>args !== null : boolean
|
|
>args : ASTList
|
|
>null : null
|
|
>(args.members.length == 1) : boolean
|
|
>args.members.length == 1 : boolean
|
|
>args.members.length : number
|
|
>args.members : AST[]
|
|
>args : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
>1 : 1
|
|
|
|
var arg = args.members[0];
|
|
>arg : AST
|
|
>args.members[0] : AST
|
|
>args.members : AST[]
|
|
>args : ASTList
|
|
>members : AST[]
|
|
>0 : 0
|
|
|
|
if ((arg.nodeType == NodeType.Name) &&
|
|
>(arg.nodeType == NodeType.Name) && (this.lval.nodeType == NodeType.Name) : boolean
|
|
>(arg.nodeType == NodeType.Name) : boolean
|
|
>arg.nodeType == NodeType.Name : boolean
|
|
>arg.nodeType : NodeType
|
|
>arg : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
(this.lval.nodeType == NodeType.Name)) {
|
|
>(this.lval.nodeType == NodeType.Name) : boolean
|
|
>this.lval.nodeType == NodeType.Name : boolean
|
|
>this.lval.nodeType : NodeType
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
>nodeType : NodeType
|
|
>NodeType.Name : any
|
|
>NodeType : any
|
|
>Name : any
|
|
|
|
if (((<Identifier>this.lval).actualText) == (<Identifier>arg).actualText) {
|
|
>((<Identifier>this.lval).actualText) == (<Identifier>arg).actualText : boolean
|
|
>((<Identifier>this.lval).actualText) : string
|
|
>(<Identifier>this.lval).actualText : string
|
|
>(<Identifier>this.lval) : Identifier
|
|
><Identifier>this.lval : Identifier
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
>actualText : string
|
|
>(<Identifier>arg).actualText : string
|
|
>(<Identifier>arg) : Identifier
|
|
><Identifier>arg : Identifier
|
|
>arg : AST
|
|
>actualText : string
|
|
|
|
return true;
|
|
>true : true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
>false : false
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingStart(this.statement);
|
|
>emitter.recordSourceMappingStart(this.statement) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.writeToOutput("for(");
|
|
>emitter.writeToOutput("for(") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"for(" : "for("
|
|
|
|
emitter.emitJavascript(this.lval, TokenID.For, false);
|
|
>emitter.emitJavascript(this.lval, TokenID.For, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
>TokenID.For : any
|
|
>TokenID : any
|
|
>For : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(" in ");
|
|
>emitter.writeToOutput(" in ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" in " : " in "
|
|
|
|
emitter.emitJavascript(this.obj, TokenID.For, false);
|
|
>emitter.emitJavascript(this.obj, TokenID.For, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.obj : AST
|
|
>this : this
|
|
>obj : AST
|
|
>TokenID.For : any
|
|
>TokenID : any
|
|
>For : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.recordSourceMappingEnd(this.statement);
|
|
>emitter.recordSourceMappingEnd(this.statement) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.emitJavascriptStatements(this.body, true, false);
|
|
>emitter.emitJavascriptStatements(this.body, true, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>true : true
|
|
>false : false
|
|
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
if (typeFlow.checker.styleSettings.forin) {
|
|
>typeFlow.checker.styleSettings.forin : any
|
|
>typeFlow.checker.styleSettings : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>styleSettings : any
|
|
>forin : any
|
|
|
|
if (!this.isFiltered()) {
|
|
>!this.isFiltered() : boolean
|
|
>this.isFiltered() : boolean
|
|
>this.isFiltered : () => boolean
|
|
>this : this
|
|
>isFiltered : () => boolean
|
|
|
|
typeFlow.checker.errorReporter.styleError(this, "no hasOwnProperty filter");
|
|
>typeFlow.checker.errorReporter.styleError(this, "no hasOwnProperty filter") : any
|
|
>typeFlow.checker.errorReporter.styleError : any
|
|
>typeFlow.checker.errorReporter : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>errorReporter : any
|
|
>styleError : any
|
|
>this : this
|
|
>"no hasOwnProperty filter" : "no hasOwnProperty filter"
|
|
}
|
|
}
|
|
return typeFlow.typeCheckForIn(this);
|
|
>typeFlow.typeCheckForIn(this) : any
|
|
>typeFlow.typeCheckForIn : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckForIn : any
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
if (this.lval) {
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
|
|
context.addContent(this.lval);
|
|
>context.addContent(this.lval) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.lval : AST
|
|
>this : this
|
|
>lval : AST
|
|
}
|
|
if (this.obj) {
|
|
>this.obj : AST
|
|
>this : this
|
|
>obj : AST
|
|
|
|
context.addContent(this.obj);
|
|
>context.addContent(this.obj) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.obj : AST
|
|
>this : this
|
|
>obj : AST
|
|
}
|
|
|
|
var loopHeader = context.current;
|
|
>loopHeader : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var loopStart = new BasicBlock();
|
|
>loopStart : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var afterLoop = new BasicBlock();
|
|
>afterLoop : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
loopHeader.addSuccessor(loopStart);
|
|
>loopHeader.addSuccessor(loopStart) : any
|
|
>loopHeader.addSuccessor : any
|
|
>loopHeader : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
|
|
context.current = loopStart;
|
|
>context.current = loopStart : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>loopStart : any
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.pushStatement(this, loopStart, afterLoop);
|
|
>context.pushStatement(this, loopStart, afterLoop) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>loopStart : any
|
|
>afterLoop : any
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
|
|
context.popStatement();
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
}
|
|
if (!(context.noContinuation)) {
|
|
>!(context.noContinuation) : boolean
|
|
>(context.noContinuation) : any
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
var loopEnd = context.current;
|
|
>loopEnd : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
loopEnd.addSuccessor(loopStart);
|
|
>loopEnd.addSuccessor(loopStart) : any
|
|
>loopEnd.addSuccessor : any
|
|
>loopEnd : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
}
|
|
context.current = afterLoop;
|
|
>context.current = afterLoop : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterLoop : any
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
loopHeader.addSuccessor(afterLoop);
|
|
>loopHeader.addSuccessor(afterLoop) : any
|
|
>loopHeader.addSuccessor : any
|
|
>loopHeader : any
|
|
>addSuccessor : any
|
|
>afterLoop : any
|
|
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class ForStatement extends Statement {
|
|
>ForStatement : ForStatement
|
|
>Statement : Statement
|
|
|
|
public cond: AST;
|
|
>cond : AST
|
|
|
|
public body: AST;
|
|
>body : AST
|
|
|
|
public incr: AST;
|
|
>incr : AST
|
|
|
|
constructor (public init: AST) {
|
|
>init : AST
|
|
|
|
super(NodeType.For);
|
|
>super(NodeType.For) : void
|
|
>super : typeof Statement
|
|
>NodeType.For : any
|
|
>NodeType : any
|
|
>For : any
|
|
}
|
|
|
|
public isLoop() { return true; }
|
|
>isLoop : () => boolean
|
|
>true : true
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput("for(");
|
|
>emitter.writeToOutput("for(") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"for(" : "for("
|
|
|
|
if (this.init) {
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
|
|
if (this.init.nodeType != NodeType.List) {
|
|
>this.init.nodeType != NodeType.List : boolean
|
|
>this.init.nodeType : NodeType
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
>nodeType : NodeType
|
|
>NodeType.List : any
|
|
>NodeType : any
|
|
>List : any
|
|
|
|
emitter.emitJavascript(this.init, TokenID.For, false);
|
|
>emitter.emitJavascript(this.init, TokenID.For, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
>TokenID.For : any
|
|
>TokenID : any
|
|
>For : any
|
|
>false : false
|
|
}
|
|
else {
|
|
emitter.setInVarBlock((<ASTList>this.init).members.length);
|
|
>emitter.setInVarBlock((<ASTList>this.init).members.length) : any
|
|
>emitter.setInVarBlock : any
|
|
>emitter : Emitter
|
|
>setInVarBlock : any
|
|
>(<ASTList>this.init).members.length : number
|
|
>(<ASTList>this.init).members : AST[]
|
|
>(<ASTList>this.init) : ASTList
|
|
><ASTList>this.init : ASTList
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
>members : AST[]
|
|
>length : number
|
|
|
|
emitter.emitJavascriptList(this.init, null, TokenID.For, false, false, false);
|
|
>emitter.emitJavascriptList(this.init, null, TokenID.For, false, false, false) : any
|
|
>emitter.emitJavascriptList : any
|
|
>emitter : Emitter
|
|
>emitJavascriptList : any
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
>null : null
|
|
>TokenID.For : any
|
|
>TokenID : any
|
|
>For : any
|
|
>false : false
|
|
>false : false
|
|
>false : false
|
|
}
|
|
}
|
|
emitter.writeToOutput("; ");
|
|
>emitter.writeToOutput("; ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"; " : "; "
|
|
|
|
emitter.emitJavascript(this.cond, TokenID.For, false);
|
|
>emitter.emitJavascript(this.cond, TokenID.For, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
>TokenID.For : any
|
|
>TokenID : any
|
|
>For : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput("; ");
|
|
>emitter.writeToOutput("; ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"; " : "; "
|
|
|
|
emitter.emitJavascript(this.incr, TokenID.For, false);
|
|
>emitter.emitJavascript(this.incr, TokenID.For, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.incr : AST
|
|
>this : this
|
|
>incr : AST
|
|
>TokenID.For : any
|
|
>TokenID : any
|
|
>For : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.emitJavascriptStatements(this.body, true, false);
|
|
>emitter.emitJavascriptStatements(this.body, true, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>true : true
|
|
>false : false
|
|
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckFor(this);
|
|
>typeFlow.typeCheckFor(this) : any
|
|
>typeFlow.typeCheckFor : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckFor : any
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext): void {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
if (this.init) {
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
|
|
context.addContent(this.init);
|
|
>context.addContent(this.init) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.init : AST
|
|
>this : this
|
|
>init : AST
|
|
}
|
|
var loopHeader = context.current;
|
|
>loopHeader : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var loopStart = new BasicBlock();
|
|
>loopStart : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var afterLoop = new BasicBlock();
|
|
>afterLoop : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
loopHeader.addSuccessor(loopStart);
|
|
>loopHeader.addSuccessor(loopStart) : any
|
|
>loopHeader.addSuccessor : any
|
|
>loopHeader : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
|
|
context.current = loopStart;
|
|
>context.current = loopStart : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>loopStart : any
|
|
|
|
var condBlock: BasicBlock = null;
|
|
>condBlock : BasicBlock
|
|
>null : null
|
|
|
|
var continueTarget = loopStart;
|
|
>continueTarget : any
|
|
>loopStart : any
|
|
|
|
var incrBB: BasicBlock = null;
|
|
>incrBB : BasicBlock
|
|
>null : null
|
|
|
|
if (this.incr) {
|
|
>this.incr : AST
|
|
>this : this
|
|
>incr : AST
|
|
|
|
incrBB = new BasicBlock();
|
|
>incrBB = new BasicBlock() : any
|
|
>incrBB : BasicBlock
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
continueTarget = incrBB;
|
|
>continueTarget = incrBB : BasicBlock
|
|
>continueTarget : any
|
|
>incrBB : BasicBlock
|
|
}
|
|
if (this.cond) {
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
|
|
condBlock = context.current;
|
|
>condBlock = context.current : any
|
|
>condBlock : BasicBlock
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.addContent(this.cond);
|
|
>context.addContent(this.cond) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.cond : AST
|
|
>this : this
|
|
>cond : AST
|
|
|
|
context.current = new BasicBlock();
|
|
>context.current = new BasicBlock() : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
condBlock.addSuccessor(context.current);
|
|
>condBlock.addSuccessor(context.current) : any
|
|
>condBlock.addSuccessor : any
|
|
>condBlock : BasicBlock
|
|
>addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
}
|
|
var targetInfo: ITargetInfo = null;
|
|
>targetInfo : ITargetInfo
|
|
>null : null
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.pushStatement(this, continueTarget, afterLoop);
|
|
>context.pushStatement(this, continueTarget, afterLoop) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>continueTarget : any
|
|
>afterLoop : any
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
|
|
targetInfo = context.popStatement();
|
|
>targetInfo = context.popStatement() : any
|
|
>targetInfo : ITargetInfo
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
}
|
|
if (this.incr) {
|
|
>this.incr : AST
|
|
>this : this
|
|
>incr : AST
|
|
|
|
if (context.noContinuation) {
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
if (incrBB.predecessors.length == 0) {
|
|
>incrBB.predecessors.length == 0 : boolean
|
|
>incrBB.predecessors.length : any
|
|
>incrBB.predecessors : any
|
|
>incrBB : BasicBlock
|
|
>predecessors : any
|
|
>length : any
|
|
>0 : 0
|
|
|
|
context.addUnreachable(this.incr);
|
|
>context.addUnreachable(this.incr) : any
|
|
>context.addUnreachable : any
|
|
>context : ControlFlowContext
|
|
>addUnreachable : any
|
|
>this.incr : AST
|
|
>this : this
|
|
>incr : AST
|
|
}
|
|
}
|
|
else {
|
|
context.current.addSuccessor(incrBB);
|
|
>context.current.addSuccessor(incrBB) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>incrBB : BasicBlock
|
|
|
|
context.current = incrBB;
|
|
>context.current = incrBB : BasicBlock
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>incrBB : BasicBlock
|
|
|
|
context.addContent(this.incr);
|
|
>context.addContent(this.incr) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.incr : AST
|
|
>this : this
|
|
>incr : AST
|
|
}
|
|
}
|
|
var loopEnd = context.current;
|
|
>loopEnd : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
if (!(context.noContinuation)) {
|
|
>!(context.noContinuation) : boolean
|
|
>(context.noContinuation) : any
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
loopEnd.addSuccessor(loopStart);
|
|
>loopEnd.addSuccessor(loopStart) : any
|
|
>loopEnd.addSuccessor : any
|
|
>loopEnd : any
|
|
>addSuccessor : any
|
|
>loopStart : any
|
|
|
|
}
|
|
if (condBlock) {
|
|
>condBlock : BasicBlock
|
|
|
|
condBlock.addSuccessor(afterLoop);
|
|
>condBlock.addSuccessor(afterLoop) : any
|
|
>condBlock.addSuccessor : any
|
|
>condBlock : BasicBlock
|
|
>addSuccessor : any
|
|
>afterLoop : any
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
}
|
|
if (afterLoop.predecessors.length > 0) {
|
|
>afterLoop.predecessors.length > 0 : boolean
|
|
>afterLoop.predecessors.length : any
|
|
>afterLoop.predecessors : any
|
|
>afterLoop : any
|
|
>predecessors : any
|
|
>length : any
|
|
>0 : 0
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
context.current = afterLoop;
|
|
>context.current = afterLoop : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterLoop : any
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class WithStatement extends Statement {
|
|
>WithStatement : WithStatement
|
|
>Statement : Statement
|
|
|
|
public body: AST;
|
|
>body : AST
|
|
|
|
public isCompoundStatement() { return true; }
|
|
>isCompoundStatement : () => boolean
|
|
>true : true
|
|
|
|
public withSym: WithSymbol = null;
|
|
>withSym : WithSymbol
|
|
>null : null
|
|
|
|
constructor (public expr: AST) {
|
|
>expr : AST
|
|
|
|
super(NodeType.With);
|
|
>super(NodeType.With) : void
|
|
>super : typeof Statement
|
|
>NodeType.With : any
|
|
>NodeType : any
|
|
>With : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("with (");
|
|
>emitter.writeToOutput("with (") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"with (" : "with ("
|
|
|
|
if (this.expr) {
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
|
|
emitter.emitJavascript(this.expr, TokenID.With, false);
|
|
>emitter.emitJavascript(this.expr, TokenID.With, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
>TokenID.With : any
|
|
>TokenID : any
|
|
>With : any
|
|
>false : false
|
|
}
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.emitJavascriptStatements(this.body, true, false);
|
|
>emitter.emitJavascriptStatements(this.body, true, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>true : true
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => any
|
|
>typeFlow : TypeFlow
|
|
|
|
return typeFlow.typeCheckWith(this);
|
|
>typeFlow.typeCheckWith(this) : any
|
|
>typeFlow.typeCheckWith : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheckWith : any
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class SwitchStatement extends Statement {
|
|
>SwitchStatement : SwitchStatement
|
|
>Statement : Statement
|
|
|
|
public caseList: ASTList;
|
|
>caseList : ASTList
|
|
|
|
public defaultCase: CaseStatement = null;
|
|
>defaultCase : CaseStatement
|
|
>null : null
|
|
|
|
public statement: ASTSpan = new ASTSpan();
|
|
>statement : ASTSpan
|
|
>new ASTSpan() : ASTSpan
|
|
>ASTSpan : typeof ASTSpan
|
|
|
|
constructor (public val: AST) {
|
|
>val : AST
|
|
|
|
super(NodeType.Switch);
|
|
>super(NodeType.Switch) : void
|
|
>super : typeof Statement
|
|
>NodeType.Switch : any
|
|
>NodeType : any
|
|
>Switch : any
|
|
}
|
|
|
|
public isCompoundStatement() { return true; }
|
|
>isCompoundStatement : () => boolean
|
|
>true : true
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
var temp = emitter.setInObjectLiteral(false);
|
|
>temp : any
|
|
>emitter.setInObjectLiteral(false) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingStart(this.statement);
|
|
>emitter.recordSourceMappingStart(this.statement) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.writeToOutput("switch(");
|
|
>emitter.writeToOutput("switch(") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"switch(" : "switch("
|
|
|
|
emitter.emitJavascript(this.val, TokenID.Identifier, false);
|
|
>emitter.emitJavascript(this.val, TokenID.Identifier, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.val : AST
|
|
>this : this
|
|
>val : AST
|
|
>TokenID.Identifier : any
|
|
>TokenID : any
|
|
>Identifier : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.recordSourceMappingEnd(this.statement);
|
|
>emitter.recordSourceMappingEnd(this.statement) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.writeLineToOutput(" {");
|
|
>emitter.writeLineToOutput(" {") : any
|
|
>emitter.writeLineToOutput : any
|
|
>emitter : Emitter
|
|
>writeLineToOutput : any
|
|
>" {" : " {"
|
|
|
|
emitter.indenter.increaseIndent();
|
|
>emitter.indenter.increaseIndent() : any
|
|
>emitter.indenter.increaseIndent : any
|
|
>emitter.indenter : any
|
|
>emitter : Emitter
|
|
>indenter : any
|
|
>increaseIndent : any
|
|
|
|
var casesLen = this.caseList.members.length;
|
|
>casesLen : number
|
|
>this.caseList.members.length : number
|
|
>this.caseList.members : AST[]
|
|
>this.caseList : ASTList
|
|
>this : this
|
|
>caseList : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
|
|
for (var i = 0; i < casesLen; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>i < casesLen : boolean
|
|
>i : number
|
|
>casesLen : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
var caseExpr = this.caseList.members[i];
|
|
>caseExpr : AST
|
|
>this.caseList.members[i] : AST
|
|
>this.caseList.members : AST[]
|
|
>this.caseList : ASTList
|
|
>this : this
|
|
>caseList : ASTList
|
|
>members : AST[]
|
|
>i : number
|
|
|
|
emitter.emitJavascript(caseExpr, TokenID.Case, true);
|
|
>emitter.emitJavascript(caseExpr, TokenID.Case, true) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>caseExpr : AST
|
|
>TokenID.Case : any
|
|
>TokenID : any
|
|
>Case : any
|
|
>true : true
|
|
|
|
emitter.writeLineToOutput("");
|
|
>emitter.writeLineToOutput("") : any
|
|
>emitter.writeLineToOutput : any
|
|
>emitter : Emitter
|
|
>writeLineToOutput : any
|
|
>"" : ""
|
|
}
|
|
emitter.indenter.decreaseIndent();
|
|
>emitter.indenter.decreaseIndent() : any
|
|
>emitter.indenter.decreaseIndent : any
|
|
>emitter.indenter : any
|
|
>emitter : Emitter
|
|
>indenter : any
|
|
>decreaseIndent : any
|
|
|
|
emitter.emitIndent();
|
|
>emitter.emitIndent() : any
|
|
>emitter.emitIndent : any
|
|
>emitter : Emitter
|
|
>emitIndent : any
|
|
|
|
emitter.writeToOutput("}");
|
|
>emitter.writeToOutput("}") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"}" : "}"
|
|
|
|
emitter.setInObjectLiteral(temp);
|
|
>emitter.setInObjectLiteral(temp) : any
|
|
>emitter.setInObjectLiteral : any
|
|
>emitter : Emitter
|
|
>setInObjectLiteral : any
|
|
>temp : any
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
var len = this.caseList.members.length;
|
|
>len : number
|
|
>this.caseList.members.length : number
|
|
>this.caseList.members : AST[]
|
|
>this.caseList : ASTList
|
|
>this : this
|
|
>caseList : ASTList
|
|
>members : AST[]
|
|
>length : number
|
|
|
|
this.val = typeFlow.typeCheck(this.val);
|
|
>this.val = typeFlow.typeCheck(this.val) : any
|
|
>this.val : AST
|
|
>this : this
|
|
>val : AST
|
|
>typeFlow.typeCheck(this.val) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.val : AST
|
|
>this : this
|
|
>val : AST
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>i < len : boolean
|
|
>i : number
|
|
>len : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
this.caseList.members[i] = typeFlow.typeCheck(this.caseList.members[i]);
|
|
>this.caseList.members[i] = typeFlow.typeCheck(this.caseList.members[i]) : any
|
|
>this.caseList.members[i] : AST
|
|
>this.caseList.members : AST[]
|
|
>this.caseList : ASTList
|
|
>this : this
|
|
>caseList : ASTList
|
|
>members : AST[]
|
|
>i : number
|
|
>typeFlow.typeCheck(this.caseList.members[i]) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.caseList.members[i] : AST
|
|
>this.caseList.members : AST[]
|
|
>this.caseList : ASTList
|
|
>this : this
|
|
>caseList : ASTList
|
|
>members : AST[]
|
|
>i : number
|
|
}
|
|
this.defaultCase = <CaseStatement>typeFlow.typeCheck(this.defaultCase);
|
|
>this.defaultCase = <CaseStatement>typeFlow.typeCheck(this.defaultCase) : CaseStatement
|
|
>this.defaultCase : CaseStatement
|
|
>this : this
|
|
>defaultCase : CaseStatement
|
|
><CaseStatement>typeFlow.typeCheck(this.defaultCase) : CaseStatement
|
|
>typeFlow.typeCheck(this.defaultCase) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.defaultCase : CaseStatement
|
|
>this : this
|
|
>defaultCase : CaseStatement
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
// if there are break statements that match this switch, then just link cond block with block after switch
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var condBlock = context.current;
|
|
>condBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.addContent(this.val);
|
|
>context.addContent(this.val) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.val : AST
|
|
>this : this
|
|
>val : AST
|
|
|
|
var execBlock = new BasicBlock();
|
|
>execBlock : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var afterSwitch = new BasicBlock();
|
|
>afterSwitch : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
condBlock.addSuccessor(execBlock);
|
|
>condBlock.addSuccessor(execBlock) : any
|
|
>condBlock.addSuccessor : any
|
|
>condBlock : any
|
|
>addSuccessor : any
|
|
>execBlock : any
|
|
|
|
context.pushSwitch(execBlock);
|
|
>context.pushSwitch(execBlock) : any
|
|
>context.pushSwitch : any
|
|
>context : ControlFlowContext
|
|
>pushSwitch : any
|
|
>execBlock : any
|
|
|
|
context.current = execBlock;
|
|
>context.current = execBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>execBlock : any
|
|
|
|
context.pushStatement(this, execBlock, afterSwitch);
|
|
>context.pushStatement(this, execBlock, afterSwitch) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>execBlock : any
|
|
>afterSwitch : any
|
|
|
|
context.walk(this.caseList, this);
|
|
>context.walk(this.caseList, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.caseList : ASTList
|
|
>this : this
|
|
>caseList : ASTList
|
|
>this : this
|
|
|
|
context.popSwitch();
|
|
>context.popSwitch() : any
|
|
>context.popSwitch : any
|
|
>context : ControlFlowContext
|
|
>popSwitch : any
|
|
|
|
var targetInfo = context.popStatement();
|
|
>targetInfo : any
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
|
|
var hasCondContinuation = (this.defaultCase == null);
|
|
>hasCondContinuation : boolean
|
|
>(this.defaultCase == null) : boolean
|
|
>this.defaultCase == null : boolean
|
|
>this.defaultCase : CaseStatement
|
|
>this : this
|
|
>defaultCase : CaseStatement
|
|
>null : null
|
|
|
|
if (this.defaultCase == null) {
|
|
>this.defaultCase == null : boolean
|
|
>this.defaultCase : CaseStatement
|
|
>this : this
|
|
>defaultCase : CaseStatement
|
|
>null : null
|
|
|
|
condBlock.addSuccessor(afterSwitch);
|
|
>condBlock.addSuccessor(afterSwitch) : any
|
|
>condBlock.addSuccessor : any
|
|
>condBlock : any
|
|
>addSuccessor : any
|
|
>afterSwitch : any
|
|
}
|
|
if (afterSwitch.predecessors.length > 0) {
|
|
>afterSwitch.predecessors.length > 0 : boolean
|
|
>afterSwitch.predecessors.length : any
|
|
>afterSwitch.predecessors : any
|
|
>afterSwitch : any
|
|
>predecessors : any
|
|
>length : any
|
|
>0 : 0
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
context.current = afterSwitch;
|
|
>context.current = afterSwitch : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterSwitch : any
|
|
}
|
|
else {
|
|
context.noContinuation = true;
|
|
>context.noContinuation = true : true
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>true : true
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class CaseStatement extends Statement {
|
|
>CaseStatement : CaseStatement
|
|
>Statement : Statement
|
|
|
|
public expr: AST = null;
|
|
>expr : AST
|
|
>null : null
|
|
|
|
public body: ASTList;
|
|
>body : ASTList
|
|
|
|
constructor () {
|
|
super(NodeType.Case);
|
|
>super(NodeType.Case) : void
|
|
>super : typeof Statement
|
|
>NodeType.Case : any
|
|
>NodeType : any
|
|
>Case : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
if (this.expr) {
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
|
|
emitter.writeToOutput("case ");
|
|
>emitter.writeToOutput("case ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"case " : "case "
|
|
|
|
emitter.emitJavascript(this.expr, TokenID.Identifier, false);
|
|
>emitter.emitJavascript(this.expr, TokenID.Identifier, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
>TokenID.Identifier : any
|
|
>TokenID : any
|
|
>Identifier : any
|
|
>false : false
|
|
}
|
|
else {
|
|
emitter.writeToOutput("default");
|
|
>emitter.writeToOutput("default") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"default" : "default"
|
|
}
|
|
emitter.writeToOutput(":");
|
|
>emitter.writeToOutput(":") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>":" : ":"
|
|
|
|
emitter.emitJavascriptStatements(this.body, false, false);
|
|
>emitter.emitJavascriptStatements(this.body, false, false) : any
|
|
>emitter.emitJavascriptStatements : any
|
|
>emitter : Emitter
|
|
>emitJavascriptStatements : any
|
|
>this.body : ASTList
|
|
>this : this
|
|
>body : ASTList
|
|
>false : false
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.expr = typeFlow.typeCheck(this.expr);
|
|
>this.expr = typeFlow.typeCheck(this.expr) : any
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
>typeFlow.typeCheck(this.expr) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
|
|
typeFlow.typeCheck(this.body);
|
|
>typeFlow.typeCheck(this.body) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.body : ASTList
|
|
>this : this
|
|
>body : ASTList
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
// TODO: more reasoning about unreachable cases (such as duplicate literals as case expressions)
|
|
// for now, assume all cases are reachable, regardless of whether some cases fall through
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var execBlock = new BasicBlock();
|
|
>execBlock : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
var sw = context.currentSwitch[context.currentSwitch.length - 1];
|
|
>sw : any
|
|
>context.currentSwitch[context.currentSwitch.length - 1] : any
|
|
>context.currentSwitch : any
|
|
>context : ControlFlowContext
|
|
>currentSwitch : any
|
|
>context.currentSwitch.length - 1 : number
|
|
>context.currentSwitch.length : any
|
|
>context.currentSwitch : any
|
|
>context : ControlFlowContext
|
|
>currentSwitch : any
|
|
>length : any
|
|
>1 : 1
|
|
|
|
// TODO: fall-through from previous (+ to end of switch)
|
|
if (this.expr) {
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
|
|
var exprBlock = new BasicBlock();
|
|
>exprBlock : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.current = exprBlock;
|
|
>context.current = exprBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>exprBlock : any
|
|
|
|
sw.addSuccessor(exprBlock);
|
|
>sw.addSuccessor(exprBlock) : any
|
|
>sw.addSuccessor : any
|
|
>sw : any
|
|
>addSuccessor : any
|
|
>exprBlock : any
|
|
|
|
context.addContent(this.expr);
|
|
>context.addContent(this.expr) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.expr : AST
|
|
>this : this
|
|
>expr : AST
|
|
|
|
exprBlock.addSuccessor(execBlock);
|
|
>exprBlock.addSuccessor(execBlock) : any
|
|
>exprBlock.addSuccessor : any
|
|
>exprBlock : any
|
|
>addSuccessor : any
|
|
>execBlock : any
|
|
}
|
|
else {
|
|
sw.addSuccessor(execBlock);
|
|
>sw.addSuccessor(execBlock) : any
|
|
>sw.addSuccessor : any
|
|
>sw : any
|
|
>addSuccessor : any
|
|
>execBlock : any
|
|
}
|
|
context.current = execBlock;
|
|
>context.current = execBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>execBlock : any
|
|
|
|
if (this.body) {
|
|
>this.body : ASTList
|
|
>this : this
|
|
>body : ASTList
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : ASTList
|
|
>this : this
|
|
>body : ASTList
|
|
>this : this
|
|
}
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class TypeReference extends AST {
|
|
>TypeReference : TypeReference
|
|
>AST : AST
|
|
|
|
constructor (public term: AST, public arrayCount: number) {
|
|
>term : AST
|
|
>arrayCount : number
|
|
|
|
super(NodeType.TypeRef);
|
|
>super(NodeType.TypeRef) : void
|
|
>super : typeof AST
|
|
>NodeType.TypeRef : any
|
|
>NodeType : any
|
|
>TypeRef : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
throw new Error("should not emit a type ref");
|
|
>new Error("should not emit a type ref") : Error
|
|
>Error : ErrorConstructor
|
|
>"should not emit a type ref" : "should not emit a type ref"
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
var prevInTCTR = typeFlow.inTypeRefTypeCheck;
|
|
>prevInTCTR : any
|
|
>typeFlow.inTypeRefTypeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>inTypeRefTypeCheck : any
|
|
|
|
typeFlow.inTypeRefTypeCheck = true;
|
|
>typeFlow.inTypeRefTypeCheck = true : true
|
|
>typeFlow.inTypeRefTypeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>inTypeRefTypeCheck : any
|
|
>true : true
|
|
|
|
var typeLink = getTypeLink(this, typeFlow.checker, true);
|
|
>typeLink : any
|
|
>getTypeLink(this, typeFlow.checker, true) : any
|
|
>getTypeLink : any
|
|
>this : this
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>true : true
|
|
|
|
typeFlow.checker.resolveTypeLink(typeFlow.scope, typeLink, false);
|
|
>typeFlow.checker.resolveTypeLink(typeFlow.scope, typeLink, false) : any
|
|
>typeFlow.checker.resolveTypeLink : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>resolveTypeLink : any
|
|
>typeFlow.scope : any
|
|
>typeFlow : TypeFlow
|
|
>scope : any
|
|
>typeLink : any
|
|
>false : false
|
|
|
|
if (this.term) {
|
|
>this.term : AST
|
|
>this : this
|
|
>term : AST
|
|
|
|
typeFlow.typeCheck(this.term);
|
|
>typeFlow.typeCheck(this.term) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.term : AST
|
|
>this : this
|
|
>term : AST
|
|
}
|
|
|
|
typeFlow.checkForVoidConstructor(typeLink.type, this);
|
|
>typeFlow.checkForVoidConstructor(typeLink.type, this) : any
|
|
>typeFlow.checkForVoidConstructor : any
|
|
>typeFlow : TypeFlow
|
|
>checkForVoidConstructor : any
|
|
>typeLink.type : any
|
|
>typeLink : any
|
|
>type : any
|
|
>this : this
|
|
|
|
this.type = typeLink.type;
|
|
>this.type = typeLink.type : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeLink.type : any
|
|
>typeLink : any
|
|
>type : any
|
|
|
|
// in error recovery cases, there may not be a term
|
|
if (this.term) {
|
|
>this.term : AST
|
|
>this : this
|
|
>term : AST
|
|
|
|
this.term.type = this.type;
|
|
>this.term.type = this.type : Type
|
|
>this.term.type : Type
|
|
>this.term : AST
|
|
>this : this
|
|
>term : AST
|
|
>type : Type
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
}
|
|
|
|
typeFlow.inTypeRefTypeCheck = prevInTCTR;
|
|
>typeFlow.inTypeRefTypeCheck = prevInTCTR : any
|
|
>typeFlow.inTypeRefTypeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>inTypeRefTypeCheck : any
|
|
>prevInTCTR : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class TryFinally extends Statement {
|
|
>TryFinally : TryFinally
|
|
>Statement : Statement
|
|
|
|
constructor (public tryNode: AST, public finallyNode: Finally) {
|
|
>tryNode : AST
|
|
>finallyNode : Finally
|
|
|
|
super(NodeType.TryFinally);
|
|
>super(NodeType.TryFinally) : void
|
|
>super : typeof Statement
|
|
>NodeType.TryFinally : any
|
|
>NodeType : any
|
|
>TryFinally : any
|
|
}
|
|
|
|
public isCompoundStatement() { return true; }
|
|
>isCompoundStatement : () => boolean
|
|
>true : true
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitJavascript(this.tryNode, TokenID.Try, false);
|
|
>emitter.emitJavascript(this.tryNode, TokenID.Try, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.tryNode : AST
|
|
>this : this
|
|
>tryNode : AST
|
|
>TokenID.Try : any
|
|
>TokenID : any
|
|
>Try : any
|
|
>false : false
|
|
|
|
emitter.emitJavascript(this.finallyNode, TokenID.Finally, false);
|
|
>emitter.emitJavascript(this.finallyNode, TokenID.Finally, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.finallyNode : Finally
|
|
>this : this
|
|
>finallyNode : Finally
|
|
>TokenID.Finally : any
|
|
>TokenID : any
|
|
>Finally : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.tryNode = typeFlow.typeCheck(this.tryNode);
|
|
>this.tryNode = typeFlow.typeCheck(this.tryNode) : any
|
|
>this.tryNode : AST
|
|
>this : this
|
|
>tryNode : AST
|
|
>typeFlow.typeCheck(this.tryNode) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.tryNode : AST
|
|
>this : this
|
|
>tryNode : AST
|
|
|
|
this.finallyNode = <Finally>typeFlow.typeCheck(this.finallyNode);
|
|
>this.finallyNode = <Finally>typeFlow.typeCheck(this.finallyNode) : Finally
|
|
>this.finallyNode : Finally
|
|
>this : this
|
|
>finallyNode : Finally
|
|
><Finally>typeFlow.typeCheck(this.finallyNode) : Finally
|
|
>typeFlow.typeCheck(this.finallyNode) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.finallyNode : Finally
|
|
>this : this
|
|
>finallyNode : Finally
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var afterFinally = new BasicBlock();
|
|
>afterFinally : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.walk(this.tryNode, this);
|
|
>context.walk(this.tryNode, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.tryNode : AST
|
|
>this : this
|
|
>tryNode : AST
|
|
>this : this
|
|
|
|
var finBlock = new BasicBlock();
|
|
>finBlock : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
if (context.current) {
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.current.addSuccessor(finBlock);
|
|
>context.current.addSuccessor(finBlock) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>finBlock : any
|
|
}
|
|
context.current = finBlock;
|
|
>context.current = finBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>finBlock : any
|
|
|
|
context.pushStatement(this, null, afterFinally);
|
|
>context.pushStatement(this, null, afterFinally) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>null : null
|
|
>afterFinally : any
|
|
|
|
context.walk(this.finallyNode, this);
|
|
>context.walk(this.finallyNode, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.finallyNode : Finally
|
|
>this : this
|
|
>finallyNode : Finally
|
|
>this : this
|
|
|
|
if (!context.noContinuation && context.current) {
|
|
>!context.noContinuation && context.current : any
|
|
>!context.noContinuation : boolean
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.current.addSuccessor(afterFinally);
|
|
>context.current.addSuccessor(afterFinally) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>afterFinally : any
|
|
}
|
|
if (afterFinally.predecessors.length > 0) {
|
|
>afterFinally.predecessors.length > 0 : boolean
|
|
>afterFinally.predecessors.length : any
|
|
>afterFinally.predecessors : any
|
|
>afterFinally : any
|
|
>predecessors : any
|
|
>length : any
|
|
>0 : 0
|
|
|
|
context.current = afterFinally;
|
|
>context.current = afterFinally : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterFinally : any
|
|
}
|
|
else {
|
|
context.noContinuation = true;
|
|
>context.noContinuation = true : true
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>true : true
|
|
}
|
|
context.popStatement();
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class TryCatch extends Statement {
|
|
>TryCatch : TryCatch
|
|
>Statement : Statement
|
|
|
|
constructor (public tryNode: Try, public catchNode: Catch) {
|
|
>tryNode : Try
|
|
>catchNode : Catch
|
|
|
|
super(NodeType.TryCatch);
|
|
>super(NodeType.TryCatch) : void
|
|
>super : typeof Statement
|
|
>NodeType.TryCatch : any
|
|
>NodeType : any
|
|
>TryCatch : any
|
|
}
|
|
|
|
public isCompoundStatement() { return true; }
|
|
>isCompoundStatement : () => boolean
|
|
>true : true
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.emitJavascript(this.tryNode, TokenID.Try, false);
|
|
>emitter.emitJavascript(this.tryNode, TokenID.Try, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.tryNode : Try
|
|
>this : this
|
|
>tryNode : Try
|
|
>TokenID.Try : any
|
|
>TokenID : any
|
|
>Try : any
|
|
>false : false
|
|
|
|
emitter.emitJavascript(this.catchNode, TokenID.Catch, false);
|
|
>emitter.emitJavascript(this.catchNode, TokenID.Catch, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.catchNode : Catch
|
|
>this : this
|
|
>catchNode : Catch
|
|
>TokenID.Catch : any
|
|
>TokenID : any
|
|
>Catch : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
var beforeTry = context.current;
|
|
>beforeTry : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
var tryBlock = new BasicBlock();
|
|
>tryBlock : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
beforeTry.addSuccessor(tryBlock);
|
|
>beforeTry.addSuccessor(tryBlock) : any
|
|
>beforeTry.addSuccessor : any
|
|
>beforeTry : any
|
|
>addSuccessor : any
|
|
>tryBlock : any
|
|
|
|
context.current = tryBlock;
|
|
>context.current = tryBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>tryBlock : any
|
|
|
|
var afterTryCatch = new BasicBlock();
|
|
>afterTryCatch : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.pushStatement(this, null, afterTryCatch);
|
|
>context.pushStatement(this, null, afterTryCatch) : any
|
|
>context.pushStatement : any
|
|
>context : ControlFlowContext
|
|
>pushStatement : any
|
|
>this : this
|
|
>null : null
|
|
>afterTryCatch : any
|
|
|
|
context.walk(this.tryNode, this);
|
|
>context.walk(this.tryNode, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.tryNode : Try
|
|
>this : this
|
|
>tryNode : Try
|
|
>this : this
|
|
|
|
if (!context.noContinuation) {
|
|
>!context.noContinuation : boolean
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
if (context.current) {
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.current.addSuccessor(afterTryCatch);
|
|
>context.current.addSuccessor(afterTryCatch) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>afterTryCatch : any
|
|
}
|
|
}
|
|
context.current = new BasicBlock();
|
|
>context.current = new BasicBlock() : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
beforeTry.addSuccessor(context.current);
|
|
>beforeTry.addSuccessor(context.current) : any
|
|
>beforeTry.addSuccessor : any
|
|
>beforeTry : any
|
|
>addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.walk(this.catchNode, this);
|
|
>context.walk(this.catchNode, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.catchNode : Catch
|
|
>this : this
|
|
>catchNode : Catch
|
|
>this : this
|
|
|
|
context.popStatement();
|
|
>context.popStatement() : any
|
|
>context.popStatement : any
|
|
>context : ControlFlowContext
|
|
>popStatement : any
|
|
|
|
if (!context.noContinuation) {
|
|
>!context.noContinuation : boolean
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
|
|
if (context.current) {
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
|
|
context.current.addSuccessor(afterTryCatch);
|
|
>context.current.addSuccessor(afterTryCatch) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>afterTryCatch : any
|
|
}
|
|
}
|
|
context.current = afterTryCatch;
|
|
>context.current = afterTryCatch : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>afterTryCatch : any
|
|
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.tryNode = <Try>typeFlow.typeCheck(this.tryNode);
|
|
>this.tryNode = <Try>typeFlow.typeCheck(this.tryNode) : Try
|
|
>this.tryNode : Try
|
|
>this : this
|
|
>tryNode : Try
|
|
><Try>typeFlow.typeCheck(this.tryNode) : Try
|
|
>typeFlow.typeCheck(this.tryNode) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.tryNode : Try
|
|
>this : this
|
|
>tryNode : Try
|
|
|
|
this.catchNode = <Catch>typeFlow.typeCheck(this.catchNode);
|
|
>this.catchNode = <Catch>typeFlow.typeCheck(this.catchNode) : Catch
|
|
>this.catchNode : Catch
|
|
>this : this
|
|
>catchNode : Catch
|
|
><Catch>typeFlow.typeCheck(this.catchNode) : Catch
|
|
>typeFlow.typeCheck(this.catchNode) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.catchNode : Catch
|
|
>this : this
|
|
>catchNode : Catch
|
|
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class Try extends Statement {
|
|
>Try : Try
|
|
>Statement : Statement
|
|
|
|
constructor (public body: AST) {
|
|
>body : AST
|
|
|
|
super(NodeType.Try);
|
|
>super(NodeType.Try) : void
|
|
>super : typeof Statement
|
|
>NodeType.Try : any
|
|
>NodeType : any
|
|
>Try : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("try ");
|
|
>emitter.writeToOutput("try ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"try " : "try "
|
|
|
|
emitter.emitJavascript(this.body, TokenID.Try, false);
|
|
>emitter.emitJavascript(this.body, TokenID.Try, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>TokenID.Try : any
|
|
>TokenID : any
|
|
>Try : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.body = typeFlow.typeCheck(this.body);
|
|
>this.body = typeFlow.typeCheck(this.body) : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>typeFlow.typeCheck(this.body) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
}
|
|
}
|
|
|
|
export class Catch extends Statement {
|
|
>Catch : Catch
|
|
>Statement : Statement
|
|
|
|
constructor (public param: VarDecl, public body: AST) {
|
|
>param : VarDecl
|
|
>body : AST
|
|
|
|
super(NodeType.Catch);
|
|
>super(NodeType.Catch) : void
|
|
>super : typeof Statement
|
|
>NodeType.Catch : any
|
|
>NodeType : any
|
|
>Catch : any
|
|
|
|
if (this.param) {
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
|
|
this.param.varFlags |= VarFlags.AutoInit;
|
|
>this.param.varFlags |= VarFlags.AutoInit : number
|
|
>this.param.varFlags : any
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
>varFlags : any
|
|
>VarFlags.AutoInit : any
|
|
>VarFlags : any
|
|
>AutoInit : any
|
|
}
|
|
}
|
|
public statement: ASTSpan = new ASTSpan();
|
|
>statement : ASTSpan
|
|
>new ASTSpan() : ASTSpan
|
|
>ASTSpan : typeof ASTSpan
|
|
|
|
public containedScope: SymbolScope = null;
|
|
>containedScope : SymbolScope
|
|
>null : null
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput(" ");
|
|
>emitter.writeToOutput(" ") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>" " : " "
|
|
|
|
emitter.recordSourceMappingStart(this.statement);
|
|
>emitter.recordSourceMappingStart(this.statement) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.writeToOutput("catch (");
|
|
>emitter.writeToOutput("catch (") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"catch (" : "catch ("
|
|
|
|
emitter.emitJavascript(this.param, TokenID.OpenParen, false);
|
|
>emitter.emitJavascript(this.param, TokenID.OpenParen, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
>TokenID.OpenParen : any
|
|
>TokenID : any
|
|
>OpenParen : any
|
|
>false : false
|
|
|
|
emitter.writeToOutput(")");
|
|
>emitter.writeToOutput(")") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>")" : ")"
|
|
|
|
emitter.recordSourceMappingEnd(this.statement);
|
|
>emitter.recordSourceMappingEnd(this.statement) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this.statement : ASTSpan
|
|
>this : this
|
|
>statement : ASTSpan
|
|
|
|
emitter.emitJavascript(this.body, TokenID.Catch, false);
|
|
>emitter.emitJavascript(this.body, TokenID.Catch, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>TokenID.Catch : any
|
|
>TokenID : any
|
|
>Catch : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
if (this.param) {
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
|
|
context.addContent(this.param);
|
|
>context.addContent(this.param) : any
|
|
>context.addContent : any
|
|
>context : ControlFlowContext
|
|
>addContent : any
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
|
|
var bodBlock = new BasicBlock();
|
|
>bodBlock : any
|
|
>new BasicBlock() : any
|
|
>BasicBlock : any
|
|
|
|
context.current.addSuccessor(bodBlock);
|
|
>context.current.addSuccessor(bodBlock) : any
|
|
>context.current.addSuccessor : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>addSuccessor : any
|
|
>bodBlock : any
|
|
|
|
context.current = bodBlock;
|
|
>context.current = bodBlock : any
|
|
>context.current : any
|
|
>context : ControlFlowContext
|
|
>current : any
|
|
>bodBlock : any
|
|
}
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
}
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
var prevScope = typeFlow.scope;
|
|
>prevScope : any
|
|
>typeFlow.scope : any
|
|
>typeFlow : TypeFlow
|
|
>scope : any
|
|
|
|
typeFlow.scope = this.containedScope;
|
|
>typeFlow.scope = this.containedScope : SymbolScope
|
|
>typeFlow.scope : any
|
|
>typeFlow : TypeFlow
|
|
>scope : any
|
|
>this.containedScope : SymbolScope
|
|
>this : this
|
|
>containedScope : SymbolScope
|
|
|
|
this.param = <VarDecl>typeFlow.typeCheck(this.param);
|
|
>this.param = <VarDecl>typeFlow.typeCheck(this.param) : VarDecl
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
><VarDecl>typeFlow.typeCheck(this.param) : VarDecl
|
|
>typeFlow.typeCheck(this.param) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
|
|
var exceptVar = new ValueLocation();
|
|
>exceptVar : any
|
|
>new ValueLocation() : any
|
|
>ValueLocation : any
|
|
|
|
var varSym = new VariableSymbol((<VarDecl>this.param).id.text,
|
|
>varSym : any
|
|
>new VariableSymbol((<VarDecl>this.param).id.text, this.param.minChar, typeFlow.checker.locationInfo.unitIndex, exceptVar) : any
|
|
>VariableSymbol : any
|
|
>(<VarDecl>this.param).id.text : string
|
|
>(<VarDecl>this.param).id : Identifier
|
|
>(<VarDecl>this.param) : VarDecl
|
|
><VarDecl>this.param : VarDecl
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
>id : Identifier
|
|
>text : string
|
|
|
|
this.param.minChar,
|
|
>this.param.minChar : number
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
>minChar : number
|
|
|
|
typeFlow.checker.locationInfo.unitIndex,
|
|
>typeFlow.checker.locationInfo.unitIndex : any
|
|
>typeFlow.checker.locationInfo : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>locationInfo : any
|
|
>unitIndex : any
|
|
|
|
exceptVar);
|
|
>exceptVar : any
|
|
|
|
exceptVar.symbol = varSym;
|
|
>exceptVar.symbol = varSym : any
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
>varSym : any
|
|
|
|
exceptVar.typeLink = new TypeLink();
|
|
>exceptVar.typeLink = new TypeLink() : any
|
|
>exceptVar.typeLink : any
|
|
>exceptVar : any
|
|
>typeLink : any
|
|
>new TypeLink() : any
|
|
>TypeLink : any
|
|
|
|
// var type for now (add syntax for type annotation)
|
|
exceptVar.typeLink.type = typeFlow.anyType;
|
|
>exceptVar.typeLink.type = typeFlow.anyType : any
|
|
>exceptVar.typeLink.type : any
|
|
>exceptVar.typeLink : any
|
|
>exceptVar : any
|
|
>typeLink : any
|
|
>type : any
|
|
>typeFlow.anyType : any
|
|
>typeFlow : TypeFlow
|
|
>anyType : any
|
|
|
|
var thisFnc = typeFlow.thisFnc;
|
|
>thisFnc : any
|
|
>typeFlow.thisFnc : any
|
|
>typeFlow : TypeFlow
|
|
>thisFnc : any
|
|
|
|
if (thisFnc && thisFnc.type) {
|
|
>thisFnc && thisFnc.type : any
|
|
>thisFnc : any
|
|
>thisFnc.type : any
|
|
>thisFnc : any
|
|
>type : any
|
|
|
|
exceptVar.symbol.container = thisFnc.type.symbol;
|
|
>exceptVar.symbol.container = thisFnc.type.symbol : any
|
|
>exceptVar.symbol.container : any
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
>container : any
|
|
>thisFnc.type.symbol : any
|
|
>thisFnc.type : any
|
|
>thisFnc : any
|
|
>type : any
|
|
>symbol : any
|
|
}
|
|
else {
|
|
exceptVar.symbol.container = null;
|
|
>exceptVar.symbol.container = null : null
|
|
>exceptVar.symbol.container : any
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
>container : any
|
|
>null : null
|
|
}
|
|
this.param.sym = exceptVar.symbol;
|
|
>this.param.sym = exceptVar.symbol : any
|
|
>this.param.sym : Symbol
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
>sym : Symbol
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
|
|
typeFlow.scope.enter(exceptVar.symbol.container, this.param, exceptVar.symbol,
|
|
>typeFlow.scope.enter(exceptVar.symbol.container, this.param, exceptVar.symbol, typeFlow.checker.errorReporter, false, false, false) : any
|
|
>typeFlow.scope.enter : any
|
|
>typeFlow.scope : any
|
|
>typeFlow : TypeFlow
|
|
>scope : any
|
|
>enter : any
|
|
>exceptVar.symbol.container : any
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
>container : any
|
|
>this.param : VarDecl
|
|
>this : this
|
|
>param : VarDecl
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
|
|
typeFlow.checker.errorReporter, false, false, false);
|
|
>typeFlow.checker.errorReporter : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>errorReporter : any
|
|
>false : false
|
|
>false : false
|
|
>false : false
|
|
|
|
this.body = typeFlow.typeCheck(this.body);
|
|
>this.body = typeFlow.typeCheck(this.body) : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>typeFlow.typeCheck(this.body) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
// if we're in provisional typecheck mode, clean up the symbol entry
|
|
// REVIEW: This is obviously bad form, since we're counting on the internal
|
|
// layout of the symbol table, but this is also the only place where we insert
|
|
// symbols during typecheck
|
|
if (typeFlow.checker.inProvisionalTypecheckMode()) {
|
|
>typeFlow.checker.inProvisionalTypecheckMode() : any
|
|
>typeFlow.checker.inProvisionalTypecheckMode : any
|
|
>typeFlow.checker : any
|
|
>typeFlow : TypeFlow
|
|
>checker : any
|
|
>inProvisionalTypecheckMode : any
|
|
|
|
var table = typeFlow.scope.getTable();
|
|
>table : any
|
|
>typeFlow.scope.getTable() : any
|
|
>typeFlow.scope.getTable : any
|
|
>typeFlow.scope : any
|
|
>typeFlow : TypeFlow
|
|
>scope : any
|
|
>getTable : any
|
|
|
|
(<any>table).secondaryTable.table[exceptVar.symbol.name] = undefined;
|
|
>(<any>table).secondaryTable.table[exceptVar.symbol.name] = undefined : undefined
|
|
>(<any>table).secondaryTable.table[exceptVar.symbol.name] : any
|
|
>(<any>table).secondaryTable.table : any
|
|
>(<any>table).secondaryTable : any
|
|
>(<any>table) : any
|
|
><any>table : any
|
|
>table : any
|
|
>secondaryTable : any
|
|
>table : any
|
|
>exceptVar.symbol.name : any
|
|
>exceptVar.symbol : any
|
|
>exceptVar : any
|
|
>symbol : any
|
|
>name : any
|
|
>undefined : undefined
|
|
}
|
|
this.type = typeFlow.voidType;
|
|
>this.type = typeFlow.voidType : any
|
|
>this.type : Type
|
|
>this : this
|
|
>type : Type
|
|
>typeFlow.voidType : any
|
|
>typeFlow : TypeFlow
|
|
>voidType : any
|
|
|
|
typeFlow.scope = prevScope;
|
|
>typeFlow.scope = prevScope : any
|
|
>typeFlow.scope : any
|
|
>typeFlow : TypeFlow
|
|
>scope : any
|
|
>prevScope : any
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class Finally extends Statement {
|
|
>Finally : Finally
|
|
>Statement : Statement
|
|
|
|
constructor (public body: AST) {
|
|
>body : AST
|
|
|
|
super(NodeType.Finally);
|
|
>super(NodeType.Finally) : void
|
|
>super : typeof Statement
|
|
>NodeType.Finally : any
|
|
>NodeType : any
|
|
>Finally : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeToOutput("finally");
|
|
>emitter.writeToOutput("finally") : any
|
|
>emitter.writeToOutput : any
|
|
>emitter : Emitter
|
|
>writeToOutput : any
|
|
>"finally" : "finally"
|
|
|
|
emitter.emitJavascript(this.body, TokenID.Finally, false);
|
|
>emitter.emitJavascript(this.body, TokenID.Finally, false) : any
|
|
>emitter.emitJavascript : any
|
|
>emitter : Emitter
|
|
>emitJavascript : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>TokenID.Finally : any
|
|
>TokenID : any
|
|
>Finally : any
|
|
>false : false
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
|
|
public addToControlFlow(context: ControlFlowContext) {
|
|
>addToControlFlow : (context: ControlFlowContext) => void
|
|
>context : ControlFlowContext
|
|
|
|
if (this.body) {
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
context.walk(this.body, this);
|
|
>context.walk(this.body, this) : any
|
|
>context.walk : any
|
|
>context : ControlFlowContext
|
|
>walk : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>this : this
|
|
}
|
|
context.walker.options.goChildren = false;
|
|
>context.walker.options.goChildren = false : false
|
|
>context.walker.options.goChildren : any
|
|
>context.walker.options : any
|
|
>context.walker : any
|
|
>context : ControlFlowContext
|
|
>walker : any
|
|
>options : any
|
|
>goChildren : any
|
|
>false : false
|
|
|
|
context.noContinuation = false;
|
|
>context.noContinuation = false : false
|
|
>context.noContinuation : any
|
|
>context : ControlFlowContext
|
|
>noContinuation : any
|
|
>false : false
|
|
}
|
|
|
|
public typeCheck(typeFlow: TypeFlow) {
|
|
>typeCheck : (typeFlow: TypeFlow) => this
|
|
>typeFlow : TypeFlow
|
|
|
|
this.body = typeFlow.typeCheck(this.body);
|
|
>this.body = typeFlow.typeCheck(this.body) : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
>typeFlow.typeCheck(this.body) : any
|
|
>typeFlow.typeCheck : any
|
|
>typeFlow : TypeFlow
|
|
>typeCheck : any
|
|
>this.body : AST
|
|
>this : this
|
|
>body : AST
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
export class Comment extends AST {
|
|
>Comment : Comment
|
|
>AST : AST
|
|
|
|
public text: string[] = null;
|
|
>text : string[]
|
|
>null : null
|
|
|
|
constructor (public content: string, public isBlockComment: boolean, public endsLine) {
|
|
>content : string
|
|
>isBlockComment : boolean
|
|
>endsLine : any
|
|
|
|
super(NodeType.Comment);
|
|
>super(NodeType.Comment) : void
|
|
>super : typeof AST
|
|
>NodeType.Comment : any
|
|
>NodeType : any
|
|
>Comment : any
|
|
}
|
|
|
|
public getText(): string[] {
|
|
>getText : () => string[]
|
|
|
|
if (this.text == null) {
|
|
>this.text == null : boolean
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
>null : null
|
|
|
|
if (this.isBlockComment) {
|
|
>this.isBlockComment : boolean
|
|
>this : this
|
|
>isBlockComment : boolean
|
|
|
|
this.text = this.content.split("\n");
|
|
>this.text = this.content.split("\n") : string[]
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
>this.content.split("\n") : string[]
|
|
>this.content.split : (separator: string | RegExp, limit?: number) => string[]
|
|
>this.content : string
|
|
>this : this
|
|
>content : string
|
|
>split : (separator: string | RegExp, limit?: number) => string[]
|
|
>"\n" : "\n"
|
|
|
|
for (var i = 0; i < this.text.length; i++) {
|
|
>i : number
|
|
>0 : 0
|
|
>i < this.text.length : boolean
|
|
>i : number
|
|
>this.text.length : number
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
>length : number
|
|
>i++ : number
|
|
>i : number
|
|
|
|
this.text[i] = this.text[i].replace(/^\s+|\s+$/g, '');
|
|
>this.text[i] = this.text[i].replace(/^\s+|\s+$/g, '') : string
|
|
>this.text[i] : string
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
>i : number
|
|
>this.text[i].replace(/^\s+|\s+$/g, '') : string
|
|
>this.text[i].replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
|
|
>this.text[i] : string
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
>i : number
|
|
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
|
|
>/^\s+|\s+$/g : RegExp
|
|
>'' : ""
|
|
}
|
|
}
|
|
else {
|
|
this.text = [(this.content.replace(/^\s+|\s+$/g, ''))];
|
|
>this.text = [(this.content.replace(/^\s+|\s+$/g, ''))] : string[]
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
>[(this.content.replace(/^\s+|\s+$/g, ''))] : string[]
|
|
>(this.content.replace(/^\s+|\s+$/g, '')) : string
|
|
>this.content.replace(/^\s+|\s+$/g, '') : string
|
|
>this.content.replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
|
|
>this.content : string
|
|
>this : this
|
|
>content : string
|
|
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
|
|
>/^\s+|\s+$/g : RegExp
|
|
>'' : ""
|
|
}
|
|
}
|
|
|
|
return this.text;
|
|
>this.text : string[]
|
|
>this : this
|
|
>text : string[]
|
|
}
|
|
}
|
|
|
|
export class DebuggerStatement extends Statement {
|
|
>DebuggerStatement : DebuggerStatement
|
|
>Statement : Statement
|
|
|
|
constructor () {
|
|
super(NodeType.Debugger);
|
|
>super(NodeType.Debugger) : void
|
|
>super : typeof Statement
|
|
>NodeType.Debugger : any
|
|
>NodeType : any
|
|
>Debugger : any
|
|
}
|
|
|
|
public emit(emitter: Emitter, tokenId: TokenID, startLine: boolean) {
|
|
>emit : (emitter: Emitter, tokenId: TokenID, startLine: boolean) => void
|
|
>emitter : Emitter
|
|
>tokenId : TokenID
|
|
>startLine : boolean
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, true);
|
|
>emitter.emitParensAndCommentsInPlace(this, true) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>true : true
|
|
|
|
emitter.recordSourceMappingStart(this);
|
|
>emitter.recordSourceMappingStart(this) : any
|
|
>emitter.recordSourceMappingStart : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingStart : any
|
|
>this : this
|
|
|
|
emitter.writeLineToOutput("debugger;");
|
|
>emitter.writeLineToOutput("debugger;") : any
|
|
>emitter.writeLineToOutput : any
|
|
>emitter : Emitter
|
|
>writeLineToOutput : any
|
|
>"debugger;" : "debugger;"
|
|
|
|
emitter.recordSourceMappingEnd(this);
|
|
>emitter.recordSourceMappingEnd(this) : any
|
|
>emitter.recordSourceMappingEnd : any
|
|
>emitter : Emitter
|
|
>recordSourceMappingEnd : any
|
|
>this : this
|
|
|
|
emitter.emitParensAndCommentsInPlace(this, false);
|
|
>emitter.emitParensAndCommentsInPlace(this, false) : any
|
|
>emitter.emitParensAndCommentsInPlace : any
|
|
>emitter : Emitter
|
|
>emitParensAndCommentsInPlace : any
|
|
>this : this
|
|
>false : false
|
|
}
|
|
}
|
|
}
|