1/* 2 Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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 Copyright (c) 2024 Huawei Device Co., Ltd. 16 Licensed under the Apache License, Version 2.0 (the "License"); 17 you may not use this file except in compliance with the License. 18 You may obtain a copy of the License at 19 * 20 http://www.apache.org/licenses/LICENSE-2.0 21 * 22 Unless required by applicable law or agreed to in writing, software 23 distributed under the License is distributed on an "AS IS" BASIS, 24 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 See the License for the specific language governing permissions and 26 limitations under the License. 27 */ 28 29function ifTrue(a) { 30 if (true) { 31 print(1); 32 } else { 33 if (a) { 34 print(2); 35 } else { 36 print(3); 37 } 38 } 39} 40 41function ifFalse(a) { 42 if (false) { 43 if (a) { 44 print(1); 45 } else { 46 print(2); 47 } 48 } else { 49 print(3); 50 } 51} 52 53function innerIfTrue() { 54 if (a) { 55 if (true) { 56 print(1); 57 } else { 58 print(2); 59 } 60 } 61} 62 63function innerIfFalse() { 64 if (a) { 65 if (false) { 66 print(1); 67 } else { 68 print(2); 69 } 70 } 71} 72 73function whileTrue() { 74 while (true) { 75 print(1); 76 } 77 print(2); 78} 79 80function whileFalse() { 81 while (false) { 82 print(1); 83 } 84 print(2); 85} 86