brighterscript 1.0.0-alpha.25 → 1.0.0-alpha.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/bsconfig.schema.json +5 -0
- package/dist/AstValidationSegmenter.d.ts +1 -1
- package/dist/AstValidationSegmenter.js +6 -7
- package/dist/AstValidationSegmenter.js.map +1 -1
- package/dist/BsConfig.d.ts +1 -0
- package/dist/DiagnosticMessages.d.ts +1 -3
- package/dist/DiagnosticMessages.js +5 -8
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/Program.d.ts +1 -1
- package/dist/Program.js +40 -42
- package/dist/Program.js.map +1 -1
- package/dist/Scope.d.ts +2 -13
- package/dist/Scope.js +27 -35
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +1 -8
- package/dist/SymbolTable.js +1 -10
- package/dist/SymbolTable.js.map +1 -1
- package/dist/SymbolTableFlag.d.ts +8 -0
- package/dist/SymbolTableFlag.js +13 -0
- package/dist/SymbolTableFlag.js.map +1 -0
- package/dist/XmlScope.d.ts +1 -6
- package/dist/XmlScope.js +6 -25
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +1 -2
- package/dist/astUtils/CachedLookups.js +3 -14
- package/dist/astUtils/CachedLookups.js.map +1 -1
- package/dist/astUtils/Editor.spec.js +1 -1
- package/dist/astUtils/Editor.spec.js.map +1 -1
- package/dist/astUtils/creators.js +77 -18
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +4 -4
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +3 -1
- package/dist/astUtils/reflection.js +12 -4
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +59 -42
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +30 -19
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +2 -1
- package/dist/bscPlugin/BscPlugin.js +7 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.js +7 -7
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- package/dist/bscPlugin/SignatureHelpUtil.js +5 -4
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +2 -2
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +23 -23
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.d.ts +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +28 -8
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +74 -2
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +2 -5
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +8 -6
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +46 -47
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +120 -39
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +165 -10
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +1 -1
- package/dist/files/BrsFile.Class.spec.js +7 -6
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +7 -15
- package/dist/files/BrsFile.js +49 -309
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +111 -157
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +2 -3
- package/dist/files/XmlFile.js +0 -2
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/interfaces.d.ts +109 -84
- package/dist/interfaces.js +9 -9
- package/dist/interfaces.js.map +1 -1
- package/dist/parser/AstNode.spec.js +6 -6
- package/dist/parser/AstNode.spec.js.map +1 -1
- package/dist/parser/Expression.d.ts +301 -164
- package/dist/parser/Expression.js +355 -294
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +26 -27
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +6 -2
- package/dist/parser/Parser.js +361 -160
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +69 -213
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.js +49 -35
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +36 -24
- package/dist/parser/SGTypes.js +26 -55
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +381 -238
- package/dist/parser/Statement.js +510 -386
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +2 -2
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +2 -2
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +11 -11
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +30 -5
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +2 -2
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +2 -2
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.js +8 -9
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +8 -8
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +2 -2
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +2 -2
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +2 -2
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +10 -3
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/roku-types/data.json +70 -52
- package/dist/roku-types/index.d.ts +43 -21
- package/dist/types/ArrayType.js +1 -2
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +7 -8
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.js +2 -3
- package/dist/types/AssociativeArrayType.js.map +1 -1
- package/dist/types/BscType.d.ts +1 -1
- package/dist/types/BscType.js +2 -3
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.js +15 -9
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.spec.js +31 -32
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -1
- package/dist/types/ClassType.spec.js +10 -11
- package/dist/types/ClassType.spec.js.map +1 -1
- package/dist/types/ComponentType.d.ts +2 -1
- package/dist/types/ComponentType.js.map +1 -1
- package/dist/types/EnumType.js +2 -3
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/InheritableType.js +3 -4
- package/dist/types/InheritableType.js.map +1 -1
- package/dist/types/InterfaceType.js +2 -3
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +3 -4
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/ObjectType.js +1 -2
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +1 -1
- package/dist/types/ReferenceType.spec.js +21 -22
- package/dist/types/ReferenceType.spec.js.map +1 -1
- package/dist/types/UnionType.js +3 -3
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/UnionType.spec.js +37 -38
- package/dist/types/UnionType.spec.js.map +1 -1
- package/dist/types/helper.spec.js +4 -5
- package/dist/types/helper.spec.js.map +1 -1
- package/dist/util.d.ts +16 -7
- package/dist/util.js +89 -43
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +0 -9
- package/dist/validators/ClassValidator.js +9 -52
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ const chai_config_spec_1 = require("../chai-config.spec");
|
|
|
4
4
|
const sinonImport = require("sinon");
|
|
5
5
|
const vscode_languageserver_1 = require("vscode-languageserver");
|
|
6
6
|
const Program_1 = require("../Program");
|
|
7
|
-
const BooleanType_1 = require("../types/BooleanType");
|
|
8
7
|
const DynamicType_1 = require("../types/DynamicType");
|
|
9
8
|
const TypedFunctionType_1 = require("../types/TypedFunctionType");
|
|
10
9
|
const IntegerType_1 = require("../types/IntegerType");
|
|
@@ -23,7 +22,6 @@ const fsExtra = require("fs-extra");
|
|
|
23
22
|
const vscode_uri_1 = require("vscode-uri");
|
|
24
23
|
const undent_1 = require("undent");
|
|
25
24
|
const testHelpers_spec_2 = require("../testHelpers.spec");
|
|
26
|
-
const SymbolTable_1 = require("../SymbolTable");
|
|
27
25
|
const types_1 = require("../types");
|
|
28
26
|
let sinon = sinonImport.createSandbox();
|
|
29
27
|
describe('BrsFile', () => {
|
|
@@ -185,7 +183,10 @@ describe('BrsFile', () => {
|
|
|
185
183
|
it('computes new import statements after clearing parser references', () => {
|
|
186
184
|
const file = program.setFile('source/main.bs', ``);
|
|
187
185
|
(0, chai_config_spec_1.expect)(file.ownScriptImports).to.be.empty;
|
|
188
|
-
file.parser.ast.statements.push(new Statement_1.ImportStatement(
|
|
186
|
+
file.parser.ast.statements.push(new Statement_1.ImportStatement({
|
|
187
|
+
import: (0, creators_1.createToken)(TokenKind_1.TokenKind.Import),
|
|
188
|
+
path: (0, creators_1.createToken)(TokenKind_1.TokenKind.StringLiteral, 'pkg:/source/lib.brs')
|
|
189
|
+
}));
|
|
189
190
|
(0, chai_config_spec_1.expect)(file.ownScriptImports).to.be.empty;
|
|
190
191
|
file['_cachedLookups'].invalidate();
|
|
191
192
|
(0, chai_config_spec_1.expect)(file.ownScriptImports.map(x => x.text)).to.eql(['pkg:/source/lib.brs']);
|
|
@@ -1102,26 +1103,6 @@ describe('BrsFile', () => {
|
|
|
1102
1103
|
(0, chai_config_spec_1.expect)(file.callables[1].name).to.equal('DoA');
|
|
1103
1104
|
(0, chai_config_spec_1.expect)(file.callables[1].nameRange.start.line).to.equal(5);
|
|
1104
1105
|
});
|
|
1105
|
-
it('finds function call line and column numbers', () => {
|
|
1106
|
-
let file = new BrsFile_1.BrsFile({
|
|
1107
|
-
srcPath: 'absolute_path/file.brs',
|
|
1108
|
-
destPath: 'relative_path/file.brs',
|
|
1109
|
-
program: program
|
|
1110
|
-
});
|
|
1111
|
-
file.parse(`
|
|
1112
|
-
function DoA()
|
|
1113
|
-
DoB("a")
|
|
1114
|
-
end function
|
|
1115
|
-
function DoB(a as string)
|
|
1116
|
-
DoC()
|
|
1117
|
-
end function
|
|
1118
|
-
`);
|
|
1119
|
-
(0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(2);
|
|
1120
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 28));
|
|
1121
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].nameRange).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 23));
|
|
1122
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[1].range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 25));
|
|
1123
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 23));
|
|
1124
|
-
});
|
|
1125
1106
|
it('finds function calls that are unfinished', () => {
|
|
1126
1107
|
let file = new BrsFile_1.BrsFile({
|
|
1127
1108
|
srcPath: 'absolute_path/file.brs',
|
|
@@ -1143,11 +1124,6 @@ describe('BrsFile', () => {
|
|
|
1143
1124
|
DiagnosticMessages_1.DiagnosticMessages.expectedRightParenAfterFunctionCallArguments(),
|
|
1144
1125
|
DiagnosticMessages_1.DiagnosticMessages.expectedNewlineOrColon()
|
|
1145
1126
|
]);
|
|
1146
|
-
(0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(2);
|
|
1147
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 27));
|
|
1148
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].nameRange).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 23));
|
|
1149
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[1].range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 24));
|
|
1150
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 23));
|
|
1151
1127
|
});
|
|
1152
1128
|
it('sanitizes brs errors', () => {
|
|
1153
1129
|
let file = new BrsFile_1.BrsFile({
|
|
@@ -1324,79 +1300,6 @@ describe('BrsFile', () => {
|
|
|
1324
1300
|
(0, chai_config_spec_1.expect)(callable.params[2].type).instanceof(StringType_1.StringType);
|
|
1325
1301
|
});
|
|
1326
1302
|
});
|
|
1327
|
-
describe('findCallableInvocations', () => {
|
|
1328
|
-
it('finds arguments with literal values', () => {
|
|
1329
|
-
let file = new BrsFile_1.BrsFile({
|
|
1330
|
-
srcPath: 'absolute_path/file.brs',
|
|
1331
|
-
destPath: 'relative_path/file.brs',
|
|
1332
|
-
program: program
|
|
1333
|
-
});
|
|
1334
|
-
file.parse(`
|
|
1335
|
-
function Sum()
|
|
1336
|
-
DoSomething("name", 12, true)
|
|
1337
|
-
end function
|
|
1338
|
-
`);
|
|
1339
|
-
(0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(1);
|
|
1340
|
-
const argsMap = file.functionCalls[0].args.map(arg => {
|
|
1341
|
-
// disregard arg.expression, etc.
|
|
1342
|
-
return { type: arg.type, range: arg.range, text: arg.text };
|
|
1343
|
-
});
|
|
1344
|
-
(0, chai_config_spec_1.expect)(argsMap).to.eql([{
|
|
1345
|
-
type: StringType_1.StringType.instance,
|
|
1346
|
-
range: util_1.default.createRange(2, 32, 2, 38),
|
|
1347
|
-
text: '"name"'
|
|
1348
|
-
}, {
|
|
1349
|
-
type: IntegerType_1.IntegerType.instance,
|
|
1350
|
-
range: util_1.default.createRange(2, 40, 2, 42),
|
|
1351
|
-
text: '12'
|
|
1352
|
-
}, {
|
|
1353
|
-
type: BooleanType_1.BooleanType.instance,
|
|
1354
|
-
range: util_1.default.createRange(2, 44, 2, 48),
|
|
1355
|
-
text: 'true'
|
|
1356
|
-
}]);
|
|
1357
|
-
});
|
|
1358
|
-
it('finds function calls nested inside statements', () => {
|
|
1359
|
-
program.setFile(`source/main.brs`, `
|
|
1360
|
-
sub main()
|
|
1361
|
-
if true then
|
|
1362
|
-
DoesNotExist(1, 2)
|
|
1363
|
-
end if
|
|
1364
|
-
end sub
|
|
1365
|
-
`);
|
|
1366
|
-
program.validate();
|
|
1367
|
-
(0, testHelpers_spec_1.expectDiagnostics)(program, [
|
|
1368
|
-
DiagnosticMessages_1.DiagnosticMessages.cannotFindName('DoesNotExist')
|
|
1369
|
-
]);
|
|
1370
|
-
});
|
|
1371
|
-
it('finds arguments with variable values', () => {
|
|
1372
|
-
let file = new BrsFile_1.BrsFile({
|
|
1373
|
-
srcPath: 'absolute_path/file.brs',
|
|
1374
|
-
destPath: 'relative_path/file.brs',
|
|
1375
|
-
program: program
|
|
1376
|
-
});
|
|
1377
|
-
file.parse(`
|
|
1378
|
-
function Sum()
|
|
1379
|
-
count = 1
|
|
1380
|
-
name = "John"
|
|
1381
|
-
isAlive = true
|
|
1382
|
-
DoSomething(count, name, isAlive)
|
|
1383
|
-
end function
|
|
1384
|
-
`);
|
|
1385
|
-
(0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(1);
|
|
1386
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].args[0]).deep.include({
|
|
1387
|
-
type: new DynamicType_1.DynamicType(),
|
|
1388
|
-
text: 'count'
|
|
1389
|
-
});
|
|
1390
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].args[1]).deep.include({
|
|
1391
|
-
type: new DynamicType_1.DynamicType(),
|
|
1392
|
-
text: 'name'
|
|
1393
|
-
});
|
|
1394
|
-
(0, chai_config_spec_1.expect)(file.functionCalls[0].args[2]).deep.include({
|
|
1395
|
-
type: new DynamicType_1.DynamicType(),
|
|
1396
|
-
text: 'isAlive'
|
|
1397
|
-
});
|
|
1398
|
-
});
|
|
1399
|
-
});
|
|
1400
1303
|
describe('findCallables', () => {
|
|
1401
1304
|
//this test is to help with code coverage
|
|
1402
1305
|
it('skips top-level statements', () => {
|
|
@@ -1972,6 +1875,39 @@ describe('BrsFile', () => {
|
|
|
1972
1875
|
end sub
|
|
1973
1876
|
`);
|
|
1974
1877
|
});
|
|
1878
|
+
it('handles multi-index multi-dimensional arrays', async () => {
|
|
1879
|
+
await testTranspile(`
|
|
1880
|
+
sub main()
|
|
1881
|
+
myMultiArray = [[[[[[[[["hello"]]]]]]]]]
|
|
1882
|
+
myMultiArray[0][0][0][0][0][0][0][0][0] = "goodbye"
|
|
1883
|
+
print myMultiArray[0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
1884
|
+
end sub
|
|
1885
|
+
`, `
|
|
1886
|
+
sub main()
|
|
1887
|
+
myMultiArray = [
|
|
1888
|
+
[
|
|
1889
|
+
[
|
|
1890
|
+
[
|
|
1891
|
+
[
|
|
1892
|
+
[
|
|
1893
|
+
[
|
|
1894
|
+
[
|
|
1895
|
+
[
|
|
1896
|
+
"hello"
|
|
1897
|
+
]
|
|
1898
|
+
]
|
|
1899
|
+
]
|
|
1900
|
+
]
|
|
1901
|
+
]
|
|
1902
|
+
]
|
|
1903
|
+
]
|
|
1904
|
+
]
|
|
1905
|
+
]
|
|
1906
|
+
myMultiArray[0][0][0][0][0][0][0][0][0] = "goodbye"
|
|
1907
|
+
print myMultiArray[0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
1908
|
+
end sub
|
|
1909
|
+
`);
|
|
1910
|
+
});
|
|
1975
1911
|
it('transpiles calls to fully-qualified namespaced functions', async () => {
|
|
1976
1912
|
await testTranspile(`
|
|
1977
1913
|
namespace NameA
|
|
@@ -2400,7 +2336,8 @@ describe('BrsFile', () => {
|
|
|
2400
2336
|
program.validate();
|
|
2401
2337
|
(0, testHelpers_spec_1.expectZeroDiagnostics)(program);
|
|
2402
2338
|
});
|
|
2403
|
-
it('sets invalid on empty callfunc', async () => {
|
|
2339
|
+
it('sets invalid on empty callfunc with legacyCallfuncHandling=true', async () => {
|
|
2340
|
+
program.options.legacyCallfuncHandling = true;
|
|
2404
2341
|
await testTranspile(`
|
|
2405
2342
|
sub main()
|
|
2406
2343
|
node = invalid
|
|
@@ -2417,6 +2354,23 @@ describe('BrsFile', () => {
|
|
|
2417
2354
|
end sub
|
|
2418
2355
|
`);
|
|
2419
2356
|
});
|
|
2357
|
+
it('empty callfunc allowed by default', async () => {
|
|
2358
|
+
await testTranspile(`
|
|
2359
|
+
sub main()
|
|
2360
|
+
node = invalid
|
|
2361
|
+
node@.doSomething()
|
|
2362
|
+
m.top.node@.doSomething()
|
|
2363
|
+
m.top.node@.doSomething(1)
|
|
2364
|
+
end sub
|
|
2365
|
+
`, `
|
|
2366
|
+
sub main()
|
|
2367
|
+
node = invalid
|
|
2368
|
+
node.callfunc("doSomething")
|
|
2369
|
+
m.top.node.callfunc("doSomething")
|
|
2370
|
+
m.top.node.callfunc("doSomething", 1)
|
|
2371
|
+
end sub
|
|
2372
|
+
`);
|
|
2373
|
+
});
|
|
2420
2374
|
it('includes original arguments', async () => {
|
|
2421
2375
|
await testTranspile(`
|
|
2422
2376
|
sub main()
|
|
@@ -3211,7 +3165,7 @@ describe('BrsFile', () => {
|
|
|
3211
3165
|
]);
|
|
3212
3166
|
const requiredSymbolsFlags = mainFile.requiredSymbols.map(x => x.flags);
|
|
3213
3167
|
(0, chai_config_spec_1.expect)(requiredSymbolsFlags).to.have.same.members([
|
|
3214
|
-
|
|
3168
|
+
2 /* SymbolTypeFlag.typetime */, 2 /* SymbolTypeFlag.typetime */, 1 /* SymbolTypeFlag.runtime */
|
|
3215
3169
|
]);
|
|
3216
3170
|
});
|
|
3217
3171
|
it('should include enums and consts that are not in the file', () => {
|
|
@@ -3238,7 +3192,7 @@ describe('BrsFile', () => {
|
|
|
3238
3192
|
]);
|
|
3239
3193
|
const requiredSymbolsFlags = mainFile.requiredSymbols.map(x => x.flags);
|
|
3240
3194
|
(0, chai_config_spec_1.expect)(requiredSymbolsFlags).to.have.same.members([
|
|
3241
|
-
|
|
3195
|
+
2 /* SymbolTypeFlag.typetime */, 1 /* SymbolTypeFlag.runtime */, 1 /* SymbolTypeFlag.runtime */, 1 /* SymbolTypeFlag.runtime */
|
|
3242
3196
|
]);
|
|
3243
3197
|
});
|
|
3244
3198
|
it('should include types not defined in the file', () => {
|
|
@@ -3268,7 +3222,7 @@ describe('BrsFile', () => {
|
|
|
3268
3222
|
]);
|
|
3269
3223
|
const requiredSymbolsFlags = mainFile.requiredSymbols.map(x => x.flags);
|
|
3270
3224
|
(0, chai_config_spec_1.expect)(requiredSymbolsFlags).to.have.same.members([
|
|
3271
|
-
|
|
3225
|
+
2 /* SymbolTypeFlag.typetime */, 2 /* SymbolTypeFlag.typetime */, 2 /* SymbolTypeFlag.typetime */, 2 /* SymbolTypeFlag.typetime */, 2 /* SymbolTypeFlag.typetime */
|
|
3272
3226
|
]);
|
|
3273
3227
|
});
|
|
3274
3228
|
it('includes namespace details', () => {
|
|
@@ -3325,7 +3279,7 @@ describe('BrsFile', () => {
|
|
|
3325
3279
|
`);
|
|
3326
3280
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3327
3281
|
(0, chai_config_spec_1.expect)(mainFile.requiredSymbols.length).to.eq(1);
|
|
3328
|
-
(0, chai_config_spec_1.expect)(mainFile.requiredSymbols[0].flags).to.eq(
|
|
3282
|
+
(0, chai_config_spec_1.expect)(mainFile.requiredSymbols[0].flags).to.eq(2 /* SymbolTypeFlag.typetime */);
|
|
3329
3283
|
});
|
|
3330
3284
|
});
|
|
3331
3285
|
describe('providedSymbols', () => {
|
|
@@ -3344,7 +3298,7 @@ describe('BrsFile', () => {
|
|
|
3344
3298
|
file: mainFile
|
|
3345
3299
|
};
|
|
3346
3300
|
program.plugins.emit('onFileValidate', validateFileEvent);
|
|
3347
|
-
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3301
|
+
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3348
3302
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3349
3303
|
const someFuncType = runtimeSymbols.get('somefunc').type;
|
|
3350
3304
|
(0, testHelpers_spec_1.expectTypeToBe)(someFuncType, TypedFunctionType_1.TypedFunctionType);
|
|
@@ -3362,14 +3316,14 @@ describe('BrsFile', () => {
|
|
|
3362
3316
|
file: mainFile
|
|
3363
3317
|
};
|
|
3364
3318
|
program.plugins.emit('onFileValidate', validateFileEvent);
|
|
3365
|
-
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3319
|
+
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3366
3320
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3367
3321
|
const someFuncType = runtimeSymbols.get('somefunc').type;
|
|
3368
3322
|
(0, testHelpers_spec_1.expectTypeToBe)(someFuncType, TypedFunctionType_1.TypedFunctionType);
|
|
3369
3323
|
const requiredSymbols = mainFile.requiredSymbols.map(x => x.typeChain[0].name);
|
|
3370
3324
|
(0, chai_config_spec_1.expect)(requiredSymbols).to.have.same.members(['OtherFileType', 'OtherFileType']);
|
|
3371
3325
|
const requiredSymbolTypes = mainFile.requiredSymbols.map(x => x.flags);
|
|
3372
|
-
(0, chai_config_spec_1.expect)(requiredSymbolTypes).to.have.same.members([
|
|
3326
|
+
(0, chai_config_spec_1.expect)(requiredSymbolTypes).to.have.same.members([1 /* SymbolTypeFlag.runtime */, 2 /* SymbolTypeFlag.typetime */]);
|
|
3373
3327
|
});
|
|
3374
3328
|
it('includes classes defined in the file', () => {
|
|
3375
3329
|
const mainFile = program.setFile('source/main.bs', `
|
|
@@ -3394,12 +3348,12 @@ describe('BrsFile', () => {
|
|
|
3394
3348
|
file: mainFile
|
|
3395
3349
|
};
|
|
3396
3350
|
program.plugins.emit('onFileValidate', validateFileEvent);
|
|
3397
|
-
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3351
|
+
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3398
3352
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(3);
|
|
3399
3353
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('klass').type, types_1.ClassType);
|
|
3400
3354
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('klass2').type, types_1.ClassType);
|
|
3401
3355
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('klass3').type, types_1.ClassType);
|
|
3402
|
-
const typetimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3356
|
+
const typetimeSymbols = mainFile.providedSymbols.symbolMap.get(2 /* SymbolTypeFlag.typetime */);
|
|
3403
3357
|
(0, chai_config_spec_1.expect)(typetimeSymbols.size).to.eq(3);
|
|
3404
3358
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('klass').type, types_1.ClassType);
|
|
3405
3359
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('klass2').type, types_1.ClassType);
|
|
@@ -3425,11 +3379,11 @@ describe('BrsFile', () => {
|
|
|
3425
3379
|
file: mainFile
|
|
3426
3380
|
};
|
|
3427
3381
|
program.plugins.emit('onFileValidate', validateFileEvent);
|
|
3428
|
-
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3382
|
+
const runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3429
3383
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3430
3384
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('myenum').type, types_1.EnumType);
|
|
3431
3385
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('mynamespace.myconst').type, types_1.FloatType);
|
|
3432
|
-
const typetimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3386
|
+
const typetimeSymbols = mainFile.providedSymbols.symbolMap.get(2 /* SymbolTypeFlag.typetime */);
|
|
3433
3387
|
(0, chai_config_spec_1.expect)(typetimeSymbols.size).to.eq(2);
|
|
3434
3388
|
(0, testHelpers_spec_1.expectTypeToBe)(typetimeSymbols.get('myinterface').type, types_1.InterfaceType);
|
|
3435
3389
|
(0, testHelpers_spec_1.expectTypeToBe)(runtimeSymbols.get('myenum').type, types_1.EnumType);
|
|
@@ -3442,7 +3396,7 @@ describe('BrsFile', () => {
|
|
|
3442
3396
|
end sub
|
|
3443
3397
|
`);
|
|
3444
3398
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3445
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3399
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3446
3400
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3447
3401
|
mainFile = program.setFile('source/main.bs', `
|
|
3448
3402
|
sub someFunc()
|
|
@@ -3454,9 +3408,9 @@ describe('BrsFile', () => {
|
|
|
3454
3408
|
end sub
|
|
3455
3409
|
`);
|
|
3456
3410
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3457
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3411
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3458
3412
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3459
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3413
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3460
3414
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3461
3415
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('somefunc2')).to.be.true;
|
|
3462
3416
|
});
|
|
@@ -3471,7 +3425,7 @@ describe('BrsFile', () => {
|
|
|
3471
3425
|
end sub
|
|
3472
3426
|
`);
|
|
3473
3427
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3474
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3428
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3475
3429
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3476
3430
|
mainFile = program.setFile('source/main.bs', `
|
|
3477
3431
|
sub someFunc()
|
|
@@ -3479,9 +3433,9 @@ describe('BrsFile', () => {
|
|
|
3479
3433
|
end sub
|
|
3480
3434
|
`);
|
|
3481
3435
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3482
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3436
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3483
3437
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3484
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3438
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3485
3439
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3486
3440
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('somefunc2')).to.be.true;
|
|
3487
3441
|
});
|
|
@@ -3491,7 +3445,7 @@ describe('BrsFile', () => {
|
|
|
3491
3445
|
end namespace
|
|
3492
3446
|
`);
|
|
3493
3447
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3494
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3448
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3495
3449
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(0);
|
|
3496
3450
|
mainFile = program.setFile('source/main.bs', `
|
|
3497
3451
|
namespace Alpha
|
|
@@ -3499,9 +3453,9 @@ describe('BrsFile', () => {
|
|
|
3499
3453
|
end namespace
|
|
3500
3454
|
`);
|
|
3501
3455
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3502
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3456
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3503
3457
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3504
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3458
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3505
3459
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3506
3460
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('alpha.abc')).to.be.true;
|
|
3507
3461
|
});
|
|
@@ -3516,7 +3470,7 @@ describe('BrsFile', () => {
|
|
|
3516
3470
|
end namespace
|
|
3517
3471
|
`);
|
|
3518
3472
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3519
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3473
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3520
3474
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3521
3475
|
mainFile = program.setFile('source/main.bs', `
|
|
3522
3476
|
sub printSomething()
|
|
@@ -3528,9 +3482,9 @@ describe('BrsFile', () => {
|
|
|
3528
3482
|
end namespace
|
|
3529
3483
|
`);
|
|
3530
3484
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3531
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3485
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3532
3486
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3533
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3487
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3534
3488
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3535
3489
|
});
|
|
3536
3490
|
it('should include changes in function signatures', () => {
|
|
@@ -3540,7 +3494,7 @@ describe('BrsFile', () => {
|
|
|
3540
3494
|
end function
|
|
3541
3495
|
`);
|
|
3542
3496
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3543
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3497
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3544
3498
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3545
3499
|
mainFile = program.setFile('source/main.bs', `
|
|
3546
3500
|
function someFunc(x, y)
|
|
@@ -3548,9 +3502,9 @@ describe('BrsFile', () => {
|
|
|
3548
3502
|
end function
|
|
3549
3503
|
`);
|
|
3550
3504
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3551
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3505
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3552
3506
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3553
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3507
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3554
3508
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3555
3509
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('somefunc'));
|
|
3556
3510
|
});
|
|
@@ -3564,7 +3518,7 @@ describe('BrsFile', () => {
|
|
|
3564
3518
|
end class
|
|
3565
3519
|
`);
|
|
3566
3520
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3567
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3521
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3568
3522
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3569
3523
|
mainFile = program.setFile('source/main.bs', `
|
|
3570
3524
|
class MyKlass
|
|
@@ -3575,12 +3529,12 @@ describe('BrsFile', () => {
|
|
|
3575
3529
|
end class
|
|
3576
3530
|
`);
|
|
3577
3531
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3578
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3532
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3579
3533
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3580
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3534
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3581
3535
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3582
3536
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('myklass'));
|
|
3583
|
-
let typeTimeChanges = mainFile.providedSymbols.changes.get(
|
|
3537
|
+
let typeTimeChanges = mainFile.providedSymbols.changes.get(2 /* SymbolTypeFlag.typetime */);
|
|
3584
3538
|
(0, chai_config_spec_1.expect)(typeTimeChanges.size).to.eq(1);
|
|
3585
3539
|
(0, chai_config_spec_1.expect)(typeTimeChanges.has('myklass'));
|
|
3586
3540
|
});
|
|
@@ -3592,9 +3546,9 @@ describe('BrsFile', () => {
|
|
|
3592
3546
|
end interface
|
|
3593
3547
|
`);
|
|
3594
3548
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3595
|
-
let typetimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3549
|
+
let typetimeSymbols = mainFile.providedSymbols.symbolMap.get(2 /* SymbolTypeFlag.typetime */);
|
|
3596
3550
|
(0, chai_config_spec_1.expect)(typetimeSymbols.size).to.eq(1);
|
|
3597
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3551
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3598
3552
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(0);
|
|
3599
3553
|
mainFile = program.setFile('source/main.bs', `
|
|
3600
3554
|
interface Iface1
|
|
@@ -3604,12 +3558,12 @@ describe('BrsFile', () => {
|
|
|
3604
3558
|
end interface
|
|
3605
3559
|
`);
|
|
3606
3560
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3607
|
-
typetimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3561
|
+
typetimeSymbols = mainFile.providedSymbols.symbolMap.get(2 /* SymbolTypeFlag.typetime */);
|
|
3608
3562
|
(0, chai_config_spec_1.expect)(typetimeSymbols.size).to.eq(1);
|
|
3609
|
-
let typeTimeChanges = mainFile.providedSymbols.changes.get(
|
|
3563
|
+
let typeTimeChanges = mainFile.providedSymbols.changes.get(2 /* SymbolTypeFlag.typetime */);
|
|
3610
3564
|
(0, chai_config_spec_1.expect)(typeTimeChanges.size).to.eq(1);
|
|
3611
3565
|
(0, chai_config_spec_1.expect)(typeTimeChanges.has('iface1'));
|
|
3612
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3566
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3613
3567
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3614
3568
|
});
|
|
3615
3569
|
it('should not include changes in enum values, if inner type is the same', () => {
|
|
@@ -3622,7 +3576,7 @@ describe('BrsFile', () => {
|
|
|
3622
3576
|
end enum
|
|
3623
3577
|
`);
|
|
3624
3578
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3625
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3579
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3626
3580
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3627
3581
|
mainFile = program.setFile('source/main.bs', `
|
|
3628
3582
|
enum MyEnum
|
|
@@ -3633,13 +3587,13 @@ describe('BrsFile', () => {
|
|
|
3633
3587
|
end enum
|
|
3634
3588
|
`);
|
|
3635
3589
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3636
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3590
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3637
3591
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3638
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3592
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3639
3593
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3640
|
-
let typetimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3594
|
+
let typetimeSymbols = mainFile.providedSymbols.symbolMap.get(2 /* SymbolTypeFlag.typetime */);
|
|
3641
3595
|
(0, chai_config_spec_1.expect)(typetimeSymbols.size).to.eq(1);
|
|
3642
|
-
let typetimeChanges = mainFile.providedSymbols.changes.get(
|
|
3596
|
+
let typetimeChanges = mainFile.providedSymbols.changes.get(2 /* SymbolTypeFlag.typetime */);
|
|
3643
3597
|
(0, chai_config_spec_1.expect)(typetimeChanges.size).to.eq(0);
|
|
3644
3598
|
});
|
|
3645
3599
|
it('should include changes in enum, if different number of members', () => {
|
|
@@ -3664,7 +3618,7 @@ describe('BrsFile', () => {
|
|
|
3664
3618
|
end enum
|
|
3665
3619
|
`);
|
|
3666
3620
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3667
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3621
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3668
3622
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(3);
|
|
3669
3623
|
mainFile = program.setFile('source/main.bs', `
|
|
3670
3624
|
enum Direction ' same
|
|
@@ -3687,9 +3641,9 @@ describe('BrsFile', () => {
|
|
|
3687
3641
|
end enum
|
|
3688
3642
|
`);
|
|
3689
3643
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3690
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3644
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3691
3645
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(3);
|
|
3692
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3646
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3693
3647
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(2);
|
|
3694
3648
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('weather'));
|
|
3695
3649
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('colors'));
|
|
@@ -3704,7 +3658,7 @@ describe('BrsFile', () => {
|
|
|
3704
3658
|
end enum
|
|
3705
3659
|
`);
|
|
3706
3660
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3707
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3661
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3708
3662
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3709
3663
|
mainFile = program.setFile('source/main.bs', `
|
|
3710
3664
|
enum Direction ' now is a string
|
|
@@ -3715,9 +3669,9 @@ describe('BrsFile', () => {
|
|
|
3715
3669
|
end enum
|
|
3716
3670
|
`);
|
|
3717
3671
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3718
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3672
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3719
3673
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3720
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3674
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3721
3675
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3722
3676
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('direction'));
|
|
3723
3677
|
});
|
|
@@ -3728,7 +3682,7 @@ describe('BrsFile', () => {
|
|
|
3728
3682
|
end namespace
|
|
3729
3683
|
`);
|
|
3730
3684
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3731
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3685
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3732
3686
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3733
3687
|
mainFile = program.setFile('source/main.bs', `
|
|
3734
3688
|
namespace alpha.beta
|
|
@@ -3736,9 +3690,9 @@ describe('BrsFile', () => {
|
|
|
3736
3690
|
end namespace
|
|
3737
3691
|
`);
|
|
3738
3692
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3739
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3693
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3740
3694
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(1);
|
|
3741
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3695
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3742
3696
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(1);
|
|
3743
3697
|
(0, chai_config_spec_1.expect)(runtimeChanges.has('alpha.beta.pi'));
|
|
3744
3698
|
});
|
|
@@ -3756,7 +3710,7 @@ describe('BrsFile', () => {
|
|
|
3756
3710
|
end sub
|
|
3757
3711
|
`);
|
|
3758
3712
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3759
|
-
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3713
|
+
let runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3760
3714
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3761
3715
|
mainFile = program.setFile('source/main.bs', `
|
|
3762
3716
|
function func1(p as string) as integer
|
|
@@ -3771,9 +3725,9 @@ describe('BrsFile', () => {
|
|
|
3771
3725
|
end sub
|
|
3772
3726
|
`);
|
|
3773
3727
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3774
|
-
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(
|
|
3728
|
+
runtimeSymbols = mainFile.providedSymbols.symbolMap.get(1 /* SymbolTypeFlag.runtime */);
|
|
3775
3729
|
(0, chai_config_spec_1.expect)(runtimeSymbols.size).to.eq(2);
|
|
3776
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3730
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3777
3731
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3778
3732
|
});
|
|
3779
3733
|
it('classes that override AA built-in methods show change properly', () => {
|
|
@@ -3789,7 +3743,7 @@ describe('BrsFile', () => {
|
|
|
3789
3743
|
// No changes!
|
|
3790
3744
|
mainFile = program.setFile('source/class.bs', classFileContent);
|
|
3791
3745
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3792
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3746
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3793
3747
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3794
3748
|
});
|
|
3795
3749
|
it('functions in a namespace that return classes show change properly', () => {
|
|
@@ -3815,7 +3769,7 @@ describe('BrsFile', () => {
|
|
|
3815
3769
|
// No changes!
|
|
3816
3770
|
mainFile = program.setFile('source/class.bs', fileContent);
|
|
3817
3771
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3818
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3772
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3819
3773
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3820
3774
|
});
|
|
3821
3775
|
it('functions in a namespace that have class params show change properly', () => {
|
|
@@ -3840,7 +3794,7 @@ describe('BrsFile', () => {
|
|
|
3840
3794
|
// No changes!
|
|
3841
3795
|
mainFile = program.setFile('source/class.bs', fileContent);
|
|
3842
3796
|
program.plugins.emit('onFileValidate', { program: program, file: mainFile });
|
|
3843
|
-
let runtimeChanges = mainFile.providedSymbols.changes.get(
|
|
3797
|
+
let runtimeChanges = mainFile.providedSymbols.changes.get(1 /* SymbolTypeFlag.runtime */);
|
|
3844
3798
|
(0, chai_config_spec_1.expect)(runtimeChanges.size).to.eq(0);
|
|
3845
3799
|
});
|
|
3846
3800
|
});
|