Title: [215349] trunk
Revision
215349
Author
[email protected]
Date
2017-04-13 16:51:41 -0700 (Thu, 13 Apr 2017)

Log Message

Change Intl prototypes to plain objects
https://bugs.webkit.org/show_bug.cgi?id=168178

Patch by Andy VanWagoner <[email protected]> on 2017-04-13
Reviewed by JF Bastien.

Source/_javascript_Core:

* builtins/StringPrototype.js:
(localeCompare): Create default Collator once instead of using prototype.
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototype::IntlCollatorPrototype):
* runtime/IntlCollatorPrototype.h:
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::IntlDateTimeFormatPrototype):
* runtime/IntlDateTimeFormatPrototype.h:
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::IntlNumberFormatPrototype):
* runtime/IntlNumberFormatPrototype.h:
* runtime/IntlObject.cpp:
(JSC::IntlObject::finishCreation): Don't set constructor on each prototype.

LayoutTests:

* js/intl-collator-expected.txt:
* js/intl-datetimeformat-expected.txt:
* js/intl-numberformat-expected.txt:
* js/script-tests/intl-collator.js:
* js/script-tests/intl-datetimeformat.js:
* js/script-tests/intl-numberformat.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (215348 => 215349)


--- trunk/LayoutTests/ChangeLog	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/ChangeLog	2017-04-13 23:51:41 UTC (rev 215349)
@@ -1,3 +1,17 @@
+2017-04-13  Andy VanWagoner  <[email protected]>
+
+        Change Intl prototypes to plain objects
+        https://bugs.webkit.org/show_bug.cgi?id=168178
+
+        Reviewed by JF Bastien.
+
+        * js/intl-collator-expected.txt:
+        * js/intl-datetimeformat-expected.txt:
+        * js/intl-numberformat-expected.txt:
+        * js/script-tests/intl-collator.js:
+        * js/script-tests/intl-datetimeformat.js:
+        * js/script-tests/intl-numberformat.js:
+
 2017-04-13  Ryan Haddad  <[email protected]>
 
         Mark fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html as flaky on iOS.

Modified: trunk/LayoutTests/js/intl-collator-expected.txt (215348 => 215349)


--- trunk/LayoutTests/js/intl-collator-expected.txt	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/js/intl-collator-expected.txt	2017-04-13 23:51:41 UTC (rev 215349)
@@ -125,28 +125,27 @@
 PASS Intl.Collator.supportedLocalesOf('x-en-US-12345-12345') did not throw exception.
 PASS Intl.Collator.supportedLocalesOf('x-en-u-foo') did not throw exception.
 PASS Intl.Collator.supportedLocalesOf('x-en-u-foo-u-bar') did not throw exception.
-PASS Intl.Collator.prototype.constructor is Intl.Collator
-PASS Intl.Collator.prototype.compare is an instance of Function
+PASS Intl.Collator.prototype.constructor is Object
+PASS Object.getPrototypeOf(Intl.Collator.prototype) is Object.prototype
+PASS Object.prototype.toString.call(Intl.Collator.prototype) is '[object Object]'
+PASS defaultCollator.compare is an instance of Function
 PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').get is an instance of Function
 PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').set is undefined
 PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').enumerable is false
 PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').configurable is true
