<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Apr 11, 2017]]></title><description><![CDATA[<p dir="auto">Tim Murphy<br />
Newbie to OpenJSCAD. Love it. Could someone point me to tips for debugging my jscad scripts.</p>
<p dir="auto">I'm familiar with js, chrome, chrome developer tools. Tried to use the options for worker scripts (new to me). I can't get a breakpoint to work (the script seems to get replaced each run).</p>
<p dir="auto">Any help would be appreciated.<br />
5 comments<br />
5<br />
no plus ones<br />
no shares<br />
Shared publicly</p>
<pre><code>Jeff Gay
The worker basically runs within another context, and that makes debugging difficult. And as you know, the worker is provided with the script (JSCAD script appended with others), parameters, library list, etc.

Basically, the worker is a small instance of JS, which works within the scope of the parameters passed to it. No more. This eliminates security issues, but makes them almost useless.
</code></pre>
<p dir="auto">Apr 12, 2017<br />
Tim Murphy<br />
OK. Thank you.</p>
<p dir="auto">Apr 12, 2017<br />
Jeff Gay<br />
Do you want to make some changes? We always welcome contributions.</p>
<p dir="auto">Apr 12, 2017<br />
Ivaan Nazaroff<br />
+1<br />
If you put line</p>
<p dir="auto">debugger;</p>
<p dir="auto">into your script, and have the developer console open, you will trigger a break in the worker context. From there you can step in, step over, interrogate variables and run adhoc js in the context of the loaded libraries.</p>
<p dir="auto">Apr 23, 2017<br />
Tim Murphy<br />
I been away from this for a while... Thank you both for your comments. +Ivaan Nazaroff The 'debugger;' thing was what I was missing.  It's exactly what I was after. I'm fairly new to JS and wasn't aware of it.</p>
]]></description><link>https://openjscad.nodebb.com/topic/49/apr-11-2017</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 12:31:23 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/49.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Apr 2019 08:12:46 GMT</pubDate><ttl>60</ttl></channel></rss>