`addTest()` dot properties only work internally #1355

Open
stucox opened this Issue May 20, 2014 · 3 comments

Projects

None yet

2 participants

@stucox
Member
stucox commented May 20, 2014

Well, sorta. Given a page which has already loaded a reasonably comprehensive v3 build…

This throws an error:

> Modernizr.addTest('mytest.thing', true);
  TypeError: Cannot read property 'thing' of undefined

This doesn’t work as I’d expect:

> Modernizr.addTest('mytest', true);
> Modernizr.mytest
  true
> Modernizr.addTest('mytest.thing', true);
> Modernizr.mytest.thing
  undefined

But this does work as I’d expect:

> Modernizr.addTest('audio.mycodec', 'probably');
> Modernizr.audio.mycodec
  'probably'

/cc @SlexAxton

Are we going to “fix” this for v3, or leave it as an undocumented feature we only exercise internally?

@stucox stucox added this to the Modernizr v3 milestone May 20, 2014
@patrickkettner
Member
@patrickkettner
Member

@stucox - what do you think we should do?

@stucox
Member
stucox commented Aug 20, 2014

Moving to 3.1 milestone so I don’t have to think about it.

@stucox stucox modified the milestone: Modernizr v3, Modernizr v3.1 Aug 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment