bublejs / buble

https://buble.surge.sh
MIT License
871 stars 67 forks source link

Parser cannot extend acornDynamicImport, cause it's not a function #222

Open devtorich opened 5 years ago

devtorich commented 5 years ago

I run this source code and the result is incorrect

const parser = Parser.extend(classFields, acornDynamicImport);

result:

...\node_modules\acorn\dist\acorn.js:571
Parser.extend = function extend () {
      var plugins = [], len = arguments.length;
      while ( len-- ) plugins[ len ] = arguments[ len ];

    var cls = this;
    for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
                                                               ^

TypeError: plugins[i] is not a function
mourner commented 5 years ago

Can you say more? Is this purely an Acorn issue, or related to Buble in any way?