mirror of https://github.com/lukechilds/rollup.git
Rich Harris
10 years ago
4 changed files with 75 additions and 13 deletions
@ -0,0 +1,13 @@ |
|||||
|
var assert = require( 'assert' ); |
||||
|
|
||||
|
module.exports = { |
||||
|
description: 'correct statement order is preserved even in weird edge cases', |
||||
|
context: { |
||||
|
getAnswer: function ( obj ) { |
||||
|
return obj.answer; |
||||
|
} |
||||
|
}, |
||||
|
exports: function ( exports ) { |
||||
|
assert.equal( exports, 'right' ); |
||||
|
} |
||||
|
}; |
@ -0,0 +1,17 @@ |
|||||
|
var prop, |
||||
|
answer; |
||||
|
|
||||
|
var foo = { answer: 'wrong' }; |
||||
|
var bar = { answer: 'right' }; |
||||
|
|
||||
|
if ( typeof bar === "object" ) { |
||||
|
for ( prop in bar ) { |
||||
|
if ( bar.hasOwnProperty(prop) ) { |
||||
|
foo[prop] = bar[prop]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
answer = getAnswer( foo ); |
||||
|
|
||||
|
export default answer; |
@ -0,0 +1,3 @@ |
|||||
|
import answer from './answer'; |
||||
|
var answer2 = answer; |
||||
|
export default answer2; |
Loading…
Reference in new issue