Giter VIP home page Giter VIP logo

Comments (6)

Rich-Harris avatar Rich-Harris commented on May 29, 2024

Thanks. No need for a more isolated test, I reckon this is small enough to work with - will look into it as soon as I get a chance. Not immediately sure what's causing it but am sure it's fixable (he said confidently...)

from rollup.

Rich-Harris avatar Rich-Harris commented on May 29, 2024

@mbostock Turns out I'm struggling to reproduce this - all the d3-shape tests are passing for me, and the statement ordering looks to be correct. Has anything changed since this issue was opened?

from rollup.

mbostock avatar mbostock commented on May 29, 2024

Yeah, there’s a workaround I’ve been using.

I’ll try to pare down a standalone test case.

from rollup.

mbostock avatar mbostock commented on May 29, 2024

Here ya go:

https://gist.github.com/mbostock/bc1ffc78c3f933eff312

Note that if you reverse the order of statements in index.js, the test passes!

from rollup.

Rich-Harris avatar Rich-Harris commented on May 29, 2024

Ah, I see what's going on here. The (new Foo) line causes the Foo definition to be included, which means also including Foo.prototype.test = ... and (because rollup can't know that Object.create doesn't modify Foo.prototype) Bar.prototype = Object.create(Foo.prototype). So the second line, which causes the Bar declaration to be included, doesn't include the Bar.prototype = statement because it's already included.

Not immediately sure what a general solution looks like (the last time I tried to naively sort statements according to their original order, it ended badly), but I'll try a few things. Suggestions welcome!

from rollup.

Rich-Harris avatar Rich-Harris commented on May 29, 2024

Fixed in 0.9.0 - have confirmed all the d3-shape tests now pass without the workaround

from rollup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.