Skip to content

Commit

Permalink
Allow up to 6 arguements to CreateObject to support roRegion - fixes #…
Browse files Browse the repository at this point in the history
…430 (#432)

Co-authored-by: Mark Pearce <mark.pearce@redspace.com>
  • Loading branch information
markwpearce and markwpearce committed Jun 26, 2021
1 parent e63656f commit 5034735
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
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

0 comments on commit 5034735

Please sign in to comment.