Avoid issues in IE with other code containing comments like //@todo xyz.

Former-commit-id: 92ec6258539bf48144e9af05d0e326651a5fedda
This commit is contained in:
John-David Dalton
2012-08-28 23:58:07 -07:00
parent cf075df7d1
commit 2ad9bbae25

View File

@@ -211,14 +211,12 @@
* The JS engine in Narwhal will generate the function `function anonymous(){//}` * The JS engine in Narwhal will generate the function `function anonymous(){//}`
* and throw a syntax error. * and throw a syntax error.
* *
* In IE, `@` symbols are part of its non-standard conditional compilation support. * Avoid comments beginning `@` symbols in IE because they are part of its
* The `@cc_on` statement activates its support while the trailing ` !` induces * non-standard conditional compilation support.
* a syntax error to exlude it. Compatibility modes in IE > 8 require a space * http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx
* before the `!` to induce a syntax error.
* See http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx
*/ */
try { try {
var useSourceURL = (Function('//@cc_on !')(), true); var useSourceURL = (Function('//@')(), !window.attachEvent);
} catch(e){ } } catch(e){ }
/** Used to identify object classifications that are array-like */ /** Used to identify object classifications that are array-like */