forked from TokyoFarmer/node-sql-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunary.js
More file actions
30 lines (24 loc) · 830 Bytes
/
unary.js
File metadata and controls
30 lines (24 loc) · 830 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
26
27
28
29
30
'use strict';
var _ = require('lodash');
var Node = require('./');
var valueExpressionMixin = require('./valueExpression');
var valueExpressionMixed = false;
// parent class of prefix and postfix unary
var UnaryNode = Node.define({
type: 'UNARY',
constructor: function(config) {
Node.call(this);
this.left = config.left;
this.operator = config.operator;
// Delay mixin to runtime, when all nodes have been defined, and
// mixin only once. ValueExpressionMixin has circular dependencies.
if (!valueExpressionMixed) {
valueExpressionMixed = true;
_.extend(UnaryNode.prototype, valueExpressionMixin());
}
}
});
// allow aliasing
var AliasNode = require('./alias');
_.extend(UnaryNode.prototype, AliasNode.AliasMixin);
module.exports = UnaryNode;