Skip to content

Commit d9b953d

Browse files
mheveryIgorMinar
authored andcommitted
chore: replace CONST_EXPR with /*@ts2dart_const*/
1 parent d1eef86 commit d9b953d

80 files changed

Lines changed: 298 additions & 350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/@angular/common/src/common_directives.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {CONST_EXPR, Type} from '@angular/facade';
2-
1+
import {Type} from '@angular/facade';
32
import {FORM_DIRECTIVES} from './forms';
43
import {CORE_DIRECTIVES} from './directives';
54

@@ -46,4 +45,4 @@ import {CORE_DIRECTIVES} from './directives';
4645
* }
4746
* ```
4847
*/
49-
export const COMMON_DIRECTIVES: Type[][] = CONST_EXPR([CORE_DIRECTIVES, FORM_DIRECTIVES]);
48+
export const COMMON_DIRECTIVES: Type[][] = /*@ts2dart_const*/ ([CORE_DIRECTIVES, FORM_DIRECTIVES]);

modules/@angular/common/src/directives/core_directives.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {CONST_EXPR, Type} from '@angular/facade';
1+
import {Type} from '@angular/facade';
22
import {NgClass} from './ng_class';
33
import {NgFor} from './ng_for';
44
import {NgIf} from './ng_if';
@@ -47,7 +47,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
4747
* }
4848
* ```
4949
*/
50-
export const CORE_DIRECTIVES: Type[] = CONST_EXPR([
50+
export const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/ ([
5151
NgClass,
5252
NgFor,
5353
NgIf,

modules/@angular/common/src/directives/ng_switch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {Directive, Host, ViewContainerRef, TemplateRef} from '@angular/core';
2-
import {isPresent, isBlank, normalizeBlank, CONST_EXPR} from '@angular/facade';
2+
import {isPresent, isBlank, normalizeBlank} from '@angular/facade';
33
import {ListWrapper, Map} from '@angular/facade';
44

5-
const _WHEN_DEFAULT = CONST_EXPR(new Object());
5+
const _WHEN_DEFAULT = /*@ts2dart_const*/ (new Object());
66

77
export class SwitchView {
88
constructor(private _viewContainerRef: ViewContainerRef, private _templateRef: TemplateRef) {}

modules/@angular/common/src/forms.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export {
4141
export {FormBuilder} from './forms/form_builder';
4242
import {FormBuilder} from './forms/form_builder';
4343
import {RadioControlRegistry} from './forms/directives/radio_control_value_accessor';
44-
import {Type, CONST_EXPR} from '@angular/facade';
44+
import {Type} from '@angular/core';
4545

4646
/**
4747
* Shorthand set of providers used for building Angular forms.
@@ -52,7 +52,7 @@ import {Type, CONST_EXPR} from '@angular/facade';
5252
* bootstrap(MyApp, [FORM_PROVIDERS]);
5353
* ```
5454
*/
55-
export const FORM_PROVIDERS: Type[] = CONST_EXPR([FormBuilder, RadioControlRegistry]);
55+
export const FORM_PROVIDERS: Type[] = /*@ts2dart_const*/ ([FormBuilder, RadioControlRegistry]);
5656

5757
/**
5858
* See {@link FORM_PROVIDERS} instead.

modules/@angular/common/src/forms/directives.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {Type, CONST_EXPR} from '@angular/facade';
2-
1+
import {Type} from '@angular/core';
32
import {NgControlName} from './directives/ng_control_name';
43
import {NgFormControl} from './directives/ng_form_control';
54
import {NgModel} from './directives/ng_model';
@@ -65,7 +64,7 @@ export {ControlValueAccessor} from './directives/control_value_accessor';
6564
* class MyApp {}
6665
* ```
6766
*/
68-
export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
67+
export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/ ([
6968
NgControlName,
7069
NgControlGroup,
7170

modules/@angular/common/src/forms/directives/checkbox_value_accessor.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import {Directive, Renderer, ElementRef, Self, forwardRef, Provider} from '@angular/core';
2-
import {CONST_EXPR} from '@angular/facade';
3-
42
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
53

6-
7-
const CHECKBOX_VALUE_ACCESSOR = CONST_EXPR(new Provider(
4+
const CHECKBOX_VALUE_ACCESSOR = /*@ts2dart_const*/ (new Provider(
85
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true}));
96

107
/**

modules/@angular/common/src/forms/directives/control_value_accessor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {OpaqueToken} from '@angular/core';
2-
import {CONST_EXPR} from '@angular/facade';
32

43
/**
54
* A bridge between a control and a native element.
@@ -31,4 +30,4 @@ export interface ControlValueAccessor {
3130
*
3231
* See {@link DefaultValueAccessor} for how to implement one.
3332
*/
34-
export const NG_VALUE_ACCESSOR: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValueAccessor"));
33+
export const NG_VALUE_ACCESSOR: OpaqueToken = /*@ts2dart_const*/ (new OpaqueToken("NgValueAccessor"));

modules/@angular/common/src/forms/directives/default_value_accessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from '@angular/core';
2-
import {isBlank, CONST_EXPR} from '@angular/facade';
2+
import {isBlank} from '@angular/facade';
33
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
44

5-
const DEFAULT_VALUE_ACCESSOR = CONST_EXPR(new Provider(
5+
const DEFAULT_VALUE_ACCESSOR = /*@ts2dart_const*/ (new Provider(
66
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => DefaultValueAccessor), multi: true}));
77

88
/**

modules/@angular/common/src/forms/directives/ng_control_group.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import {
1010
Provider,
1111
Self
1212
} from '@angular/core';
13-
import {CONST_EXPR} from '@angular/facade';
14-
1513
import {ControlContainer} from './control_container';
1614
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
1715
import {ControlGroup} from '../model';
@@ -20,7 +18,8 @@ import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
2018
import {AsyncValidatorFn, ValidatorFn} from './validators';
2119

2220
const controlGroupProvider =
23-
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgControlGroup)}));
21+
/*@ts2dart_const*/ (
22+
new Provider(ControlContainer, {useExisting: forwardRef(() => NgControlGroup)}));
2423

2524
/**
2625
* Creates and binds a control group to a DOM element.

modules/@angular/common/src/forms/directives/ng_control_name.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Self
1414
} from '@angular/core';
1515

16-
import {CONST_EXPR} from '@angular/facade';
1716
import {EventEmitter, ObservableWrapper} from '@angular/facade';
1817

1918
import {ControlContainer} from './control_container';
@@ -32,7 +31,7 @@ import {ValidatorFn, AsyncValidatorFn} from './validators';
3231

3332

3433
const controlNameBinding =
35-
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgControlName)}));
34+
/*@ts2dart_const*/ (new Provider(NgControl, {useExisting: forwardRef(() => NgControlName)}));
3635

3736
/**
3837
* Creates and binds a control with a specified name to a DOM element.

0 commit comments

Comments
 (0)