<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,20 +1,56 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
+&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
 &lt;plist version=&quot;1.0&quot;&gt;
 &lt;dict&gt;
 	&lt;key&gt;beforeRunningCommand&lt;/key&gt;
 	&lt;string&gt;nop&lt;/string&gt;
 	&lt;key&gt;command&lt;/key&gt;
 	&lt;string&gt;#!/usr/bin/env bash
-
-cat &amp;gt;/tmp/tmp_test.js
-
 . &quot;$TM_SUPPORT_PATH/lib/webpreview.sh&quot;
-html_header &quot;Test Javascript&quot;
+html_header &quot;Javascript Runner&quot; &quot;Open Web Inspector for log&quot;
+
+YOURCODE=`cat`
 
-echo '&amp;lt;pre&amp;gt;&amp;lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&amp;gt; try{/*YOUR STUFF*/'
-cat /tmp/tmp_test.js
-echo '/*YOUR STUFF*/}catch(e){ document.write(e) }; &amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;'
+cat &amp;lt;&amp;lt;HTML
+&amp;lt;script&amp;gt;
+(function(){try{
+	
+	function e_sh(s){
+		return s
+		.toString()
+		.replace(/\x27/g,&quot;&#8217;&quot;)
+		.replace(/\&quot;/g,'\\\&quot;')
+		;
+	};
+	
+	window.alert = function(s){
+		TextMate.system('&quot;$DIALOG&quot; -e -p \'{messageTitle=&quot;JavaScript&quot;;informativeText=&quot;'+e_sh(s)+'&quot;;}\'', null);
+	};
+	
+	var __TM_confirm_Status;
+	window.confirm = function(s){
+		TextMate.system('&quot;$DIALOG&quot; -e -p \'{messageTitle=&quot;JavaScript&quot;;informativeText=&quot;'+e_sh(s)+'&quot;;buttonTitles=(&quot;OK&quot;,&quot;Cancel&quot;);}\'', null)
+		.onreadoutput = function(s){ __TM_confirm_Status = s != 1; };
+		return(__TM_confirm_Status);
+	};
+	
+}catch(e){ console.log(e.message); }; })();
+&amp;lt;/script&amp;gt;
+&amp;lt;pre id=&quot;log&quot;&amp;gt;
+$YOURCODE
+&amp;lt;script&amp;gt;
+try{throw {}}catch(e){ window.__line=(e.line||0) + 3 };
+try{
+/*----  YOUR CODE ----*/
+$YOURCODE
+/*---- /YOUR CODE ----*/
+}catch(e){
+	console.log(e);
+	var __line_offset = ${TM_INPUT_START_LINE:-1};
+	alert(&quot;$TM_FILEPATH:&quot; + ((e.line||1) - __line + __line_offset) +&quot;\n&quot;+ e.message||'')
+};
+&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;
+HTML
 
 html_footer
 &lt;/string&gt;</diff>
      <filename>Commands/Test Javascript.tmCommand</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>43d2cd3ae2931f61e59df915cc8f5e165b854b52</id>
    </parent>
  </parents>
  <author>
    <name>Thomas Aylott</name>
    <email>oblivious+git@subtlegradient.com</email>
  </author>
  <url>http://github.com/johnmuhl/javascript-tools-tmbundle/commit/86cd1e0212595789daf95df69e85532271dc54fc</url>
  <id>86cd1e0212595789daf95df69e85532271dc54fc</id>
  <committed-date>2008-09-25T09:35:52-07:00</committed-date>
  <authored-date>2008-09-25T09:35:52-07:00</authored-date>
  <message>The Javascript Runner now logs errors to the web inspector console as well as alerting with the filepath &amp; corrected line number.
The Javascript Runner now outputs your code visibly as well as running it.
Implemented (a slightly modified version of) Hans-J&#246;rg Bibiko's alert &amp; confirm.</message>
  <tree>c68a8175d62a6c53d7beb22014ea1437059cb98d</tree>
  <committer>
    <name>Thomas Aylott</name>
    <email>oblivious+git@subtlegradient.com</email>
  </committer>
</commit>