-PASS Intl.Collator.prototype.compare.length is 2
+PASS Intl.Collator().compare.length is 2
+PASS Intl.Collator.prototype.compare threw exception TypeError: Intl.Collator.prototype.compare called on value that's not an object initialized as a Collator.
 PASS Object.defineProperty({}, 'compare', Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare')).compare threw exception TypeError: Intl.Collator.prototype.compare called on value that's not an object initialized as a Collator.
-PASS Intl.Collator.prototype.compare !== Intl.Collator().compare is true
 PASS new Intl.Collator().compare !== new Intl.Collator().compare is true
-PASS Intl.Collator.prototype.compare({ toString() { throw Error('6') } }, { toString() { ++badCalls; return ''; } }) threw exception Error: 6.
+PASS defaultCollator.compare({ toString() { throw Error('6') } }, { toString() { ++badCalls; return ''; } }) threw exception Error: 6.
 PASS badCalls is 0
-PASS Intl.Collator.prototype.compare('a', { toString() { throw Error('8') } }) threw exception Error: 8.
-PASS Intl.Collator.prototype.compare.call(null, 'a', 'b') is -1
-PASS Intl.Collator.prototype.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a') is 1
-PASS Intl.Collator.prototype.compare.call(5, 'a', 'b') is -1
-PASS new Intl.Collator().compare.call(null, 'a', 'b') is -1
-PASS new Intl.Collator().compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a') is 1
-PASS new Intl.Collator().compare.call(5, 'a', 'b') is -1
-PASS Intl.Collator.prototype.compare() is 0
-PASS Intl.Collator.prototype.compare('undefinec') is -1
-PASS Intl.Collator.prototype.compare('undefinee') is 1
+PASS defaultCollator.compare('a', { toString() { throw Error('8') } }) threw exception Error: 8.
+PASS defaultCollator.compare.call(null, 'a', 'b') is -1
+PASS defaultCollator.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a') is 1
+PASS defaultCollator.compare.call(5, 'a', 'b') is -1
+PASS defaultCollator.compare() is 0
+PASS defaultCollator.compare('undefinec') is -1
+PASS defaultCollator.compare('undefinee') is 1
 PASS Intl.Collator('en').compare('ä', 'z') is -1
 PASS Intl.Collator('sv').compare('ä', 'z') is 1
 PASS Intl.Collator('de').compare('ö', 'od') is -1
@@ -242,10 +241,10 @@
 PASS Intl.Collator('en').compare('Ä', 'Ä') is 0
 PASS Intl.Collator('en').compare('Å̧', 'Å̧') is 0
 PASS Intl.Collator.prototype.resolvedOptions.length is 0
-PASS Intl.Collator.prototype.resolvedOptions() is an instance of Object
-PASS Intl.Collator.prototype.resolvedOptions() === Intl.Collator.prototype.resolvedOptions() is false
+PASS defaultCollator.resolvedOptions() is an instance of Object
+PASS defaultCollator.resolvedOptions() === defaultCollator.resolvedOptions() is false
 PASS Intl.Collator.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.Collator.prototype.resolvedOptions called on value that's not an object initialized as a Collator.
-PASS var options = Intl.Collator.prototype.resolvedOptions(); delete options['locale']; JSON.stringify(options) is '{"usage":"sort","sensitivity":"variant","ignorePunctuation":false,"collation":"default","numeric":false}'
+PASS var options = defaultCollator.resolvedOptions(); delete options['locale']; JSON.stringify(options) is '{"usage":"sort","sensitivity":"variant","ignorePunctuation":false,"collation":"default","numeric":false}'
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/js/intl-datetimeformat-expected.txt (215348 => 215349)


--- trunk/LayoutTests/js/intl-datetimeformat-expected.txt	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/js/intl-datetimeformat-expected.txt	2017-04-13 23:51:41 UTC (rev 215349)
@@ -62,43 +62,29 @@
 PASS Intl.DateTimeFormat.supportedLocalesOf('x-en-US-12345-12345') did not throw exception.
 PASS Intl.DateTimeFormat.supportedLocalesOf('x-en-u-foo') did not throw exception.
 PASS Intl.DateTimeFormat.supportedLocalesOf('x-en-u-foo-u-bar') did not throw exception.
-PASS Intl.DateTimeFormat.prototype.constructor is Intl.DateTimeFormat
-PASS Intl.DateTimeFormat.prototype.format is an instance of Function
+PASS Intl.DateTimeFormat.prototype.constructor is Object
+PASS Object.getPrototypeOf(Intl.DateTimeFormat.prototype) is Object.prototype
+PASS Object.prototype.toString.call(Intl.DateTimeFormat.prototype) is '[object Object]'
+PASS defaultDTFormat.format is an instance of Function
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').get is an instance of Function
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').set is undefined
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').enumerable is false
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').configurable is true
-PASS Intl.DateTimeFormat.prototype.format.length is 1
+PASS defaultDTFormat.format.length is 1
+PASS Intl.DateTimeFormat.prototype.format threw exception TypeError: Intl.DateTimeFormat.prototype.format called on value that's not an object initialized as a DateTimeFormat.
 PASS Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format')).format threw exception TypeError: Intl.DateTimeFormat.prototype.format called on value that's not an object initialized as a DateTimeFormat.
-PASS Intl.DateTimeFormat.prototype.format !== Intl.DateTimeFormat().format is true
 PASS new Intl.DateTimeFormat().format !== new Intl.DateTimeFormat().format is true
-PASS Intl.DateTimeFormat.prototype.format({ valueOf() { throw Error('4b') } }) threw exception Error: 4b.
-PASS Intl.DateTimeFormat.prototype.format(Infinity) threw exception RangeError: date value is not finite in DateTimeFormat format().
-PASS Intl.DateTimeFormat.prototype.format.call(null, 0) is Intl.DateTimeFormat().format(0)
-PASS Intl.DateTimeFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 0) is Intl.DateTimeFormat().format(0)
-PASS Intl.DateTimeFormat.prototype.format.call(5, 0) is Intl.DateTimeFormat().format(0)
-PASS new Intl.DateTimeFormat().format.call(null, 0) is Intl.DateTimeFormat().format(0)
-PASS new Intl.DateTimeFormat().format.call(Intl.DateTimeFormat('ar'), 0) is Intl.DateTimeFormat().format(0)
-PASS new Intl.DateTimeFormat().format.call(5, 0) is Intl.DateTimeFormat().format(0)
-PASS typeof Intl.DateTimeFormat.prototype.format() === 'string' is true
+PASS defaultDTFormat.format({ valueOf() { throw Error('4b') } }) threw exception Error: 4b.
+PASS defaultDTFormat.format(Infinity) threw exception RangeError: date value is not finite in DateTimeFormat format().
+PASS defaultDTFormat.format.call(null, 0) is Intl.DateTimeFormat().format(0)
+PASS defaultDTFormat.format.call(Intl.DateTimeFormat('ar'), 0) is Intl.DateTimeFormat().format(0)
+PASS defaultDTFormat.format.call(5, 0) is Intl.DateTimeFormat().format(0)
+PASS typeof defaultDTFormat.format() === 'string' is true
 PASS Intl.DateTimeFormat('en', { timeZone: 'America/Denver' }).format(new Date(1451099872641)) is '12/25/2015'
 PASS Intl.DateTimeFormat.prototype.resolvedOptions.length is 0
-PASS Intl.DateTimeFormat.prototype.resolvedOptions() is an instance of Object
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().locale is new Intl.DateTimeFormat().resolvedOptions().locale
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().timeZone is new Intl.DateTimeFormat().resolvedOptions().timeZone
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().calendar is new Intl.DateTimeFormat().resolvedOptions().calendar
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().numberingSystem is new Intl.DateTimeFormat().resolvedOptions().numberingSystem
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().weekday is new Intl.DateTimeFormat().resolvedOptions().weekday
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().era is new Intl.DateTimeFormat().resolvedOptions().era
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().year is new Intl.DateTimeFormat().resolvedOptions().year
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().month is new Intl.DateTimeFormat().resolvedOptions().month
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().day is new Intl.DateTimeFormat().resolvedOptions().day
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().hour is new Intl.DateTimeFormat().resolvedOptions().hour
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().hour12 is new Intl.DateTimeFormat().resolvedOptions().hour12
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().minute is new Intl.DateTimeFormat().resolvedOptions().minute
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().second is new Intl.DateTimeFormat().resolvedOptions().second
-PASS Intl.DateTimeFormat.prototype.resolvedOptions().timeZoneName is new Intl.DateTimeFormat().resolvedOptions().timeZoneName
-PASS Intl.DateTimeFormat.prototype.resolvedOptions() === Intl.DateTimeFormat.prototype.resolvedOptions() is false
+PASS defaultDTFormat.resolvedOptions() is an instance of Object
+PASS defaultDTFormat.resolvedOptions() === defaultDTFormat.resolvedOptions() is false
+PASS Intl.DateTimeFormat.prototype.resolvedOptions() threw exception TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that's not an object initialized as a DateTimeFormat.
 PASS Intl.DateTimeFormat.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that's not an object initialized as a DateTimeFormat.
 PASS Intl.DateTimeFormat('$') threw exception RangeError: invalid language tag: $.
 PASS Intl.DateTimeFormat('en', null) threw exception TypeError: null is not an object (evaluating 'Intl.DateTimeFormat('en', null)').

Modified: trunk/LayoutTests/js/intl-numberformat-expected.txt (215348 => 215349)


--- trunk/LayoutTests/js/intl-numberformat-expected.txt	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/js/intl-numberformat-expected.txt	2017-04-13 23:51:41 UTC (rev 215349)
@@ -130,23 +130,22 @@
 PASS Intl.NumberFormat.supportedLocalesOf('x-en-US-12345-12345') did not throw exception.
 PASS Intl.NumberFormat.supportedLocalesOf('x-en-u-foo') did not throw exception.
 PASS Intl.NumberFormat.supportedLocalesOf('x-en-u-foo-u-bar') did not throw exception.
-PASS Intl.NumberFormat.prototype.constructor is Intl.NumberFormat
-PASS Intl.NumberFormat.prototype.format is an instance of Function
+PASS Intl.NumberFormat.prototype.constructor is Object
+PASS Object.getPrototypeOf(Intl.NumberFormat.prototype) is Object.prototype
+PASS Object.prototype.toString.call(Intl.NumberFormat.prototype) is '[object Object]'
+PASS defaultNFormat.format is an instance of Function
 PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').get is an instance of Function
 PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').set is undefined
 PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').enumerable is false
 PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').configurable is true
-PASS Intl.NumberFormat.prototype.format.length is 1
+PASS defaultNFormat.format.length is 1
+PASS Intl.NumberFormat.prototype.format threw exception TypeError: Intl.NumberFormat.prototype.format called on value that's not an object initialized as a NumberFormat.
 PASS Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format')).format threw exception TypeError: Intl.NumberFormat.prototype.format called on value that's not an object initialized as a NumberFormat.
-PASS Intl.NumberFormat.prototype.format !== Intl.NumberFormat().format is true
 PASS new Intl.NumberFormat().format !== new Intl.NumberFormat().format is true
-PASS Intl.NumberFormat.prototype.format({ valueOf() { throw Error('5') } }) threw exception Error: 5.
-PASS Intl.NumberFormat.prototype.format.call(null, 1.2) is Intl.NumberFormat().format(1.2)
-PASS Intl.NumberFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 1.2) is Intl.NumberFormat().format(1.2)
-PASS Intl.NumberFormat.prototype.format.call(5, 1.2) is Intl.NumberFormat().format(1.2)
-PASS new Intl.NumberFormat().format.call(null, 1.2) is Intl.NumberFormat().format(1.2)
-PASS new Intl.NumberFormat().format.call(Intl.DateTimeFormat('ar'), 1.2) is Intl.NumberFormat().format(1.2)
-PASS new Intl.NumberFormat().format.call(5, 1.2) is Intl.NumberFormat().format(1.2)
+PASS defaultNFormat.format({ valueOf() { throw Error('5') } }) threw exception Error: 5.
+PASS defaultNFormat.format.call(null, 1.2) is Intl.NumberFormat().format(1.2)
+PASS defaultNFormat.format.call(Intl.DateTimeFormat('ar'), 1.2) is Intl.NumberFormat().format(1.2)
+PASS defaultNFormat.format.call(5, 1.2) is Intl.NumberFormat().format(1.2)
 PASS Intl.NumberFormat('en').format(42) is '42'
 PASS Intl.NumberFormat('en').format('42') is '42'
 PASS Intl.NumberFormat('en').format({ valueOf() { return 42; } }) is '42'
@@ -160,7 +159,7 @@
 PASS Intl.NumberFormat('en').format(Number.MAX_VALUE) is '179,769,313,486,232,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000'
 PASS Intl.NumberFormat('en').format(1234.567) is '1,234.567'
 PASS Intl.NumberFormat('es').format(1234.567) is '1.234,567'
-PASS Intl.NumberFormat('fr').format(1234.567) is '1 234,567'
+PASS Intl.NumberFormat('fr').format(1234.567) is '1\xA0234,567'
 PASS Intl.NumberFormat('en-u-nu-latn').format(1234.567) is '1,234.567'
 PASS Intl.NumberFormat('en-u-nu-fullwide').format(1234.567) is '1,234.567'
 PASS Intl.NumberFormat('th-u-nu-thai').format(1234.567) is '๑,๒๓๔.๕๖๗'
@@ -204,15 +203,16 @@
 PASS Intl.NumberFormat('en', {maximumSignificantDigits: 4}).format(1234567) is '1,235,000'
 PASS Intl.NumberFormat('en', {useGrouping: true}).format(1234567.123) is '1,234,567.123'
 PASS Intl.NumberFormat('es', {useGrouping: true}).format(1234567.123) is '1.234.567,123'
-PASS Intl.NumberFormat('fr', {useGrouping: true}).format(1234567.123) is '1 234 567,123'
+PASS Intl.NumberFormat('fr', {useGrouping: true}).format(1234567.123) is '1\xA0234\xA0567,123'
 PASS Intl.NumberFormat('en', {useGrouping: false}).format(1234567.123) is '1234567.123'
 PASS Intl.NumberFormat('es', {useGrouping: false}).format(1234567.123) is '1234567,123'
 PASS Intl.NumberFormat('fr', {useGrouping: false}).format(1234567.123) is '1234567,123'
 PASS Intl.NumberFormat.prototype.resolvedOptions.length is 0
