Clarification of [[Prototype]] of Intl.Collator.prototype

# Yusuke Suzuki (13 years ago)

Hello everyone,

In lastest i18n draft, Intl.Collator.prototype is defined in section 11.2.1

The value of Intl.Collator.prototype is the built-in Intl.Collator

prototype object (11.3)

and section 11.3

The Intl.Collator prototype object is itself an Intl.Collator instance as

specified in 11.4,

whose internal properties are set as if it had been constructed by the

expression new Intl.Collator().

But this is ambiguous about prototype's [[Prototype]]. Intl.NumberFormat.prototype and Intl.DateTimeFormat.prototype have the same problem. For example, I found a curious point in test262 intl tests, intl402/ch11/11.3/11.3.js.

var testcase = function() { "use strict";

if (!(Intl.Collator.prototype instanceof Intl.Collator)) { $ERROR("Intl.Collator's prototype is not an instance of " + "Intl.Collator"); }

return true; } runTestCase(testcase);

If this test case is passed, chain starting from Intl.Collator.prototype.[[Prototype]] get to Intl.Collator.prototype. And this is circular reference, so following script

var collator = new Intl.Collator(); collator.toString; // this is not defined in Intl.Collator.prototype

never stops because of infinite loop of [[Prototype]] resolution in [[GetProperty]]. intl402/ch12/12.3/12.3.js and intl402/ch13/13.3/13.3.js have the same bug. This is reported in mail.mozilla.org/pipermail/test262-discuss/2012-April/000098.html And later I'll file issue to bugs.ecmascript.org.

So, to make it clear, I suggest adding description about [[Prototype]] of Intl.Collator.protoype like ES5 Array.prototype in section 15.4.4, like

The value of the [[Prototype]] internal property of the Intl.Collator

prototype object is the standard built-in Object prototype object (15.2.4).

, Yusuke Suzuki

# Norbert Lindenberg (13 years ago)

Suzuki-san,

Thank you for reporting this issue in the specification. I'm sorry that I wasn't aware of the discussion on test262-discuss - I've subscribed now.

Best , Norbert

# Yusuke Suzuki (13 years ago)

Thanks for your quick reply! Later, I'll file these test262 bugs to bugs.ecmascript.org.

PS. Sorry, I forgot to add es-discuss to CC.

, Yusuke Suzuki