1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16void 0; 17 18void 'hello'; 19 20void (1 + 2); 21 22void { a: 1, b: 2 }; 23 24void [1, 2, 3]; 25 26void console.log('expression evaluated'); 27 28const undefined_value = void 1; 29 30const undefined_value2: undefined = void 2; 31 32const undefined_value3: number | undefined = void 3; 33 34void void 1; 35 36void function () { 37 console.log('foo'); 38}; 39 40void function () { 41 console.log("bar!"); 42}(); 43 44void (function () { 45 console.log('baz!'); 46})(); 47 48void class {}; 49 50void (class {}); 51 52void (() => {}); 53 54function foo() { 55 let a = 1; 56 void a++; 57 58 let b = [1, 2, 3]; 59 void console.log(b.filter(x => x % 2 !== 0)); 60 61 void function() { 62 console.log('foo'); 63 }; 64 65 void function localFun() { 66 console.log('foo'); 67 }; 68 69 void class {}; 70 71 void class localClass{}; 72} 73