File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -340,12 +340,12 @@ export function play_wave(wave: Wave, duration: number): AudioPlayed {
340
340
export function play ( sound : Sound ) : AudioPlayed {
341
341
// Type-check sound
342
342
if ( ! is_sound ( sound ) ) {
343
- throw new Error ( `play is expecting sound, but encountered ${ sound } ` ) ;
343
+ throw new Error ( `${ play . name } is expecting sound, but encountered ${ sound } ` ) ;
344
344
// If a sound is already playing, terminate execution.
345
345
} else if ( isPlaying ) {
346
- throw new Error ( ' play: audio system still playing previous sound' ) ;
346
+ throw new Error ( ` ${ play . name } : audio system still playing previous sound` ) ;
347
347
} else if ( get_duration ( sound ) < 0 ) {
348
- throw new Error ( ' play: duration of sound is negative' ) ;
348
+ throw new Error ( ` ${ play . name } : duration of sound is negative` ) ;
349
349
} else {
350
350
// Instantiate audio context if it has not been instantiated.
351
351
if ( ! audioplayer ) {
@@ -424,7 +424,7 @@ export function play_concurrently(sound: Sound): void {
424
424
// Type-check sound
425
425
if ( ! is_sound ( sound ) ) {
426
426
throw new Error (
427
- `play_concurrently is expecting sound, but encountered ${ sound } ` ,
427
+ `${ play_concurrently . name } is expecting sound, but encountered ${ sound } ` ,
428
428
) ;
429
429
} else if ( get_duration ( sound ) <= 0 ) {
430
430
// Do nothing
Original file line number Diff line number Diff line change @@ -375,12 +375,12 @@ export function play_waves(
375
375
export function play ( sound : Sound ) : AudioPlayed {
376
376
// Type-check sound
377
377
if ( ! is_sound ( sound ) ) {
378
- throw new Error ( `play is expecting sound, but encountered ${ sound } ` ) ;
378
+ throw new Error ( `${ play . name } is expecting sound, but encountered ${ sound } ` ) ;
379
379
// If a sound is already playing, terminate execution.
380
380
} else if ( isPlaying ) {
381
- throw new Error ( ' play: audio system still playing previous sound' ) ;
381
+ throw new Error ( ` ${ play . name } : audio system still playing previous sound` ) ;
382
382
} else if ( get_duration ( sound ) < 0 ) {
383
- throw new Error ( ' play: duration of sound is negative' ) ;
383
+ throw new Error ( ` ${ play . name } : duration of sound is negative` ) ;
384
384
} else {
385
385
// Instantiate audio context if it has not been instantiated.
386
386
if ( ! audioplayer ) {
@@ -484,7 +484,7 @@ export function play_concurrently(sound: Sound): void {
484
484
// Type-check sound
485
485
if ( ! is_sound ( sound ) ) {
486
486
throw new Error (
487
- `play_concurrently is expecting sound, but encountered ${ sound } ` ,
487
+ `${ play_concurrently . name } is expecting sound, but encountered ${ sound } ` ,
488
488
) ;
489
489
} else if ( get_duration ( sound ) <= 0 ) {
490
490
// Do nothing
You can’t perform that action at this time.
0 commit comments