I've been trying to find the cause of a very misleading compiler error:
"Unable to get property 'type' of undefined or null reference - VSTSC"
I took to deleting code line-by-line, and seem to have found the cause; this line:
ns[""] = attrValue;
It may look strange, but I believe it to be valid to have an empty string as a property name - in this case, I'm getting a list of XML namespaces, and this particular line is setting the default namespace in 'attrValue' to object 'ns'.
Anyway, that seems to be the cause of the error, even though the error message itself doesn't seem to relate to it.
I can get around this with:
var empty = "";
ns[empty] = attrValue
I think this may be a bug, but I thought I'd post it here first to see if others can reproduce or give a reason why it might be happening. Thanks.