Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: for/in loop in JScript standards mode

0
0
Hi again,

We have a set of Javascripts that work with Google Chrome and Firefox and we would rather not modify them with non-standard code.

Just curious, why are you using JScript? V8 provides much better performance and Chrome compatibility, and it isn't affected by the issue you discovered.

What makes you think this is a problem with JScript? It is able to enumerate JScript objects, I would imagine it is using some kind of IDispatch/Ex capability.

We've investigated this internally and found some surprising things. When Standards Mode is enabled, JScript subtly breaks the IDispatchEx contract in order to pass some extra data to the host for certain calls. Hosts such as Internet Explorer and JScript itself can handle this, but the CLR cannot, and ClearScript relies on the CLR's built-in IDispatchEx implementation. The for..in loop isn't the only feature affected by this; host property deletion also fails in Standards Mode, and there may be others.

It may be possible to work around this problem. We're still investigating.

Thanks again!

Viewing all articles
Browse latest Browse all 2297