[Cuis-dev] Bugfix: MethodNode>>sourceText can return a string with syntax errors
Facundo Javier Gelatti
javiergelatti at gmail.com
Sun Oct 4 09:28:46 PDT 2026
As MethodNode>>sourceText uses #printString, it can return a string with
invalid syntax if the method is very large. I attach some example code to
see this in a workspace (example1.workspace.st).
Note that it's not needed to have a method literally that large to trigger
this bug.
For example, I've found this when running some tests with the CodeCoverage
package. The code of the method was not so long, but as the coverage tool
instruments the method, it increased its size by a considerable amount.
Another example of a short method triggering the bug can be found in
example2.workspace.st.
The fix is to use #fullPrintString instead of #printString. I attach a
changeset to do this.
Cheers!
Facu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20261004/4ba68582/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example1.workspace.st
Type: application/vnd.sailingtracker.track
Size: 210 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20261004/4ba68582/attachment.st>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example2.workspace.st
Type: application/vnd.sailingtracker.track
Size: 184 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20261004/4ba68582/attachment-0001.st>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CuisCore-MethodNode_sourceText.cs.st
Type: application/vnd.sailingtracker.track
Size: 210 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20261004/4ba68582/attachment-0002.st>
More information about the Cuis-dev
mailing list