According the spec, if Symbol.species is set, the return value of constructor should be the value of Symbol.species. It seems rhino doesn't do this.
Test case:
var emptyFunc=function() {};
var p = Promise.resolve(1);
p.constructor = {};
var pt1=p.then(emptyFunc);
console.log('pt1='+pt1);
var t = function(e) {
e(emptyFunc, emptyFunc);
};
p.constructor[Symbol.species] = t;
var pt2=p.then(emptyFunc);
console.log('pt2='+pt2);
console.log(pt2 instanceof t);
According the spec, if Symbol.species is set, the return value of constructor should be the value of Symbol.species. It seems rhino doesn't do this.
Test case:
In htmlunit the output is:
In real browser such as chrome, the output is: