forked from brianc/node-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinary.js
More file actions
25 lines (21 loc) · 739 Bytes
/
binary.js
File metadata and controls
25 lines (21 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
var _ = require('lodash');
var Node = require(__dirname);
var valueExpressionMixin = require(__dirname + '/valueExpression');
var valueExpressionMixed = false;
var BinaryNode = Node.define(_.extend({
type: 'BINARY',
constructor: function(config) {
Node.call(this);
this.left = config.left;
this.operator = config.operator;
this.right = config.right;
// Delay mixin to runtime, when all nodes have been defined, and
// mixin only once. ValueExpressionMixin has circular dependencies.
if (!valueExpressionMixed) {
valueExpressionMixed = true;
_.extend(BinaryNode.prototype, valueExpressionMixin());
}
},
}));
module.exports = BinaryNode;