bublejs / bublejs/buble

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

Open
#222 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
874
Forks
62
PR merge metrics
No merged PRs in 30d

Description

I run this source code and the result is incorrect

```javascript
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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the shown Parser.extend(classFields, acornDynamicImport) snippet and inspect the Parser.extend entry point, using the stack location in node_modules/acorn/dist/acorn.js as the starting point. Check why acornDynamicImport is not being accepted as a plugin; done means the parser no longer raises the TypeError and produces the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.