GeezerVison is showing github.com — perf(core): use `ngDevMode` to tree-shake warnings (#39959) · angular/angular@1e3534f
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/core/src/sanitization
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: goldens/size-tracking/integration-payloads.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
39 | 39 | "master": { |
40 | 40 | "uncompressed": { |
41 | 41 | "runtime-es2015": 2285, |
42 | | - "main-es2015": 242075, |
| 42 | + "main-es2015": 241457, |
43 | 43 | "polyfills-es2015": 36709, |
44 | 44 | "5-es2015": 745 |
45 | 45 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/core/src/sanitization/html_sanitizer.ts +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
6 | 6 | * found in the LICENSE file at https://angular.io/license |
7 | 7 | */ |
8 | 8 |
|
9 | | -import {isDevMode} from '../util/is_dev_mode'; |
10 | 9 | import {getInertBodyHelper, InertBodyHelper} from './inert_body'; |
11 | 10 | import {_sanitizeUrl, sanitizeSrcset} from './url_sanitizer'; |
12 | 11 |
|
@@ -269,7 +268,7 @@ export function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): string |
269 | 268 | const sanitizer = new SanitizingHtmlSerializer(); |
270 | 269 | const safeHtml = sanitizer.sanitizeChildren( |
271 | 270 | getTemplateContent(inertBodyElement!) as Element || inertBodyElement); |
272 | | - if (isDevMode() && sanitizer.sanitizedSomething) { |
| 271 | + if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) { |
273 | 272 | console.warn( |
274 | 273 | 'WARNING: sanitizing HTML stripped some content, see https://g.co/ng/security#xss'); |
275 | 274 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/core/src/sanitization/url_sanitizer.ts +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
6 | 6 | * found in the LICENSE file at https://angular.io/license |
7 | 7 | */ |
8 | 8 |
|
9 | | -import {isDevMode} from '../util/is_dev_mode'; |
10 | 9 |
|
11 | 10 | /** |
12 | 11 | * A pattern that recognizes a commonly useful subset of URLs that are safe. |
@@ -47,7 +46,7 @@ export function _sanitizeUrl(url: string): string { |
47 | 46 | url = String(url); |
48 | 47 | if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN)) return url; |
49 | 48 |
|
50 | | - if (isDevMode()) { |
| 49 | + if (typeof ngDevMode === 'undefined' || ngDevMode) { |
51 | 50 | console.warn(`WARNING: sanitizing unsafe URL value ${url} (see https://g.co/ng/security#xss)`); |
52 | 51 | } |
53 | 52 |
|
|