Skip to content
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

Support IE < 9 #3

Open
wolverian opened this issue May 14, 2013 · 4 comments
Open

Support IE < 9 #3

wolverian opened this issue May 14, 2013 · 4 comments

Comments

@wolverian
Copy link

do is an invalid identifier in IE < 9:

>>foo.do = function(){}
  "Expected identifier"

foo["do"] does work.

@mtkopone
Copy link
Owner

Yeah. I'm sorry about this, I really should have mentioned it at least in the readme.

BEGIN Mumbling into internets

Long story short: I was aware of this when writing zhain. Also, my current project didn't/doesn't need to support IE < 9. I thought long and hard about valid, working synonym, and since I couldn't find a word concise and relevant enough, I gave up and blatantly decided to let legacy-IE-people suffer. Sorry about that, it was my laziness.

Suggestions for an alias are welcome. Here's what I've thought of:
.ex() - as in execute
pow() - as in a meaningless word and therefore understandable only through documentation
go() - you know, as in "go do this"
z() - as in, well, "zhain it", I suppose

Not really happy about any of them. .do() is a word that matches what's going on in a nice way...

Oh, and there's of course also the option to forget about the .do altogether, and write something crazy like this:

zhain()
  (function() { console.log('what up?') })
  (function() { console.log('... homeboys') })
  .run()

But I feel it might scare people ;)

END Mumbling into internets

How important is this for you?

@antris
Copy link

antris commented May 15, 2013

The parens-only syntax seems pretty sweet. Any non-feelings based reason for not using it?

Just my two cents

@wolverian
Copy link
Author

The parens-only syntax seems pretty sweet. Any non-feelings based reason for not using it?

It wouldn't fit CoffeeScript very well, I think:

zhain()
  (-> foo)
  (->
    bar
    quux)
  .end()

vs

zhain()
  .do ->
    foo
  .do ->
    bar
    quux
  .end()

The latter is much more idiomatic.

Suggestions for an alias are welcome.

  • Bacon uses doAction.
  • then might work, though it does overload what Promises/A+ means with then.
  • z is pretty nice.

One unrealistic option would be to change all uses of .do in Zhain to ["do"]. This is what CoffeeScript compiles .do accesses to, so if you wanted to use Zhain with IE < 9, you'd have to use CoffeeScript, or write ["do"] everywhere yourself.

@antris
Copy link

antris commented May 15, 2013

I'm not convinced. If I don't get a djuizzy zhain(foo)(bar)(baz)() syntax, imma fork!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants