@@ -250,12 +250,17 @@ private void appendUnsignedInt(ByteList buf, int value) {
250250 buf .append (value >>> 24 );
251251 }
252252
253- private byte [] encodeEvalScopes (ByteList buf , StaticScope scope ) {
253+ private void encodeEvalScopes (ByteList buf , StaticScope scope ) {
254254 int startIndex = buf .realSize ();
255+
256+ // append uint 0 to reserve the space
255257 appendUnsignedInt (buf , 0 );
258+
259+ // write the scopes to the buffer
256260 int count = encodeEvalScopesInner (buf , scope , 1 );
261+
262+ // overwrite int 0 with scope count
257263 writeUnsignedInt (buf , startIndex , count );
258- return buf .bytes ();
259264 }
260265
261266 private int encodeEvalScopesInner (ByteList buf , StaticScope scope , int count ) {
@@ -265,8 +270,13 @@ private int encodeEvalScopesInner(ByteList buf, StaticScope scope, int count) {
265270
266271 // once more for method scope
267272 String names [] = scope .getVariables ();
273+
274+ // number of variables
268275 appendUnsignedInt (buf , names .length );
276+
277+ // forwarding flags
269278 buf .append (0 );
279+
270280 for (String name : names ) {
271281 // Get the bytes "raw" (which we use ISO8859_1 for) as this is how we record these in StaticScope.
272282 byte [] bytes = name .getBytes (ISO8859_1Encoding .INSTANCE .getCharset ());
0 commit comments