Skip to content

Conversation

@groner
Copy link

@groner groner commented Feb 1, 2017

    <testcase name="#171 ES2015: Directive return object (arrow function)">
      <failure>
          ---
            operator: equal
            expected: '// directive return objectmyMod.directive("foo", ["$scope", $scope =&gt; {    return {        controller: ["$scope", "$timeout", ($scope, $timeout) =&gt; {            bar;        }]    };}]);myMod.directive("foo", ["$scope", $scope =&gt; {    return {        controller: () =&gt; {            bar;        }    };}]);myMod.directive("foo", ["$scope", $scope =&gt; ({    controller: ["$scope", "$timeout", ($scope, $timeout) =&gt; {        bar;    }]})]);'
            actual: '// directive return objectmyMod.directive("foo", ["$scope", $scope =&gt; {    return {        controller: ["$scope", "$timeout", ($scope, $timeout) =&gt; {            bar;        }]    };}]);myMod.directive("foo", ["$scope", $scope =&gt; {    return {        controller: () =&gt; {            bar;        }    };}]);myMod.directive("foo", ["$scope", $scope =&gt; ({    controller: ($scope, $timeout) =&gt; {        bar;    }})]);'
            at: doTransform (/home/kai/src/babel-plugin-angularjs-annotate/tests/tests.js:84:5)
          ...
      </failure>
    </testcase>

@groner
Copy link
Author

groner commented Feb 1, 2017

The test passes!

});
myMod.directive("foo", ($scope) => ({
controller: ($scope, $timeout) => {
bar;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this is not an implicit return, because bar is inside of a block-body ({ }).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. Nevermind. We're looking at two different things. I do indeed see the implicit return on the line above 🤦‍♂️

@schmod schmod merged commit f6c0ab3 into schmod:master Jul 12, 2017
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

Successfully merging this pull request may close these issues.

2 participants