File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ describe('isValid', () => {
77 const el = {
88 nodeType : 1 ,
99 nodeName : 'svg' ,
10- attributes : [ { value : 'onload' } ] ,
10+ attributes : [ { name : 'onload' } ] ,
1111 childNodes : [ ]
1212 } as any ;
1313 expect ( isValid ( el ) ) . toBe ( false ) ;
@@ -17,7 +17,7 @@ describe('isValid', () => {
1717 const el = {
1818 nodeType : 1 ,
1919 nodeName : 'svg' ,
20- attributes : [ { value : 'OnClIcK' } ] ,
20+ attributes : [ { name : 'OnClIcK' } ] ,
2121 childNodes : [ ]
2222 } as any ;
2323 expect ( isValid ( el ) ) . toBe ( false ) ;
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ export const isValid = (elm: HTMLElement) => {
3434 }
3535
3636 for ( let i = 0 ; i < elm . attributes . length ; i ++ ) {
37- const val = elm . attributes [ i ] . value ;
38- if ( isStr ( val ) && val . toLowerCase ( ) . indexOf ( 'on' ) === 0 ) {
37+ const name = elm . attributes [ i ] . name ;
38+ if ( isStr ( name ) && name . toLowerCase ( ) . indexOf ( 'on' ) === 0 ) {
3939 return false ;
4040 }
4141 }
You can’t perform that action at this time.
0 commit comments