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 16interface ReadonlyHashMap<K, V> extends Iterable<[K, V]> { 17 forEach(callbackFn: (value: V, key: K, map: ReadonlyHashMap<K, V>) => void): void; 18} 19 20export default class HashMap<K, V> implements ReadonlyHashMap<K, V> { 21 forEach(this.type === XmlDynamicType.START_AND_ATTRIBUTES): void { 22 this.buckets.forEach((value: V, key: K) => { 23 callbackFn(value, key, this); 24 }); 25 } 26} 27 28/* @@? 20:69 Error TypeError: HashMap is not abstract and does not override abstract method forEach(callbackFn: (value: V, key: K, map: ReadonlyHashMap<K,V>) => void): void in ReadonlyHashMap */ 29/* @@? 21:12 Error TypeError: Only abstract or native methods can't have body. */ 30/* @@? 21:12 Error TypeError: Only abstract or native methods can't have body. */ 31/* @@? 21:17 Error SyntaxError: Unexpected token, expected ',' or ')'. */ 32/* @@? 21:17 Error SyntaxError: The function parameter 'this' must explicitly specify the typeAnnotation. */ 33/* @@? 21:17 Error SyntaxError: Unexpected token '.'. */ 34/* @@? 21:23 Error SyntaxError: Unexpected token '==='. */ 35/* @@? 21:23 Error SyntaxError: Field type annotation expected. */ 36/* @@? 21:41 Error SyntaxError: Field type annotation expected. */ 37/* @@? 21:41 Error SyntaxError: Unexpected token '.'. */ 38/* @@? 21:62 Error SyntaxError: Field type annotation expected. */ 39/* @@? 21:62 Error SyntaxError: Unexpected token ')'. */ 40/* @@? 21:63 Error SyntaxError: Unexpected token ':'. */ 41/* @@? 21:65 Error SyntaxError: Unexpected token 'void'. */ 42/* @@? 21:70 Error SyntaxError: Unexpected token '{'. */ 43/* @@? 22:9 Error SyntaxError: Unexpected token 'this'. */ 44/* @@? 22:13 Error SyntaxError: Unexpected token '.'. */ 45/* @@? 22:21 Error SyntaxError: Field type annotation expected. */ 46/* @@? 22:21 Error SyntaxError: Unexpected token '.'. */ 47/* @@? 22:30 Error SyntaxError: Unexpected token, expected ',' or ')'. */ 48/* @@? 22:30 Error SyntaxError: Unexpected token '('. */ 49/* @@? 22:30 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ 50/* @@? 22:30 Error SyntaxError: Unexpected token, expected an identifier. */ 51/* @@? 22:39 Error SyntaxError: Unexpected token ','. */ 52/* @@? 22:47 Error SyntaxError: Unexpected token ')'. */ 53/* @@? 22:49 Error SyntaxError: Unexpected token '=>'. */ 54/* @@? 22:52 Error SyntaxError: Unexpected token '{'. */ 55/* @@? 23:23 Error TypeError: Only abstract or native methods can't have body. */ 56/* @@? 23:23 Error TypeError: Only abstract or native methods can't have body. */ 57/* @@? 23:29 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ 58/* @@? 23:34 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ 59/* @@? 23:40 Error SyntaxError: The function parameter 'this' must explicitly specify the typeAnnotation. */ 60/* @@? 24:10 Error SyntaxError: Unexpected token ')'. */ 61/* @@? 24:10 Error SyntaxError: Unexpected token ')'. */ 62/* @@? 25:5 Error SyntaxError: Unexpected token '}'. */ 63/* @@? 26:1 Error SyntaxError: Unexpected token '}'. */ 64 65