Commit 988307f6 988307f6cb6b6549356110445d133d655ca5a12a by Nicolas Perriault

fixed missing file location information on syntax error on a required file

1 parent ce868249
Showing 1 changed file with 3 additions and 2 deletions
...@@ -162,9 +162,10 @@ if (!phantom.casperLoaded) { ...@@ -162,9 +162,10 @@ if (!phantom.casperLoaded) {
162 return requireCache[file].exports; 162 return requireCache[file].exports;
163 } 163 }
164 try { 164 try {
165 new Function('module', 'exports', phantom.getScriptCode(file))(module, module.exports); 165 var scriptCode = phantom.getScriptCode(file);
166 new Function('module', 'exports', scriptCode)(module, module.exports);
166 } catch (e) { 167 } catch (e) {
167 phantom.processScriptError(e); 168 phantom.processScriptError(e, file);
168 } 169 }
169 requireCache[file] = module; 170 requireCache[file] = module;
170 return module.exports; 171 return module.exports;
......