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

rokucommunity / brighterscript / #12717

14 Jun 2024 08:20PM UTC coverage: 85.629% (-2.3%) from 87.936%
#12717

push

web-flow
Merge 94311dc0a into 42db50190

10808 of 13500 branches covered (80.06%)

Branch coverage included in aggregate %.

6557 of 7163 new or added lines in 96 files covered. (91.54%)

83 existing lines in 17 files now uncovered.

12270 of 13451 relevant lines covered (91.22%)

26531.66 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;
61,413✔
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';
168✔
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;
226✔
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) {
249!
NEW
53
            return this.builtInMemberTable;
×
54
        }
55
        this.builtInMemberTable = new SymbolTable(`${this.__identifier} Built-in Members`);
249✔
56
        this.pushMemberProvider(() => this.builtInMemberTable);
277✔
57
        return this.builtInMemberTable;
249✔
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

© 2026 Coveralls, Inc