-PASS Intl.NumberFormat.prototype.resolvedOptions() is an instance of Object
-PASS Intl.NumberFormat.prototype.resolvedOptions() === Intl.NumberFormat.prototype.resolvedOptions() is false
+PASS defaultNFormat.resolvedOptions() is an instance of Object
+PASS defaultNFormat.resolvedOptions() === defaultNFormat.resolvedOptions() is false
+PASS Intl.NumberFormat.prototype.resolvedOptions() threw exception TypeError: Intl.NumberFormat.prototype.resolvedOptions called on value that's not an object initialized as a NumberFormat.
 PASS Intl.NumberFormat.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.NumberFormat.prototype.resolvedOptions called on value that's not an object initialized as a NumberFormat.
-PASS var options = Intl.NumberFormat.prototype.resolvedOptions(); delete options['locale']; JSON.stringify(options) is '{"numberingSystem":"latn","style":"decimal","minimumIntegerDigits":1,"minimumFractionDigits":0,"maximumFractionDigits":3,"useGrouping":true}'
+PASS var options = defaultNFormat.resolvedOptions(); delete options['locale']; JSON.stringify(options) is '{"numberingSystem":"latn","style":"decimal","minimumIntegerDigits":1,"minimumFractionDigits":0,"maximumFractionDigits":3,"useGrouping":true}'
 PASS var legacy = Object.create(Intl.NumberFormat.prototype);Intl.NumberFormat.apply(legacy) is legacy
 PASS var legacy = Object.create(Intl.NumberFormat.prototype);Intl.NumberFormat.call(legacy, 'en-u-nu-arab').format(1.2345) is '١٫٢٣٥'
 PASS var incompat = {};Intl.NumberFormat.apply(incompat) is not incompat

Modified: trunk/LayoutTests/js/script-tests/intl-collator.js (215348 => 215349)


--- trunk/LayoutTests/js/script-tests/intl-collator.js	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/js/script-tests/intl-collator.js	2017-04-13 23:51:41 UTC (rev 215349)
@@ -207,13 +207,16 @@
 
 // 10.3 Properties of the Intl.Collator Prototype Object
 
-// The value of Intl.Collator.prototype.constructor is %Collator%.
-shouldBe("Intl.Collator.prototype.constructor", "Intl.Collator");
+// is a plain object
+shouldBe("Intl.Collator.prototype.constructor", "Object");
+shouldBe("Object.getPrototypeOf(Intl.Collator.prototype)", "Object.prototype");
+shouldBe("Object.prototype.toString.call(Intl.Collator.prototype)", "'[object Object]'");
 
 // 10.3.3 Intl.Collator.prototype.compare
 
 // This named accessor property returns a function that compares two strings according to the sort order of this Collator object.
-shouldBeType("Intl.Collator.prototype.compare", "Function");
+var defaultCollator = Intl.Collator();
+shouldBeType("defaultCollator.compare", "Function");
 
 // The value of the [[Get]] attribute is a function
 shouldBeType("Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').get", "Function");
@@ -226,13 +229,13 @@
 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').configurable");
 
 // The value of F’s length property is 2.
-shouldBe("Intl.Collator.prototype.compare.length", "2");
+shouldBe("Intl.Collator().compare.length", "2");
 
 // Throws on non-Collator this.
+shouldThrow("Intl.Collator.prototype.compare", "'TypeError: Intl.Collator.prototype.compare called on value that\\'s not an object initialized as a Collator'");
 shouldThrow("Object.defineProperty({}, 'compare', Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare')).compare", "'TypeError: Intl.Collator.prototype.compare called on value that\\'s not an object initialized as a Collator'");
 
 // The compare function is unique per instance.
-shouldBeTrue("Intl.Collator.prototype.compare !== Intl.Collator().compare");
 shouldBeTrue("new Intl.Collator().compare !== new Intl.Collator().compare");
 
 // 10.3.4 Collator Compare Functions
@@ -246,25 +249,22 @@
 // 5. Let X be ToString(x).
 // 6. ReturnIfAbrupt(X).
 var badCalls = 0;
-shouldThrow("Intl.Collator.prototype.compare({ toString() { throw Error('6') } }, { toString() { ++badCalls; return ''; } })", "'Error: 6'");
+shouldThrow("defaultCollator.compare({ toString() { throw Error('6') } }, { toString() { ++badCalls; return ''; } })", "'Error: 6'");
 shouldBe("badCalls", "0");
 
 // 7. Let Y be ToString(y).
 // 8. ReturnIfAbrupt(Y).
-shouldThrow("Intl.Collator.prototype.compare('a', { toString() { throw Error('8') } })", "'Error: 8'");
+shouldThrow("defaultCollator.compare('a', { toString() { throw Error('8') } })", "'Error: 8'");
 
 // Compare is bound, so calling with alternate "this" has no effect.
-shouldBe("Intl.Collator.prototype.compare.call(null, 'a', 'b')", "-1");
-shouldBe("Intl.Collator.prototype.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a')", "1");
-shouldBe("Intl.Collator.prototype.compare.call(5, 'a', 'b')", "-1");
-shouldBe("new Intl.Collator().compare.call(null, 'a', 'b')", "-1");
-shouldBe("new Intl.Collator().compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a')", "1");
-shouldBe("new Intl.Collator().compare.call(5, 'a', 'b')", "-1");
+shouldBe("defaultCollator.compare.call(null, 'a', 'b')", "-1");
+shouldBe("defaultCollator.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a')", "1");
+shouldBe("defaultCollator.compare.call(5, 'a', 'b')", "-1");
 
 // Test comparing undefineds.
-shouldBe("Intl.Collator.prototype.compare()", "0");
-shouldBe("Intl.Collator.prototype.compare('undefinec')", "-1");
-shouldBe("Intl.Collator.prototype.compare('undefinee')", "1");
+shouldBe("defaultCollator.compare()", "0");
+shouldBe("defaultCollator.compare('undefinec')", "-1");
+shouldBe("defaultCollator.compare('undefinee')", "1");
 
 // Test locales.
 shouldBe("Intl.Collator('en').compare('ä', 'z')", "-1");
@@ -355,13 +355,13 @@
 shouldBe("Intl.Collator.prototype.resolvedOptions.length", "0");
 
 // Returns a new object whose properties and attributes are set as if constructed by an object literal.
-shouldBeType("Intl.Collator.prototype.resolvedOptions()", "Object");
+shouldBeType("defaultCollator.resolvedOptions()", "Object");
 
 // Returns a new object each time.
