10.2.1.1.3 SetMutableBinding

2010-05-06

Undefined SetMutableBinding(N:String, V:mixed, S:Boolean) throws TypeError

Initialize or change a mutable binding N to value V. S denotes strict mode and throws an error if something fails. The binding N must already exist.

In these examples, a Binding is an object {value:mixed, mutable:Boolean, deletable:Boolean}

Code: (Meta Ecma)
function SetMutableBinding(N, V, S){
var envRec = this;
if (!(N in envRec)) return; // "assert envRec does not already have a binding for N"
if (this[N].mutable) this[N].value = V;
else if (S) throw TypeError;
};