File tree 2 files changed +0
-40
lines changed
test/unit/features/options
2 files changed +0
-40
lines changed Original file line number Diff line number Diff line change @@ -292,9 +292,6 @@ function normalizeProps (options: Object, vm: ?Component) {
292
292
for ( const key in props ) {
293
293
val = props [ key ]
294
294
name = camelize ( key )
295
- if ( process . env . NODE_ENV !== 'production' && isPlainObject ( val ) ) {
296
- validatePropObject ( name , val , vm )
297
- }
298
295
res [ name ] = isPlainObject ( val )
299
296
? val
300
297
: { type : val }
@@ -309,26 +306,6 @@ function normalizeProps (options: Object, vm: ?Component) {
309
306
options . props = res
310
307
}
311
308
312
- /**
313
- * Validate whether a prop object keys are valid.
314
- */
315
- const propOptionsRE = / ^ ( t y p e | d e f a u l t | r e q u i r e d | v a l i d a t o r ) $ /
316
-
317
- function validatePropObject (
318
- propName : string ,
319
- prop : Object ,
320
- vm : ?Component
321
- ) {
322
- for ( const key in prop ) {
323
- if ( ! propOptionsRE . test ( key ) ) {
324
- warn (
325
- `Invalid key "${ key } " in validation rules object for prop "${ propName } ".` ,
326
- vm
327
- )
328
- }
329
- }
330
- }
331
-
332
309
/**
333
310
* Normalize all injections into Object-based format
334
311
*/
Original file line number Diff line number Diff line change @@ -513,23 +513,6 @@ describe('Options props', () => {
513
513
} )
514
514
} )
515
515
516
- it ( 'should warn about misspelled keys in prop validation object' , ( ) => {
517
- new Vue ( {
518
- template : '<test></test>' ,
519
- components : {
520
- test : {
521
- template : '<div></div>' ,
522
- props : {
523
- value : { reqquired : true } ,
524
- count : { deafult : 1 }
525
- }
526
- }
527
- }
528
- } ) . $mount ( )
529
- expect ( `Invalid key "reqquired" in validation rules object for prop "value".` ) . toHaveBeenWarned ( )
530
- expect ( `Invalid key "deafult" in validation rules object for prop "count".` ) . toHaveBeenWarned ( )
531
- } )
532
-
533
516
it ( 'should not trigger re-render on non-changed inline literals' , done => {
534
517
const updated = jasmine . createSpy ( 'updated' )
535
518
const vm = new Vue ( {
You can’t perform that action at this time.
0 commit comments