Browse Source

failing test for #26

contingency-plan
Rich Harris 10 years ago
parent
commit
ae48cc1691
  1. 15
      test/function/statement-order/_config.js
  2. 17
      test/function/statement-order/answer.js
  3. 3
      test/function/statement-order/main.js

15
test/function/statement-order/_config.js

@ -0,0 +1,15 @@
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' );
},
solo: true,
show: true
};

17
test/function/statement-order/answer.js

@ -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;

3
test/function/statement-order/main.js

@ -0,0 +1,3 @@
import answer from './answer';
var answer2 = answer;
export default answer2;
Loading…
Cancel
Save