Polymer / tools

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

[BUG] error [unknown-superclass] - Unable to resolve superclass Array #2437

Open atolk opened 7 years ago

atolk commented 7 years ago

Description

Polymer build unable to resolve superclass when subclassing from built-in objects.

Versions & Environment

Error occurred with polymer-cli 0.18.2 as well. With 0.18.1 build passing normally.

Steps to Reproduce

  1. Create an application project: polymer init polymer-2-starter-kit
  2. In the src directory create files:
    • MyArray.html: <script src='MyArray.js'></script>
    • MyArray.js: class MyArray extends Array {}
  3. Add on top to the my-app.html: <link rel="import" href="MyArray.html">
  4. Build: polymer build

Expected Results

No error is throw

Actual Results

class MyArray extends Array {}



src/MyArray.js(0,22) error [unknown-superclass] - Unable to resolve superclass Array
error:   Promise rejection: Error: 1 error(s) occurred during build.
error:   Error: 1 error(s) occurred during build.
    at BuildAnalyzer._done (/usr/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:229:36)
    at BuildAnalyzer.<anonymous> (/usr/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:189:26)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
    at process._tickCallback (internal/process/next_tick.js:109:7)
justinfagnani commented 7 years ago

cc @e111077

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.