• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / brighterscript / #13311

22 Nov 2024 08:22PM UTC coverage: 86.806%. Remained the same
#13311

push

web-flow
Merge a320d9302 into 2a6afd921

11836 of 14421 branches covered (82.07%)

Branch coverage included in aggregate %.

192 of 206 new or added lines in 26 files covered. (93.2%)

200 existing lines in 18 files now uncovered.

12869 of 14039 relevant lines covered (91.67%)

32035.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.85
/src/types/AssociativeArrayType.ts
1
import { SymbolTable } from '../SymbolTable';
1✔
2
import { SymbolTypeFlag } from '../SymbolTypeFlag';
1✔
3
import { isAssociativeArrayType, isClassType, isDynamicType, isObjectType } from '../astUtils/reflection';
1✔
4
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
5
import { BscType } from './BscType';
1✔
6
import { BscTypeKind } from './BscTypeKind';
1✔
7
import { DynamicType } from './DynamicType';
1✔
8
import { isUnionTypeCompatible } from './helpers';
1✔
9

10
export class AssociativeArrayType extends BscType {
1✔
11

12

13
    public readonly kind = BscTypeKind.AssociativeArrayType;
72,146✔
14

15
    public isBuiltIn = true;
72,146✔
16

17
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
18
        if (isDynamicType(targetType)) {
7!
UNCOV
19
            return true;
×
20
        } else if (isObjectType(targetType)) {
7!
21
            return true;
×
22
        } else if (isUnionTypeCompatible(this, targetType)) {
7!
23
            return true;
×
24
        } else if (isAssociativeArrayType(targetType)) {
7✔
25
            return true;
4✔
26
        } else if (this.checkCompatibilityBasedOnMembers(targetType, SymbolTypeFlag.runtime, data)) {
3✔
27
            return true;
1✔
28
        } else if (isClassType(targetType)) {
2!
UNCOV
29
            return true;
×
30
        }
31
        return false;
2✔
32
    }
33

34
    public toString() {
35
        return 'roAssociativeArray';
194✔
36
    }
37

38
    public toTypeString(): string {
UNCOV
39
        return 'object';
×
40
    }
41

42
    getMemberType(name: string, options: GetTypeOptions) {
43
        // if a member has specifically been added, cool. otherwise, assume dynamic
44
        return super.getMemberType(name, options) ?? DynamicType.instance;
259✔
45
    }
46

47
    isEqual(otherType: BscType) {
48
        return isAssociativeArrayType(otherType) && this.checkCompatibilityBasedOnMembers(otherType, SymbolTypeFlag.runtime);
8✔
49
    }
50

51
    private builtInMemberTable: SymbolTable;
52

53
    getBuiltInMemberTable(): SymbolTable {
54
        if (this.builtInMemberTable) {
277!
UNCOV
55
            return this.builtInMemberTable;
×
56
        }
57
        this.builtInMemberTable = new SymbolTable(`${this.__identifier} Built-in Members`);
277✔
58
        this.pushMemberProvider(() => this.builtInMemberTable);
308✔
59
        return this.builtInMemberTable;
277✔
60

61
    }
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc