| /arkcompiler/ets_frontend/es2panda/test/parser/ts/type_checker/ |
| D | assignment_unknown.ts | 17 let variable: unknown; variable 19 variable = null; 20 variable = true; 21 variable = 12; 22 variable = "Hello World"; 23 variable = []; 24 variable = {};
|
| D | assignment_unknown-expected.txt | 11 "name": "variable", 68 "name": "variable", 123 "name": "variable", 178 "name": "variable", 233 "name": "variable", 288 "name": "variable", 343 "name": "variable",
|
| /arkcompiler/ets_frontend/ets2panda/test/compiler/ts/ |
| D | assignment_unknown.ts | 17 let variable: unknown; variable 19 variable = null; 20 variable = true; 21 variable = 12; 22 variable = "Hello World"; 23 variable = []; 24 variable = {};
|
| D | assignment_unknown-expected.txt | 11 "name": "variable", 69 "name": "variable", 125 "name": "variable", 181 "name": "variable", 237 "name": "variable", 293 "name": "variable", 349 "name": "variable",
|
| /arkcompiler/ets_frontend/ts2panda/tests/ |
| D | scope.test.ts | 34 let variable = scope.add("x", VarDeclarationKind.NONE); variable 35 expect(variable instanceof GlobalVariable).to.be.true; 37 expect(outVariable === variable).to.be.true; 44 let variable = scope.add("x", VarDeclarationKind.VAR); variable 45 expect(variable instanceof GlobalVariable).to.be.true; 47 expect(outVariable === variable).to.be.true; 54 let variable = scope.add("x", VarDeclarationKind.LET); variable 55 expect(variable instanceof LocalVariable).to.be.true; 57 expect(outVariable === variable).to.be.true; 64 let variable = scope.add("x", VarDeclarationKind.CONST); variable [all …]
|
| /arkcompiler/ets_frontend/ets2panda/compiler/base/ |
| D | lexenv.cpp | 32 …tic void CheckConstAssignment(PandaGen *pg, const ir::AstNode *node, varbinder::Variable *variable) in CheckConstAssignment() argument 34 if (!variable->Declaration()->IsConstDecl()) { in CheckConstAssignment() 38 pg->ThrowConstAssignment(node, variable->Name()); in CheckConstAssignment() 45 if (result.variable->Declaration()->IsVarDecl()) { in ExpandLoadLexVar() 46 pg->LoadLexicalVar(node, result.lexLevel, result.variable->AsLocalVariable()->LexIdx()); in ExpandLoadLexVar() 48 … pg->LoadLexical(node, result.name, result.lexLevel, result.variable->AsLocalVariable()->LexIdx()); in ExpandLoadLexVar() 54 auto *local = result.variable->AsLocalVariable(); in ExpandLoadNormalVar() 65 if (result.variable->LexicalBound()) { in Expand() 74 static void StoreLocalExport(PandaGen *pg, const ir::AstNode *node, varbinder::Variable *variable) in StoreLocalExport() argument 76 … if (!variable->HasFlag(varbinder::VariableFlags::LOCAL_EXPORT) || !pg->Scope()->IsModuleScope()) { in StoreLocalExport() [all …]
|
| /arkcompiler/ets_runtime/test/typeinfer/ldboolean/ |
| D | ldboolean.ts | 17 let variable = true; 18 AssertType(variable, "boolean"); 20 variable = false; 21 typeof(variable); 22 AssertType(variable, "boolean");
|
| /arkcompiler/ets_frontend/ts2panda/src/ |
| D | lexenv.ts | 42 variable: Variable; property in VariableAccessBase 46 constructor(scope: Scope, level: number, variable: Variable) { 47 this.variable = variable; 53 return this.variable.isLexVar; 58 return this.variable.idxLex; 68 constructor(scope: Scope, level: number, variable: Variable) { 69 super(scope, level, variable); 82 let v = this.variable; 98 let v = this.variable; 115 …constructor(scope: Scope, level: number, variable: Variable, isDeclaration: boolean, node: ts.Node… [all …]
|
| D | compiler.ts | 292 let variable: Variable; 294 variable = <Variable>paramRef.variable!.v; 297 variable = <Variable>this.scope.find(paramName).v; 300 let paramReg = pandaGen.getVregForVariable(variable!); 325 (ts.isIdentifier(parameter) && (variable!.isLexVar))) { 1419 variable: { scope: Scope | undefined, level: number, v: Variable | undefined }, 1421 if (variable.v instanceof LocalVariable) { 1422 if (isDeclaration && variable.v.isLetOrConst()) { 1423 variable.v.initialize(); 1424 if (variable.scope instanceof GlobalScope) { [all …]
|
| /arkcompiler/ets_frontend/es2panda/compiler/base/ |
| D | lexenv.cpp | 35 static void CheckConstAssignment(PandaGen *pg, const ir::AstNode *node, binder::Variable *variable) in CheckConstAssignment() argument 37 if (!variable->Declaration()->IsConstDecl()) { in CheckConstAssignment() 41 pg->ThrowConstAssignment(node, variable->Name()); in CheckConstAssignment() 57 …pg->LoadLexicalVar(node, result.lexLevel, result.variable->AsLocalVariable()->LexIdx(), result.var… in ExpandLoadLexVar() 58 const auto *decl = result.variable->Declaration(); in ExpandLoadLexVar() 60 pg->ThrowUndefinedIfHole(node, result.variable->Name()); in ExpandLoadLexVar() 66 auto *local = result.variable->AsLocalVariable(); in ExpandLoadNormalVar() 78 if (result.variable->LexicalBound()) { in Expand() 98 binder::LocalVariable *local = result.variable->AsLocalVariable(); in ExpandStoreLexVar() 100 const auto *decl = result.variable->Declaration(); in ExpandStoreLexVar() [all …]
|
| /arkcompiler/ets_frontend/ts2panda/src/base/ |
| D | lreference.ts | 38 …readonly variable: { scope: Scope | undefined, level: number, v: Variable | undefined } | undefine… property in LReference 46 … variable: { scope: Scope | undefined, level: number, v: Variable | undefined } | undefined) { 55 this.variable = variable!; 75 this.compiler.loadTarget(this.node, this.variable!); 106 this.compiler.storeTarget(this.node, this.variable!, this.isDeclaration); 142 let variable = compiler.getCurrentScope().find(name); variable 143 if (!variable.v) { 146 variable.v = compiler.getCurrentScope().add(name, VarDeclarationKind.VAR); 148 variable.v = compiler.getCurrentScope().add(name, VarDeclarationKind.NONE); 152 … return new LReference(realNode, compiler, isDeclaration, ReferenceKind.LOCAL_OR_GLOBAL, variable);
|
| /arkcompiler/ets_frontend/ets2panda/compiler/lowering/scopesInit/ |
| D | savedBindingsCtx.cpp | 29 for (const auto &[name, variable] : VarBinder()->GetScope()->Bindings()) { in BindImportDecl() 34 declList.push_back(variable->Declaration()->AsImportDecl()); in BindImportDecl() 63 for (const auto &[name, variable] : VarBinder()->GetScope()->Bindings()) { in BindExportDecl() 70 variable->AddFlag(varbinder::VariableFlags::LOCAL_EXPORT); in BindExportDecl() 72 …VarBinder()->AddDecl<varbinder::ExportDecl>(variable->Declaration()->Node()->Start(), exportName, … in BindExportDecl()
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/stdlib-templates/utils/ |
| D | test_core_value.j2 | 19 let variable : {{.item.name}}; 22 variable = {{.init_value}}; 23 actualValue = Value.of(variable) as {{.item.value_name}}Value; 25 …testResult = checkTestResult(actualValue.getValueData() as {{.item.name}}, variable as {{.item.nam… 27 … testResult = checkTestResult(actualValue.getData() as {{.item.name}}, variable as {{.item.name}}); 31 testResult = checkTestResult(actualValue.getType(), Type.of(variable));
|
| /arkcompiler/ets_frontend/es2panda/ir/statements/ |
| D | functionDeclaration.cpp | 47 ASSERT(result.variable); in Check() 51 if (!result.variable->TsType()) { in Check() 52 …checker->InferFunctionDeclarationType(result.variable->Declaration()->AsFunctionDecl(), result.var… in Check()
|
| /arkcompiler/ets_frontend/es2panda/test/parser/concurrent/ |
| D | using-mutable-lexical-variable-1-expected.txt | 1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
|
| D | using-const-lexical-variable-4-expected.txt | 1 …ent function should only use import variable or local variable, 'a' is not one of them [using-cons…
|
| D | using-mutable-lexical-variable-4-expected.txt | 1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
|
| D | using-mutable-lexical-variable-3-expected.txt | 1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
|
| D | using-mutable-lexical-variable-5-expected.txt | 1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
|
| D | using-mutable-lexical-variable-2-expected.txt | 1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
|
| D | sendable-member-function-contains-lexical-variable-expected.txt | 1 …n should only use import variable or local variable, 'b' is not one of them [sendable-member-funct…
|
| D | sendable-class-constructor-contains-lexical-variable-expected.txt | 1 … should only use import variable or local variable, 'b' is not one of them [sendable-class-constru…
|
| /arkcompiler/ets_frontend/ets2panda/varbinder/ |
| D | varbinder.cpp | 161 ASSERT(res.variable); in LookupReference() 162 res.variable->SetLexical(res.scope); in LookupReference() 229 …Variable *variable = scope->FindLocal(classDef->PrivateId(), varbinder::ResolveBindingOptions::BIN… in InstantiatePrivateContext() local 231 if (!variable->HasFlag(VariableFlags::INITIALIZED)) { in InstantiatePrivateContext() 236 variable->SetLexical(scope); in InstantiatePrivateContext() 263 ASSERT(res.variable); in LookupIdentReference() 264 res.variable->SetLexical(res.scope); in LookupIdentReference() 267 if (res.variable == nullptr) { in LookupIdentReference() 271 …if (res.variable->Declaration()->IsLetOrConstDecl() && !res.variable->HasFlag(VariableFlags::INITI… in LookupIdentReference() 275 ident->SetVariable(res.variable); in LookupIdentReference() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/compiler/core/ |
| D | envScope.cpp | 63 for (const auto &[_, variable] : scope_->Bindings()) { in CopyBindings() 65 if (!variable->HasFlag(flag)) { in CopyBindings() 69 pg->LoadLexicalVar(scope_->Node(), 1, variable->AsLocalVariable()->LexIdx()); in CopyBindings() 70 pg->StoreLexicalVar(scope_->Parent()->Node(), 0, variable->AsLocalVariable()->LexIdx()); in CopyBindings()
|
| /arkcompiler/ets_frontend/es2panda/util/ |
| D | concurrent.cpp | 71 if (result.variable->IsModuleVariable() && result.variable->Declaration()->IsImportDecl()) { in ProcessConcurrent() 77 result.variable->Declaration()->Name()); in ProcessConcurrent() 82 int moduleRequestIdx = program->ModuleRecord()->GetModuleRequestIdx(result.variable->Name()); in CollectRelativeModule()
|