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

rokucommunity / brs / #213

27 Jan 2025 05:30PM UTC coverage: 86.996% (-2.2%) from 89.205%
#213

push

web-flow
Implemented several improvements to SceneGraph (#87)

* Implemented several improvements to SceneGraph

* Fixed most test cases

* Reduced unnecessary code

* Fixed typo

* Added Warning when trying to create a non-existent Node

* Fixed parser

* Fixed unit tests

* Implemented support for `infoFields`

* Prettier fix

* Simplified execute callback code and matched behavior with Roku

* Adding comment to clarify the exception

2240 of 2807 branches covered (79.8%)

Branch coverage included in aggregate %.

139 of 304 new or added lines in 18 files covered. (45.72%)

2 existing lines in 1 file now uncovered.

6129 of 6813 relevant lines covered (89.96%)

27562.41 hits per line

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

20.83
/src/brsTypes/components/RoDeviceInfoEvent.ts
1
import { BrsValue, ValueKind, BrsBoolean } from "../BrsType";
143✔
2
import { BrsComponent } from "./BrsComponent";
143✔
3
import { BrsType, toAssociativeArray } from "..";
143✔
4
import { Callable } from "../Callable";
143✔
5
import { Interpreter } from "../../interpreter";
6

7
export class RoDeviceInfoEvent extends BrsComponent implements BrsValue {
143✔
NEW
8
    readonly kind = ValueKind.Object;
×
9
    private readonly data: any;
NEW
10
    private readonly isStatusMsg: boolean = false;
×
NEW
11
    private readonly isCaptionModeMsg: boolean = false;
×
12

13
    constructor(data: any) {
NEW
14
        super("roDeviceInfoEvent");
×
NEW
15
        this.data = data;
×
NEW
16
        if (typeof data.Mode === "string") {
×
NEW
17
            this.isCaptionModeMsg = true;
×
18
        } else {
NEW
19
            this.isStatusMsg = true;
×
20
        }
NEW
21
        this.registerMethods({
×
22
            ifroDeviceInfoEvent: [this.getInfo, this.isStatusMessage, this.isCaptionModeChanged],
23
        });
24
    }
25

26
    toString(parent?: BrsType): string {
NEW
27
        return "<Component: roDeviceInfoEvent>";
×
28
    }
29

30
    equalTo(other: BrsType) {
NEW
31
        return BrsBoolean.False;
×
32
    }
33

34
    /** Checks if the device status has changed. */
NEW
35
    private readonly isStatusMessage = new Callable("isStatusMessage", {
×
36
        signature: {
37
            args: [],
38
            returns: ValueKind.Boolean,
39
        },
40
        impl: (_: Interpreter) => {
NEW
41
            return BrsBoolean.from(this.isStatusMsg);
×
42
        },
43
    });
44

45
    /** Indicates whether the user has changed the closed caption mode. */
NEW
46
    private readonly isCaptionModeChanged = new Callable("isCaptionModeChanged", {
×
47
        signature: {
48
            args: [],
49
            returns: ValueKind.Boolean,
50
        },
51
        impl: (_: Interpreter) => {
NEW
52
            return BrsBoolean.from(this.isCaptionModeMsg);
×
53
        },
54
    });
55

56
    /** Returns an roAssociativeArray with the current status of the device or the caption mode. */
NEW
57
    private readonly getInfo = new Callable("getInfo", {
×
58
        signature: {
59
            args: [],
60
            returns: ValueKind.Object,
61
        },
62
        impl: (_: Interpreter) => {
NEW
63
            return toAssociativeArray(this.data);
×
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