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

Fixed 6.17.0 Babel transpiling error #84

Merged
merged 1 commit into from
Dec 30, 2016
Merged

Fixed 6.17.0 Babel transpiling error #84

merged 1 commit into from
Dec 30, 2016

Conversation

eddyystop
Copy link
Collaborator

Using softDelete() pointed out a Babel 6.17.0 transpiling error in iffElse()

- iffElse was not calling hooks with service as their context
- Babel incorrectly transpiled an arrow func with (...hooks).call(this, )
@daffl
Copy link
Member

daffl commented Dec 26, 2016

What was the error? It looks like it should work (I just tried and it seems to be working with 6.20.0).

@eddyystop
Copy link
Collaborator Author

eddyystop commented Dec 27, 2016

hooks => hooks ? combine(...hooks).call(this, hook)

transpiled as

var runHooks = function (hooks) {
  return hooks ? combine.apply(this, hooks).call(this, hook) : hook;
};

The second this is wrong.

I didn't investigate if .call(this, ...) always has an issue, or if it occurred in conjunction with the (...hooks).

@daffl
Copy link
Member

daffl commented Dec 29, 2016

We can :shipit: I'd just be curious in which case it'd break (it looks right to me).

@daffl daffl merged commit 006c96c into master Dec 30, 2016
@daffl daffl deleted the softDelete-fix branch December 30, 2016 21:05
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