I need to know how to get rid of this EOF error.

This is the error: Assets/flashlightonandoff.js(1,1): BCE0044: expecting EOF, found ‘Light’.

I am making a game sort of slender-ish and I wanted a button to toggle the flashlight on and off so I have the script. I have tried many different placements of parenthesis’ and can’t seem to get them in the right place without them triggering another EOF error.
Please help. Thankyou in advance.

SCRIPT:

Light : flashlight
bool : on = false;

void Start()
{
flashlight = GetComponentInChildren();;
}

void Update()
{
if(on)
flashlight.light.enabled = true;
else if(!on)
flashlight.light.enabled = false;
if(Input.GetKeyDown(KeyCode.F))
on = !on;
}

What is that script? thats not a javascipt here this should work:
var flashlight : Light;

flashlight.enabled = false;//change to true if you want it to light when the light to work when starting the script

void Update(){
if(Input.GetKeyDown(KeyCode.F)){//Every time you click F
if(!flashlight.enabled)//if the light not working
flashlight.light.enabled = true;//set it to work.
else if(flashlight.enabled)//if it is working
flashlight.light.enabled = false;//set it to not work
}
}