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

rokucommunity / brighterscript / #15038

17 Dec 2025 01:49PM UTC coverage: 87.035% (+0.01%) from 87.023%
#15038

push

web-flow
Merge 723b94596 into 2ea4d2108

14488 of 17585 branches covered (82.39%)

Branch coverage included in aggregate %.

161 of 231 new or added lines in 11 files covered. (69.7%)

134 existing lines in 8 files now uncovered.

15231 of 16561 relevant lines covered (91.97%)

24122.14 hits per line

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

80.0
/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;
85,842✔
14

15
    public isBuiltIn = true;
85,842✔
16

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

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

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

42
    getMemberType(name: string, options: GetTypeOptions) {
43
        // if a member has specifically been added, cool. otherwise, assume dynamic
44
        const memberType = super.getMemberType(name, options);
306✔
45
        if (!memberType && !options.ignoreAADefaultDynamicMembers) {
306✔
46
            return DynamicType.instance;
233✔
47
        }
48
        return memberType;
73✔
49
    }
50

51
    isEqual(otherType: BscType) {
52
        return isAssociativeArrayType(otherType) && this.checkCompatibilityBasedOnMembers(otherType, SymbolTypeFlag.runtime);
14✔
53
    }
54

55
    private builtInMemberTable: SymbolTable;
56

57
    getBuiltInMemberTable(): SymbolTable {
58
        if (this.builtInMemberTable) {
343!
UNCOV
59
            return this.builtInMemberTable;
×
60
        }
61
        this.builtInMemberTable = new SymbolTable(`${this.__identifier} Built-in Members`);
343✔
62
        this.pushMemberProvider(() => this.builtInMemberTable);
372✔
63
        return this.builtInMemberTable;
343✔
64

65
    }
66
}
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