-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[browserified] Fails on IE7 (and IE6) #49
Comments
If this issue is a must-have for you, feel free to submit a patch, or at least thumb up this issue. |
I took a look at this, because my life is sad enough to involve IE7. Looks like it's as simple as IE7 not supporting string subscripting. This patch seems to fix it:
|
@Fanjita Thanks for pointing this out. Can you please check new browserified version works now? |
Thanks. I see you included a few cases that I'd missed, but it looks like you missed one:
Without this, the parser isn't able to recognise any of the primitive types - e.g. bools become strings. Otherwise, it seems to be working well on IE7 and IE8. Note that as well as the es5-shims, I also needed to add this shim manually to make things work properly:
|
Thanks once again. Hope now it will work :D Please let me know if this is not a bug in IE7 anymore, so I'll be happy to close this issue :D |
The demo seems broken on IE7 - I just get the error "The value of the property 'owns' is null or undefined, not a Function object". That seems to be a problem with the getOwnPropertyDescriptor sham, which is the only piece of code in the demo that contains "owns". I'm wary of using the shams - they're separated out because they're incomplete or broken. Replacing my existing custom shim for getOwnPropertyNames with the version from es5-shams does seem to work for me, though, on IE7 and above - maybe the best fix is to replace uses of getOwnPropertyNames in js-yaml with "Object.keys(obj)", which is all that the sham does, and then you shouldn't need to use the shams at all. |
Instead of using shams, provide own implementation of getOwnPropertyNames. See discussion of #49.
Hm. I tend to agree. I've updated browserified version and demo with your proposal. |
Bah. The latest browserified script works fine for everything I need to do with it on IE7 and IE8. But the demo still fails. I added a shim for Object.create (taking the version from es5-shams), which got a bit further, but then it complains about getOwnPropertyDescriptor. I can't find a shim for that that doesn't use owns(), which also seems to be missing from IE7/8, and is brutal to google for. I'll try to find time to look at whether the use of getOwnPropertyDescriptor is necessary or not. |
This patch to the demo fixes things for IE7 (it turns out that getOwnPropertyDescriptor is only being used for displaying the results):
IE8 is still broken, though, with a very unhelpful error of "Object doesn't support this action". I'm still looking into that. |
Seems that IE8's Object.getOwnPropertyDescriptor() method is broken for non-DOM objects (http://msdn.microsoft.com/en-us/library/ie/dd548686%28v=vs.94%29.aspx). This works as a dirty hack to make the demo functional:
I can't see any obvious way to autodetect that the method is broken for IE8, nor a working shim/sham implementation. Possibly you could simply undefine Object.getOwnPropertyDescriptor, and use the es5-sham implementation for all cases, which is probably good enough for the demo. Alternatively I guess you can autodetect IE7 or IE8, and use something like the hack above. I'm not really sure which is least ugly! |
@ixti Looks like
|
Version 2.x.x reads input using |
Closing an issue as code was completely rewritten and it needs to be tested in IE completely once again. |
While support of IE6 is close to necrophilia, IE7 is still one of the things that make our days not so shiny. By some reason js-yaml ignores new-line breaks on IE7.
This works:
{ foo: bar, baz: 123 }
And this one doesn't:
To demonstrate problem closer:
Becomes:
Also, integers are becomes integers ONLY with strict type casting:
{ foo: !!int 123, bar: 123 }
The above will become:
The text was updated successfully, but these errors were encountered: