aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/harness/testBuiltInObject.js123
-rw-r--r--test/suite/intl402/ch08/8.0/8.0.js39
-rw-r--r--test/suite/intl402/ch08/8.0/8.0_L15.js14
-rw-r--r--test/suite/intl402/ch08/8.1/8.1.js23
-rw-r--r--test/suite/intl402/ch10/10.1/10.1_L15.js14
-rw-r--r--test/suite/intl402/ch10/10.2/10.2.1.js25
-rw-r--r--test/suite/intl402/ch10/10.2/10.2.2_L15.js14
-rw-r--r--test/suite/intl402/ch10/10.2/10.2.js16
-rw-r--r--test/suite/intl402/ch10/10.3/10.3.2_1_a_L15.js14
-rw-r--r--test/suite/intl402/ch10/10.3/10.3.2_L15.js14
-rw-r--r--test/suite/intl402/ch10/10.3/10.3.3_L15.js14
-rw-r--r--test/suite/intl402/ch10/10.3/10.3_L15.js14
-rw-r--r--test/suite/intl402/ch11/11.1/11.1_L15.js14
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.1.js26
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.2_L15.js14
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.js17
-rw-r--r--test/suite/intl402/ch11/11.3/11.3.2_1_a_L15.js14
-rw-r--r--test/suite/intl402/ch11/11.3/11.3.2_L15.js14
-rw-r--r--test/suite/intl402/ch11/11.3/11.3.3_L15.js14
-rw-r--r--test/suite/intl402/ch11/11.3/11.3_L15.js14
-rw-r--r--test/suite/intl402/ch12/12.1/12.1_L15.js14
-rw-r--r--test/suite/intl402/ch12/12.2/12.2.1.js26
-rw-r--r--test/suite/intl402/ch12/12.2/12.2.2_L15.js14
-rw-r--r--test/suite/intl402/ch12/12.2/12.2.js17
-rw-r--r--test/suite/intl402/ch12/12.3/12.3.2_1_a_L15.js14
-rw-r--r--test/suite/intl402/ch12/12.3/12.3.2_L15.js14
-rw-r--r--test/suite/intl402/ch12/12.3/12.3.3_L15.js14
-rw-r--r--test/suite/intl402/ch12/12.3/12.3_L15.js14
-rw-r--r--test/suite/intl402/ch13/13.1/13.1.1_L15.js14
-rw-r--r--test/suite/intl402/ch13/13.2/13.2.1_L15.js14
-rw-r--r--test/suite/intl402/ch13/13.3/13.3.1_L15.js14
-rw-r--r--test/suite/intl402/ch13/13.3/13.3.2_L15.js14
-rw-r--r--test/suite/intl402/ch13/13.3/13.3.3_L15.js14
33 files changed, 459 insertions, 189 deletions
diff --git a/test/harness/testBuiltInObject.js b/test/harness/testBuiltInObject.js
new file mode 100644
index 000000000..e8eb39c67
--- /dev/null
+++ b/test/harness/testBuiltInObject.js
@@ -0,0 +1,123 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @description Tests that obj meets the requirements for built-in objects
+ * defined by the introduction of chapter 15 of the ECMAScript Language Specification.
+ * @param {Object} obj the object to be tested.
+ * @param {boolean} isFunction whether the specification describes obj as a function.
+ * @param {boolean} isConstructor whether the specification describes obj as a constructor.
+ * @param {String[]} properties an array with the names of the built-in properties of obj,
+ * excluding length, prototype, or properties with non-default attributes.
+ * @param {number} length for functions only: the length specified for the function
+ * or derived from the argument list.
+ * @author Norbert Lindenberg
+ */
+
+function testBuiltInObject(obj, isFunction, isConstructor, properties, length) {
+
+ if (obj === undefined) {
+ $ERROR("Object being tested is undefined.");
+ }
+
+ var objString = Object.prototype.toString.call(obj);
+ if (isFunction) {
+ if (objString !== "[object Function]") {
+ $ERROR("The [[Class]] internal property of a built-in function must be " +
+ "\"Function\", but toString() returns " + objString);
+ }
+ } else {
+ if (objString !== "[object Object]") {
+ $ERROR("The [[Class]] internal property of a built-in non-function object must be " +
+ "\"Object\", but toString() returns " + objString);
+ }
+ }
+
+ if (!Object.isExtensible(obj)) {
+ $ERROR("Built-in objects must be extensible.");
+ }
+
+ if (isFunction && Object.getPrototypeOf(obj) !== Function.prototype) {
+ $ERROR("Built-in functions must have Function.prototype as their prototype.");
+ }
+
+ if (isConstructor && Object.getPrototypeOf(obj.prototype) !== Object.prototype) {
+ $ERROR("Built-in prototype objects must have Object.prototype as their prototype.");
+ }
+
+ // verification of the absence of the [[Construct]] internal property has
+ // been moved to the end of the test
+
+ // verification of the absence of the prototype property has
+ // been moved to the end of the test
+
+ if (isFunction) {
+
+ if (typeof obj.length !== "number" || obj.length !== Math.floor(obj.length)) {
+ $ERROR("Built-in functions must have a length property with an integer value.");
+ }
+
+ if (obj.length !== length) {
+ $ERROR("Function's length property doesn't have specified value.");
+ }
+
+ var desc = Object.getOwnPropertyDescriptor(obj, "length");
+ if (desc.writable) {
+ $ERROR("The length property of a built-in function must not be writable.");
+ }
+ if (desc.enumerable) {
+ $ERROR("The length property of a built-in function must not be enumerable.");
+ }
+ if (desc.configurable) {
+ $ERROR("The length property of a built-in function must not be configurable.");
+ }
+ }
+
+ properties.forEach(function(prop) {
+ var desc = Object.getOwnPropertyDescriptor(obj, prop);
+ if (desc === undefined) {
+ $ERROR("Missing property " + prop + ".");
+ }
+ // accessor properties don't have writable attribute
+ if (desc.hasOwnProperty("writable") && !desc.writable) {
+ $ERROR("The " + prop + " property of this built-in function must be writable.");
+ }
+ if (desc.enumerable) {
+ $ERROR("The " + prop + " property of this built-in function must not be enumerable.");
+ }
+ if (!desc.configurable) {
+ $ERROR("The " + prop + " property of this built-in function must be configurable.");
+ }
+ });
+
+ // The remaining sections have been moved to the end of the test because
+ // unbound non-constructor functions written in JavaScript cannot possibly
+ // pass them, and we still want to test JavaScript implementations as much
+ // as possible.
+
+ var exception;
+ if (isFunction && !isConstructor) {
+ // this is not a complete test for the presence of [[Construct]]:
+ // if it's absent, the exception must be thrown, but it may also
+ // be thrown if it's present and just has preconditions related to
+ // arguments or the this value that this statement doesn't meet.
+ try {
+ /*jshint newcap:false*/
+ var instance = new obj();
+ } catch (e) {
+ exception = e;
+ }
+ if (exception === undefined || exception.name !== "TypeError") {
+ $ERROR("Built-in functions that aren't constructors must throw TypeError when " +
+ "used in a \"new\" statement.");
+ }
+ }
+
+ if (isFunction && !isConstructor && obj.hasOwnProperty("prototype")) {
+ $ERROR("Built-in functions that aren't constructors must not have a prototype property.");
+ }
+
+ // passed the complete test!
+ return true;
+}
+
diff --git a/test/suite/intl402/ch08/8.0/8.0.js b/test/suite/intl402/ch08/8.0/8.0.js
deleted file mode 100644
index e35db5dff..000000000
--- a/test/suite/intl402/ch08/8.0/8.0.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests properties of Intl object.
- */
-
-// We keep Intl extensible and not frozen.
-if (Object.isFrozen(Intl) === true) {
- $ERROR('isFrozen(Intl) returns true.');
-}
-
-if (Object.isExtensible(Intl) === false) {
- $ERROR('isExtensible(Intl) returns false.');
-}
-
-var falsey;
-
-// Intl can't be constructed.
-try {
- falsey = new Intl();
-} catch (e) {
-}
-
-if (!!falsey) {
- $ERROR('Intl object should not be constructable.');
-}
-
-// Intl can't be called as a function.
-try {
- /*jshint newcap:false*/
- falsey = Intl();
-} catch (e) {
-}
-
-if (!!falsey) {
- $ERROR('Intl should not be callable.');
-}
-
diff --git a/test/suite/intl402/ch08/8.0/8.0_L15.js b/test/suite/intl402/ch08/8.0/8.0_L15.js
new file mode 100644
index 000000000..9b0b63952
--- /dev/null
+++ b/test/suite/intl402/ch08/8.0/8.0_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl, false, false, ["Collator", "NumberFormat", "DateTimeFormat"]);
+
diff --git a/test/suite/intl402/ch08/8.1/8.1.js b/test/suite/intl402/ch08/8.1/8.1.js
deleted file mode 100644
index f9ee77111..000000000
--- a/test/suite/intl402/ch08/8.1/8.1.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that Intl object has proper constructors.
- */
-
-if (Intl === undefined) {
- $ERROR('Intl object is undefined.');
-}
-
-if (typeof Intl.Collator !== 'function') {
- $ERROR('Intl.Collator is not a function.');
-}
-
-if (typeof Intl.NumberFormat !== 'function') {
- $ERROR('Intl.NumberFormat is not a function.');
-}
-
-if (typeof Intl.DateTimeFormat !== 'function') {
- $ERROR('Intl.DateTimeFormat is not a function.');
-}
-
diff --git a/test/suite/intl402/ch10/10.1/10.1_L15.js b/test/suite/intl402/ch10/10.1/10.1_L15.js
new file mode 100644
index 000000000..4dbabfd64
--- /dev/null
+++ b/test/suite/intl402/ch10/10.1/10.1_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.Collator
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.Collator, true, true, ["supportedLocalesOf"], 0);
+
diff --git a/test/suite/intl402/ch10/10.2/10.2.1.js b/test/suite/intl402/ch10/10.2/10.2.1.js
deleted file mode 100644
index 6583bed08..000000000
--- a/test/suite/intl402/ch10/10.2/10.2.1.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that the Intl.Collator prototype object exists and
- * is not writable, enumerable, or configurable.
- */
-
-var desc;
-
-if (!Intl.Collator.hasOwnProperty('prototype')) {
- $ERROR('Intl.Collator has no prototype property');
-}
-
-desc = Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype');
-if (desc.writable === true) {
- $ERROR('Intl.Collator.prototype is writable.');
-}
-if (desc.enumerable === true) {
- $ERROR('Intl.Collator.prototype is enumerable.');
-}
-if (desc.configurable === true) {
- $ERROR('Intl.Collator.prototype is configurable.');
-}
-
diff --git a/test/suite/intl402/ch10/10.2/10.2.2_L15.js b/test/suite/intl402/ch10/10.2/10.2.2_L15.js
new file mode 100644
index 000000000..6ffcdde84
--- /dev/null
+++ b/test/suite/intl402/ch10/10.2/10.2.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.Collator.supportedLocalesOf
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.Collator.supportedLocalesOf, true, false, [], 1);
+
diff --git a/test/suite/intl402/ch10/10.2/10.2.js b/test/suite/intl402/ch10/10.2/10.2.js
deleted file mode 100644
index 2a9c073e9..000000000
--- a/test/suite/intl402/ch10/10.2/10.2.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that the Intl.Collator constructor has a length
- * property that equals 2.
- */
-
-if (!Intl.Collator.hasOwnProperty('length')) {
- $ERROR('Intl.Collator has no length property');
-}
-
-if (Intl.Collator.length != 2) {
- $ERROR('Intl.Collator.length is not 2.');
-}
-
diff --git a/test/suite/intl402/ch10/10.3/10.3.2_1_a_L15.js b/test/suite/intl402/ch10/10.3/10.3.2_1_a_L15.js
new file mode 100644
index 000000000..3d49601db
--- /dev/null
+++ b/test/suite/intl402/ch10/10.3/10.3.2_1_a_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that the function returned by Intl.Collator.prototype.compare
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(new Intl.Collator().compare, true, false, [], 2);
+
diff --git a/test/suite/intl402/ch10/10.3/10.3.2_L15.js b/test/suite/intl402/ch10/10.3/10.3.2_L15.js
new file mode 100644
index 000000000..5845ea3ca
--- /dev/null
+++ b/test/suite/intl402/ch10/10.3/10.3.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that the getter for Intl.Collator.prototype.compare
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get , true, false, [], 0);
+
diff --git a/test/suite/intl402/ch10/10.3/10.3.3_L15.js b/test/suite/intl402/ch10/10.3/10.3.3_L15.js
new file mode 100644
index 000000000..718cc9fea
--- /dev/null
+++ b/test/suite/intl402/ch10/10.3/10.3.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.Collator.prototype.resolvedOptions
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.Collator.prototype.resolvedOptions, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch10/10.3/10.3_L15.js b/test/suite/intl402/ch10/10.3/10.3_L15.js
new file mode 100644
index 000000000..60719736c
--- /dev/null
+++ b/test/suite/intl402/ch10/10.3/10.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.Collator.prototype
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.Collator.prototype, false, false, ["constructor", "compare", "resolvedOptions"]);
+
diff --git a/test/suite/intl402/ch11/11.1/11.1_L15.js b/test/suite/intl402/ch11/11.1/11.1_L15.js
new file mode 100644
index 000000000..e40ffc53e
--- /dev/null
+++ b/test/suite/intl402/ch11/11.1/11.1_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.NumberFormat
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.NumberFormat, true, true, ["supportedLocalesOf"], 0);
+
diff --git a/test/suite/intl402/ch11/11.2/11.2.1.js b/test/suite/intl402/ch11/11.2/11.2.1.js
deleted file mode 100644
index 0ff91067a..000000000
--- a/test/suite/intl402/ch11/11.2/11.2.1.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that the Intl.NumberFormat prototype object exists and
- * is not writable, enumerable, or configurable.
- * @author: Roozbeh Pournader
- */
-
-var desc;
-
-if (!Intl.NumberFormat.hasOwnProperty('prototype')) {
- $ERROR('Intl.NumberFormat has no prototype property');
-}
-
-desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype');
-if (desc.writable === true) {
- $ERROR('Intl.NumberFormat.prototype is writable.');
-}
-if (desc.enumerable === true) {
- $ERROR('Intl.NumberFormat.prototype is enumerable.');
-}
-if (desc.configurable === true) {
- $ERROR('Intl.NumberFormat.prototype is configurable.');
-}
-
diff --git a/test/suite/intl402/ch11/11.2/11.2.2_L15.js b/test/suite/intl402/ch11/11.2/11.2.2_L15.js
new file mode 100644
index 000000000..49dce3bae
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.NumberFormat.supportedLocalesOf
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.NumberFormat.supportedLocalesOf, true, false, [], 1);
+
diff --git a/test/suite/intl402/ch11/11.2/11.2.js b/test/suite/intl402/ch11/11.2/11.2.js
deleted file mode 100644
index 8094d3bd1..000000000
--- a/test/suite/intl402/ch11/11.2/11.2.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that the Intl.NumberFormat constructor has a length
- * property that equals 2.
- * @author: Roozbeh Pournader
- */
-
-if (!Intl.NumberFormat.hasOwnProperty('length')) {
- $ERROR('Intl.NumberFormat has no length property');
-}
-
-if (Intl.NumberFormat.length != 2) {
- $ERROR('Intl.NumberFormat.length is not 2.');
-}
-
diff --git a/test/suite/intl402/ch11/11.3/11.3.2_1_a_L15.js b/test/suite/intl402/ch11/11.3/11.3.2_1_a_L15.js
new file mode 100644
index 000000000..8e1c95835
--- /dev/null
+++ b/test/suite/intl402/ch11/11.3/11.3.2_1_a_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that the function returned by Intl.NumberFormat.prototype.format
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(new Intl.NumberFormat().format, true, false, [], 1);
+
diff --git a/test/suite/intl402/ch11/11.3/11.3.2_L15.js b/test/suite/intl402/ch11/11.3/11.3.2_L15.js
new file mode 100644
index 000000000..17b688b7a
--- /dev/null
+++ b/test/suite/intl402/ch11/11.3/11.3.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that the getter for Intl.NumberFormat.prototype.format
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get , true, false, [], 0);
+
diff --git a/test/suite/intl402/ch11/11.3/11.3.3_L15.js b/test/suite/intl402/ch11/11.3/11.3.3_L15.js
new file mode 100644
index 000000000..b9f95866d
--- /dev/null
+++ b/test/suite/intl402/ch11/11.3/11.3.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.NumberFormat.prototype.resolvedOptions
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.NumberFormat.prototype.resolvedOptions, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch11/11.3/11.3_L15.js b/test/suite/intl402/ch11/11.3/11.3_L15.js
new file mode 100644
index 000000000..ac1f0c05d
--- /dev/null
+++ b/test/suite/intl402/ch11/11.3/11.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.NumberFormat.prototype
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.NumberFormat.prototype, false, false, ["constructor", "format", "resolvedOptions"]);
+
diff --git a/test/suite/intl402/ch12/12.1/12.1_L15.js b/test/suite/intl402/ch12/12.1/12.1_L15.js
new file mode 100644
index 000000000..46c4f5f50
--- /dev/null
+++ b/test/suite/intl402/ch12/12.1/12.1_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.DateTimeFormat
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.DateTimeFormat, true, true, ["supportedLocalesOf"], 0);
+
diff --git a/test/suite/intl402/ch12/12.2/12.2.1.js b/test/suite/intl402/ch12/12.2/12.2.1.js
deleted file mode 100644
index 4ec28c5d3..000000000
--- a/test/suite/intl402/ch12/12.2/12.2.1.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that the Intl.DateTimeFormat prototype object exists and
- * is not writable, enumerable, or configurable.
- * @author: Roozbeh Pournader
- */
-
-var desc;
-
-if (!Intl.DateTimeFormat.hasOwnProperty('prototype')) {
- $ERROR('Intl.DateTimeFormat has no prototype property');
-}
-
-desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype');
-if (desc.writable === true) {
- $ERROR('Intl.DateTimeFormat.prototype is writable.');
-}
-if (desc.enumerable === true) {
- $ERROR('Intl.DateTimeFormat.prototype is enumerable.');
-}
-if (desc.configurable === true) {
- $ERROR('Intl.DateTimeFormat.prototype is configurable.');
-}
-
diff --git a/test/suite/intl402/ch12/12.2/12.2.2_L15.js b/test/suite/intl402/ch12/12.2/12.2.2_L15.js
new file mode 100644
index 000000000..8b21df1fd
--- /dev/null
+++ b/test/suite/intl402/ch12/12.2/12.2.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.DateTimeFormat.supportedLocalesOf
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.DateTimeFormat.supportedLocalesOf, true, false, [], 1);
+
diff --git a/test/suite/intl402/ch12/12.2/12.2.js b/test/suite/intl402/ch12/12.2/12.2.js
deleted file mode 100644
index 59785479a..000000000
--- a/test/suite/intl402/ch12/12.2/12.2.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @description Tests that the Intl.DateTimeFormat constructor has a length
- * property that equals 2.
- * @author: Roozbeh Pournader
- */
-
-if (!Intl.DateTimeFormat.hasOwnProperty('length')) {
- $ERROR('Intl.DateTimeFormat has no length property');
-}
-
-if (Intl.DateTimeFormat.length != 2) {
- $ERROR('Intl.DateTimeFormat.length is not 2.');
-}
-
diff --git a/test/suite/intl402/ch12/12.3/12.3.2_1_a_L15.js b/test/suite/intl402/ch12/12.3/12.3.2_1_a_L15.js
new file mode 100644
index 000000000..2fb768d09
--- /dev/null
+++ b/test/suite/intl402/ch12/12.3/12.3.2_1_a_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that the function returned by Intl.DateTimeFormat.prototype.format
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(new Intl.DateTimeFormat().format, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch12/12.3/12.3.2_L15.js b/test/suite/intl402/ch12/12.3/12.3.2_L15.js
new file mode 100644
index 000000000..73d309e26
--- /dev/null
+++ b/test/suite/intl402/ch12/12.3/12.3.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that the getter for Intl.DateTimeFormat.prototype.format
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get , true, false, [], 0);
+
diff --git a/test/suite/intl402/ch12/12.3/12.3.3_L15.js b/test/suite/intl402/ch12/12.3/12.3.3_L15.js
new file mode 100644
index 000000000..1b4079ebe
--- /dev/null
+++ b/test/suite/intl402/ch12/12.3/12.3.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.DateTimeFormat.prototype.resolvedOptions
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.DateTimeFormat.prototype.resolvedOptions, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch12/12.3/12.3_L15.js b/test/suite/intl402/ch12/12.3/12.3_L15.js
new file mode 100644
index 000000000..55f1c16ca
--- /dev/null
+++ b/test/suite/intl402/ch12/12.3/12.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.DateTimeFormat.prototype
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Intl.DateTimeFormat.prototype, false, false, ["constructor", "format", "resolvedOptions"]);
+
diff --git a/test/suite/intl402/ch13/13.1/13.1.1_L15.js b/test/suite/intl402/ch13/13.1/13.1.1_L15.js
new file mode 100644
index 000000000..d921de000
--- /dev/null
+++ b/test/suite/intl402/ch13/13.1/13.1.1_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that String.prototype.localeCompare
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(String.prototype.localeCompare, true, false, [], 1);
+
diff --git a/test/suite/intl402/ch13/13.2/13.2.1_L15.js b/test/suite/intl402/ch13/13.2/13.2.1_L15.js
new file mode 100644
index 000000000..8b53f7496
--- /dev/null
+++ b/test/suite/intl402/ch13/13.2/13.2.1_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Number.prototype.toLocaleString
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Number.prototype.toLocaleString, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch13/13.3/13.3.1_L15.js b/test/suite/intl402/ch13/13.3/13.3.1_L15.js
new file mode 100644
index 000000000..a8c697c07
--- /dev/null
+++ b/test/suite/intl402/ch13/13.3/13.3.1_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Date.prototype.toLocaleString
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Date.prototype.toLocaleString, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch13/13.3/13.3.2_L15.js b/test/suite/intl402/ch13/13.3/13.3.2_L15.js
new file mode 100644
index 000000000..5eeed944e
--- /dev/null
+++ b/test/suite/intl402/ch13/13.3/13.3.2_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Date.prototype.toLocaleDateString
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Date.prototype.toLocaleDateString, true, false, [], 0);
+
diff --git a/test/suite/intl402/ch13/13.3/13.3.3_L15.js b/test/suite/intl402/ch13/13.3/13.3.3_L15.js
new file mode 100644
index 000000000..dac7c3513
--- /dev/null
+++ b/test/suite/intl402/ch13/13.3/13.3.3_L15.js
@@ -0,0 +1,14 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/**
+ * @description Tests that Date.prototype.toLocaleTimeString
+ * meets the requirements for built-in objects defined by the introduction of
+ * chapter 15 of the ECMAScript Language Specification.
+ * @author Norbert Lindenberg
+ */
+
+$INCLUDE("testBuiltInObject.js");
+
+testBuiltInObject(Date.prototype.toLocaleTimeString, true, false, [], 0);
+