Skip to content
Snippets Groups Projects
Commit 6a0f1189 authored by jungshik's avatar jungshik Committed by Tom Care
Browse files

Drop 3 tests testing an obsolete Ecma402 v1 spec (#807)

The following three tests check an obsolete provision in Ecma 402
v1 regarding Intl.{Collator,DateTimeFormat,NumberFormat} constructor
called as a function.

Collator/10.1.2.1_4.js
DateTimeFormat/12.1.2.1_4.js
NumberFormat/11.1.2.1_4.js
parent fcc9e072
No related branches found
No related tags found
No related merge requests found
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 10.1.2.1_4
description: >
Tests that non-object values passed as this to Collator are ignored
and a normal collator object will be initialized and returned.
author: Norbert Lindenberg
---*/
var thisValues = [true, 42, "国際化"];
thisValues.forEach(function (value) {
var collator = Intl.Collator.call(value);
// check that the returned object functions as a collator
var referenceCollator = new Intl.Collator();
if (Intl.Collator.prototype.compare.call(collator, "a", "b") !== referenceCollator.compare("a", "b")) {
$ERROR("Collator initialized from " + value + " doesn't behave like normal collator.");
}
return true;
});
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.1.2.1_4
description: >
Tests that non-object values passed as this to DateTimeFormat are ignored
and a normal date-time format object will be initialized and returned.
author: Norbert Lindenberg
---*/
var thisValues = [true, 42, "国際化"];
thisValues.forEach(function (value) {
var format = Intl.DateTimeFormat.call(value);
// check that the returned object functions as a date-time format
var referenceFormat = new Intl.DateTimeFormat();
if (Intl.DateTimeFormat.prototype.format.call(format, new Date(111111111)) !== referenceFormat.format(new Date(111111111))) {
$ERROR("DateTimeFormat initialized from " + value + " doesn't behave like normal date-time format.");
}
return true;
});
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 11.1.2.1_4
description: >
Tests that non-object values passed as this to NumberFormat are ignored
and a normal number format object will be initialized and returned.
author: Norbert Lindenberg
---*/
var thisValues = [true, 42, "国際化"];
thisValues.forEach(function (value) {
var format = Intl.NumberFormat.call(value);
// check that the returned object functions as a number format
var referenceFormat = new Intl.NumberFormat();
if (Intl.NumberFormat.prototype.format.call(format, 12.3456) !== referenceFormat.format(12.3456)) {
$ERROR("NumberFormat initialized from " + value + " doesn't behave like normal number format.");
}
return true;
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment