@@ -238,6 +238,9 @@ suite('String', function () {
238
238
( 'foo <script>boo();<' + '/script><script type="text/javascript">boo();\nmoo();<' + '/script>bar' ) . extractScripts ( ) ) ;
239
239
assert . enumEqual ( [ 'boo();' , 'boo();\nmoo();' ] ,
240
240
( 'foo <script>boo();<' + '/script>blub\nblub<script type="text/javascript">boo();\nmoo();<' + '/script>bar' ) . extractScripts ( ) ) ;
241
+
242
+ assert . enumEqual ( [ ] , ( '<' + 'script type="x-something">wat();<' + '/script>' ) . extractScripts ( ) ) ;
243
+ assert . enumEqual ( [ 'wat();' ] , ( '<' + 'script type="text/javascript">wat();<' + '/script>' ) . extractScripts ( ) ) ;
241
244
} ) ;
242
245
243
246
test ( '#evalScripts' , function ( ) {
@@ -250,6 +253,27 @@ suite('String', function () {
250
253
( 3 ) . times ( function ( ) { stringWithScripts += 'foo <script>evalScriptsCounter++<' + '/script>bar' } ) ;
251
254
stringWithScripts . evalScripts ( ) ;
252
255
assert . equal ( 4 , evalScriptsCounter ) ;
256
+
257
+ // Other executable MIME-types.
258
+ ( 'foo <script type="text/javascript">evalScriptsCounter++<' + '/script>bar' )
259
+ . evalScripts ( ) ;
260
+ ( 'foo <script type="application/javascript">evalScriptsCounter++<' + '/script>bar' )
261
+ . evalScripts ( ) ;
262
+ ( 'foo <script type="application/x-javascript">evalScriptsCounter++<' + '/script>bar' )
263
+ . evalScripts ( ) ;
264
+ ( 'foo <script type="text/x-javascript">evalScriptsCounter++<' + '/script>bar' )
265
+ . evalScripts ( ) ;
266
+ ( 'foo <script type="application/ecmascript">evalScriptsCounter++<' + '/script>bar' )
267
+ . evalScripts ( ) ;
268
+ ( 'foo <script type="text/ecmascript">evalScriptsCounter++<' + '/script>bar' )
269
+ . evalScripts ( ) ;
270
+
271
+ assert . equal ( 10 , evalScriptsCounter ) ;
272
+
273
+ // a wrong one
274
+ ( 'foo <script type="text/x-dot-template">evalScriptsCounter++<' + '/script>bar' ) . evalScripts ( ) ;
275
+
276
+ assert . equal ( 10 , evalScriptsCounter ) ;
253
277
} ) ;
254
278
255
279
test ( '#escapeHTML' , function ( ) {
0 commit comments