-shouldBeFalse("Intl.Collator.prototype.resolvedOptions() === Intl.Collator.prototype.resolvedOptions()");
+shouldBeFalse("defaultCollator.resolvedOptions() === defaultCollator.resolvedOptions()");
 
 // Throws on non-Collator this.
 shouldThrow("Intl.Collator.prototype.resolvedOptions.call(5)", "'TypeError: Intl.Collator.prototype.resolvedOptions called on value that\\'s not an object initialized as a Collator'");
 
 // Returns the default options.
-shouldBe("var options = Intl.Collator.prototype.resolvedOptions(); delete options['locale']; JSON.stringify(options)", '\'{"usage":"sort","sensitivity":"variant","ignorePunctuation":false,"collation":"default","numeric":false}\'');
+shouldBe("var options = defaultCollator.resolvedOptions(); delete options['locale']; JSON.stringify(options)", '\'{"usage":"sort","sensitivity":"variant","ignorePunctuation":false,"collation":"default","numeric":false}\'');

Modified: trunk/LayoutTests/js/script-tests/intl-datetimeformat.js (215348 => 215349)


--- trunk/LayoutTests/js/script-tests/intl-datetimeformat.js	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/js/script-tests/intl-datetimeformat.js	2017-04-13 23:51:41 UTC (rev 215349)
@@ -101,13 +101,16 @@
 
 // 12.3 Properties of the Intl.DateTimeFormat Prototype Object
 
-// The value of Intl.DateTimeFormat.prototype.constructor is %DateTimeFormat%.
-shouldBe("Intl.DateTimeFormat.prototype.constructor", "Intl.DateTimeFormat");
+// is a plain object
+shouldBe("Intl.DateTimeFormat.prototype.constructor", "Object");
+shouldBe("Object.getPrototypeOf(Intl.DateTimeFormat.prototype)", "Object.prototype");
+shouldBe("Object.prototype.toString.call(Intl.DateTimeFormat.prototype)", "'[object Object]'");
 
 // 12.3.3 Intl.DateTimeFormat.prototype.format
 
 // This named accessor property returns a function that formats a date according to the effective locale and the formatting options of this DateTimeFormat object.
-shouldBeType("Intl.DateTimeFormat.prototype.format", "Function");
+var defaultDTFormat = Intl.DateTimeFormat();
+shouldBeType("defaultDTFormat.format", "Function");
 
 // The value of the [[Get]] attribute is a function
 shouldBeType("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').get", "Function");
@@ -120,13 +123,13 @@
 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').configurable");
 
 // The value of F’s length property is 1.
-shouldBe("Intl.DateTimeFormat.prototype.format.length", "1");
+shouldBe("defaultDTFormat.format.length", "1");
 
 // Throws on non-DateTimeFormat this.
+shouldThrow("Intl.DateTimeFormat.prototype.format", "'TypeError: Intl.DateTimeFormat.prototype.format called on value that\\'s not an object initialized as a DateTimeFormat'");
 shouldThrow("Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format')).format", "'TypeError: Intl.DateTimeFormat.prototype.format called on value that\\'s not an object initialized as a DateTimeFormat'");
 
 // The format function is unique per instance.
-shouldBeTrue("Intl.DateTimeFormat.prototype.format !== Intl.DateTimeFormat().format");
 shouldBeTrue("new Intl.DateTimeFormat().format !== new Intl.DateTimeFormat().format");
 
 // 12.3.4 DateTime Format Functions
@@ -140,22 +143,19 @@
 // 4. Else
 // a. Let x be ToNumber(date).
 // b. ReturnIfAbrupt(x).
-shouldThrow("Intl.DateTimeFormat.prototype.format({ valueOf() { throw Error('4b') } })", "'Error: 4b'");
+shouldThrow("defaultDTFormat.format({ valueOf() { throw Error('4b') } })", "'Error: 4b'");
 
 // 12.3.4 FormatDateTime abstract operation
 
 // 1. If x is not a finite Number, then throw a RangeError exception.
-shouldThrow("Intl.DateTimeFormat.prototype.format(Infinity)", "'RangeError: date value is not finite in DateTimeFormat format()'");
+shouldThrow("defaultDTFormat.format(Infinity)", "'RangeError: date value is not finite in DateTimeFormat format()'");
 
 // Format is bound, so calling with alternate "this" has no effect.
-shouldBe("Intl.DateTimeFormat.prototype.format.call(null, 0)", "Intl.DateTimeFormat().format(0)");
-shouldBe("Intl.DateTimeFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 0)", "Intl.DateTimeFormat().format(0)");
-shouldBe("Intl.DateTimeFormat.prototype.format.call(5, 0)", "Intl.DateTimeFormat().format(0)");
-shouldBe("new Intl.DateTimeFormat().format.call(null, 0)", "Intl.DateTimeFormat().format(0)");
-shouldBe("new Intl.DateTimeFormat().format.call(Intl.DateTimeFormat('ar'), 0)", "Intl.DateTimeFormat().format(0)");
-shouldBe("new Intl.DateTimeFormat().format.call(5, 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("defaultDTFormat.format.call(null, 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("defaultDTFormat.format.call(Intl.DateTimeFormat('ar'), 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("defaultDTFormat.format.call(5, 0)", "Intl.DateTimeFormat().format(0)");
 
-shouldBeTrue("typeof Intl.DateTimeFormat.prototype.format() === 'string'");
+shouldBeTrue("typeof defaultDTFormat.format() === 'string'");
 shouldBe("Intl.DateTimeFormat('en', { timeZone: 'America/Denver' }).format(new Date(1451099872641))", "'12/25/2015'");
 
 // 12.3.5 Intl.DateTimeFormat.prototype.resolvedOptions ()
@@ -163,28 +163,13 @@
 shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions.length", "0");
 
 // Returns a new object whose properties and attributes are set as if constructed by an object literal.
-shouldBeType("Intl.DateTimeFormat.prototype.resolvedOptions()", "Object");
+shouldBeType("defaultDTFormat.resolvedOptions()", "Object");
 
-// The Intl.DateTimeFormat prototype object is itself an %DateTimeFormat% instance, whose internal slots are set as if it had been constructed by the _expression_ Construct(%DateTimeFormat%).
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().locale", "new Intl.DateTimeFormat().resolvedOptions().locale");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().timeZone", "new Intl.DateTimeFormat().resolvedOptions().timeZone");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().calendar", "new Intl.DateTimeFormat().resolvedOptions().calendar");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().numberingSystem", "new Intl.DateTimeFormat().resolvedOptions().numberingSystem");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().weekday", "new Intl.DateTimeFormat().resolvedOptions().weekday");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().era", "new Intl.DateTimeFormat().resolvedOptions().era");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().year", "new Intl.DateTimeFormat().resolvedOptions().year");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().month", "new Intl.DateTimeFormat().resolvedOptions().month");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().day", "new Intl.DateTimeFormat().resolvedOptions().day");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().hour", "new Intl.DateTimeFormat().resolvedOptions().hour");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().hour12", "new Intl.DateTimeFormat().resolvedOptions().hour12");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().minute", "new Intl.DateTimeFormat().resolvedOptions().minute");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().second", "new Intl.DateTimeFormat().resolvedOptions().second");
-shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions().timeZoneName", "new Intl.DateTimeFormat().resolvedOptions().timeZoneName");
-
 // Returns a new object each time.
