Home
last modified time | relevance | path

Searched full:reflect (Results 1 – 25 of 156) sorted by relevance

1234567

/arkcompiler/ets_frontend/ets2panda/linter/test/interop/
Dreflect_built_in.ets18 Reflect.get(prx, 'a') // 'hello'
19 Reflect.set(prx, 'a', 'world') // true
20 Reflect.ownKeys(prx) // ['a']
24 return Reflect.has(obj, 'prop');
36 Reflect.get(prx, 'a') // 'hello'
37 Reflect.set(prx, 'a', 'world') // true
38 Reflect.ownKeys(prx) // ['a']
42 Reflect.get(new Reflect1(), 'a')
43 Reflect.set(new Reflect1(), 'a', 'world')
44 Reflect.ownKeys(new Reflect1())
[all …]
Dreflect_built_in.ets.arkts2.json24 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
34 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
44 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
54 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
64 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
74 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
114 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
124 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
134 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
144 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
[all …]
Dreflect_built_in.ets.json24 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
34 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
44 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
54 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
94 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
104 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
114 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
124 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
134 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
144 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/escompat/
DReflectOwnKeys.ets26 compareArray(Reflect.ownKeys(true), emptyArray)
27 compareArray(Reflect.ownKeys(false), emptyArray)
31 compareArray(Reflect.ownKeys(0 as byte), emptyArray)
32 compareArray(Reflect.ownKeys(Byte.MIN_VALUE), emptyArray)
33 compareArray(Reflect.ownKeys(Byte.MAX_VALUE), emptyArray)
37 compareArray(Reflect.ownKeys(c'\0'), emptyArray)
38 compareArray(Reflect.ownKeys(c'1'), emptyArray)
42 compareArray(Reflect.ownKeys(0 as short), emptyArray)
43 compareArray(Reflect.ownKeys(Short.MIN_VALUE), emptyArray)
44 compareArray(Reflect.ownKeys(Short.MAX_VALUE), emptyArray)
[all …]
DReflectGetBadCases.ets20 failures += test(reflectGetBadCases(), "Reflect.get on types without fields and elements");
57 Reflect.get(c, "a")
59 … result += e.toString().contains("`target` argument of Reflect.get must have fields", 0) ? 0 : 1
63 Reflect.get(bo, "a")
65 … result += e.toString().contains("`target` argument of Reflect.get must have fields", 0) ? 0 : 1
69 Reflect.get(bt, "a")
71 … result += e.toString().contains("`target` argument of Reflect.get must have fields", 0) ? 0 : 1
75 Reflect.get(sh, "a")
77 … result += e.toString().contains("`target` argument of Reflect.get must have fields", 0) ? 0 : 1
81 Reflect.get(i, "a")
[all …]
DReflectHas.ets19 failures += test(reflectHas(), "Reflect.has");
71 result += (Reflect.has(arr, 0) == true) ? 0 : 1
72 result += (Reflect.has(arr, 3) == false) ? 0 : 1
73 result += (Reflect.has(arr, "length") == true) ? 0 : 1
74 result += (Reflect.has(arr, "qwerty") == false) ? 0 : 1
75 result += (Reflect.has(arr, "toString") == true) ? 0 : 1
76 result += (Reflect.has(arr, "toLocaleString") == true) ? 0 : 1
77 result += (Reflect.has(arr, "keys") == false) ? 0 : 1
79 result += (Reflect.has(str, 0) == true) ? 0 : 1
80 result += (Reflect.has(str, 3) == false) ? 0 : 1
[all …]
DReflectSet.ets20 failures += test(reflectSetClass(), "Reflect.set on class type");
21 failures += test(reflectSetArray(), "Reflect.set on array type");
22 failures += test(reflectSetTypeConvert(), "Reflect.set convert type");
72 result += (Reflect.set(p, "x", 40 as number) == true) ? 0 : 1
73 result += (Reflect.set(p, "y", 50 as number) == true) ? 0 : 1
74 result += (Reflect.set(p, "z", 60 as number) == true) ? 0 : 1
76 result += (Reflect.get(p, "x") as Number == 40) ? 0 : 1
77 result += (Reflect.get(p, "y") as Number == 50) ? 0 : 1
78 result += (Reflect.get(p, "z") as Number == 60) ? 0 : 1
80 result += (Reflect.set(p, "axisnum", 10 as number) == false) ? 0 : 1
[all …]
DReflectGet.ets20 failures += test(reflectGetClass(), "Reflect.get on class type");
21 failures += test(reflectGetArray(), "Reflect.get on array type");
22 failures += test(reflectGetLambda(), "Reflect.get on function type");
51 result += (Reflect.get(p, "x") as Number == 10) ? 0 : 1
52 result += (Reflect.get(p, "y") as Number == 20) ? 0 : 1
53 result += (Reflect.get(p, "z") as Number == 30) ? 0 : 1
55 result += (Reflect.get(p, "axisnum") == undefined) ? 0 : 1
56 result += (Reflect.get(p, "qwerty") == undefined) ? 0 : 1
57 result += (Reflect.get(p, 1) == null) ? 0 : 1
68 result += (Reflect.get(arr, 0) as Number == 10) ? 0 : 1
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/core/
DTypedArrayReflectSetTest.ets18 arktest.assertEQ(Reflect.set(sample, '1.1', 1), true);
21 arktest.assertEQ(Reflect.set(sample, '0.0001', 1), true);
24 arktest.assertEQ(Reflect.set(sample, '0', '127'), true);
27 arktest.assertEQ(Reflect.set(sample, '0', '0x7F'), true);
30 arktest.assertEQ(Reflect.set(sample, '0', '0o77'), true);
33 arktest.assertEQ(Reflect.set(sample, '0', '0b101010'), true);
36 arktest.assertEQ(Reflect.set(sample, '0', '3.9'), true);
39 arktest.assertEQ(Reflect.set(sample, '0', 7.8), true);
42 arktest.assertEQ(Reflect.set(sample, '0', '-0x1F'), true);
48 arktest.assertEQ(Reflect.set(sample, '1.1', 1), true);
[all …]
/arkcompiler/ets_runtime/test/moduletest/builtins/
Dbuiltinsreflect.js18 * @tc.desc:test builtins reflect
22 print("builtins reflect start");
24 // test1 -- reflect set length
27 var tag1 = Reflect.set(y, 'length', 0);
28 var tag2 = Reflect.set(y, 'length', 5);
35 Reflect.set(v56, "length", v0)
36 Reflect.set(v55, "length", v0, v56)
87 if (true == Reflect.get(target, "bla") &&
88 42 == Reflect.get(target, 4) &&
89 42 == Reflect.get(target, "4") &&
[all …]
/arkcompiler/ets_runtime/test/aottest/builtin_inlining/reflect/Reflect/
DbuiltinReflectReflect.ts17 //aot: [trace] aot inline builtin: Reflect.getPrototypeOf, caller function name:func_main_0@builtin…
18 print(Reflect.getPrototypeOf({})) //: [object Object]
20 …//aot: [trace] aot inline builtin: Reflect.getPrototypeOf, caller function name:func_main_0@builti…
21 Reflect.getPrototypeOf(1);
26 //aot: [trace] aot inline builtin: Reflect.get, caller function name:func_main_0@builtinReflectRefl…
27 print(Reflect.get(o, "a")); //: 123
28 //aot: [trace] aot inline builtin: Reflect.get, caller function name:func_main_0@builtinReflectRefl…
29 print(Reflect.get(o, "b")); //: abc
30 //aot: [trace] aot inline builtin: Reflect.get, caller function name:func_main_0@builtinReflectRefl…
31 print(Reflect.get(o, "c")); //: undefined
[all …]
/arkcompiler/ets_runtime/test/aottest/aot_compatibility_test/builtins_api/
Dbuiltins_api.ts26 print("Reflect.has:", Reflect.has(this, "b"));
27 print("Reflect.ownKeys():", Reflect.ownKeys(this));
28 print("Reflect.get:", Reflect.get(this, "b"));
29 … print("Reflect.getOwnPropertyDescriptor():", Reflect.getOwnPropertyDescriptor(this, "b"));
35 print("Reflect.has:", Reflect.has(this, "b"));
36 print("Reflect.ownKeys():", Reflect.ownKeys(this));
37 print("Reflect.get:", Reflect.get(this, "b"));
38 … print("Reflect.getOwnPropertyDescriptor():", Reflect.getOwnPropertyDescriptor(this, "b"));
Dexpect_output.txt18 Reflect.has: false
19 Reflect.ownKeys():
20 Reflect.get: undefined
21 Reflect.getOwnPropertyDescriptor(): undefined
26 Reflect.has: true
27 Reflect.ownKeys(): b
28 Reflect.get: abc
29 Reflect.getOwnPropertyDescriptor(): [object Object]
/arkcompiler/ets_frontend/ets2panda/linter/test/interop/oh_modules/
Dreflect_export.ets17 Reflect.get(prx, 'a') // 'hello'
18 Reflect.set(prx, 'a', 'world') // true
19 Reflect.ownKeys(prx) // ['a']
23 return Reflect.has(obj, 'prop');
43 Reflect.ownKeys(prx) // ['a']
44 Reflect.set(prx, 'a', 7) // true
45 Reflect.get(prx, 'a') // true
46 Reflect.has(prx, 'a') // true
50 Reflect.set(prx, 'a', 7) // true
54 Reflect.get(prx, 'a') // true
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/test/rules/
Drule144.ets84 /// Reflect
85 Reflect.apply<C, number[], void>(() => {}, c, []);
86 Reflect.construct<number[], C>(C, []);
87 Reflect.defineProperty(c, 'p', {});
88 Reflect.deleteProperty(c, 'p', );
89 Reflect.get<C, string>(c, 'p');
90 Reflect.getOwnPropertyDescriptor<C, string>(c, 'p');
91 Reflect.getPrototypeOf(c);
92 Reflect.isExtensible(c);
93 Reflect.preventExtensions(c);
[all …]
Drule144.ets.json284 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
304 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
334 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
364 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
374 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
394 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
414 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
434 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
454 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
474 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/homecheck/src/checker/migration/
DInteropRuleInfo.ts33 // 1.1 Reflect => ArkTS 1.2 对象
35 ruleId: 'arkts-interop-d2s-dynamic-reflect-on-static-instance',
37 description: "ArkTS 1.1 Reflect's built-in methods work on ArkTS 1.2 objects",
49 // 1.2 Reflect => ArkTS 1.1 对象
51 ruleId: 'arkts-interop-d2s-static-reflect-on-dynamic-instance',
53 description: "ArkTS 1.2 Reflect's built-in methods work on ArkTS 1.1 objects",
65 // 1.1 Reflect => ArkTS 1.2 对象
67 ruleId: 'arkts-interop-s2d-dynamic-reflect-on-static-instance',
69 description: "ArkTS 1.1 Reflect's built-in methods work on ArkTS 1.2 objects",
81 // 1.2 Reflect => 1.1 对象
[all …]
/arkcompiler/ets_runtime/ecmascript/builtins/
Dbuiltins_reflect.h29 // List of functions in Reflect, excluding the '@@' properties.
31 // where BuiltinsRefject::func refers to the native implementation of Reflect[name].
34 /* Reflect.apply ( target, thisArgument, argumentsList ) */ \
36 /* Reflect.construct ( target, argumentsList [ , newTarget ] ) */ \
38 /* Reflect.defineProperty ( target, propertyKey, attributes ) */ \
40 /* Reflect.deleteProperty ( target, propertyKey ) */ \
42 /* Reflect.get ( target, propertyKey [ , receiver ] ) */ \
44 /* Reflect.getOwnPropertyDescriptor ( target, propertyKey ) */ \
46 /* Reflect.getPrototypeOf ( target ) */ \
48 /* Reflect.has ( target, propertyKey ) */ \
[all …]
Dbuiltins_reflect.cpp22 // ecma 26.1.1 Reflect.apply (target, thisArgument, argumentsList)
26 BUILTINS_API_TRACE(argv->GetThread(), Reflect, Apply); in ReflectApply()
42 …THROW_TYPE_ERROR_AND_RETURN(thread, "Reflect.apply target is not callable", JSTaggedValue::Excepti… in ReflectApplyInternal()
60 // ecma 26.1.2 Reflect.construct (target, argumentsList [ , newTarget])
64 BUILTINS_API_TRACE(argv->GetThread(), Reflect, Constructor); in ReflectConstruct()
70 …THROW_TYPE_ERROR_AND_RETURN(thread, "Reflect.construct target is not constructor", JSTaggedValue::… in ReflectConstruct()
77 … THROW_TYPE_ERROR_AND_RETURN(thread, "Reflect.construct newTarget is present, but not constructor", in ReflectConstruct()
101 // ecma 26.1.3 Reflect.defineProperty (target, propertyKey, attributes)
105 BUILTINS_API_TRACE(argv->GetThread(), Reflect, DefineProperty); in ReflectDefineProperty()
111 …THROW_TYPE_ERROR_AND_RETURN(thread, "Reflect.defineProperty target is not object", JSTaggedValue::… in ReflectDefineProperty()
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/test/main/
Dlimited_stdlib_api.ets84 /// Reflect
85 Reflect.apply<C, number[], void>(() => {}, c, []);
86 Reflect.construct<number[], C>(C, []);
87 Reflect.defineProperty(c, 'p', {});
88 Reflect.deleteProperty(c, 'p', );
89 Reflect.get<C, string>(c, 'p');
90 Reflect.getOwnPropertyDescriptor<C, string>(c, 'p');
91 Reflect.getPrototypeOf(c);
92 Reflect.isExtensible(c);
93 Reflect.preventExtensions(c);
[all …]
Dlimited_stdlib_api.ets.json284 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
304 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
334 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
364 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
374 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
394 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
414 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
434 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
454 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
474 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
[all …]
Dlimited_stdlib_api.ets.arkts2.json364 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
384 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
414 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
444 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
464 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
474 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
494 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
514 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
534 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
554 …ule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a c…
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/test/interop/ignore_files/
Dunique_types.ts196 Reflect.apply(prx.getName, {a: 12}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 12
197Reflect.defineProperty(prx, 'newField', {value: 7}) // arkts-interop-ts2s-ts-object-on-static-inst…
198 Reflect.deleteProperty(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 true
199Reflect.getOwnPropertyDescriptor(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 …
200 Reflect.ownKeys(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 ['a']
201 Reflect.isExtensible(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true
202 Reflect.set(prx, 'newField', 7) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true
203 Reflect.setPrototypeOf(prx, {}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true
207 Reflect.apply(prx.getName, {a: 12}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 12
210Reflect.defineProperty(prx, 'newField', {value: 7}) // arkts-interop-ts2s-ts-object-on-static-inst…
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/
DReflect.ets18 export class Reflect {
45 throw new Error("`target` argument of Reflect.get must have fields")
47 if (!Reflect.has(target, key)) {
56 const getter = Reflect.findMethod(t, Reflect.GETTER_PREFIX + key)
118 throw new Error("`target` argument of Reflect.get must be indexed")
120 if (!Reflect.has(target, index)) {
163 return Reflect.numberFromString(value);
308 if (!Reflect.isValidBigIntDigits(digits, radix)) {
312 let result: long|double = Reflect.stringToLongWithRadix(digits, radix);
373 let result = Reflect.parseBigIntFromString(value);
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_test_suite/object_literal/
Dis_interface_literal.ets103 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), true)
108 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), false)
113 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), true)
118 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), false)
123 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), true)
128 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), false)
133 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), true)
138 arktest.assertEQ(Reflect.isLiteralInitializedInterface(tif), false)

1234567