Skip to content

updating source-map from 0.6.1 to 0.7.0 fails recast unit tests due to missing methods in SourceMapConsumer #322

@GerHobbelt

Description

@GerHobbelt

Error message:

  1) source maps
       should generate correct mappings:
     TypeError: smc.originalPositionFor is not a function
      at check (...path...\lib\js\recast\test\mapping.js:59:34)
      at Context.<anonymous> (...path...\lib\js\recast\test\mapping.js:80:9)
      at callFn (...path...\lib\js\recast\node_modules\mocha\lib\runnable.js:360:21)
      at Test.Runnable.run (...path...\lib\js\recast\node_modules\mocha\lib\runnable.js:352:7)
      at Runner.runTest (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:442:10)
      at ...path...\lib\js\recast\node_modules\mocha\lib\runner.js:560:12
      at next (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:356:14)
      at ...path...\lib\js\recast\node_modules\mocha\lib\runner.js:366:7
      at next (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:290:14)
      at Immediate.<anonymous> (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:334:5)
      at runCallback (timers.js:789:20)
      at tryOnImmediate (timers.js:751:5)
      at processImmediate [as _immediateCallback] (timers.js:722:5)

  2) source maps
       should compose with inputSourceMap:
     TypeError: smcLatter.eachMapping is not a function
      at Object.util.composeSourceMaps (...path...\lib\js\recast\lib\util.js:56:13)
      at Printer.print (...path...\lib\js\recast\lib\printer.js:173:18)
      at Context.<anonymous> (...path...\lib\js\recast\test\mapping.js:141:12)
      at callFn (...path...\lib\js\recast\node_modules\mocha\lib\runnable.js:360:21)
      at Test.Runnable.run (...path...\lib\js\recast\node_modules\mocha\lib\runnable.js:352:7)
      at Runner.runTest (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:442:10)
      at ...path...\lib\js\recast\node_modules\mocha\lib\runner.js:560:12
      at next (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:356:14)
      at ...path...\lib\js\recast\node_modules\mocha\lib\runner.js:366:7
      at next (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:290:14)
      at Immediate.<anonymous> (...path...\lib\js\recast\node_modules\mocha\lib\runner.js:334:5)
      at runCallback (timers.js:789:20)
      at tryOnImmediate (timers.js:751:5)
      at processImmediate [as _immediateCallback] (timers.js:722:5)

How to reproduce

  • fetch https://github.com/GerHobbelt/recast

  • in that repository's directory, run these commands:

  • npm i

  • npm test --> SUCCESS

  • now update package.json file: source-map from "0.6.1" to "0.7.0" (or do this using a tool such as this command line: ncu -a --packageFile=package.json

  • rm package-lock.json

  • rm -rf node_modules/source-map/

  • npm i

  • npm test --> FAIL (with error report shown above)

See also: GerHobbelt/recast@ff1a45b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions