forked from brianc/node-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslice.js
More file actions
28 lines (24 loc) · 824 Bytes
/
slice.js
File metadata and controls
28 lines (24 loc) · 824 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
'use strict';
var _ = require('lodash');
var Node = require(__dirname);
var valueExpressionMixin = require(__dirname + '/valueExpression');
var valueExpressionMixed = false;
var SliceNode = Node.define({
type: 'SLICE',
constructor: function(value, start, end) {
Node.call(this);
this.value = value;
this.start = start;
this.end = end;
// Delay mixin to runtime, when all nodes have been defined, and
// mixin only once. ValueExpressionMixin has circular dependencies.
if (!valueExpressionMixed) {
valueExpressionMixed = true;
_.extend(SliceNode.prototype, valueExpressionMixin());
}
}
});
// allow aliasing
var AliasNode = require(__dirname + '/alias');
_.extend(SliceNode.prototype, AliasNode.AliasMixin);
module.exports = SliceNode;