@@ -194,7 +194,7 @@ export class SceDelegateProvider {
194194 */
195195 this . trustedResourceUrlList = function ( value ) {
196196 if ( arguments . length ) {
197- trustedResourceUrlList = value . map ( ( v ) => adjustMatcher ( v ) ) ;
197+ trustedResourceUrlList = value . map ( adjustMatcher ) ;
198198 }
199199
200200 return trustedResourceUrlList ;
@@ -224,7 +224,7 @@ export class SceDelegateProvider {
224224 */
225225 this . bannedResourceUrlList = function ( value ) {
226226 if ( arguments . length ) {
227- bannedResourceUrlList = value . map ( ( v ) => adjustMatcher ( v ) ) ;
227+ bannedResourceUrlList = value . map ( adjustMatcher ) ;
228228 }
229229
230230 return bannedResourceUrlList ;
@@ -274,14 +274,12 @@ export class SceDelegateProvider {
274274 function isResourceUrlAllowedByPolicy ( url ) {
275275 const parsedUrl = urlResolve ( url . toString ( ) ) ;
276276
277- let i ;
278-
279- let n ;
280-
281- let allowed = false ;
277+ let i ,
278+ j ,
279+ allowed = false ;
282280
283281 // Ensure that at least one item from the trusted resource URL list allows this url.
284- for ( i = 0 , n = trustedResourceUrlList . length ; i < n ; i ++ ) {
282+ for ( i = 0 , j = trustedResourceUrlList . length ; i < j ; i ++ ) {
285283 if ( matchUrl ( trustedResourceUrlList [ i ] , parsedUrl ) ) {
286284 allowed = true ;
287285 break ;
@@ -290,7 +288,7 @@ export class SceDelegateProvider {
290288
291289 if ( allowed ) {
292290 // Ensure that no item from the banned resource URL list has blocked this url.
293- for ( i = 0 , n = bannedResourceUrlList . length ; i < n ; i ++ ) {
291+ for ( i = 0 , j = bannedResourceUrlList . length ; i < j ; i ++ ) {
294292 if ( matchUrl ( bannedResourceUrlList [ i ] , parsedUrl ) ) {
295293 allowed = false ;
296294 break ;
@@ -499,8 +497,9 @@ export class SceDelegateProvider {
499497 // htmlSanitizer throws its own error when no sanitizer is available.
500498 return htmlSanitizer ( ) ;
501499 }
500+
502501 // Default error when the $sce service has no way to make the input safe.
503- $exceptionHandler (
502+ return $exceptionHandler (
504503 $sceMinErr (
505504 "unsafe" ,
506505 "Attempting to use an unsafe value in a safe context." ,
@@ -562,9 +561,7 @@ export function SceProvider() {
562561 sce . trustAs = sce . getTrusted = function ( type , value ) {
563562 return value ;
564563 } ;
565- sce . valueOf = function ( $ ) {
566- return $ ;
567- } ;
564+ sce . valueOf = ( v ) => v ;
568565 }
569566
570567 /**
0 commit comments