Lines Matching full:scope
30 Scope,
33 } from "./scope";
70 function addInnerArgs(node: ts.Node, scope: VariableScope, enableTypeRecord: boolean): void {
72 scope.addParameter(MandatoryFuncObj, VarDeclarationKind.CONST, -1);
76 scope.addParameter("0newTarget", VarDeclarationKind.CONST, -1);
77 scope.addParameter("0this", VarDeclarationKind.CONST, 0);
79 scope.addParameter(MandatoryNewTarget, VarDeclarationKind.CONST, -1);
80 scope.addParameter(MandatoryThis, VarDeclarationKind.CONST, 0);
84 scope.addParameter("exports", VarDeclarationKind.LET, 1);
85 scope.addParameter("require", VarDeclarationKind.LET, 2);
86 scope.addParameter("module", VarDeclarationKind.LET, 3);
87 scope.addParameter("__filename", VarDeclarationKind.LET, 4);
88 scope.addParameter("__dirname", VarDeclarationKind.LET, 5);
93 addParameters(funcNode, scope, enableTypeRecord);
96 if (scope.getUseArgs() || CmdOptions.isDebugMode()) {
98 let parentVariableScope = <VariableScope>scope.getParentVariableScope();
101 scope.setUseArgs(false);
102 } else if (scope.getUseArgs()){
103 if (!scope.findLocal(MandatoryArguments)) {
104 scope.add(MandatoryArguments, VarDeclarationKind.CONST, InitStatus.INITIALIZED);
114 scopeMap.forEach((scope, node) => {
116 if (scope instanceof VariableScope) {
117 addInnerArgs(node, scope, enableTypeRecord);
119 hoistDecls = <Decl[]>hoistMap.get(scope);
124 v = scope.add(hoistDecl, VarDeclarationKind.VAR);
126 v = scope.add(hoistDecl, VarDeclarationKind.FUNCTION);
139 let decls = scope.getDecls();
140 let nearestVariableScope = <VariableScope>scope.getNearestVariableScope();
150 v = scope.add(decl, VarDeclarationKind.LET, InitStatus.UNINITIALIZED);
152 v = scope.add(decl, VarDeclarationKind.CONST, InitStatus.UNINITIALIZED);
156 v = scope.add(decl, VarDeclarationKind.FUNCTION);
158 let functionScope = <Scope>recorder.getScopeOfNode(funcNode);
162 v = scope.add(decl, VarDeclarationKind.LET);
166 v = scope.add(decl, VarDeclarationKind.CLASS, InitStatus.UNINITIALIZED);
168 let classScope = <Scope>recorder.getScopeOfNode(classNode);
175 * Case 2: "var undefined" in global scope is not added to hoistDecls,
176 * but it should be added to scope
179 v = scope.add(decls[j].name, VarDeclarationKind.VAR);
189 function addParameters(node: ts.FunctionLikeDeclaration, scope: VariableScope, enableTypeRecord: bo…
201 let v = scope.addParameter(name, VarDeclarationKind.VAR, i + 1);
209 addPatternParamterElements(patternParams[i], scope);
213 function addPatternParamterElements(pattern: ts.BindingPattern, scope: VariableScope) {
223 scope.add(name, VarDeclarationKind.VAR);
226 addPatternParamterElements(innerPattern, scope);