Re: [custom-elements-tests] Submission/unipro custom elements (#715)

It seems redundant to have ExtenderChars.EXTENDER_CHARS. It also seems redundant to have testEach pass so many parameters through to testCharArray, etc.

I would just assign an expando property on the array, something like:

var extenderChars = [ ... ];
extenderChars.testEach = testCharCodeArray;

If that is not appealing you could make a constructor function which takes an array as a parameter.

You would need to make testCharCodeArray iterate over 'this', but that seems OK.

It is possible you don't even need testCharCodeArray or the range test function to be visible; you could wrap testcommon up in an anonymous function and make those local helper functions.

View on GitHub: https://github.com/w3c/web-platform-tests/pull/715#discussion_r10332980

Received on Thursday, 6 March 2014 06:35:42 UTC