( code, node, doc )
| 102 | }; |
| 103 | |
| 104 | function DOMEval( code, node, doc ) { |
| 105 | doc = doc || document; |
| 106 | |
| 107 | var i, val, |
| 108 | script = doc.createElement( "script" ); |
| 109 | |
| 110 | script.text = code; |
| 111 | if ( node ) { |
| 112 | for ( i in preservedScriptAttributes ) { |
| 113 | |
| 114 | // Support: Firefox 64+, Edge 18+ |
| 115 | // Some browsers don't support the "nonce" property on scripts. |
| 116 | // On the other hand, just using `getAttribute` is not enough as |
| 117 | // the `nonce` attribute is reset to an empty string whenever it |
| 118 | // becomes browsing-context connected. |
| 119 | // See https://github.com/whatwg/html/issues/2369 |
| 120 | // See https://html.spec.whatwg.org/#nonce-attributes |
| 121 | // The `node.getAttribute` check was added for the sake of |
| 122 | // `jQuery.globalEval` so that it can fake a nonce-containing node |
| 123 | // via an object. |
| 124 | val = node[ i ] || node.getAttribute && node.getAttribute( i ); |
| 125 | if ( val ) { |
| 126 | script.setAttribute( i, val ); |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | doc.head.appendChild( script ).parentNode.removeChild( script ); |
| 131 | } |
| 132 | |
| 133 | |
| 134 | function toType( obj ) { |
no outgoing calls
no test coverage detected