Unity says that my script isn't doing anything?

I am working on a building game, and I spawn objects & parent them to a master object. Unity is giving me the

Expressions in statements must only be executed for their side-effects.

error. After a little bit of research, I discovered that Unity thinks my script does not do anything. My script obviously does do something, actually it does quite a bit.

here is the script-

#pragma strict

var gamemanager : GameObject;
var spawnedobj : GameObject;

function Start () {
	gamemanager = GameObject.FindGameObjectWithTag("gmanager");
}


function OnMouseOver () {
	if(Input.GetMouseButtonDown(0)) {
		spawnedobj = Instantiate(gamemanager.GetComponent("itemmanager").selectedobject, transform.position, transform.rotation);
        spawnedobj.AddComponent(HingeJoint);
        spawnedobj.GetComponent(HingeJoint).spring.damper.Mathf.Infinity;
	}

	if(Input.GetMouseButtonDown(1)) {
		Destroy(spawnedobj);
		spawnedobj = null;
	}
}

any thoughts on what to do?

*javascript only please, duh

*thanks

spawnedobj.GetComponent(HingeJoint).spring.damper.Mathf.Infinity;

does not do anything. You need to assign values using the = symbol.