-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Given the following I'd expect the same result from both lengths:
Input Code
const foo = (...args) => { }
console.log(foo.length) // 0
const asyncFoo = async (...args) => { }
console.log(asyncFoo.length) // 1Babel Configuration (.babelrc, package.json, cli command)
.bablerc:
{
"presets": [
"react",
"es2015",
"stage-3"
],
"plugins": [
"transform-runtime",
"transform-decorators-legacy",
"transform-class-properties"
]
}Package.json:
"babel-core": "^6.18.2",
"babel-plugin-transform-class-properties": "^6.18.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-3": "^6.17.0",
Context
I was tripped up because Mocha behaves differently depending on the test function's length. I couldn't figure out why everything stopped working when I changed a test wrapper function to async.
Your Environment
| software | version |
|---|---|
| Babel | 6.18.2 |
| node | v4.6.2 |
| npm | 3.10.9 |
| Operating System | MacOS 10.12.1 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue