Home
last modified time | relevance | path

Searched refs:prop (Results 1 – 25 of 275) sorted by relevance

1234567891011

/arkcompiler/ets_frontend/ts2panda/src/expression/
DobjectLiteralExpression.ts61 for (let prop of properties) {
62 if (prop.getKind() === PropertyKind.SPREAD || prop.getKind() === PropertyKind.COMPUTED) {
66 if (prop.getKind() === PropertyKind.PROTOTYPE || prop.isRedeclared()) {
70 let nameLiteral = new Literal(LiteralTag.STRING, String(prop.getName()));
72 if (prop.getKind() === PropertyKind.CONSTANT) {
73 let valLiteral: Literal = createConstantLiteral(prop);
76 prop.setCompiled(); // need to be careful
79 if (prop.getKind() === PropertyKind.VARIABLE) {
81 let valueNode = prop.getValue();
93 prop.setCompiled();
[all …]
DmemberAccessExpression.ts29 let { obj: obj, prop: property } = getObjAndProp(node, objReg, propReg, compiler);
48 … objReg: VReg, propReg: VReg, compiler: Compiler): { obj: VReg; prop: any; } {
51 let prop: VReg | string | number = propReg; variable
64 prop = jshelpers.getTextOfIdentifierOrLiteral(node.name);
67 prop = jshelpers.getTextOfIdentifierOrLiteral(node.argumentExpression);
69 let temp = Number(prop);
70 …if (!isNaN(Number.parseFloat(prop)) && !isNaN(temp) && isValidIndex(temp) && String(temp) === prop
71 prop = temp;
74 prop = parseFloat(jshelpers.getTextOfIdentifierOrLiteral(node.argumentExpression));
75 if (!isValidIndex(prop)) {
[all …]
/arkcompiler/ets_frontend/es2panda/test/compiler/ts/cases/conformance/classes/
Dtest-ts-classes-18.ts18 prop = 1; property in Base
24 this.prop = 4;
26 prop = 2; property in A
27 prop2 = this.prop;
32 constructor(public prop = 3) { property in B
34 this.prop = 4;
36 prop2 = this.prop;
40 print(a.prop);
44 print(b.prop);
Dtest-ts-classes-13.ts18 prop = "str1"; property in A
21 print(obj.prop);
25 prop = "Str_NSEA"; property in ns.NSEA
29 print(objNSEA.prop);
32 prop = "str_B"; variable
35 print(objCExpr.prop);
39 prop = "str_NSB"; variable
43 print(objNSClass.prop);
Dtest-ts-classes-12.ts20 prop = "base_prop"; property in Base
36 prop:string; property in B
39 this.prop = "ctor_B_prop";
48 constructor(public prop = "tsparam_prop") { property in C
60 print(objB.prop);
66 print(objC.prop);
/arkcompiler/ets_frontend/es2panda/ir/expressions/
DobjectExpression.cpp100 auto *prop = it->AsProperty(); in ValidateExpression() local
101 info = prop->ValidateExpression(); in ValidateExpression()
103 if (prop->Kind() == PropertyKind::PROTO) { in ValidateExpression()
105 … return {"Duplicate __proto__ fields are not allowed in object literals", prop->Key()->Start()}; in ValidateExpression()
241 static const Literal *CreateLiteral(compiler::PandaGen *pg, const ir::Property *prop, util::BitSet … in CreateLiteral() argument
244 if (util::Helpers::IsConstantExpr(prop->Value())) { in CreateLiteral()
246 return prop->Value()->AsLiteral(); in CreateLiteral()
249 if (prop->Kind() != ir::PropertyKind::INIT) { in CreateLiteral()
250 ASSERT(prop->IsAccessor()); in CreateLiteral()
254 if (prop->IsMethod()) { in CreateLiteral()
[all …]
/arkcompiler/ets_frontend/ts2panda/src/base/
Dlreference.ts36 private prop: VReg | undefined = undefined; property in LReference
58 this.prop = compiler.getPandaGen().getTemp();
66 let prop: VReg | number | string; variable
68 prop = <VReg>this.prop!;
70 prop = this.propLiteral;
72 pandaGen.loadObjProperty(this.node, <VReg>this.obj, prop);
88 let prop: VReg | number | string; variable
90 prop = <VReg>this.prop!;
92 prop = this.propLiteral;
97 pandaGen.storeSuperProperty(this.node, thisReg, prop);
[all …]
/arkcompiler/ets_frontend/es2panda/ir/base/
DclassDefinition.cpp149 const ir::MethodDefinition *prop = properties[i]->AsMethodDefinition(); in CreateClassPublicBuffer() local
152 if (prop->IsPrivate()) { in CreateClassPublicBuffer()
156 if (prop->Computed()) { in CreateClassPublicBuffer()
160 if (prop->IsAccessor() && !isSendable_) { in CreateClassPublicBuffer()
164 if (prop->IsAbstract()) { in CreateClassPublicBuffer()
169 if (prop->IsOptional() && prop->Value()->Function()->IsOverload()) { in CreateClassPublicBuffer()
174 util::StringView name = util::Helpers::LiteralToPropName(pg->Allocator(), prop->Key()); in CreateClassPublicBuffer()
175 compiler::LiteralBuffer *literalBuf = prop->IsStatic() ? &staticBuf : buf; in CreateClassPublicBuffer()
176 auto &nameMap = prop->IsStatic() ? staticPropNameMap : propNameMap; in CreateClassPublicBuffer()
181 if (!prop->IsStatic()) { in CreateClassPublicBuffer()
[all …]
/arkcompiler/ets_frontend/es2panda/test/parser/ts/type_checker/
DobjectDestructuring.ts21 var { prop: [var3, , , var4], var5 = true } = { prop: [1, [], {}, "foo"] } variable
26 var { prop: { var6 = 3, var7 = "" } = { var6: "foo", var7: true } } = { prop: { var6: 1, var7: "bar… variable
32 var { prop: { prop: [var8 = 1, var9 = { a: 3, b: "bar" }] } = { prop: ["foo", true] } } = { prop: {… variable
50 var { prop: { var15, ...var16 } }: { prop: { var15: number, a: string, b(a: number, b: number[]): b… variable
/arkcompiler/ets_frontend/ets2panda/test/compiler/ts/
DobjectDestructuring.ts21 var { prop: [var3, , , var4], var5 = true } = { prop: [1, [], {}, "foo"] } variable
26 var { prop: { var6 = 3, var7 = "" } = { var6: "foo", var7: true } } = { prop: { var6: 1, var7: "bar… variable
32 var { prop: { prop: [var8 = 1, var9 = { a: 3, b: "bar" }] } = { prop: ["foo", true] } } = { prop: {… variable
50 var { prop: { var15, ...var16 } }: { prop: { var15: number, a: string, b(a: number, b: number[]): b… variable
/arkcompiler/ets_frontend/ts2panda/src/statement/
DclassStatement.ts77 let prop = properties[propertyIndex];
79 if (prop.getKind() === PropertyKind.CONSTANT) {
81 let nameLiteral = new Literal(LiteralTag.STRING, String(prop.getName()));
83 compiler.compileExpression(<ts.Expression>prop.getValue());
84 pandaGen.storeAccumulator(prop.getValue(), tmpVreg);
85 prop.setCompiled();
88 if (prop.getKind() === PropertyKind.VARIABLE) {
89 if (prop.getValue().kind != ts.SyntaxKind.Constructor) {
90 if (jshelpers.hasStaticModifier(prop.getValue())) {
93 let nameLiteral = new Literal(LiteralTag.STRING, String(prop.getName()));
[all …]
/arkcompiler/ets_frontend/ets2panda/test/parser/ts/
Dtest-ts-mapped-type.ts17 type Type1<T1> = { -readonly [prop in keyof T1]-?: boolean; };
18 type Type2<T2> = { +readonly [prop in keyof T2]+?: boolean; };
19 type Type3<T3> = { readonly [prop in keyof T3]?: boolean; };
20 type Type4<T4> = { [prop in keyof T4]: boolean; };
21 type Type5<T5> = { [prop in keyof T5]: boolean };
22 type Type6<T6> = { [prop in keyof T6]; };
23 type Type7<T7> = { [prop in keyof T7] };
/arkcompiler/ets_frontend/es2panda/test/parser/ts/
Dtest-ts-mapped-type.ts17 type Type1<T1> = { -readonly [prop in keyof T1]-?: boolean; };
18 type Type2<T2> = { +readonly [prop in keyof T2]+?: boolean; };
19 type Type3<T3> = { readonly [prop in keyof T3]?: boolean; };
20 type Type4<T4> = { [prop in keyof T4]: boolean; };
21 type Type5<T5> = { [prop in keyof T5]: boolean };
22 type Type6<T6> = { [prop in keyof T6]; };
23 type Type7<T7> = { [prop in keyof T7] };
Dtest-static-blocks-in-class4.ts18 static prop: number = 1; property in MultiFoo
20 print("hi " + MultiFoo.prop++);
23 print("hello " + MultiFoo.prop++);
26 print("world " + MultiFoo.prop++);
/arkcompiler/ets_frontend/es2panda/test/parser/sendable_class/
Dsendable-class-getter-setter.ts17 private prop: string; property in A
22 return this.prop;
24 set Prop(prop: string) {
25 this.prop = prop;
/arkcompiler/ets_frontend/es2panda/compiler/core/
Dfunction.cpp141 static void CompileField(PandaGen *pg, const ir::ClassProperty *prop, VReg thisReg, int32_t level) in CompileField() argument
146 if (prop->IsPrivate()) { in CompileField()
147 result = pg->Scope()->FindPrivateName(prop->Key()->AsPrivateIdentifier()->Name()); in CompileField()
148 } else if (prop->IsComputed() && prop->NeedCompileKey()) { in CompileField()
149 auto slot = prop->Parent()->AsClassDefinition()->GetSlot(prop->Key()); in CompileField()
150 pg->LoadLexicalVar(prop->Key(), level, slot); in CompileField()
152 pg->StoreAccumulator(prop->Key(), std::get<VReg>(op)); in CompileField()
154 op = pg->ToPropertyKey(prop->Key(), prop->IsComputed()); in CompileField()
157 if (!prop->Value()) { in CompileField()
158 pg->LoadConst(prop, Constant::JS_UNDEFINED); in CompileField()
[all …]
/arkcompiler/ets_frontend/ets2panda/checker/ts/
DtypeElaborationContext.cpp108 ir::Property *prop = it->AsProperty(); in Start() local
111 if (prop->IsComputed()) { in Start()
112 propKeyType = checker_->CheckComputedPropertyName(prop->Key()); in Start()
114 switch (prop->Key()->Type()) { in Start()
116 … propKeyType = checker_->Allocator()->New<StringLiteralType>(prop->Key()->AsIdentifier()->Name()); in Start()
121 prop->Key()->AsNumberLiteral()->Number().GetDouble()); in Start()
125 …propKeyType = checker_->Allocator()->New<StringLiteralType>(prop->Key()->AsStringLiteral()->Str()); in Start()
138 …targetElementType = GetBestMatchingType(propKeyType, prop->IsShorthand() ? nullptr : prop->Value()… in Start()
153 if (prop->IsShorthand()) { in Start()
157 checker_->ElaborateElementwise(targetElementType, prop->Value(), it->Start()); in Start()
/arkcompiler/ets_frontend/es2panda/typescript/core/
DtypeElaborationContext.cpp108 const ir::Property *prop = it->AsProperty(); in Start() local
111 if (prop->IsComputed()) { in Start()
112 propKeyType = checker_->CheckComputedPropertyName(prop->Key()); in Start()
114 switch (prop->Key()->Type()) { in Start()
116 … propKeyType = checker_->Allocator()->New<StringLiteralType>(prop->Key()->AsIdentifier()->Name()); in Start()
121 … checker_->Allocator()->New<NumberLiteralType>(prop->Key()->AsNumberLiteral()->Number()); in Start()
125 …propKeyType = checker_->Allocator()->New<StringLiteralType>(prop->Key()->AsStringLiteral()->Str()); in Start()
138 …targetElementType = GetBestMatchingType(propKeyType, prop->IsShorthand() ? nullptr : prop->Value()… in Start()
153 if (prop->IsShorthand()) { in Start()
157 checker_->ElaborateElementwise(targetElementType, prop->Value(), it->Start()); in Start()
/arkcompiler/ets_frontend/ets2panda/checker/types/ets/
DetsEnumType.cpp123 const ir::Identifier *const prop) const in LookupConstant()
126 …checker->ThrowTypeError({"Enum constant do not have property '", prop->Name(), "'"}, prop->Start()… in LookupConstant()
129 auto *const member = FindMember(prop->Name()); in LookupConstant()
131 …checker->ThrowTypeError({"No enum constant named '", prop->Name(), "' in enum '", this, "'"}, prop in LookupConstant()
147 const ir::Identifier *const prop) const in LookupMethod()
150 return LookupTypeMethod(checker, prop); in LookupMethod()
154 return LookupConstantMethod(checker, prop); in LookupMethod()
300 const ir::Identifier *const prop) const in LookupConstantMethod()
302 if (prop->Name() == TO_STRING_METHOD_NAME) { in LookupConstantMethod()
307 if (prop->Name() == GET_VALUE_METHOD_NAME) { in LookupConstantMethod()
[all …]
DetsObjectType.cpp31 for (const auto *prop : GetAllProperties()) { in Iterate() local
32 cb(prop); in Iterate()
188 for (const auto &[_, prop] : InstanceFields()) { in GetAllProperties()
190 allProperties.push_back(prop); in GetAllProperties()
193 for (const auto &[_, prop] : StaticFields()) { in GetAllProperties()
195 allProperties.push_back(prop); in GetAllProperties()
198 for (const auto &[_, prop] : InstanceMethods()) { in GetAllProperties()
200 allProperties.push_back(prop); in GetAllProperties()
203 for (const auto &[_, prop] : StaticMethods()) { in GetAllProperties()
205 allProperties.push_back(prop); in GetAllProperties()
[all …]
/arkcompiler/runtime_core/static_core/compiler/docs/
Dlicm_conditions_doc.md44 prop: start, bc: 0x00000000
53 prop: prehead, bc: 0x00000000
57 prop: head, loop 1, depth 1, bc: 0x00000000
65 prop: loop 1, depth 1, bc: 0x00000000
70 prop: loop 1, depth 1, bc: 0x00000000
75 prop: loop 1, depth 1, bc: 0x00000000
80 prop: loop 1, depth 1, bc: 0x00000000
85 prop: loop 1, depth 1, bc: 0x00000000
91 prop: bc: 0x00000000
96 prop: end, bc: 0x00000000
[all …]
/arkcompiler/ets_frontend/es2panda/test/compiler/ts/cases/compiler/
Dtest-ts-static-blocks-in-class3.ts19 static prop: number = 1; property in MultiFoo
21 print("hi " + MultiFoo.prop++);
24 print("hello " + MultiFoo.prop++);
27 print("world " + MultiFoo.prop++);
Dtest-ts-static-blocks-in-class6.ts19 static prop: number = 1; variable
21 print("hi " + MultiFoo.prop++);
24 print("hello " + MultiFoo.prop++);
27 print("world " + MultiFoo.prop++);
/arkcompiler/ets_frontend/ets2panda/ir/expressions/
DobjectExpression.cpp104 auto *prop = it->AsProperty(); in ValidateExpression() local
105 info = prop->ValidateExpression(); in ValidateExpression()
107 if (prop->Kind() == PropertyKind::PROTO) { in ValidateExpression()
109 … return {"Duplicate __proto__ fields are not allowed in object literals", prop->Key()->Start()}; in ValidateExpression()
260 auto *prop = (*it)->AsProperty(); in CheckPattern() local
262 if (prop->IsComputed()) { in CheckPattern()
266 … varbinder::LocalVariable *foundVar = desc->FindProperty(prop->Key()->AsIdentifier()->Name()); in CheckPattern()
270 if (prop->IsShorthand()) { in CheckPattern()
271 switch (prop->Value()->Type()) { in CheckPattern()
273 const ir::Identifier *ident = prop->Value()->AsIdentifier(); in CheckPattern()
[all …]
/arkcompiler/ets_frontend/ets2panda/compiler/core/
Dfunction.cpp177 const auto *prop = element->AsClassProperty(); in CompileInstanceFields() local
179 if ((prop->IsStatic())) { in CompileInstanceFields()
183 if (prop->IsPrivateElement()) { in CompileInstanceFields()
184 if (prop->Value() == nullptr) { in CompileInstanceFields()
188 prop->Value()->Compile(pg); in CompileInstanceFields()
191 pg->ClassPrivateFieldAdd(prop, ctor, thisReg, prop->Key()->AsIdentifier()->Name()); in CompileInstanceFields()
198 if (prop->IsComputed()) { in CompileInstanceFields()
200 pg->LoadAccumulator(prop, computedInstanceFieldsArray); in CompileInstanceFields()
201 pg->LoadObjByIndex(prop, computedInstanceFieldsIndex++); in CompileInstanceFields()
202 pg->StoreAccumulator(prop, keyReg); in CompileInstanceFields()
[all …]

1234567891011