๏̯͡๏ Jasvir Nagra (2013-07-29T20:56:36.000Z)
domenic at domenicdenicola.com (2013-08-12T05:20:16.540Z)
I am not sure I completely understand what a realm is but I am assuming it is similar to a set of primodials (say an iframe in a browser). Unless I am really misreading your examples, I do not think the new proposal overcomes the problems of http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null. If Function.setTypeOf dynamically affects subsequent use of typeof, then action-at-a-distance problems will persist. If one library adopts one convention regarding typeof null and another a different one, then these libraries will not be useable together. Similarly, the use of such a library in a program would suddenly cause existing typeof conventions to break. Finally, given the following snippet: ```js var x = typeof a; f(); var y = typeof b; ``` it would be surprising to me if x !== y just because f() happened to call Function.setTypeOf(). Especially if you make typeof extensible, this kind of action-at-a-distance will be a hazard to developers. If we must make typeof extensible, it would be less of a hazard if the effect of the declaration was lexically scoped. In that case, it would genuinely affect only new code and maintain the invariants of legacy code.