You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
457 B
20 lines
457 B
var utils = require('../utils'); |
|
|
|
/** |
|
* Perform `op` on the `left` and `right` operands. |
|
* |
|
* @param {String} op |
|
* @param {Node} left |
|
* @param {Node} right |
|
* @return {Node} |
|
* @api public |
|
*/ |
|
|
|
function operate(op, left, right){ |
|
utils.assertType(op, 'string', 'op'); |
|
utils.assertPresent(left, 'left'); |
|
utils.assertPresent(right, 'right'); |
|
return left.operate(op.val, right); |
|
} |
|
operate.params = ['op', 'left', 'right']; |
|
module.exports = operate;
|
|
|