MatAtBread / fast-async

603 stars 21 forks source link

test failed with latest dependencies #2

Closed uzcc closed 8 years ago

uzcc commented 8 years ago
$ npm test

> fast-async@6.0.15 test /Users/undozen/github/fa
> cd tests && npm i && node .

npm WARN package.json fast-async-test@6.0.11 No repository field.
npm WARN package.json fast-async-test@6.0.11 No README data
colors@1.1.2 node_modules/colors

fast-async@6.0.15 node_modules/fast-async
└── nodent@2.4.0 (acorn-es7-plugin@1.0.11, source-map@0.5.3, acorn@2.7.0)

babel-plugin-syntax-async-functions@6.5.0 node_modules/babel-plugin-syntax-async-functions
└── babel-runtime@5.8.35 (core-js@1.2.6)

babel-core@6.5.1 node_modules/babel-core
├── slash@1.0.0
├── babel-messages@6.5.0
├── path-exists@1.0.0
├── babel-template@6.5.0
├── shebang-regex@1.0.0
├── path-is-absolute@1.0.0
├── babel-helpers@6.5.0
├── private@0.1.6
├── babylon@6.5.0
├── convert-source-map@1.1.3
├── source-map@0.5.3
├── json5@0.4.0
├── debug@2.2.0 (ms@0.7.1)
├── babel-types@6.5.1 (to-fast-properties@1.0.1, esutils@2.0.2)
├── minimatch@2.0.10 (brace-expansion@1.1.3)
├── babel-traverse@6.5.0 (globals@8.18.0, invariant@2.2.0, repeating@1.1.3)
├── babel-code-frame@6.5.0 (js-tokens@1.0.2, esutils@2.0.2, line-numbers@0.2.0, chalk@1.1.1, repeating@1.1.3)
├── babel-generator@6.5.0 (trim-right@1.0.1, detect-indent@3.0.1, is-integer@1.0.6, repeating@1.1.3)
├── lodash@3.10.1
├── babel-register@6.5.1 (home-or-tmp@1.0.0, mkdirp@0.5.1, source-map-support@0.2.10, core-js@1.2.6)
└── babel-runtime@5.8.35 (core-js@1.2.6)
#### To run the tests you need to npm install babel-core. This additional module is only required for testing, not deployment.

Starting tests...
'npm install babel-plugin-transform-async-to-generator babel-preset-es2015' to compare against babel plugin 'transform-async-to-generator'
'npm install babel-plugin-transform-async-to-module-method babel-preset-es2015 bluebird coroutine' to compare against babel plugin 'transform-async-to-module-method'
Transforming with fast-async
TypeError: unknown: Cannot read property 'end' of undefined
    at /Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:50:19
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:99:30)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace._findToken (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:101:19)
    at Whitespace.getNewlinesAfter (/Users/undozen/github/fa/tests/node_modules/babel-core/node_modules/babel-generator/lib/whitespace.js:49:22)
matAtWork commented 8 years ago

Good catch. Fixed in 6.0.16 https://github.com/MatAtBread/fast-async/commit/87705862cea07431eadd42eb2d5f142e3fb8da7e

It appears that Babel >=6.5.0 uses the original source locations during output (I have no idea why - maybe as an attempt to preserve formatting?) and gets upset when ASTs are concatenated (as the plugin does to prepend the runtime).

Note that Nodent and Acorn have also been updated, which may have broken some (very rare) edge cases in parsing (see Acorn notes for v2.7.0).

Please re-open if you have additional issues.