Skip to content

Commit

Permalink
fix new keyword mess
Browse files Browse the repository at this point in the history
  • Loading branch information
wassertim committed Mar 23, 2021
1 parent a2dc442 commit 355dc97
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 88 deletions.
2 changes: 1 addition & 1 deletion tests/annotation_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ VF.Test.Annotation = (function () {
},

tabNotes: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 600, 200);
var ctx = contextBuilder(options.elementId, 600, 200);
ctx.font = '10pt Arial';
var stave = new VF.TabStave(10, 10, 550);
stave.setContext(ctx);
Expand Down
2 changes: 1 addition & 1 deletion tests/articulation_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ VF.Test.Articulation = (function () {
},

tabNotes: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 600, 200);
var ctx = contextBuilder(options.elementId, 600, 200);
ctx.font = '10pt Arial';
var stave = new VF.TabStave(10, 10, 550);
stave.setContext(ctx);
Expand Down
10 changes: 5 additions & 5 deletions tests/bend_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ VF.Test.Bend = (function () {
},

doubleBends: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 500, 240);
var ctx = contextBuilder(options.elementId, 500, 240);
ctx.scale(1.5, 1.5);
ctx.fillStyle = '#221';
ctx.strokeStyle = '#221';
Expand Down Expand Up @@ -65,7 +65,7 @@ VF.Test.Bend = (function () {
},

doubleBendsWithRelease: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 550, 240);
var ctx = contextBuilder(options.elementId, 550, 240);
ctx.scale(1.0, 1.0);
ctx.setBackgroundFillStyle('#FFF');
ctx.setFont('Arial', VF.Test.Font.size);
Expand Down Expand Up @@ -119,7 +119,7 @@ VF.Test.Bend = (function () {
},

reverseBends: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 500, 240);
var ctx = contextBuilder(options.elementId, 500, 240);

ctx.scale(1.5, 1.5);
ctx.fillStyle = '#221';
Expand Down Expand Up @@ -179,7 +179,7 @@ VF.Test.Bend = (function () {
},

bendPhrase: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 500, 240);
var ctx = contextBuilder(options.elementId, 500, 240);
ctx.scale(1.5, 1.5);
ctx.fillStyle = '#221';
ctx.strokeStyle = '#221';
Expand Down Expand Up @@ -226,7 +226,7 @@ VF.Test.Bend = (function () {
},

whackoBends: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 240);
var ctx = contextBuilder(options.elementId, 400, 240);
ctx.scale(1.0, 1.0);
ctx.setBackgroundFillStyle('#FFF');
ctx.setFont('Arial', VF.Test.Font.size);
Expand Down
4 changes: 2 additions & 2 deletions tests/dot_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ VF.Test.Dot = (function () {
},

basic: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 1000, 240);
var ctx = contextBuilder(options.elementId, 1000, 240);
ctx.setFillStyle('#221');
ctx.setStrokeStyle('#221');

Expand Down Expand Up @@ -106,7 +106,7 @@ VF.Test.Dot = (function () {
},

multiVoice: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 750, 300);
var ctx = contextBuilder(options.elementId, 750, 300);
ctx.setFillStyle('#221');
ctx.setStrokeStyle('#221');

Expand Down
12 changes: 6 additions & 6 deletions tests/gracenote_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ VF.Test.GraceNote = (function () {
voice.addTickables(createNoteBlock(['g/4'], 1));
voice.addTickables(createNoteBlock(['d/5'], -1));

new vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);
vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);

vf.draw();

Expand Down Expand Up @@ -220,7 +220,7 @@ VF.Test.GraceNote = (function () {
voice.addTickables(createBeamdNoteBlock(['g/4'], 1, beams));
voice.addTickables(createBeamdNoteBlock(['d/5'], -1, beams));

new vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);
vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);

vf.draw();

Expand Down Expand Up @@ -275,7 +275,7 @@ VF.Test.GraceNote = (function () {
voice.addTickables(createNoteBlock(['d/4', 'a/4'], 1));
voice.addTickables(createNoteBlock(['d/4', 'a/4'], -1));

new vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);
vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);

vf.draw();

Expand Down Expand Up @@ -323,7 +323,7 @@ VF.Test.GraceNote = (function () {
voice.addTickables(createNoteBlock(['d/4', 'a/4'], 1));
voice.addTickables(createNoteBlock(['d/4', 'a/4'], -1));

new vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);
vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);

vf.draw();

Expand Down Expand Up @@ -388,7 +388,7 @@ VF.Test.GraceNote = (function () {
vf.Beam({ notes: notes2.slice(0, 4) });
vf.Beam({ notes: notes2.slice(4, 8) });

new VF.Formatter().joinVoices([voice, voice2]).formatToStave([voice, voice2], stave);
vf.Formatter().joinVoices([voice, voice2]).formatToStave([voice, voice2], stave);

vf.draw();

Expand Down Expand Up @@ -453,7 +453,7 @@ VF.Test.GraceNote = (function () {
vf.Beam({ notes: notes2.slice(0, 4) });
vf.Beam({ notes: notes2.slice(4, 8) });

new VF.Formatter().joinVoices([voice, voice2]).formatToStave([voice, voice2], stave);
vf.Formatter().joinVoices([voice, voice2]).formatToStave([voice, voice2], stave);

vf.draw();
vf.draw();
Expand Down
4 changes: 2 additions & 2 deletions tests/key_clef_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ VF.Test.ClefKeySignature = (function () {
'percussion',
];

var ctx = new contextBuilder(options.elementId, 400, 20 + 80 * 2 * clefs.length);
var ctx = contextBuilder(options.elementId, 400, 20 + 80 * 2 * clefs.length);
var staves = [];
var keys = options.params.majorKeys ? VF.Test.ClefKeySignature.MAJOR_KEYS : VF.Test.ClefKeySignature.MINOR_KEYS;

Expand Down Expand Up @@ -102,7 +102,7 @@ VF.Test.ClefKeySignature = (function () {
},

staveHelper: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 400);
var ctx = contextBuilder(options.elementId, 400, 400);
var stave = new VF.Stave(10, 10, 370);
var stave2 = new VF.Stave(10, 90, 370);
var stave3 = new VF.Stave(10, 170, 370);
Expand Down
14 changes: 7 additions & 7 deletions tests/keysignature_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ VF.Test.KeySignature = (function () {
},

majorKeys: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 240);
var ctx = contextBuilder(options.elementId, 400, 240);
var stave = new VF.Stave(10, 10, 350);
var stave2 = new VF.Stave(10, 90, 350);
var keys = VF.Test.KeySignature.MAJOR_KEYS;
Expand All @@ -81,7 +81,7 @@ VF.Test.KeySignature = (function () {
},

majorKeysCanceled: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 780, 500);
var ctx = contextBuilder(options.elementId, 780, 500);
ctx.scale(0.9, 0.9);
var stave = new VF.Stave(10, 10, 750).addTrebleGlyph();
var stave2 = new VF.Stave(10, 90, 750).addTrebleGlyph();
Expand Down Expand Up @@ -135,7 +135,7 @@ VF.Test.KeySignature = (function () {
},

keysCanceledForEachClef: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 600, 380);
var ctx = contextBuilder(options.elementId, 600, 380);
ctx.scale(0.8, 0.8);
var keys = ['C#', 'Cb'];

Expand All @@ -161,7 +161,7 @@ VF.Test.KeySignature = (function () {
},

majorKeysAltered: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 780, 500);
var ctx = contextBuilder(options.elementId, 780, 500);
ctx.scale(0.9, 0.9);
var stave = new VF.Stave(10, 10, 750).addTrebleGlyph();
var stave2 = new VF.Stave(10, 90, 750).addTrebleGlyph();
Expand Down Expand Up @@ -213,7 +213,7 @@ VF.Test.KeySignature = (function () {
},

minorKeys: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 240);
var ctx = contextBuilder(options.elementId, 400, 240);
var stave = new VF.Stave(10, 10, 350);
var stave2 = new VF.Stave(10, 90, 350);
var keys = VF.Test.KeySignature.MINOR_KEYS;
Expand All @@ -237,7 +237,7 @@ VF.Test.KeySignature = (function () {
ok(true, 'all pass');
},
endKeyWithClef: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 200);
var ctx = contextBuilder(options.elementId, 400, 200);
ctx.scale(0.9, 0.9);
var stave1 = new VF.Stave(10, 10, 350);
stave1
Expand All @@ -257,7 +257,7 @@ VF.Test.KeySignature = (function () {
},

staveHelper: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 240);
var ctx = contextBuilder(options.elementId, 400, 240);
var stave = new VF.Stave(10, 10, 350);
var stave2 = new VF.Stave(10, 90, 350);
var keys = VF.Test.KeySignature.MAJOR_KEYS;
Expand Down
6 changes: 3 additions & 3 deletions tests/notehead_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ VF.Test.NoteHead = (function () {
},

setupContext: function (options, x, y) {
var ctx = new options.contextBuilder(options.elementId, x || 450, y || 140);
var ctx = options.contextBuilder(options.elementId, x || 450, y || 140);
ctx.scale(0.9, 0.9);
ctx.fillStyle = '#221';
ctx.strokeStyle = '#221';
Expand Down Expand Up @@ -97,7 +97,7 @@ VF.Test.NoteHead = (function () {
{ keys: ['g/5/r2'], duration: '4' },
];

var ctx = new contextBuilder(options.elementId, notes.length * 25 + 100, 240);
var ctx = contextBuilder(options.elementId, notes.length * 25 + 100, 240);

// Draw two staves, one with up-stems and one with down-stems.
for (var h = 0; h < 2; ++h) {
Expand Down Expand Up @@ -138,7 +138,7 @@ VF.Test.NoteHead = (function () {
{ keys: ['a/4/r2', 'g/5/t3'], duration: '4' },
];

var ctx = new contextBuilder(options.elementId, notes.length * 25 + 100, 240);
var ctx = contextBuilder(options.elementId, notes.length * 25 + 100, 240);

// Draw two staves, one with up-stems and one with down-stems.
for (var h = 0; h < 2; ++h) {
Expand Down
4 changes: 2 additions & 2 deletions tests/percussion_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ VF.Test.Percussion = (function () {
},

draw: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 120);
var ctx = contextBuilder(options.elementId, 400, 120);

new VF.Stave(10, 10, 300).addClef('percussion').setContext(ctx).draw();

Expand All @@ -215,7 +215,7 @@ VF.Test.Percussion = (function () {
{ keys: ['g/5/x3'], duration: '4' },
];

var ctx = new contextBuilder(options.elementId, notes.length * 25 + 100, 240);
var ctx = contextBuilder(options.elementId, notes.length * 25 + 100, 240);

// Draw two staves, one with up-stems and one with down-stems.
for (var h = 0; h < 2; ++h) {
Expand Down
4 changes: 2 additions & 2 deletions tests/rests_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ VF.Test.Rests = (function () {
},

setupContext: function (options, contextBuilder, x, y) {
var ctx = new contextBuilder(options.elementId, x || 350, y || 150);
var ctx = contextBuilder(options.elementId, x || 350, y || 150);
ctx.scale(0.9, 0.9);
ctx.fillStyle = '#221';
ctx.strokeStyle = '#221';
Expand Down Expand Up @@ -294,7 +294,7 @@ VF.Test.Rests = (function () {
},

multi: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 600, 200);
var ctx = contextBuilder(options.elementId, 600, 200);

var stave = new VF.Stave(50, 10, 500).addClef('treble').setContext(ctx).addTimeSignature('4/4').draw();

Expand Down
12 changes: 6 additions & 6 deletions tests/rhythm_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ VF.Test.Rhythm = (function () {
},

drawSlash: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 350, 180);
var ctx = contextBuilder(options.elementId, 350, 180);
var stave = new VF.Stave(10, 10, 350);
stave.setContext(ctx);
stave.draw();
Expand All @@ -43,7 +43,7 @@ VF.Test.Rhythm = (function () {
},

drawBasic: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 800, 150);
var ctx = contextBuilder(options.elementId, 800, 150);

// bar 1
var staveBar1 = new VF.Stave(10, 30, 150);
Expand Down Expand Up @@ -159,7 +159,7 @@ VF.Test.Rhythm = (function () {
},

drawBeamedSlashNotes: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 800, 150);
var ctx = contextBuilder(options.elementId, 800, 150);

// bar 1
var staveBar1 = new VF.Stave(10, 30, 300);
Expand Down Expand Up @@ -233,7 +233,7 @@ VF.Test.Rhythm = (function () {
},

drawSlashAndBeamAndRests: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 800, 150);
var ctx = contextBuilder(options.elementId, 800, 150);

// bar 1
var staveBar1 = new VF.Stave(10, 30, 300);
Expand Down Expand Up @@ -318,7 +318,7 @@ VF.Test.Rhythm = (function () {
},

drawSixtenthWithScratches: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 800, 150);
var ctx = contextBuilder(options.elementId, 800, 150);

// bar 1
var staveBar1 = new VF.Stave(10, 30, 300);
Expand Down Expand Up @@ -393,7 +393,7 @@ VF.Test.Rhythm = (function () {
},

drawThirtySecondWithScratches: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 800, 150);
var ctx = contextBuilder(options.elementId, 800, 150);

// bar 1
var staveBar1 = new VF.Stave(10, 30, 300);
Expand Down
12 changes: 6 additions & 6 deletions tests/stave_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ VF.Test.Stave = (function () {
},

draw: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 150);
var ctx = contextBuilder(options.elementId, 400, 150);
var stave = new VF.Stave(10, 10, 300);
stave.setContext(ctx);
stave.draw();
Expand All @@ -100,7 +100,7 @@ VF.Test.Stave = (function () {
},

drawOpenStave: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 350);
var ctx = contextBuilder(options.elementId, 400, 350);
var stave = new VF.Stave(10, 10, 300, { left_bar: false });
stave.setContext(ctx);
stave.draw();
Expand Down Expand Up @@ -670,7 +670,7 @@ VF.Test.Stave = (function () {
},

configureSingleLine: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 120);
var ctx = contextBuilder(options.elementId, 400, 120);
var stave = new VF.Stave(10, 10, 300);
stave
.setConfigForLine(0, { visible: true })
Expand All @@ -691,7 +691,7 @@ VF.Test.Stave = (function () {
},

configureAllLines: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 400, 120);
var ctx = contextBuilder(options.elementId, 400, 120);
var stave = new VF.Stave(10, 10, 300);
stave
.setConfigForLines([{ visible: false }, null, { visible: false }, { visible: true }, { visible: false }])
Expand All @@ -709,7 +709,7 @@ VF.Test.Stave = (function () {
},

drawStaveText: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 900, 140);
var ctx = contextBuilder(options.elementId, 900, 140);
var stave = new VF.Stave(300, 10, 300);
stave.setText('Violin', VF.Modifier.Position.LEFT);
stave.setText('Right Text', VF.Modifier.Position.RIGHT);
Expand All @@ -721,7 +721,7 @@ VF.Test.Stave = (function () {
},

drawStaveTextMultiLine: function (options, contextBuilder) {
var ctx = new contextBuilder(options.elementId, 900, 200);
var ctx = contextBuilder(options.elementId, 900, 200);
var stave = new VF.Stave(300, 40, 300);
stave.setText('Violin', VF.Modifier.Position.LEFT, { shift_y: -10 });
stave.setText('2nd line', VF.Modifier.Position.LEFT, { shift_y: 10 });
Expand Down
Loading

0 comments on commit 355dc97

Please sign in to comment.