getCanonicalLocales-overridden-species.js (586B)
1 // |reftest| skip-if(!this.hasOwnProperty("Intl")) 2 3 // Tests the getCanonicalLocales function for overriden Array[Symbol.species]. 4 5 Object.defineProperty(Array, Symbol.species, { 6 value: function() { 7 return new Proxy(["?"], { 8 get(t, pk, r) { 9 return Reflect.get(t, pk, r); 10 }, 11 defineProperty(t, pk) { 12 return true; 13 } 14 }); 15 } 16 }); 17 18 var arr = Intl.getCanonicalLocales("de-x-private"); 19 20 assertEqArray(arr, ["de-x-private"]); 21 22 if (typeof reportCompare === "function") 23 reportCompare(0, 0);