File tree Expand file tree Collapse file tree 2 files changed +0
-40
lines changed
test/unit/features/options Expand file tree Collapse file tree 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) {
292292 for ( const key in props ) {
293293 val = props [ key ]
294294 name = camelize ( key )
295- if ( process . env . NODE_ENV !== 'production' && isPlainObject ( val ) ) {
296- validatePropObject ( name , val , vm )
297- }
298295 res [ name ] = isPlainObject ( val )
299296 ? val
300297 : { type : val }
@@ -309,26 +306,6 @@ function normalizeProps (options: Object, vm: ?Component) {
309306 options . props = res
310307}
311308
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-
332309/**
333310 * Normalize all injections into Object-based format
334311 */
Original file line number Diff line number Diff line change @@ -513,23 +513,6 @@ describe('Options props', () => {
513513 } )
514514 } )
515515
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-
533516 it ( 'should not trigger re-render on non-changed inline literals' , done => {
534517 const updated = jasmine . createSpy ( 'updated' )
535518 const vm = new Vue ( {
You can’t perform that action at this time.
0 commit comments