phiggins42/has.js — pull request #86 by jrburke (2011-11-24 06:51:43+00:00)
Title: Module boilerplate that supports AMD and node

This is related to issue #61, but a bit different focus. Allow has.js and its tests to be used in AMD, node and with browser globals.

I only did an initial commit that shows has.js, _base.js and the array.js tests using the boilerplate. If this approach looks good, then i'll add more commits that convert the rest of the detect scripts.

I also have an AMD loader plugin in the works that uses this modified has.js and array.js to choose loading one of two modules, depending on the result of the has test: [here is a use of it](https://github.com/jrburke/require-hasm/blob/master/demo/lib/main.js), and [the hasm loader plugin](https://github.com/jrburke/require-hasm/blob/master/hasm.js).

I'm trying to keep the loader plugin separate from this repo since it is not a core has.js concern, and it allows others to make different kinds of AMD loader plugins on top of has.js, and I did not want to add too much change to this repo.

Going to try ccing @kriszyp and @bryanforbes in this message, hopefully they get notified too. Want them to be aware of this alternate approach to #61 and check my work.