5 var gTS
= window
.location
.toString
;
6 var gGHR
= Object
.getOwnPropertyDescriptor(window
.location
, 'href').get;
7 function getTests(fromOuter
) {
10 return fromOuter
? window
.location
: location
;
13 getLocationImplicit: function() {
16 getLocationExplicit: function() {
17 return loc().toString();
19 getLocationApply1: function() {
20 return gTS
.call(loc());
22 getLocationApply2: function() {
23 return gTS
.apply(loc(), []);
25 getLocationApply3: function() {
26 return Function
.call
.apply(gTS
, [loc()]);
31 getHrefViaApply: function() {
32 return Function
.call
.apply(gGHR
, [loc()]);
37 function mungeNames(obj
, suffix
) {
39 Object
.getOwnPropertyNames(obj
)
40 .forEach(name
=> rv
[name
+ suffix
] = obj
[name
]);
44 function mergeObjects(a
, b
) {
46 Object
.getOwnPropertyNames(a
).forEach(name
=> rv
[name
] = a
[name
]);
47 Object
.getOwnPropertyNames(b
).forEach(name
=> rv
[name
] = b
[name
]);
51 function getAllTests() {
52 var innerTests
= getTests(false);
53 var outerTests
= getTests(true);
54 return mergeObjects(mungeNames(innerTests
, '_inner'),
55 mungeNames(outerTests
, '_outer'));