File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict' ;
2-
3- var BinaryNode = module . exports = require ( __dirname ) . define ( {
2+ var Node = require ( __dirname ) ;
3+ var BinaryNode = module . exports = Node . define ( {
44 type : 'BINARY' ,
55 constructor : function ( config ) {
6+ Node . call ( this ) ;
67 this . left = config . left ;
78 this . operator = config . operator ;
89 this . right = config . right ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var Node = require(__dirname);
55module . exports = Node . define ( {
66 type : 'COLUMN' ,
77 constructor : function ( config ) {
8+ Node . call ( this ) ;
89 this . name = config . name ;
910 this . alias = config . alias ;
1011 this . star = config . star ;
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ var util = require ( 'util' ) ;
34var assert = require ( 'assert' ) ;
45
56var Node = function ( type ) {
@@ -25,20 +26,14 @@ Node.prototype.addAll = function(nodes) {
2526
2627Node . define = function ( def ) {
2728 var c = function ( ) {
28- Node . apply ( this , arguments ) ;
29+ Node . call ( this ) ;
2930 } ;
3031 //allow custom sub-class constructor
31- if ( def . constructor ) {
32- c = function ( ) {
33- Node . apply ( this , arguments ) ;
34- def . constructor . apply ( this , arguments ) ;
35- } ;
32+ if ( def . constructor && def . constructor != { } . constructor ) {
33+ c = def . constructor ;
3634 }
37- var key ;
38- for ( key in Node . prototype ) {
39- c . prototype [ key ] = Node . prototype [ key ] ;
40- }
41- for ( key in def ) {
35+ util . inherits ( c , Node ) ;
36+ for ( var key in def ) {
4237 c . prototype [ key ] = def [ key ] ;
4338 }
4439 return c ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var DefaultNode = require('./default');
77var Insert = Node . define ( {
88 type : 'INSERT' ,
99 constructor : function ( ) {
10+ Node . call ( this ) ;
1011 this . names = [ ] ;
1112 this . columns = [ ] ;
1213 this . valueSets = [ ] ;
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- var JoinNode = module . exports = require ( __dirname ) . define ( {
3+ var Node = require ( __dirname ) ;
4+ var JoinNode = module . exports = Node . define ( {
45 type : 'JOIN' ,
56 constructor : function ( subType , from , to ) {
7+ Node . call ( this ) ;
68 this . subType = subType ;
79 this . from = from . toNode ( ) ;
810 this . to = to . toNode ( ) ;
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- var OrderByColumn = module . exports = require ( __dirname ) . define ( {
3+ var Node = require ( __dirname ) ;
4+ var OrderByColumn = module . exports = Node . define ( {
45 type : 'ORDER BY COLUMN' ,
56 constructor : function ( config ) {
7+ Node . call ( this ) ;
68 this . column = config . column ;
79 this . direction = config . direction ;
810 }
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- module . exports = require ( __dirname ) . define ( {
3+ var Node = require ( __dirname ) ;
4+ module . exports = Node . define ( {
45 type : 'PARAMETER' ,
56 constructor : function ( val ) {
7+ Node . call ( this ) ;
68 this . _val = val ;
79 } ,
810 value : function ( ) {
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ var Modifier = Node.define({
3535var Query = Node . define ( {
3636 type : 'QUERY' ,
3737 constructor : function ( table ) {
38+ Node . call ( this ) ;
3839 this . table = table ;
3940 } ,
4041 select : function ( ) {
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- module . exports = require ( __dirname ) . define ( {
3+ var Node = require ( __dirname ) ;
4+ module . exports = Node . define ( {
45 type : 'TABLE' ,
56 constructor : function ( table ) {
7+ Node . call ( this ) ;
68 this . table = table ;
79 }
810} ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var Node = require(__dirname);
55module . exports = Node . define ( {
66 type : 'TEXT' ,
77 constructor : function ( text ) {
8+ Node . call ( this ) ;
89 this . text = text ;
910 }
1011} ) ;
You can’t perform that action at this time.
0 commit comments