From 438b87b5b649314e7247c305b5870ed69916bb53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Bargull?= <andre.bargull@gmail.com>
Date: Wed, 8 Jul 2015 19:13:31 +0200
Subject: [PATCH] Intl sub-classing is now restricted to class syntax.

---
 test/intl402/10.1.2_a.js | 11 +++++------
 test/intl402/11.1.2.js   | 11 +++++------
 test/intl402/12.1.2.js   | 11 +++++------
 3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/test/intl402/10.1.2_a.js b/test/intl402/10.1.2_a.js
index 285cc7b6d5..83bd66b464 100644
--- a/test/intl402/10.1.2_a.js
+++ b/test/intl402/10.1.2_a.js
@@ -15,15 +15,14 @@ var a = ["A", "C", "E", "B", "D", "F"];
 var referenceCollator = new Intl.Collator(locales);
 var referenceSorted = a.slice().sort(referenceCollator.compare);
 
-function MyCollator(locales, options) {
-    Intl.Collator.call(this, locales, options);
+class MyCollator extends Intl.Collator {
+  constructor(locales, options) {
+    super(locales, options);
     // could initialize MyCollator properties
+  }
+  // could add methods to MyCollator.prototype
 }
 
-MyCollator.prototype = Object.create(Intl.Collator.prototype);
-MyCollator.prototype.constructor = MyCollator;
-// could add methods to MyCollator.prototype
-
 var collator = new MyCollator(locales);
 a.sort(collator.compare);
 testArraysAreSame(referenceSorted, a);
diff --git a/test/intl402/11.1.2.js b/test/intl402/11.1.2.js
index cd722b0f35..6032130c86 100644
--- a/test/intl402/11.1.2.js
+++ b/test/intl402/11.1.2.js
@@ -15,15 +15,14 @@ var a = [0, 1, -1, -123456.789, -Infinity, NaN];
 var referenceNumberFormat = new Intl.NumberFormat(locales);
 var referenceFormatted = a.map(referenceNumberFormat.format);
 
-function MyNumberFormat(locales, options) {
-    Intl.NumberFormat.call(this, locales, options);
+class MyNumberFormat extends Intl.NumberFormat {
+  constructor(locales, options) {
+    super(locales, options);
     // could initialize MyNumberFormat properties
+  }
+  // could add methods to MyNumberFormat.prototype
 }
 
-MyNumberFormat.prototype = Object.create(Intl.NumberFormat.prototype);
-MyNumberFormat.prototype.constructor = MyNumberFormat;
-// could add methods to MyNumberFormat.prototype
-
 var format = new MyNumberFormat(locales);
 var actual = a.map(format.format);
 testArraysAreSame(referenceFormatted, actual);
diff --git a/test/intl402/12.1.2.js b/test/intl402/12.1.2.js
index 6df79f5f53..5265b68fd1 100644
--- a/test/intl402/12.1.2.js
+++ b/test/intl402/12.1.2.js
@@ -15,15 +15,14 @@ var a = [new Date(0), Date.now(), new Date(Date.parse("1989-11-09T17:57:00Z"))];
 var referenceDateTimeFormat = new Intl.DateTimeFormat(locales);
 var referenceFormatted = a.map(referenceDateTimeFormat.format);
 
-function MyDateTimeFormat(locales, options) {
-    Intl.DateTimeFormat.call(this, locales, options);
+class MyDateTimeFormat extends Intl.DateTimeFormat {
+  constructor(locales, options) {
+    super(locales, options);
     // could initialize MyDateTimeFormat properties
+  }
+  // could add methods to MyDateTimeFormat.prototype
 }
 
-MyDateTimeFormat.prototype = Object.create(Intl.DateTimeFormat.prototype);
-MyDateTimeFormat.prototype.constructor = MyDateTimeFormat;
-// could add methods to MyDateTimeFormat.prototype
-
 var format = new MyDateTimeFormat(locales);
 var actual = a.map(format.format);
 testArraysAreSame(referenceFormatted, actual);
-- 
GitLab