Index: loader.js
===================================================================
--- loader.js	(revision 11494)
+++ loader.js	(working copy)
@@ -98,6 +98,7 @@
 			return true; // Boolean
 		}
 		var contents = this._getText(uri, true);
+
 		if(!contents){ return false; } // Boolean
 		this._loadedUrls[uri] = true;
 		this._loadedUrls.push(uri);
@@ -293,7 +294,39 @@
 		var ok = this._loadPath(relpath, modArg);
 
 		if((!ok)&&(!omitModuleCheck)){
-			throw new Error("Could not load '" + moduleName + "'; last tried '" + relpath + "'");
+			
+			if( !this._parsingBadFile ){  // Errors pass through here twice. Only allow once 
+			
+				this._parsingBadFile = true;
+				var _lastLoaded = this._loadedUrls[this._loadedUrls.length-1];
+				var _badFile = relpath.split("/")[relpath.split("/").length-1];
+				
+				// 		Checking if the last file attempted to load is also the last file loaded. 
+				//		In other words, this script block only cares about syntax errors. If it 
+				//		was a file-not-found, that error needs to skip this and pass down to the 
+				//		'throw' below.
+				//
+				if(_lastLoaded.indexOf(_badFile)){ 
+					
+					// 		In the event of a script error, dynamically create a script tag and 
+					//		load suspect script into it. The script can then be evaluated directly 
+					//		by the Javascript debugger and gives an accurate pointer to location of 
+					//		the problem, and a general description of the incorrect syntax. 
+					//		Yes, this even works in IE.
+					//
+					var scr = document.createElement("script");
+					scr.src = _lastLoaded;
+					document.getElementsByTagName("head")[0].appendChild(scr);
+					
+					// 		Stop the thread here, and don't go through to the error throw below. 
+					//		It's inaccurate for syntax errors anyway. It causes a double error, 
+					//		and the 'throw' is first, with a misleading pointer to this script.
+					//
+					return;
+				}
+			}
+			//
+			throw new Error("Could not load '" + moduleName + "'; last tried: '" + relpath + "'");
 		}
 
 		// check that the symbol was defined
