Home
last modified time | relevance | path

Searched full:null (Results 1 – 25 of 3686) sorted by relevance

12345678910>>...148

/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/13.chaining_operator/
Dchop0.ets18 If the object to the left of ('?.') is undefined or null, then the evaluation of the entire
28 fldA: string|null = "abc"
29 fldAn: string|null = null
30 metA(p: string): string|null {
31 return p == "null" ? null : p
36 fldB: A|null = new A()
37 fldBn: A|null = null
38 metB(p: string): A|null {
39 return p == "null" ? null : new A()
43 function boo(p: string): B|null {
[all …]
/arkcompiler/ets_frontend/ets2panda/test/runtime/ets/
DnullableType.ets19 type tmp = (A | null) | null | null;
20 type tmp2 = A | null;
22 type NullableA_alias = (A_alias | null) | null;
31 let a : Object | null = null;
32 let b : Object | null = new Object();
33 let c : Object | null | null = b;
34 let d : (((Object) | null) | null) | null = numericNullableType();
35 let f : A | null = null;
36 let g : tmp | null = f;
37 let g2 : tmp2 = null;
[all …]
DSmartCast_04.ets16 function fooAnd(x: String|null, y: String|null): string {
17 if (x != null && y != null) {
19 } else if (x == null && y == null) {
20 return "null";
21 } else if (x != null && y == null) {
23 } else if (x == null && y != null) {
30 function fooOr1(x: String|null, y: String|null): string {
31 if (x != null || y != null) {
33 } else if (x == null && y == null) {
34 return "null";
[all …]
DUnionAsAndInstanceof.ets38 function foo(x: Object | null | undefined) { return x as Object }
43 assert_ccexc(() => { let f = ((x: Object | null | undefined) => x as Object); f(null); });
44 assert_ccexc(() => { let f = ((x: Object | null | undefined) => x as Object); f(undefined); });
45 assert_ccexc(() => { let f = ((x: Object | null) => x as Object); f(null); });
48 …assert_ccexc(() => { let f = ((x: Object | null | undefined) => x as Object | undefined); f(null);…
49 …assert_ccexc(() => { let f = ((x: Object | null | undefined) => x as Object | null); f(undefined);…
50 assert_ccexc(() => { let f = ((x: Object | null) => x as Object | undefined); f(null); });
51 assert_ccexc(() => { let f = ((x: Object | undefined) => x as Object | null); f(undefined); });
53 assert_ccexc(() => { let f = ((x: A | null | undefined) => x as A); f(null); });
54 assert_ccexc(() => { let f = ((x: A | null | undefined) => x as A); f(undefined); });
[all …]
/arkcompiler/ets_frontend/ets2panda/test/parser/ets/
Dawait_keyword.ets16 async function asyncFoo(): Promise<Object | null> {
17 …let promise: Promise<Object | null> | null = (): Promise<Object | null> | null => { return null; }…
18 let obj: Object | null = await promise!;
22 let asyncLambda: () => Promise<Object | null> = async (): Promise<Object | null> => {
23 …let promise: Promise<Object | null> | null = (): Promise<Object | null> | null => { return null; }…
24 let obj: Object | null = await promise!;
29 …let promise: Promise<Object | null> | null = (): Promise<Object | null> | null => { return null; }…
30 let obj: Object | null = await promise!;
34 …let promise: Promise<Object | null> | null = (): Promise<Object | null> | null => { return null; }…
35 let obj: Object | null = await promise!;
[all …]
Dnull-expected.txt15 "program": "null.ets"
20 "program": "null.ets"
24 "superClass": null,
37 "program": "null.ets"
42 "program": "null.ets"
62 "program": "null.ets"
67 "program": "null.ets"
82 "program": "null.ets"
87 "program": "null.ets"
95 "program": "null.ets"
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/03.types/20.nullish_types/
Dreference_nullable_types.params.yaml16 # null
17 - {type: "Byte|null", value: "5"}
18 - {type: "Byte|null", value: "null"}
19 - {type: "Short|null", value: "5"}
20 - {type: "Short|null", value: "null"}
21 - {type: "Int|null", value: "5"}
22 - {type: "Int|null", value: "null"}
23 - {type: "Long|null", value: "5 as long"}
24 - {type: "Long|null", value: "null"}
25 - {type: "Float|null", value: "5.0"}
[all …]
/arkcompiler/ets_runtime/test/jittest/wide_call_range_pref_imm16v8/
Dwide_call_range_pref_imm16v8.ts21 …at_video_info, wx_plugin_middle_page, xj_wechat_canvas_info, serializationConstructorMarker, null);
34 var tmp9_local0 = null;
35 var tmp10_local1 = null;
37 var tmp12_local3 = null;
38 var tmp13_local4 = null;
39 var tmp14_local5 = null;
42 var tmp17_local8 = null;
44 var tmp19_local10 = null;
46 var tmp21_local12 = null;
47 var tmp22_local13 = null;
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/01.assignment-like_contexts/
Dnull_call.params.yaml17 - Boolean|null
18 - Byte|null
19 - Char|null
20 - Double|null
21 - Float|null
22 - Int|null
23 - Long|null
24 - Object|null
25 - Short|null
26 - StringBuilder|null
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/05.generics/02.generic_instantiations/01.type_arguments/type_arguments_of_parameterized_declarations/
Dconstr_args1.params.yaml21 let v: A<X|null> = new A<X|null> (new X())
24 let v: A<X|null> = new A<X|null> (null)
31 let v: A<X|null> = new A<X|null> (new X())
32 bound: ' extends X|null'
35 let v: A<X|null> = new A<X|null> (null)
36 bound: ' extends Object|null'
43 let v: A<I|null> = new A<I|null> (new Y())
46 let v: A<I|null> = new A<I|null> (null)
53 let v: A<I|null> = new A<I|null> (new Y())
54 bound: ' extends I|null'
[all …]
Dconstr_args5_neg.params.yaml21 let v: A<Int,X|null> = new A<Int,X|null>(new Int(), new Object()) // Object is not X
24 let v: A<Int|null,X> = new A<Int|null,X>(null, null) // null is not X
27 let v: A<X,X|null> = new A<X,X|null>(new X(), new X()) // out of bound
32 let v: A<I,I> = new A<I,I>(new X(), null) // null is not I
35 let v: A<I|null,I|null> = new A<I|null,I|null>(null, new Object()) // Object is not I
38 let v: A<Y,Object|null> = new A<Y,Object|null>(new Y(), null) // out of bound
39 bound: ' extends I|null'
46 …let v: A<int[]|null,X[]|null> = new A<int[]|null,X[]|null>(null, new Object[0]) // Object[] is no…
54 let v: A<B,B> = new A<B,B>(null, new X[0]) // X[] is not X[][]
55 decl: type B = X[][]|null
[all …]
Dconstr_args2.params.yaml21 let v: A<Int,X|null> = new A<Int,X|null>(new Int(), new X())
24 let v: A<Int|null,X|null> = new A<Int|null,X|null>(null, null)
27 let v: A<X,X|null> = new A<X,X|null>(new X(), new X())
28 bound: ' extends X|null'
31 let v: A<Object,X|null> = new A<Object,X|null>(new X(), null)
32 bound: ' extends Object|null'
39 let v: A<I|null,I|null> = new A<I|null,I|null>(null, new Y())
42 let v: A<Y,I|null> = new A<Y,I|null>(new Y(), new Y())
43 bound: ' extends I|null'
50 let v: A<int[]|null,X[]|null> = new A<int[]|null,X[]|null>(null, new X[0])
[all …]
Dconstr_args2_neg.params.yaml21 let v: A<Int> = new <X|null> A<Int>(new Int(), new Object()) // Object is not X
24 let v: A<Int|null> = new <X> A<Int|null>(null, null) // null is not X
27 let v: A<X> = new <X|null> A<X>(new X(), new X()) // out of bound
32 let v: A<I> = new <I> A<I>(new X(), null) // null is not I
35 let v: A<I|null> = new <I|null> A<I|null>(null, new Object()) // Object is not I
38 let v: A<Y> = new <Object|null> A<Y>(new Y(), null) // out of bound
39 bound: ' extends I|null'
46 … let v: A<int[]|null> = new <X[]|null> A<int[]|null>(null, new Object[0]) // Object[] is not X[]
54 let v: A<B> = new <B> A<B>(null, new X[0]) // X[] is not X[][]
55 decl: type B = X[][]|null
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/test/main/
Dfunctions.ets93 foo(f(null));
94 foo(null);
97 f(null);
101 f(null);
102 }, null, f(null));
106 f(null);
107 }, null, f(null));
108 }, null, foo(f(null)));
116 f(null)
117 foo(null) {
[all …]
Dnull_check_calls.ets21 function g1(): C1 | null {
25 return null
30 bar(null);
31 bar(null, null);
32 applyToUnknown(null);
33 fooExecute(null);
37 fff(null);
38 ff(null);
39 f(null);
42 ((a: number) => a)(null);
[all …]
Dfunctions.ets.json123 "suggest": "Argument of type 'null' is not assignable to parameter of type 'string'.",
124 "rule": "Argument of type 'null' is not assignable to parameter of type 'string'.",
133 "suggest": "Argument of type 'null' is not assignable to parameter of type 'string'.",
134 "rule": "Argument of type 'null' is not assignable to parameter of type 'string'.",
143 "suggest": "Argument of type 'null' is not assignable to parameter of type 'string'.",
144 "rule": "Argument of type 'null' is not assignable to parameter of type 'string'.",
153 "suggest": "Argument of type 'null' is not assignable to parameter of type 'string'.",
154 "rule": "Argument of type 'null' is not assignable to parameter of type 'string'.",
163 "suggest": "Argument of type 'null' is not assignable to parameter of type 'string'.",
164 "rule": "Argument of type 'null' is not assignable to parameter of type 'string'.",
[all …]
/arkcompiler/ets_frontend/ets2panda/test/compiler/ets/
Ddynamic_call-expected.txt106 "superClass": null,
119 "program": null
124 "program": null
145 "program": null
150 "program": null
165 "program": null
170 "program": null
178 "program": null
183 "program": null
191 "program": null
[all …]
DdynamicJsImport-expected.txt188 "superClass": null,
201 "program": null
206 "program": null
227 "program": null
232 "program": null
247 "program": null
252 "program": null
260 "program": null
265 "program": null
273 "program": null
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_ts_subset/std/core/
DPromiseNullish.ets20 Promise.resolve<string | undefined | null>(null)
21 .then<string | undefined | null>(id)
25 Promise.resolve<string | undefined | null>(undefined)
26 .then<string | undefined | null>(id)
30 Promise.all<string | undefined | null>([Promise.resolve<string | undefined | null>(undefined)])
31 .then<Array<string | undefined | null>>(id)
35 Promise.all<string | undefined | null>([Promise.resolve<string | undefined | null>(null)])
36 .then<Array<string | undefined | null>>(id)
40 Promise.allSettled<string | undefined | null>([Promise.resolve<string | undefined | null>(undefined…
41 .then<PromiseSettledResult<string | undefined | null>[]>(id)
[all …]
/arkcompiler/ets_frontend/ets2panda/bindings/test/expected/
DgetCompletionAtPosition.json8 "data": null
15 "data": null
24 "data": null
31 "data": null
38 "data": null
47 "data": null
54 "data": null
61 "data": null
68 "data": null
77 "data": null
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/08.equality_with_null_or_undefined/
Dnull_and_undefined_equality.params.yaml21 let a: undefined|null;
27 let a: A|undefined|null;
33 let a: A|undefined|null;
34 assertTrue( a == null )
39 let a: A|undefined|null;
45 let a: A|undefined|null;
46 assertTrue( a !== null )
51 let a: A|undefined|null = new A();
52 assertNE( a, null )
57 let a: A|undefined|null = new A();
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/doc/tutorial/
Dnullsafety.rst13 Null Safety
19 cannot be null. It is similar to the |TS| behavior in strict null checking
26 let x: number = null // Compile-time error
27 let y: string = null // ditto
28 let z: number[] = null // ditto
30 A variable that can have a null value is defined with a union type ``T | null``:
34 let x: number | null = null
36 x = null // ok
37 if (x != null) { /* do something */ }
41 Non-Null Assertion Operator
[all …]
/arkcompiler/ets_frontend/ets2panda/test/parser/ts/
Dtest-ts-non-null-expression-expected.txt18 "program": "test-ts-non-null-expression.ts"
23 "program": "test-ts-non-null-expression.ts"
32 "program": "test-ts-non-null-expression.ts"
37 "program": "test-ts-non-null-expression.ts"
48 "program": "test-ts-non-null-expression.ts"
53 "program": "test-ts-non-null-expression.ts"
61 "program": "test-ts-non-null-expression.ts"
66 "program": "test-ts-non-null-expression.ts"
76 "program": "test-ts-non-null-expression.ts"
81 "program": "test-ts-non-null-expression.ts"
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/uri/
DUriTestAttributeNull.ets20 assertEQ(gaogao.scheme, null);
22 assertEQ(gaogao.authority, null);
23 assertEQ(gaogao.userInfo, null);
24 assertEQ(gaogao.query, null);
25 assertEQ(gaogao.fragment, null);
26 assertEQ(gaogao.encodedAuthority, null);
27 assertEQ(gaogao.encodedUserInfo, null);
28 assertEQ(gaogao.encodedQuery, null);
29 assertEQ(gaogao.encodedFragment, null);
33 assertEQ(gaogao.userInfo, null);
[all …]
/arkcompiler/ets_runtime/test/moduletest/arrayfrom/
Dexpect_output.txt68 [0,1,2,null,null,null,null,null,null,null]
72 [null,1,null,null,null,null,null,null,null,null]
88 [0,1,2,null,null,null,null,null,null,null]
90 [null,null,null]

12345678910>>...148