Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Vulcanize doesn't understand new.target #1873

Open AshleyScirra opened 8 years ago

AshleyScirra commented 8 years ago

Using test.html:

<script src="test.js"></script>

and test.js:

"use strict";

class Foo {
    constructor()
    {
        this._target = new.target;
    }
};

then running vulcanize test.html fails with "Error parsing script in test.js at 6:21: unexpected token .". It looks like it's inside the espree module. I checked it separately and it does understand new.target, but only if you set ecmaVersion to 6, so I think vulcanize is either on an old version or has mis-configured something, so it doesn't correctly understand all ECMAScript 6 features.

AshleyScirra commented 8 years ago

Meta-bug: why is vulcanize even attempting to parse .js files if all it does is emit a <script src="..."></script> tag referencing the file?

garlicnation commented 8 years ago

@AshleyScirra If you reinstall vulcanize, it will understand es6 classes.

AshleyScirra commented 8 years ago

This isn't about ES6 classes, it's about new.target, or am I missing something?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.