mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
10 years ago
3 changed files with 4 additions and 13 deletions
@ -1,16 +1,9 @@ |
|||
import { bar } from 'bar'; |
|||
|
|||
export default function Foo() { |
|||
// XXX: one does not even have to call the method, simply having it defined
|
|||
// on the prototype triggers the failure
|
|||
//return this.bar();
|
|||
return bar.foobar(); |
|||
this.answer = bar.foobar(); |
|||
} |
|||
|
|||
// XXX: this prototype definition throws it of, comment it out and it at least
|
|||
// fails at runtime because it generates wrong code
|
|||
Foo.prototype.bar = function () { |
|||
// XXX: it also has to be a nested function, simply calling `bar()` here
|
|||
// works, or at least it fails ar runtime like the case above
|
|||
return bar.foobar(); |
|||
}; |
|||
|
@ -1,5 +1,3 @@ |
|||
// XXX: it has to be an imported module, otherwise it compiles and fails at
|
|||
// runtime
|
|||
import Foo from './foo.js'; |
|||
|
|||
assert.equal( new Foo(), 42 ); |
|||
assert.equal( new Foo().bar(), 42 ); |
|||
|
Loading…
Reference in new issue