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

rokucommunity / brighterscript / #13234

28 Oct 2024 07:06PM UTC coverage: 89.066% (+2.2%) from 86.866%
#13234

push

web-flow
Merge 9bcb77aad into 9ec6f722c

7233 of 8558 branches covered (84.52%)

Branch coverage included in aggregate %.

34 of 34 new or added lines in 5 files covered. (100.0%)

543 existing lines in 53 files now uncovered.

9621 of 10365 relevant lines covered (92.82%)

1782.52 hits per line

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

61.11
/src/types/ArrayType.ts
1
import type { BscType } from './BscType';
2
import { DynamicType } from './DynamicType';
1✔
3

4
export class ArrayType implements BscType {
1✔
5
    constructor(...innerTypes: BscType[]) {
6
        this.innerTypes = innerTypes;
14✔
7
    }
8
    public innerTypes: BscType[] = [];
14✔
9

10
    public isAssignableTo(targetType: BscType) {
11
        if (targetType instanceof DynamicType) {
7✔
12
            return true;
1✔
13
        } else if (!(targetType instanceof ArrayType)) {
6✔
14
            return false;
2✔
15
        }
16
        //this array type is assignable to the target IF
17
        //1. all of the types in this array are present in the target
18
        outer: for (let innerType of this.innerTypes) {
4✔
19
            //find this inner type in the target
20

21
            // eslint-disable-next-line no-unreachable-loop
22
            for (let targetInnerType of targetType.innerTypes) {
2✔
23
                //TODO is this loop correct? It ends after 1 iteration but we might need to do more iterations
24

25
                if (innerType.isAssignableTo(targetInnerType)) {
2✔
26
                    continue outer;
1✔
27
                }
28

29
                //our array contains a type that the target array does not...so these arrays are different
30
                return false;
1✔
31
            }
32
        }
33
        return true;
3✔
34
    }
35

36
    public isConvertibleTo(targetType: BscType) {
37
        return this.isAssignableTo(targetType);
2✔
38
    }
39

40
    public toString() {
41
        return `Array<${this.innerTypes.map((x) => x.toString()).join(' | ')}>`;
2✔
42
    }
43

44
    public toTypeString(): string {
UNCOV
45
        return 'object';
×
46
    }
47

48
    public clone() {
UNCOV
49
        return new ArrayType(...this.innerTypes?.map(x => x?.clone()) ?? []);
×
50
    }
51
}
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