fixed 'make test' bug

global.location shouldn't be set in the browser, but should be set in node.js.

It used to be set in both (to make node.js work), then it was set in neither (to make the browser work), and now it's correctly in each case.