-shouldBeFalse("Intl.DateTimeFormat.prototype.resolvedOptions() === Intl.DateTimeFormat.prototype.resolvedOptions()");
+shouldBeFalse("defaultDTFormat.resolvedOptions() === defaultDTFormat.resolvedOptions()");
 
 // Throws on non-DateTimeFormat this.
+shouldThrow("Intl.DateTimeFormat.prototype.resolvedOptions()", "'TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a DateTimeFormat'");
 shouldThrow("Intl.DateTimeFormat.prototype.resolvedOptions.call(5)", "'TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a DateTimeFormat'");
 
 shouldThrow("Intl.DateTimeFormat('$')", "'RangeError: invalid language tag: $'");

Modified: trunk/LayoutTests/js/script-tests/intl-numberformat.js (215348 => 215349)


--- trunk/LayoutTests/js/script-tests/intl-numberformat.js	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/LayoutTests/js/script-tests/intl-numberformat.js	2017-04-13 23:51:41 UTC (rev 215349)
@@ -217,13 +217,16 @@
 
 // 11.3 Properties of the Intl.NumberFormat Prototype Object
 
-// The value of Intl.NumberFormat.prototype.constructor is %NumberFormat%.
-shouldBe("Intl.NumberFormat.prototype.constructor", "Intl.NumberFormat");
+// is a plain object
+shouldBe("Intl.NumberFormat.prototype.constructor", "Object");
+shouldBe("Object.getPrototypeOf(Intl.NumberFormat.prototype)", "Object.prototype");
+shouldBe("Object.prototype.toString.call(Intl.NumberFormat.prototype)", "'[object Object]'");
 
 // 11.3.3 Intl.NumberFormat.prototype.format
 
 // This named accessor property returns a function that formats a number according to the effective locale and the formatting options of this NumberFormat object.
-shouldBeType("Intl.NumberFormat.prototype.format", "Function");
+var defaultNFormat = Intl.NumberFormat();
+shouldBeType("defaultNFormat.format", "Function");
 
 // The value of the [[Get]] attribute is a function
 shouldBeType("Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').get", "Function");
@@ -236,13 +239,13 @@
 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').configurable");
 
 // The value of F’s length property is 1.
-shouldBe("Intl.NumberFormat.prototype.format.length", "1");
+shouldBe("defaultNFormat.format.length", "1");
 
 // Throws on non-NumberFormat this.
+shouldThrow("Intl.NumberFormat.prototype.format", "'TypeError: Intl.NumberFormat.prototype.format called on value that\\'s not an object initialized as a NumberFormat'");
 shouldThrow("Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format')).format", "'TypeError: Intl.NumberFormat.prototype.format called on value that\\'s not an object initialized as a NumberFormat'");
 
 // The format function is unique per instance.
-shouldBeTrue("Intl.NumberFormat.prototype.format !== Intl.NumberFormat().format");
 shouldBeTrue("new Intl.NumberFormat().format !== new Intl.NumberFormat().format");
 
 // 11.3.4 Format Number Functions
@@ -254,15 +257,12 @@
 // 3. If value is not provided, let value be undefined.
 // 4. Let x be ToNumber(value).
 // 5. ReturnIfAbrupt(x).
-shouldThrow("Intl.NumberFormat.prototype.format({ valueOf() { throw Error('5') } })", "'Error: 5'");
+shouldThrow("defaultNFormat.format({ valueOf() { throw Error('5') } })", "'Error: 5'");
 
 // Format is bound, so calling with alternate "this" has no effect.
