Skip to content

Coverage instrumentation changes constructor execution order #354

@mobalazs

Description

@mobalazs

Description

When Rooibos/BrighterScript code coverage is enabled, the generated instrumented code changes the constructor execution order between base and derived classes.
In the instrumented dist/... output, the derived class’s constructor body runs before the super call, whereas in a normal (non-coverage) build, super executes first — as expected in standard class construction semantics.

Instrumentation should not alter constructor order; it should only add line-tracking markers between statements.


Observed behavior

Under coverage mode, the derived constructor executes before the super call, changing initialization order.


Expected behavior

Code instrumentation should preserve the original constructor call sequence and semantics.


Environment

  • Rooibos version: v6.0.0-alpha.48
    ("rooibos-roku": "https://github.com/rokucommunity/rooibos/releases/download/v6.0.0-alpha.48/rooibos-roku-6.0.0-alpha.48.tgz")
  • BrighterScript version: v1
  • Project type: Roku SceneGraph app (BrighterScript)
  • Setting: isRecordingCodeCoverage = true

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions