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

rokucommunity / brighterscript / #12930

13 Aug 2024 05:02PM UTC coverage: 86.193% (-1.7%) from 87.933%
#12930

push

web-flow
Merge 58ad447a2 into 0e968f1c3

10630 of 13125 branches covered (80.99%)

Branch coverage included in aggregate %.

6675 of 7284 new or added lines in 99 files covered. (91.64%)

84 existing lines in 18 files now uncovered.

12312 of 13492 relevant lines covered (91.25%)

26865.48 hits per line

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

78.43
/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;
62,341✔
14

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

32
    public toString() {
33
        return 'roAssociativeArray';
184✔
34
    }
35

36
    public toTypeString(): string {
NEW
37
        return 'object';
×
38
    }
39

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

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

49
    private builtInMemberTable: SymbolTable;
50

51
    getBuiltInMemberTable(): SymbolTable {
52
        if (this.builtInMemberTable) {
254!
NEW
53
            return this.builtInMemberTable;
×
54
        }
55
        this.builtInMemberTable = new SymbolTable(`${this.__identifier} Built-in Members`);
254✔
56
        this.pushMemberProvider(() => this.builtInMemberTable);
282✔
57
        return this.builtInMemberTable;
254✔
58

59
    }
60
}
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