From a0947684695f358176ea0e102920c56c3588fc29 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 23 Nov 2014 14:53:57 -0800 Subject: [PATCH] Move `sourceURL` to the beginning of the function body to avoid errors in narwhal. --- lodash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 9f6961dd9..5a7218611 100644 --- a/lodash.js +++ b/lodash.js @@ -8966,7 +8966,7 @@ // Use a sourceURL for easier debugging. // See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl. var sourceURL = 'sourceURL' in options ? options.sourceURL : ('/lodash/template/source[' + (++templateCounter) + ']'); - sourceURL = sourceURL ? ('\n//# sourceURL=' + sourceURL) : ''; + sourceURL = sourceURL ? ('//# sourceURL=' + sourceURL + '\n') : ''; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); @@ -9026,7 +9026,7 @@ 'return __p\n}'; var result = attempt(function() { - return Function(importsKeys, 'return ' + source + sourceURL).apply(undefined, importsValues); + return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues); }); // Provide the compiled function's source by its `toString` method or