According to the ES5.1 spec, the program `"use strict;" "foo".bar = 42;` causes a `String` object to be created, assigns to a property on it, and then throws the object away, resulting in no observable effects - including any exceptions. (The absence of effect can be confirmed by trying it in an ES5-compatible JS implementation like that in Opera 12.)

In modern JS implementations, it throws a `TypeError` instead—try it:

```js
"use strict"; "foo".bar = 42;
```

I am pretty sure the new behaviour is mandated by the ES6 spec, but despite reading the relevant sections several times I cannot see where it is specified that `TypeError` be thrown. In fact, [the key parts](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-putvalue) appear to be unchanged:

> 
> 6.2.3.2 PutValue (*V*, *W*)#
> 
> 
> 1. ReturnIfAbrupt(*V*).
> 2. ReturnIfAbrupt(*W*).
> 3. If Type(*V*) is not Reference, throw a **ReferenceError** exception.
> 4. Let *base* be GetBase(*V*).
> 5. If IsUnresolvableReference(*V*) is true, then
> 	* …
> 6. Else if IsPropertyReference(*V*) is true, then
> 	* a. If HasPrimitiveBase(*V*) is true, then
> 		+ i. Assert: In this case, *base* will never be null or undefined.
> 		+ ii. Set *base* to ToObject(*base*).
> 	* b. Let *succeeded* be ? *base*.[[Set]](GetReferencedName(*V*), *W*, GetThisValue(*V*)).
> 	* c. ReturnIfAbrupt(*succeeded*).
> 	* d. If *succeeded* is false and IsStrictReference(*V*) is true, throw a **TypeError** exception.
> 	* e. Return.
> 7. …
> 
> 
> 

Where does the spec (ES6 or later) mandate throwing `TypeError`?