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

rokucommunity / brighterscript / #14070

31 Mar 2025 04:48PM UTC coverage: 87.115% (-2.0%) from 89.103%
#14070

push

web-flow
Merge a8a41469d into 628a6a7f7

13279 of 16114 branches covered (82.41%)

Branch coverage included in aggregate %.

14379 of 15635 relevant lines covered (91.97%)

19544.2 hits per line

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

94.44
/src/types/ObjectType.ts
1
import { SymbolTypeFlag } from '../SymbolTypeFlag';
1✔
2
import { isObjectType } from '../astUtils/reflection';
1✔
3
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
4
import { BscType } from './BscType';
1✔
5
import { BscTypeKind } from './BscTypeKind';
1✔
6
import { BuiltInInterfaceAdder } from './BuiltInInterfaceAdder';
1✔
7
import { DynamicType } from './DynamicType';
1✔
8

9
export class ObjectType extends BscType {
1✔
10

11
    public readonly kind = BscTypeKind.ObjectType;
8✔
12

13
    public isBuiltIn = true;
8✔
14

15
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
16
        //Brightscript allows anything passed "as object", so as long as a type is provided, this is true
17
        return !!targetType;
9,371✔
18
    }
19

20
    public static instance = new ObjectType();
1✔
21

22
    public toString() {
23
        return 'object';
2,743✔
24
    }
25

26
    public toTypeString(): string {
27
        return this.toString();
×
28
    }
29

30
    getMemberType(name: string, options: GetTypeOptions) {
31
        // TODO: How should we handle accessing properties of an object?
32
        // For example, we could add fields as properties to m.top, but there could be other members added programmatically
33
        return DynamicType.instance;
19✔
34
    }
35

36
    isEqual(otherType: BscType) {
37
        return isObjectType(otherType) && this.checkCompatibilityBasedOnMembers(otherType, SymbolTypeFlag.runtime);
8✔
38
    }
39
}
40

41

42
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('object', ObjectType.instance);
1✔
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