Skip to content

Commit

Permalink
fixup! perf(core): make sanitization tree-shakable in Ivy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Aug 9, 2019
1 parent 345c7c0 commit 270d0dd
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export interface SafeUrl extends SafeValue {}
*/
export interface SafeResourceUrl extends SafeValue {}

export function domSanitizerImplFactory(doc: Document) {
return new DomSanitizerImpl(doc);
}

/**
* DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
* values to be safe to use in the different DOM contexts.
Expand Down Expand Up @@ -87,11 +91,7 @@ export interface SafeResourceUrl extends SafeValue {}
*
* @publicApi
*/
@Injectable({
providedIn: 'root',
useFactory: (doc: Document) => new DomSanitizerImpl(doc),
deps: [DOCUMENT]
})
@Injectable({providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [DOCUMENT]})
export abstract class DomSanitizer implements Sanitizer {
/**
* Sanitizes a value for use in the given SecurityContext.
Expand Down

0 comments on commit 270d0dd

Please sign in to comment.