Issue #2259 - Update Intl.* Object-ness to ECMA-402, 4th edition

- turn each Intl object into a NativeObject subclass
- create them as PlainObject
- ensure correct type is passed in self-hosted code
- implement legacy constructor semantics for DateTime&NumberFormat
- store internals on object slot instead of JS WeakMap

Based-on: m-c 1328386, 1332604
This commit is contained in:
Martok 2023-06-29 23:02:11 +02:00 committed by roytam1
commit 30157344fe
31 changed files with 633 additions and 663 deletions

View file

@ -41,7 +41,7 @@ class DateTimeFormatObject : public NativeObject
extern JSObject*
CreateDateTimeFormatPrototype(JSContext* cx, JS::Handle<JSObject*> Intl,
JS::Handle<GlobalObject*> global);
JS::Handle<GlobalObject*> global, MutableHandleObject constructor);
/**
* Returns a new instance of the standard built-in DateTimeFormat constructor.
@ -131,7 +131,7 @@ intl_patternForSkeleton(JSContext* cx, unsigned argc, Value* vp);
*
* Spec: ECMAScript Internationalization API Specification, 12.3.2.
*
* Usage: formatted = intl_FormatDateTime(dateTimeFormat, x)
* Usage: formatted = intl_FormatDateTime(dateTimeFormat, x, formatToParts)
*/
extern MOZ_MUST_USE bool
intl_FormatDateTime(JSContext* cx, unsigned argc, Value* vp);