namespace TurnAngleUsingFailDummyValue { enum TurnDirection { Left , Right } function fail ( message ) { console . error ( message ) ; throw new Error ( message ) ; } function turnAngle ( turn ) { switch ( turn ) { case TurnDirection . Left : return - 90 ; case TurnDirection . Right : return 90 ; default : { fail ( "Unknown TurnDirection" ) ; return - 1 ; } } } }