Rewrite revision 1206412 to throw a helpful exception in strict mode, and catch and ignore it otherwise. This is cleaner and lets us reuse that exception class for other cases.