Skip to content

Commit

Permalink
exports
Browse files Browse the repository at this point in the history
  • Loading branch information
keyz committed Apr 20, 2016
1 parent ec2c63f commit e8eb392
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
10 changes: 0 additions & 10 deletions src/Interp/StatementInterp.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ const interp = (exp, env) => {
continue;
}

// @TODO if statements
// case 'IfStatement': {
// const { alternate, consequent, test } = currentExp;
// const testVal = expInterp(test, currentEnv);
//
// if (testVal) {
//
// }
// }

default: {
throw new Error(`unsupported BlockStatement type ${currentExp.type}`);
}
Expand Down
29 changes: 4 additions & 25 deletions src/Interp/__tests__/ExpressionInterp-test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
'use strict';

jest.unmock('../../Parser')
jest.unmock('../index')
.unmock('../../Parser')
.unmock('../ExpressionInterp')
.unmock('../StatementInterp')
.unmock('../../Environment')
.unmock('../../Closure')
.unmock('../../Options');

const { interp } = require('../ExpressionInterp');
const { interp } = require('../index');
const { parse } = require('../../Parser');

const {
emptyEnv,
extendEnv,
Expand Down Expand Up @@ -236,27 +238,4 @@ describe('Interp', () => {

Options.isLexical = true;
});


// it('IfStatement', () => {
// expect(interpExp(`(() => {
// const foo = 12;
// if (foo > 24) {
// return -20;
// } else if (foo < 25) {
// return -12;
// } else { // eslint-disable-line no-else-return
// return 1000;
// }
// })()`)).toBe((() => {
// const foo = 12;
// if (foo > 24) {
// return -20;
// } else if (foo < 25) {
// return -12;
// } else { // eslint-disable-line no-else-return
// return 1000;
// }
// })());
// });
});
1 change: 1 addition & 0 deletions src/Interp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { interp } from './ExpressionInterp';

0 comments on commit e8eb392

Please sign in to comment.