Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow up to 6 arguments to CreateObject to support roRegion #432

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/files/BrsFile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ describe('BrsFile', () => {
expect(program.getDiagnostics()[0]?.message).to.not.exist;
});

it('supports the 6 params in CreateObject for roRegion', () => {
program.addOrReplaceFile('source/main.brs', `
sub createRegion(bitmap as object)
region = CreateObject("roRegion", bitmap, 20, 40, 100, 200)
end sub
`);
program.validate();
expect(program.getDiagnostics()[0]?.message).to.not.exist;
});

it('sets needsTranspiled to true for .bs files', () => {
//BrightScript
expect(new BrsFile(`${rootDir}/source/main.brs`, 'source/main.brs', program).needsTranspiled).to.be.false;
Expand Down
8 changes: 8 additions & 0 deletions src/globalCallables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ let runtimeFunctions = [{
name: 'param4',
type: new DynamicType(),
isOptional: true
}, {
name: 'param5',
type: new DynamicType(),
isOptional: true
}, {
name: 'param6',
type: new DynamicType(),
isOptional: true
}]
}, {
name: 'Type',
Expand Down