Home
last modified time | relevance | path

Searched refs:variable (Results 1 – 25 of 427) sorted by relevance

12345678910>>...18

/arkcompiler/ets_frontend/es2panda/test/parser/ts/type_checker/
Dassignment_unknown.ts17 let variable: unknown; variable
19 variable = null;
20 variable = true;
21 variable = 12;
22 variable = "Hello World";
23 variable = [];
24 variable = {};
Dassignment_unknown-expected.txt11 "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/
Dassignment_unknown.ts17 let variable: unknown; variable
19 variable = null;
20 variable = true;
21 variable = 12;
22 variable = "Hello World";
23 variable = [];
24 variable = {};
Dassignment_unknown-expected.txt11 "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/
Dscope.test.ts34 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/
Dlexenv.cpp32 …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/
Dldboolean.ts17 let variable = true;
18 AssertType(variable, "boolean");
20 variable = false;
21 typeof(variable);
22 AssertType(variable, "boolean");
/arkcompiler/ets_frontend/ts2panda/src/
Dlexenv.ts42 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 …]
Dcompiler.ts292 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/
Dlexenv.cpp35 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/
Dlreference.ts38 …readonly variable: { scope: Scope | undefined, level: number, v: Variable | undefined } | undefine… property in LReference
46variable: { 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/
DsavedBindingsCtx.cpp29 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/
Dtest_core_value.j219 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/
DfunctionDeclaration.cpp47 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/
Dusing-mutable-lexical-variable-1-expected.txt1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
Dusing-const-lexical-variable-4-expected.txt1 …ent function should only use import variable or local variable, 'a' is not one of them [using-cons…
Dusing-mutable-lexical-variable-4-expected.txt1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
Dusing-mutable-lexical-variable-3-expected.txt1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
Dusing-mutable-lexical-variable-5-expected.txt1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
Dusing-mutable-lexical-variable-2-expected.txt1 …nt function should only use import variable or local variable, 'a' is not one of them [using-mutab…
Dsendable-member-function-contains-lexical-variable-expected.txt1 …n should only use import variable or local variable, 'b' is not one of them [sendable-member-funct…
Dsendable-class-constructor-contains-lexical-variable-expected.txt1 … should only use import variable or local variable, 'b' is not one of them [sendable-class-constru…
/arkcompiler/ets_frontend/ets2panda/varbinder/
Dvarbinder.cpp161 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/
DenvScope.cpp63 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/
Dconcurrent.cpp71 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()

12345678910>>...18