This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I've found a problem with Web Workbench. It's an issue we can live with, for now (since we're on a pretty long development lifecycle) but it's a pretty major issue we think. Given the following CoffeeScript:
We should be getting the following JavaScript generated:
What Web Workbench is giving us is this:
This is wrong in a couple ways. First, it's using a non-strict comparison (!= vs !==). Second, it's leaving out the !== 'undefined' all together. This actually makes the existential operator given to us by CoffeeScript not useful for it's purpose. See The Existential Operator docs on CoffeeScript.org for more information. |
|
|
Could you check whether there you are using the latest version of Web Workbench? The current version is producing the desired output when we try it, but we updated the CoffeeScript compiler to 1.2.0 in December (build 19319); it's possible you're still on an older version. You can check the version in Visual Studio Extension Manager and update it via the Extension Manager Updates tab (it may sit on 'no updates found' for a few seconds so give it a moment!). |
|
|
Thanks for the reply Ivan. I'm using Visual Studio 11 Beta with Web Workbench version 3.1.140.20147, which I believe is the latest version. Here's a chunk of CoffeeScript and then the JavaScript that web workbench is compiling it to...
|
|
|
This appears to be the behaviour of the CoffeeScript compiler, not something specific to Web Workbench. If you paste your snippet into the CoffeeScript Web site, then it returns exactly the same JavaScript you're getting from Web Workbench (see attached screenshot). Possibly the compiler has decided that since .optionList is a property of @options it can skip the extra checks, or possibly this is a bug in the CoffeeScript compiler. In any case, I'm afraid it's outside our control and you'll need to raise it with the CoffeeScript folks at https://groups.google.com/forum/#!forum/coffeescript or https://github.com/jashkenas/coffee-script/issues. Let us know what the outcome is so we can include the patch if they change it! |
|
|
Thanks for pointing this out Ivan. It seems coffee script works differently when using this vs local variables. I never noticed this before. Sorry for the bother and thanks for the help! |
|