3 ms·
Author seems to be mostly concerned by code loaded as a module being treated as strict 100% of the time. Literally every difference that they list is strict mo
by olliej 10y ago
Author seems to be mostly concerned by code loaded as a module being treated as strict 100% of the time.
Literally every difference that they list is strict mode (and the usual misunderstanding of |this|)
- simplify 10y agoWhat usual misunderstanding of |this| are you referring to?
- dclowd9901 10y agoMight mean that in a module, `this` represents the environment the module was loaded in (rather than `undefined`), or `window|global` if not modularly loaded? I'm not sure either....
- olliej 10y agoPeople keep trying to apply lexical scope for |this| when it is always the left hand of the function refernece expression, e.g. Lhs.foo() Lhs[foo]() And Foo() // where lhs is implied to be the scope object defining Foo The last one seems to be what makes everyone super confused, but it is logically: GetScopeWith("foo").foo() Strict mode changes /one/ thing about|this|: whether the value of |this| undergoes object coercion
- deleted 10y ago[deleted]
- cwmma 10y agoYes that is the main difference along with top level return statements