@@ -60,6 +60,15 @@ function assertSrcContents() {
6060 var licenseStr = licenseSrc . substring ( 2 , licenseSrc . length - 2 ) ;
6161 var logs = [ ] ;
6262
63+ // These are forbidden in IE *only in SVG* but since
64+ // that's 99% of what we do here, we'll forbid them entirely
65+ // until there's some HTML use case where we need them.
66+ // (not sure what we'd do then, but we'd think of something!)
67+ var IE_SVG_BLACK_LIST = [ 'innerHTML' , 'parentElement' , 'children' ] ;
68+
69+ // Forbidden in IE in any context
70+ var IE_BLACK_LIST = [ 'classList' ] ;
71+
6372 glob ( combineGlobs ( [ srcGlob , libGlob ] ) , function ( err , files ) {
6473 files . forEach ( function ( file ) {
6574 var code = fs . readFileSync ( file , 'utf-8' ) ;
@@ -69,21 +78,18 @@ function assertSrcContents() {
6978 falafel ( code , { onComment : comments , locations : true } , function ( node ) {
7079 // look for .classList
7180 if ( node . type === 'MemberExpression' ) {
72- var parts = node . source ( ) . split ( '.' ) ;
81+ var source = node . source ( ) ;
82+ var parts = source . split ( '.' ) ;
7383 var lastPart = parts [ parts . length - 1 ] ;
74- if ( lastPart === 'classList' ) {
75- logs . push ( file + ' : contains .classList (IE failure)' ) ;
76- }
77- else if ( lastPart === 'innerHTML' ) {
78- // Note: if we do anything that's NOT in SVG, innerHTML is
79- // OK in IE. We can cross that bridge when we get to it...
80- logs . push ( file + ' : contains .innerHTML (IE failure in SVG)' ) ;
84+
85+ if ( source === 'Math.sign' ) {
86+ logs . push ( file + ' : contains Math.sign (IE failure)' ) ;
8187 }
82- else if ( lastPart === 'parentElement' ) {
83- logs . push ( file + ' : contains .parentElement (IE failure)' ) ;
88+ else if ( IE_BLACK_LIST . indexOf ( lastPart ) !== - 1 ) {
89+ logs . push ( file + ' : contains .' + lastPart + ' (IE failure)') ;
8490 }
85- else if ( node . source ( ) === 'Math.sign' ) {
86- logs . push ( file + ' : contains Math.sign (IE failure)' ) ;
91+ else if ( IE_SVG_BLACK_LIST . indexOf ( lastPart ) !== - 1 ) {
92+ logs . push ( file + ' : contains .' + lastPart + ' (IE failure in SVG )') ;
8793 }
8894 }
8995 } ) ;
0 commit comments