File tree Expand file tree Collapse file tree 4 files changed +5
-33
lines changed Expand file tree Collapse file tree 4 files changed +5
-33
lines changed Original file line number Diff line number Diff line change 121
121
* @throws {Error } if the provided argument is not a valueFormatters.ValueFormatter constructor.
122
122
*/
123
123
function assertIsValueFormatterConstructor ( Formatter ) {
124
- if ( ! $ . isFunction ( Formatter ) && Formatter . prototype instanceof vf . ValueFormatter ) {
124
+ if ( ! ( $ . isFunction ( Formatter ) && Formatter . prototype instanceof vf . ValueFormatter ) ) {
125
125
throw new Error ( 'Invalid ValueFormatter constructor' ) ;
126
126
}
127
127
}
Original file line number Diff line number Diff line change 119
119
* @throws {Error } if the provided argument is not a valueParsers.ValueParser constructor.
120
120
*/
121
121
function assertIsValueParserConstructor ( Parser ) {
122
- if ( ! $ . isFunction ( Parser ) && Parser . prototype instanceof vp . ValueParser ) {
122
+ if ( ! ( $ . isFunction ( Parser ) && Parser . prototype instanceof vp . ValueParser ) ) {
123
123
throw new Error ( 'Invalid ValueParser constructor' ) ;
124
124
}
125
125
}
Original file line number Diff line number Diff line change 60
60
'Failed trying to register an invalid formatter constructor.'
61
61
) ;
62
62
63
- assert . throws (
64
- function ( ) {
65
- formatterFactory . registerDataTypeFormatter ( StringFormatter , 'invalid' ) ;
66
- } ,
67
- 'Failed trying to register a formatter with an invalid purpose.'
68
- ) ;
69
-
70
63
formatterFactory . registerDataTypeFormatter ( StringFormatter , stringType . getId ( ) ) ;
71
64
72
65
assert . throws (
73
66
function ( ) {
74
- formatterFactory . getFormatter ( stringType . getId ( ) ) ;
67
+ formatterFactory . getFormatter ( stringType ) ;
75
68
} ,
76
69
'Failed trying to get a formatter with an invalid purpose.'
77
70
) ;
87
80
'Failed trying to register an invalid formatter constructor.'
88
81
) ;
89
82
90
- assert . throws (
91
- function ( ) {
92
- formatterFactory . registerDataValueFormatter ( StringFormatter , 'invalid' ) ;
93
- } ,
94
- 'Failed trying to register a formatter with an invalid purpose.'
95
- ) ;
96
-
97
83
formatterFactory . registerDataValueFormatter ( StringFormatter , StringValue . TYPE ) ;
98
84
99
85
assert . throws (
100
86
function ( ) {
101
- formatterFactory . getFormatter ( StringValue . TYPE ) ;
87
+ formatterFactory . getFormatter ( StringValue ) ;
102
88
} ,
103
89
'Failed trying to get a formatter with an invalid purpose.'
104
90
) ;
Original file line number Diff line number Diff line change 60
60
'Failed trying to register an invalid parser constructor.'
61
61
) ;
62
62
63
- assert . throws (
64
- function ( ) {
65
- parserFactory . registerDataTypeParser ( StringParser , 'invalid' ) ;
66
- } ,
67
- 'Failed trying to register a parser with an invalid purpose.'
68
- ) ;
69
-
70
63
parserFactory . registerDataTypeParser ( StringParser , stringType . getId ( ) ) ;
71
64
72
65
assert . throws (
73
66
function ( ) {
74
- parserFactory . getParser ( StringValue ) ;
67
+ parserFactory . getParser ( stringType ) ;
75
68
} ,
76
69
'Failed trying to get a parser with an invalid purpose.'
77
70
) ;
87
80
'Failed trying to register an invalid parser constructor.'
88
81
) ;
89
82
90
- assert . throws (
91
- function ( ) {
92
- parserFactory . registerDataValueParser ( StringParser , 'invalid' ) ;
93
- } ,
94
- 'Failed trying to register a parser with an invalid purpose.'
95
- ) ;
96
-
97
83
parserFactory . registerDataValueParser ( StringParser , StringValue . TYPE ) ;
98
84
99
85
assert . throws (
You can’t perform that action at this time.
0 commit comments