public static object StrictSetName(Scriptable bound, object value, Context cx, Scriptable scope, string id)
{
if (bound != null)
{
// TODO: The LeftHandSide also may not be a reference to a
// data property with the attribute value {[[Writable]]:false},
// to an accessor property with the attribute value
// {[[Put]]:undefined}, nor to a non-existent property of an
// object whose [[Extensible]] internal property has the value
// false. In these cases a TypeError exception is thrown (11.13.1).
// TODO: we used to special-case XMLObject here, but putProperty
// seems to work for E4X and we should optimize the common case
ScriptableObject.PutProperty(bound, id, value);
return value;
}
else
{
// See ES5 8.7.2
string msg = "Assignment to undefined \"" + id + "\" in strict mode";
throw ConstructError("ReferenceError", msg);
}
}