Skip to content

Commit 799cbb9

Browse files
ocombevicb
authored andcommitted
fix(compiler): don't overwrite missingTranslation's value in JIT (#19952)
1 parent e6f16a7 commit 799cbb9

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

packages/compiler/src/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export class CompilerConfig {
2525

2626
constructor(
2727
{defaultEncapsulation = ViewEncapsulation.Emulated, useJit = true, jitDevMode = false,
28-
missingTranslation, enableLegacyTemplate, preserveWhitespaces, strictInjectionParameters}: {
28+
missingTranslation = null, enableLegacyTemplate, preserveWhitespaces,
29+
strictInjectionParameters}: {
2930
defaultEncapsulation?: ViewEncapsulation,
3031
useJit?: boolean,
3132
jitDevMode?: boolean,
@@ -37,7 +38,7 @@ export class CompilerConfig {
3738
this.defaultEncapsulation = defaultEncapsulation;
3839
this.useJit = !!useJit;
3940
this.jitDevMode = !!jitDevMode;
40-
this.missingTranslation = missingTranslation || null;
41+
this.missingTranslation = missingTranslation;
4142
this.enableLegacyTemplate = enableLegacyTemplate === true;
4243
this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));
4344
this.strictInjectionParameters = strictInjectionParameters === true;

packages/compiler/test/config_spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {MissingTranslationStrategy} from '@angular/core';
10+
import {CompilerConfig} from '../src/config';
11+
12+
export function main() {
13+
describe('compiler config', () => {
14+
it('should set missing translation strategy', () => {
15+
const config = new CompilerConfig({missingTranslation: MissingTranslationStrategy.Error});
16+
expect(config.missingTranslation).toEqual(MissingTranslationStrategy.Error);
17+
});
18+
});
19+
}

0 commit comments

Comments
 (0)