-shouldBe("Intl.NumberFormat.prototype.format.call(null, 1.2)", "Intl.NumberFormat().format(1.2)");
-shouldBe("Intl.NumberFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 1.2)", "Intl.NumberFormat().format(1.2)");
-shouldBe("Intl.NumberFormat.prototype.format.call(5, 1.2)", "Intl.NumberFormat().format(1.2)");
-shouldBe("new Intl.NumberFormat().format.call(null, 1.2)", "Intl.NumberFormat().format(1.2)");
-shouldBe("new Intl.NumberFormat().format.call(Intl.DateTimeFormat('ar'), 1.2)", "Intl.NumberFormat().format(1.2)");
-shouldBe("new Intl.NumberFormat().format.call(5, 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("defaultNFormat.format.call(null, 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("defaultNFormat.format.call(Intl.DateTimeFormat('ar'), 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("defaultNFormat.format.call(5, 1.2)", "Intl.NumberFormat().format(1.2)");
 
 // Test various values.
 shouldBe("Intl.NumberFormat('en').format(42)", "'42'");
@@ -280,7 +280,7 @@
 // Test locales.
 shouldBe("Intl.NumberFormat('en').format(1234.567)", "'1,234.567'");
 shouldBe("Intl.NumberFormat('es').format(1234.567)", "'1.234,567'");
-shouldBe("Intl.NumberFormat('fr').format(1234.567)", "'1 234,567'");
+shouldBe("Intl.NumberFormat('fr').format(1234.567)", "'1\\xA0234,567'");
 
 // Test numbering systems.
 shouldBe("Intl.NumberFormat('en-u-nu-latn').format(1234.567)", "'1,234.567'");
@@ -344,7 +344,7 @@
 // Test the useGrouping option.
 shouldBe("Intl.NumberFormat('en', {useGrouping: true}).format(1234567.123)", "'1,234,567.123'");
 shouldBe("Intl.NumberFormat('es', {useGrouping: true}).format(1234567.123)", "'1.234.567,123'");
-shouldBe("Intl.NumberFormat('fr', {useGrouping: true}).format(1234567.123)", "'1 234 567,123'");
+shouldBe("Intl.NumberFormat('fr', {useGrouping: true}).format(1234567.123)", "'1\\xA0234\\xA0567,123'");
 shouldBe("Intl.NumberFormat('en', {useGrouping: false}).format(1234567.123)", "'1234567.123'");
 shouldBe("Intl.NumberFormat('es', {useGrouping: false}).format(1234567.123)", "'1234567,123'");
 shouldBe("Intl.NumberFormat('fr', {useGrouping: false}).format(1234567.123)", "'1234567,123'");
@@ -354,16 +354,17 @@
 shouldBe("Intl.NumberFormat.prototype.resolvedOptions.length", "0");
 
 // Returns a new object whose properties and attributes are set as if constructed by an object literal.
-shouldBeType("Intl.NumberFormat.prototype.resolvedOptions()", "Object");
+shouldBeType("defaultNFormat.resolvedOptions()", "Object");
 
 // Returns a new object each time.
-shouldBeFalse("Intl.NumberFormat.prototype.resolvedOptions() === Intl.NumberFormat.prototype.resolvedOptions()");
+shouldBeFalse("defaultNFormat.resolvedOptions() === defaultNFormat.resolvedOptions()");
 
 // Throws on non-NumberFormat this.
+shouldThrow("Intl.NumberFormat.prototype.resolvedOptions()", "'TypeError: Intl.NumberFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a NumberFormat'");
 shouldThrow("Intl.NumberFormat.prototype.resolvedOptions.call(5)", "'TypeError: Intl.NumberFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a NumberFormat'");
 
 // Returns the default options.
-shouldBe("var options = Intl.NumberFormat.prototype.resolvedOptions(); delete options['locale']; JSON.stringify(options)", '\'{"numberingSystem":"latn","style":"decimal","minimumIntegerDigits":1,"minimumFractionDigits":0,"maximumFractionDigits":3,"useGrouping":true}\'');
+shouldBe("var options = defaultNFormat.resolvedOptions(); delete options['locale']; JSON.stringify(options)", '\'{"numberingSystem":"latn","style":"decimal","minimumIntegerDigits":1,"minimumFractionDigits":0,"maximumFractionDigits":3,"useGrouping":true}\'');
 
 // Legacy compatibility with ECMA-402 1.0
 let legacyInit = "var legacy = Object.create(Intl.NumberFormat.prototype);";

Modified: trunk/Source/_javascript_Core/ChangeLog (215348 => 215349)


--- trunk/Source/_javascript_Core/ChangeLog	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-04-13 23:51:41 UTC (rev 215349)
@@ -1,3 +1,24 @@
+2017-04-13  Andy VanWagoner  <[email protected]>
+
+        Change Intl prototypes to plain objects
+        https://bugs.webkit.org/show_bug.cgi?id=168178
+
+        Reviewed by JF Bastien.
+
+        * builtins/StringPrototype.js:
+        (localeCompare): Create default Collator once instead of using prototype.
+        * runtime/IntlCollatorPrototype.cpp:
+        (JSC::IntlCollatorPrototype::IntlCollatorPrototype):
+        * runtime/IntlCollatorPrototype.h:
+        * runtime/IntlDateTimeFormatPrototype.cpp:
+        (JSC::IntlDateTimeFormatPrototype::IntlDateTimeFormatPrototype):
+        * runtime/IntlDateTimeFormatPrototype.h:
+        * runtime/IntlNumberFormatPrototype.cpp:
+        (JSC::IntlNumberFormatPrototype::IntlNumberFormatPrototype):
+        * runtime/IntlNumberFormatPrototype.h:
+        * runtime/IntlObject.cpp:
+        (JSC::IntlObject::finishCreation): Don't set constructor on each prototype.
+
 2017-04-13  Oliver Hunt  <[email protected]>
 
         allocationSize should use safe arithmetic by default

Modified: trunk/Source/_javascript_Core/builtins/StringPrototype.js (215348 => 215349)


--- trunk/Source/_javascript_Core/builtins/StringPrototype.js	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/builtins/StringPrototype.js	2017-04-13 23:51:41 UTC (rev 215349)
@@ -232,6 +232,12 @@
     return thisString.@replaceUsingStringSearch(searchString, replace);
 }
     
+@globalPrivate
+function getDefaultCollator()
+{
+    return @getDefaultCollator.collator || (@getDefaultCollator.collator = new @Collator());
+}
+    
 function localeCompare(that/*, locales, options */)
 {
     "use strict";
@@ -251,11 +257,11 @@
     // 5. ReturnIfAbrupt(That).
     var thatString = @toString(that);
 
-    // Avoid creating a collator for defaults.
+    // Avoid creating a new collator every time for defaults.
     var locales = @argument(1);
     var options = @argument(2);
     if (locales === @undefined && options === @undefined)
-        return @Collator.prototype.compare(thisString, thatString);
+        return @getDefaultCollator().compare(thisString, thatString);
 
     // 6. Let collator be Construct(%Collator%, «locales, options»).
     // 7. ReturnIfAbrupt(collator).

Modified: trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp	2017-04-13 23:51:41 UTC (rev 215349)
@@ -45,7 +45,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlCollatorPrototype::s_info = { "Object", &IntlCollator::s_info, &collatorPrototypeTable, CREATE_METHOD_TABLE(IntlCollatorPrototype) };
+const ClassInfo IntlCollatorPrototype::s_info = { "Object", &Base::s_info, &collatorPrototypeTable, CREATE_METHOD_TABLE(IntlCollatorPrototype) };
 
 /* Source for IntlCollatorPrototype.lut.h
 @begin collatorPrototypeTable
@@ -67,7 +67,7 @@
 }
 
 IntlCollatorPrototype::IntlCollatorPrototype(VM& vm, Structure* structure)
-    : IntlCollator(vm, structure)
+    : Base(vm, structure)
 {
 }
 

Modified: trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.h (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.h	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.h	2017-04-13 23:51:41 UTC (rev 215349)
@@ -32,9 +32,9 @@
 
 namespace JSC {
 
-class IntlCollatorPrototype : public IntlCollator {
+class IntlCollatorPrototype : public JSNonFinalObject {
 public:
-    typedef IntlCollator Base;
+    typedef JSNonFinalObject Base;
     static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
 
     static IntlCollatorPrototype* create(VM&, JSGlobalObject*, Structure*);

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2017-04-13 23:51:41 UTC (rev 215349)
@@ -49,7 +49,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlDateTimeFormatPrototype::s_info = { "Object", &IntlDateTimeFormat::s_info, &dateTimeFormatPrototypeTable, CREATE_METHOD_TABLE(IntlDateTimeFormatPrototype) };
+const ClassInfo IntlDateTimeFormatPrototype::s_info = { "Object", &Base::s_info, &dateTimeFormatPrototypeTable, CREATE_METHOD_TABLE(IntlDateTimeFormatPrototype) };
 
 /* Source for IntlDateTimeFormatPrototype.lut.h
 @begin dateTimeFormatPrototypeTable
@@ -71,7 +71,7 @@
 }
 
 IntlDateTimeFormatPrototype::IntlDateTimeFormatPrototype(VM& vm, Structure* structure)
-    : IntlDateTimeFormat(vm, structure)
+    : Base(vm, structure)
 {
 }
 

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.h (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.h	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.h	2017-04-13 23:51:41 UTC (rev 215349)
@@ -32,9 +32,9 @@
 
 namespace JSC {
 
-class IntlDateTimeFormatPrototype : public IntlDateTimeFormat {
+class IntlDateTimeFormatPrototype : public JSNonFinalObject {
 public:
-    typedef IntlDateTimeFormat Base;
+    typedef JSNonFinalObject Base;
     static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
 
     static IntlDateTimeFormatPrototype* create(VM&, JSGlobalObject*, Structure*);

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp	2017-04-13 23:51:41 UTC (rev 215349)
@@ -47,7 +47,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlNumberFormatPrototype::s_info = { "Object", &IntlNumberFormat::s_info, &numberFormatPrototypeTable, CREATE_METHOD_TABLE(IntlNumberFormatPrototype) };
+const ClassInfo IntlNumberFormatPrototype::s_info = { "Object", &Base::s_info, &numberFormatPrototypeTable, CREATE_METHOD_TABLE(IntlNumberFormatPrototype) };
 
 /* Source for IntlNumberFormatPrototype.lut.h
 @begin numberFormatPrototypeTable
@@ -69,7 +69,7 @@
 }
 
 IntlNumberFormatPrototype::IntlNumberFormatPrototype(VM& vm, Structure* structure)
-    : IntlNumberFormat(vm, structure)
+    : Base(vm, structure)
 {
 }
 

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.h (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.h	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.h	2017-04-13 23:51:41 UTC (rev 215349)
@@ -32,9 +32,9 @@
 
 namespace JSC {
 
-class IntlNumberFormatPrototype : public IntlNumberFormat {
+class IntlNumberFormatPrototype : public JSNonFinalObject {
 public:
-    typedef IntlNumberFormat Base;
+    typedef JSNonFinalObject Base;
     static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
 
     static IntlNumberFormatPrototype* create(VM&, JSGlobalObject*, Structure*);

Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (215348 => 215349)


--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2017-04-13 23:44:48 UTC (rev 215348)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2017-04-13 23:51:41 UTC (rev 215349)
@@ -92,22 +92,16 @@
     Structure* collatorStructure = IntlCollator::createStructure(vm, globalObject, collatorPrototype);
     IntlCollatorConstructor* collatorConstructor = IntlCollatorConstructor::create(vm, IntlCollatorConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), collatorPrototype, collatorStructure);
 
-    collatorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, collatorConstructor, DontEnum);
-
     // Set up NumberFormat.
     IntlNumberFormatPrototype* numberFormatPrototype = IntlNumberFormatPrototype::create(vm, globalObject, IntlNumberFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
     Structure* numberFormatStructure = IntlNumberFormat::createStructure(vm, globalObject, numberFormatPrototype);
     IntlNumberFormatConstructor* numberFormatConstructor = IntlNumberFormatConstructor::create(vm, IntlNumberFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), numberFormatPrototype, numberFormatStructure);
 
-    numberFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, numberFormatConstructor, DontEnum);
-
     // Set up DateTimeFormat.
     IntlDateTimeFormatPrototype* dateTimeFormatPrototype = IntlDateTimeFormatPrototype::create(vm, globalObject, IntlDateTimeFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
     Structure* dateTimeFormatStructure = IntlDateTimeFormat::createStructure(vm, globalObject, dateTimeFormatPrototype);
     IntlDateTimeFormatConstructor* dateTimeFormatConstructor = IntlDateTimeFormatConstructor::create(vm, IntlDateTimeFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), dateTimeFormatPrototype, dateTimeFormatStructure);
 
-    dateTimeFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, dateTimeFormatConstructor, DontEnum);
-
     // 8.1 Properties of the Intl Object (ECMA-402 2.0)
     putDirectWithoutTransition(vm, vm.propertyNames->Collator, collatorConstructor, DontEnum);
     putDirectWithoutTransition(vm, vm.propertyNames->NumberFormat, numberFormatConstructor, DontEnum);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to