[Nice-commit] Nice/src/gnu/expr InitializeProc.java,1.2,1.3
Brought to you by:
bonniot
From: <bo...@us...> - 2003-12-15 16:19:50
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv27562/src/gnu/expr Modified Files: InitializeProc.java Log Message: Allow custom constructors to call other custom constructors. Index: InitializeProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/InitializeProc.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InitializeProc.java 14 Dec 2003 16:52:32 -0000 1.2 --- InitializeProc.java 15 Dec 2003 16:19:47 -0000 1.3 *************** *** 27,31 **** public InitializeProc (Method constructor) { ! this(constructor, false); } --- 27,31 ---- public InitializeProc (Method constructor) { ! this(constructor, false, 0); } *************** *** 36,41 **** --- 36,52 ---- public InitializeProc (Method constructor, boolean implicitThis) { + this(constructor, implicitThis, 0); + } + + /** + @param implicitThis true if a 'this' argument should be added + during the call. + */ + public InitializeProc (Method constructor, boolean implicitThis, + int dummyArgs) + { this.constructor = constructor; this.implicitThis = implicitThis; + this.dummyArgs = dummyArgs; } *************** *** 58,61 **** --- 69,73 ---- private ConstructorExp method; private boolean implicitThis; + private int dummyArgs; public void compile (ApplyExp exp, Compilation comp, Target target) *************** *** 78,83 **** // Add dummy arguments to match the bytecode constructor. if (method != null) ! for (int i = 0; i < method.dummyArgs; i++) code.emitPushInt(0); --- 90,97 ---- // Add dummy arguments to match the bytecode constructor. + if (method !=null) + dummyArgs = method.dummyArgs; if (method != null) ! for (int i = 0; i < dummyArgs; i++) code.emitPushInt(0); |