@@ -110,17 +110,27 @@ this.Base = Base.inject(/** @lends Base# */{
110110 } ,
111111
112112 /**
113- * Reads arguments of the type of the class on which it is called on
114- * from the passed arguments list or array, at the given index, up to
115- * the specified length. This is used in argument conversion, e.g. by
116- * all basic types (Point, Size, Rectangle) and also higher classes such
117- * as Color and Segment.
113+ * When called on a subclass of Base, it reads arguments of the type of
114+ * the subclass from the passed arguments list or array, at the given
115+ * index, up to the specified length.
116+ * When called directly on Base, it reads any value without conversion
117+ * from the apssed arguments list or array.
118+ * This is used in argument conversion, e.g. by all basic types (Point,
119+ * Size, Rectangle) and also higher classes such as Color and Segment.
118120 * @param {Number } start the index at which to start reading in the list
119121 * @param {Number } length the amount of elements that can be read
120122 * @param {Boolean } clone controls wether passed objects should be
121123 * cloned if they are already provided in the required type
122124 */
123125 read : function ( list , start , length , clone , readNull ) {
126+ // See if it's called directly on Base, and if so, read value and
127+ // return without object conversion.
128+ if ( this === Base ) {
129+ var value = this . peek ( list , start ) ;
130+ list . _index ++ ;
131+ list . _read = 1 ;
132+ return value ;
133+ }
124134 var proto = this . prototype ,
125135 readIndex = proto . _readIndex ,
126136 index = start || readIndex && list . _index || 0 ;
@@ -151,17 +161,10 @@ this.Base = Base.inject(/** @lends Base# */{
151161 return obj ;
152162 } ,
153163
154- peekValue : function ( list , start ) {
164+ peek : function ( list , start ) {
155165 return list [ list . _index = start || list . _index || 0 ] ;
156166 } ,
157167
158- readValue : function ( list , start ) {
159- var value = this . peekValue ( list , start ) ;
160- list . _index ++ ;
161- list . _read = 1 ;
162- return value ;
163- } ,
164-
165168 /**
166169 * Reads all readable arguments from the list, handling nested arrays
167170 * seperately.
0 commit comments