undefined definition on the transpiled code

18 views
Skip to first unread message

João Fernandes

unread,
Feb 12, 2015, 1:18:20 PM2/12/15
to traceur-comp...@googlegroups.com
Hi, I'm using https://github.com/aaronpowell/linq-in-javascript/ and I stumbled in this error on the transpiled code.
When transpiling the WhereEnumerable function, I get the following transpiled code and the code throws  "x$__6 is not defined"

var WhereEnumerable = (function(__super) {
      return function WhereEnumerable(parent, fn) {
        var $__10 = $traceurRuntime.initGeneratorFunction(where);
        function where(fn) {
          var index,
              $__0,
              $__1,
              undefined;
          return $traceurRuntime.createGeneratorInstance(function($ctx) {
            while (true)
              switch ($ctx.state) {
                case 0:
                  index = 0;
                  $ctx.state = 13;
                  break;
                case 13:
                  $__0 = parent()[$traceurRuntime.toProperty(Symbol.iterator)]();
                  $ctx.state = 7;
                  break;
                case 7:
                  $ctx.state = (!($__1 = $__0.next()).done) ? 8 : -2;
                  break;
                case 8:
                  x$__6 = $__1.value;
                  $ctx.state = 9;
                  break;
                case 9:
                  $ctx.state = (fn(x$__6, index)) ? 1 : 4;
                  break;
                case 1:
                  $ctx.state = 2;
                  return x$__6;
                case 2:
                  $ctx.maybeThrow();
                  $ctx.state = 4;
                  break;
                case 4:
                  index++;
                  $ctx.state = 7;
                  break;
                default:
                  return $ctx.end();
              }
          }, $__10, this);
        }



Erik Arvidsson

unread,
Feb 12, 2015, 1:45:07 PM2/12/15
to traceur-comp...@googlegroups.com
Can you file an issue on github and include what your input code looks like?
> --
> You received this message because you are subscribed to the Google Groups
> "traceur-compiler-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to traceur-compiler-d...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
erik

João Fernandes

unread,
Feb 12, 2015, 2:06:29 PM2/12/15
to traceur-comp...@googlegroups.com


--
You received this message because you are subscribed to a topic in the Google Groups "traceur-compiler-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/traceur-compiler-discuss/di0DxQKUUlg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to traceur-compiler-d...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

João Fernandes
Reply all
Reply to author
Forward
0 new messages