Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: Update snapshot
  • Loading branch information
Danielku15 committed May 7, 2025
commit 82aeb029e03f9292120fff0d30c1814c71921a95
40 changes: 22 additions & 18 deletions src.compiler/csharp/CSharpAstTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,28 +234,34 @@ export default class CSharpAstTransformer {
// validate global statements
if (!defaultExport || !ts.isClassDeclaration(defaultExport)) {
for (const s of globalStatements) {
if (!this.shouldSkip(s, true)) {
this._context.addTsNodeDiagnostics(
s,
'Global statements in modules are only allowed if there is a default class export',
ts.DiagnosticCategory.Error
);
}
}
}

for (const s of additionalNestedExportDeclarations) {
if (!this.shouldSkip(s, true)) {
this._context.addTsNodeDiagnostics(
s,
'Global statements in modules are only allowed if there is a default class export',
'Global statements in modules are not yet supported',
ts.DiagnosticCategory.Error
);
}
}

for (const s of additionalNestedExportDeclarations) {
this._context.addTsNodeDiagnostics(
s,
'Global statements in modules are not yet supported',
ts.DiagnosticCategory.Error
);
}

for (const s of additionalNestedNonExportsDeclarations) {
this._context.addTsNodeDiagnostics(
s,
'Global statements in modules are not yet supported',
ts.DiagnosticCategory.Error
);
if (!this.shouldSkip(s, true)) {
this._context.addTsNodeDiagnostics(
s,
'Global statements in modules are not yet supported',
ts.DiagnosticCategory.Error
);
}
}

// TODO: make root namespace configurable from outside.
Expand Down Expand Up @@ -3621,8 +3627,7 @@ export default class CSharpAstTransformer {

const argumentSymbol = this._context.typeChecker.getSymbolAtLocation(expression.argumentExpression);
const elementAccessMethod = argumentSymbol ? this._context.getMethodNameFromSymbol(argumentSymbol) : '';
if(elementAccessMethod) {

if (elementAccessMethod) {
const memberAccess = {
nodeType: cs.SyntaxKind.MemberAccessExpression,
expression: {} as cs.Expression,
Expand All @@ -3631,7 +3636,7 @@ export default class CSharpAstTransformer {
tsNode: expression,
nullSafe: !!expression.questionDotToken
} as cs.MemberAccessExpression;

memberAccess.expression = this.visitExpression(memberAccess, expression.expression)!;
if (!memberAccess.expression) {
return null;
Expand All @@ -3640,7 +3645,6 @@ export default class CSharpAstTransformer {
return memberAccess;
}


const elementAccess = {
expression: {} as cs.Expression,
argumentExpression: {} as cs.Expression,
Expand Down
2 changes: 1 addition & 1 deletion src/alphaTab.polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ResizeObserverPolyfill } from '@src/platform/javascript/ResizeObserverPolyfill';
import { IntersectionObserverPolyfill } from '@src/platform/javascript/IntersectionObserverPolyfill';

/* @target web */
/*@target web*/
(() => {
if (typeof Symbol.dispose === 'undefined') {
type Writeable<T> = { -readonly [K in keyof T]: T[K] };
Expand Down
50 changes: 17 additions & 33 deletions test/importer/__snapshots__/gp8importer.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 71.88264,
"frameoffset" => 0,
"millisecondoffset" => 0,
},
"ratioposition" => 0,
"text" => "",
Expand All @@ -39,9 +38,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 99.72622,
"frameoffset" => 73620,
"millisecondoffset" => 1669.387755102041,
},
"ratioposition" => 0.5,
"text" => "",
Expand All @@ -57,9 +55,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 90.66336,
"frameoffset" => 126684,
"millisecondoffset" => 2872.6530612244896,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -124,9 +121,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 87.32674,
"frameoffset" => 1644300,
"millisecondoffset" => 37285.71428571428,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -156,9 +152,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 200.18156,
"frameoffset" => 1886700,
"millisecondoffset" => 42782.31292517007,
},
"ratioposition" => 0,
"text" => "",
Expand All @@ -175,9 +170,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 200.09074,
"frameoffset" => 1939572,
"millisecondoffset" => 43981.22448979592,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -402,9 +396,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 199.99873,
"frameoffset" => 4531476,
"millisecondoffset" => 102754.55782312925,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -715,9 +708,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 95.02262,
"frameoffset" => 8341740,
"millisecondoffset" => 189155.10204081633,
},
"ratioposition" => 0,
"text" => "",
Expand All @@ -743,9 +735,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 103.20769,
"frameoffset" => 8508816,
"millisecondoffset" => 192943.67346938775,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -853,9 +844,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 192.18826,
"frameoffset" => 9329220,
"millisecondoffset" => 211546.9387755102,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -893,9 +883,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 195.20833,
"frameoffset" => 9549504,
"millisecondoffset" => 216542.04081632654,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -956,9 +945,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 200.20428,
"frameoffset" => 10200132,
"millisecondoffset" => 231295.51020408163,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -1003,9 +991,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 200.38033,
"frameoffset" => 10623060,
"millisecondoffset" => 240885.71428571426,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -1188,9 +1175,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 89.990814,
"frameoffset" => 12762252,
"millisecondoffset" => 289393.4693877551,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -1228,9 +1214,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 103.1941,
"frameoffset" => 13232700,
"millisecondoffset" => 300061.2244897959,
},
"ratioposition" => 0,
"text" => "",
Expand Down Expand Up @@ -1330,9 +1315,8 @@ Map {
"value" => 0,
"syncpointvalue" => Map {
"baroccurence" => 0,
"originaltempo" => 90,
"modifiedtempo" => 103.19424,
"frameoffset" => 14155776,
"millisecondoffset" => 320992.6530612245,
},
"ratioposition" => 1,
"text" => "",
Expand All @@ -1347,7 +1331,7 @@ Map {
"bracketextendmode" => 0,
},
"backingtrack" => Map {
"framepadding" => -72900,
"padding" => -1653.061224489796,
},
"style" => Map {
"headerandfooter" => Map {
Expand Down