From 0f8bae950ea179694c40844990eec183fe3e2648 Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Mon, 16 Jul 2012 16:35:35 -0700 Subject: [PATCH] Ensure running in IE if concated with other files that enable conditional compilation /*@cc_on @/`. Former-commit-id: cf2d9c01ce92b8b85149116d48145bc4342471a4 --- lodash.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index af689d3aa..a18cb94a2 100644 --- a/lodash.js +++ b/lodash.js @@ -141,8 +141,10 @@ /** Detect if sourceURL syntax is usable without erroring */ try { - // Adobe's and Narwhal's JS engines will error - var useSourceURL = (Function('//@')(), true); + // Adobe's and Narwhal's JS engines will error. IE 8/9/etc also evaluate + // @ symbols as part of a non-standard conditional include system, so it + // parses /a/a as a malformed regular expression, so we know to exclude them. + var useSourceURL = (Function('//@/a/a')(), true); } catch(e){ } /**