Getting error in debug mode and not in run mode

I’m changing a script I made about a month ago in SD. And now I get an error in debug mode only. When I run it without debugging it runs fine.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

property NSString : a reference to current application's NSString

-- 1 - try to run with the following part commented out
-- 2 - uncomment this part and try to run again debug enabled
(* 
set mSource to ""
set mStartStr to ""
set mStart to (offset of mStartStr in mSource) + (length of mStartStr) - 1
set mElementContent to NSString's stringWithString:mSource
*)

set allData to my initSB()
allData's addStr:"Hi Mark,"
allData's addStr:"I'm having trouble with this!"

set mMsg to allData's getList() as text
display alert "SB" message mMsg



on initSB()
	script sb
		use AppleScript version "2.4"
		use framework "Foundation"
		
		property gS : {}
		
		on addStr:mStr
			set gS to gS & {mStr}
		end addStr:
		
		on getList()
			return gS
		end getList
	end script
	
	return sb
end initSB

2 posts were split to a new topic: Current application’s NSArray’s arrayWithArray won’t compile

I can reproduce the problem.

The act of storing ASObjC pointers in properties of AppleScript object instances leads the SD debugger to fail. We are working on this, but I’m not sure if a fix is possible. Watch the change notes on future SD7 builds to see if we find a solution for this.

A possible workaround is to use a global NSMutableDictionary to retain your objects, and have a key that links the values to your object instances. Kind of ugly, but that’s about all I can offer at this point.

Strange Mark, because it worked a few versions ago. I think before a change you made both to SD6 and SD7.
Can we still download older versions of SD6 because it worked in a previous version…

Just re-tested with the Script Debugger 6.0.0 build and experienced the same problem. I don’t think this is a regression from Script Debugger 6.