Home
last modified time | relevance | path

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

123456

/arkcompiler/ets_runtime/test/typeinfer/automatedcases/
DclassAttributeInferenceTemplate.ts26 const variable = 'something' constant
27 AssertType(variable, "string");
36 this.property2 = `foo-${variable}`; // Causes an error
37 AssertType(this.property2 = `foo-${variable}`, "string");
40 AssertType(`foo-${variable}`, "string");
41 AssertType(variable, "string");
43 const localProperty = `foo-${variable}`; // Correctly inferred as `string`
45 AssertType(`foo-${variable}`, "string");
46 AssertType(variable, "string");
/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/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_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/es2panda/compiler/base/
Dlexenv.cpp34 static void CheckConstAssignment(PandaGen *pg, const ir::AstNode *node, binder::Variable *variable) in CheckConstAssignment() argument
36 if (!variable->Declaration()->IsConstDecl()) { in CheckConstAssignment()
40 pg->ThrowConstAssignment(node, variable->Name()); in CheckConstAssignment()
47 …pg->LoadLexicalVar(node, result.lexLevel, result.variable->AsLocalVariable()->LexIdx(), result.var… in ExpandLoadLexVar()
48 const auto *decl = result.variable->Declaration(); in ExpandLoadLexVar()
50 pg->ThrowUndefinedIfHole(node, result.variable->Name()); in ExpandLoadLexVar()
56 auto *local = result.variable->AsLocalVariable(); in ExpandLoadNormalVar()
68 if (result.variable->LexicalBound()) { in Expand()
79 binder::LocalVariable *local = result.variable->AsLocalVariable(); in ExpandStoreLexVar()
81 const auto *decl = result.variable->Declaration(); in ExpandStoreLexVar()
[all …]
/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/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/es2panda/test/parser/concurrent/
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…
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-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…
/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_runtime/test/typeinfer/automatedcases/jsObjectsMarkedAsOpenEnded/
Db.ts21 variable.a = 1;
22 AssertType(variable.a = 1, "int");
23 AssertType(variable.a, "number");
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/globalThisDeclarationEmit2/
Dindex.ts22 import { variable } from "./variable";
23 export { variable as globalThis };
Dvariable.ts21 export const variable = globalThis;
22 AssertType(variable, "typeof globalThis");
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/globalThisDeclarationEmit3/
Dindex.ts22 import { variable } from "./variable";
23 export { variable as globalThis };
/arkcompiler/ets_frontend/es2panda/ir/ts/
DtsEnumDeclaration.cpp258 …d AddEnumValueDeclaration(checker::Checker *checker, double number, binder::EnumVariable *variable) in AddEnumValueDeclaration() argument
260 variable->SetTsType(checker->GlobalNumberType()); in AddEnumValueDeclaration()
270 decl->BindNode(variable->Declaration()->Node()); in AddEnumValueDeclaration()
281 decl->BindNode(variable->Declaration()->Node()); in AddEnumValueDeclaration()
285 enumVar->SetValue(variable->Declaration()->Name()); in AddEnumValueDeclaration()
288 void InferEnumVariableType(checker::Checker *checker, binder::EnumVariable *variable, double *value… in InferEnumVariableType() argument
291 const ir::Expression *init = variable->Declaration()->Node()->AsTSEnumMember()->Init(); in InferEnumVariableType()
294 …checker->ThrowTypeError("Enum member must have initializer.", variable->Declaration()->Node()->Sta… in InferEnumVariableType()
298 variable->SetValue(++(*value)); in InferEnumVariableType()
299 AddEnumValueDeclaration(checker, *value, variable); in InferEnumVariableType()
[all …]
/arkcompiler/ets_frontend/es2panda/ir/expressions/
DunaryExpression.cpp45 … if (!result.variable || (result.scope->IsGlobalScope() && result.variable->IsGlobalVariable())) { in Compile()
47 compiler::VReg variable = pg->AllocReg(); in Compile() local
54 pg->StoreAccumulator(this, variable); in Compile()
56 pg->DeleteObjProperty(this, global, variable); in Compile()
83 if (!res.variable && !pg->isDebuggerEvaluateExpressionMode()) { in Compile()
90 } else if (!res.variable && pg->isDebuggerEvaluateExpressionMode()) { in Compile()
/arkcompiler/ets_frontend/es2panda/util/
Dconcurrent.cpp70 if (result.variable->IsModuleVariable() && result.variable->Declaration()->IsImportDecl()) { in VerifyImportVarForConcurrentFunction()
75 result.variable->Declaration()->Name()); in VerifyImportVarForConcurrentFunction()
/arkcompiler/ets_frontend/es2panda/binder/
Dbinder.cpp239 ASSERT(res.variable); in LookupReference()
240 res.variable->SetLexical(res.scope, program_->PatchFixHelper()); in LookupReference()
300 ASSERT(res.variable); in LookupIdentReference()
301 if (!res.variable->Declaration()->IsDeclare()) { in LookupIdentReference()
303 res.variable->SetLexical(res.scope, program_->PatchFixHelper()); in LookupIdentReference()
307 if (res.variable == nullptr) { in LookupIdentReference()
311 auto decl = res.variable->Declaration(); in LookupIdentReference()
313 !res.variable->HasFlag(VariableFlags::INITIALIZED)) { in LookupIdentReference()
321 ident->SetVariable(res.variable); in LookupIdentReference()
422 auto *variable = scope_->FindLocal(name, ResolveBindingOptions::BINDINGS); in BuildVarDeclaratorId() local
[all …]
/arkcompiler/runtime_core/tests/checked/
Difcvt.pa25 # without variable, you can write only such code.
26 # Equivalent code with variable:
44 # without variable, you can write only such code.
45 # Equivalent code with variable:

123456