Added tests to verify that constructors in Internationalization API can be called with non-objects as this values.

This commit is contained in:
Norbert Lindenberg 2012-11-05 22:48:52 +00:00
parent 8f6a50843a
commit f169d16273
6 changed files with 94 additions and 10 deletions

View File

@ -0,0 +1,21 @@
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @description Tests that for non-object values passed as this to Collator a
* wrapper 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;
});

View File

@ -0,0 +1,21 @@
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @description Tests that for non-object values passed as this to NumberFormat a
* wrapper 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;
});

View File

@ -0,0 +1,21 @@
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @description Tests that for non-object values passed as this to DateTimeFormat a
* wrapper 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;
});

View File

@ -1,7 +1,7 @@
{
"testsCollection":{
"name":"Chapter - intl402",
"numTests":"138",
"numTests":"141",
"tests":[
{
"author":"Norbert Lindenberg",
@ -215,7 +215,7 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBiZWhhdmlvciBvZiBhIFJlY29yZCBpcyBub3QgYWZmZWN0ZWQgYnkgYWR2ZXJzYXJpYWwKICogICAgIGNoYW5nZXMgdG8gT2JqZWN0LnByb3RvdHlwZS4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRhaW50UHJvcGVydGllcyhbImxvY2FsZU1hdGNoZXIiLCAia24iLCAia2siLCAia2YiXSk7Cgp2YXIgbG9jYWxlID0gbmV3IEludGwuQ29sbGF0b3IodW5kZWZpbmVkLCB7bG9jYWxlTWF0Y2hlcjogImxvb2t1cCJ9KS5yZXNvbHZlZE9wdGlvbnMoKS5sb2NhbGU7CmlmICghaXNDYW5vbmljYWxpemVkU3RydWN0dXJhbGx5VmFsaWRMYW5ndWFnZVRhZyhsb2NhbGUpKSB7CiAgICAkRVJST1IoIkNvbGxhdG9yIHJldHVybnMgaW52YWxpZCBsb2NhbGUgIiArIGxvY2FsZSArICIuIik7Cn0KCg==",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBiZWhhdmlvciBvZiBhIFJlY29yZCBpcyBub3QgYWZmZWN0ZWQgYnkgYWR2ZXJzYXJpYWwKICogICAgIGNoYW5nZXMgdG8gT2JqZWN0LnByb3RvdHlwZS4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRhaW50UHJvcGVydGllcyhbImxvY2FsZU1hdGNoZXIiLCAia24iLCAia2YiXSk7Cgp2YXIgbG9jYWxlID0gbmV3IEludGwuQ29sbGF0b3IodW5kZWZpbmVkLCB7bG9jYWxlTWF0Y2hlcjogImxvb2t1cCJ9KS5yZXNvbHZlZE9wdGlvbnMoKS5sb2NhbGU7CmlmICghaXNDYW5vbmljYWxpemVkU3RydWN0dXJhbGx5VmFsaWRMYW5ndWFnZVRhZyhsb2NhbGUpKSB7CiAgICAkRVJST1IoIkNvbGxhdG9yIHJldHVybnMgaW52YWxpZCBsb2NhbGUgIiArIGxvY2FsZSArICIuIik7Cn0KCg==",
"commentary":"",
"description":"Tests that the behavior of a Record is not affected by adversarial\n changes to Object.prototype.",
"path":"TestCases/intl402/ch10/10.1/10.1.1_10.js"
@ -229,9 +229,9 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBvcHRpb25zIG51bWVyaWMsIG5vcm1hbGl6YXRpb24sIGFuZCBjYXNlRmlyc3QgYXJlIHByb2Nlc3NlZCBjb3JyZWN0bHkuCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKJElOQ0xVREUoInRlc3RJbnRsLmpzIik7Cgp0ZXN0T3B0aW9uKEludGwuQ29sbGF0b3IsICJudW1lcmljIiwgImJvb2xlYW4iLCB1bmRlZmluZWQsIHVuZGVmaW5lZCwge2lzT3B0aW9uYWw6IHRydWV9KTsKdGVzdE9wdGlvbihJbnRsLkNvbGxhdG9yLCAibm9ybWFsaXphdGlvbiIsICJib29sZWFuIiwgdW5kZWZpbmVkLCB1bmRlZmluZWQsIHtpc09wdGlvbmFsOiB0cnVlfSk7CnRlc3RPcHRpb24oSW50bC5Db2xsYXRvciwgImNhc2VGaXJzdCIsICJzdHJpbmciLCBbInVwcGVyIiwgImxvd2VyIiwgImZhbHNlIl0sIHVuZGVmaW5lZCwge2lzT3B0aW9uYWw6IHRydWV9KTsKCg==",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBvcHRpb25zIG51bWVyaWMgYW5kIGNhc2VGaXJzdCBhcmUgcHJvY2Vzc2VkIGNvcnJlY3RseS4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRlc3RPcHRpb24oSW50bC5Db2xsYXRvciwgIm51bWVyaWMiLCAiYm9vbGVhbiIsIHVuZGVmaW5lZCwgdW5kZWZpbmVkLCB7aXNPcHRpb25hbDogdHJ1ZX0pOwp0ZXN0T3B0aW9uKEludGwuQ29sbGF0b3IsICJjYXNlRmlyc3QiLCAic3RyaW5nIiwgWyJ1cHBlciIsICJsb3dlciIsICJmYWxzZSJdLCB1bmRlZmluZWQsIHtpc09wdGlvbmFsOiB0cnVlfSk7Cgo=",
"commentary":"",
"description":"Tests that the options numeric, normalization, and caseFirst are processed correctly.",
"description":"Tests that the options numeric and caseFirst are processed correctly.",
"path":"TestCases/intl402/ch10/10.1/10.1.1_13.js"
},
{
@ -243,9 +243,9 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBvcHRpb25zIG51bWVyaWMsIG5v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lvbiAodmFsdWUpIHsKICAgICAgICB2YXIgb3RoZXJWYWx1ZTsKICAgICAgICBvcHRpb24udmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHBvc3NpYmxlVmFsdWUpIHsKICAgICAgICAgICAgaWYgKHBvc3NpYmxlVmFsdWUgIT09IHZhbHVlKSB7CiAgICAgICAgICAgICAgICBvdGhlclZhbHVlID0gcG9zc2libGVWYWx1ZTsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIGlmIChvdGhlclZhbHVlICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgb3B0ID0ge307CiAgICAgICAgICAgIG9wdFtvcHRpb24ucHJvcGVydHldID0gdmFsdWU7CiAgICAgICAgICAgIGNvbGxhdG9yID0gbmV3IEludGwuQ29sbGF0b3IoW2RlZmF1bHRMb2NhbGUgKyAiLXUtIiArIG9wdGlvbi5rZXkgKyAiLSIgKyBvdGhlclZhbHVlXSwgb3B0KTsKICAgICAgICAgICAgcmVzdWx0ID0gY29sbGF0b3IucmVzb2x2ZWRPcHRpb25zKClbb3B0aW9uLnByb3BlcnR5XTsKICAgICAgICAgICAgaWYgKHJlc3VsdCAhPT0gdmFsdWUpIHsKICAgICAgICAgICAgICAgICRFUlJPUigiT3B0aW9ucyB2YWx1ZSBmb3IgcHJvcGVydHkgIiArIG9wdGlvbi5wcm9wZXJ0eSArICIgZG9lc24ndCBvdmVycmlkZSBsb2NhbGUgZXh0ZW5zaW9uIGtleSAiICsKICAgICAgICAgICAgICAgICAgICBvcHRpb24ua2V5ICsgIjsgcmVxdWVzdGVkIHZhbHVlOiAiICsgdmFsdWUgKyAiOyBhY3R1YWwgdmFsdWU6ICIgKyByZXN1bHQgKyAiLiIpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSk7Cn0pOwoK",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiA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ICAgICAgIHZhciBvdGhlclZhbHVlOwogICAgICAgIG9wdGlvbi52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAocG9zc2libGVWYWx1ZSkgewogICAgICAgICAgICBpZiAocG9zc2libGVWYWx1ZSAhPT0gdmFsdWUpIHsKICAgICAgICAgICAgICAgIG90aGVyVmFsdWUgPSBwb3NzaWJsZVZhbHVlOwogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgICAgaWYgKG90aGVyVmFsdWUgIT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICBvcHQgPSB7fTsKICAgICAgICAgICAgb3B0W29wdGlvbi5wcm9wZXJ0eV0gPSB2YWx1ZTsKICAgICAgICAgICAgY29sbGF0b3IgPSBuZXcgSW50bC5Db2xsYXRvcihbZGVmYXVsdExvY2FsZSArICItdS0iICsgb3B0aW9uLmtleSArICItIiArIG90aGVyVmFsdWVdLCBvcHQpOwogICAgICAgICAgICByZXN1bHQgPSBjb2xsYXRvci5yZXNvbHZlZE9wdGlvbnMoKVtvcHRpb24ucHJvcGVydHldOwogICAgICAgICAgICBpZiAocmVzdWx0ICE9PSB2YWx1ZSkgewogICAgICAgICAgICAgICAgJEVSUk9SKCJPcHRpb25zIHZhbHVlIGZvciBwcm9wZXJ0eSAiICsgb3B0aW9uLnByb3BlcnR5ICsgIiBkb2Vzbid0IG92ZXJyaWRlIGxvY2FsZSBleHRlbnNpb24ga2V5ICIgKwogICAgICAgICAgICAgICAgICAgIG9wdGlvbi5rZXkgKyAiOyByZXF1ZXN0ZWQgdmFsdWU6ICIgKyB2YWx1ZSArICI7IGFjdHVhbCB2YWx1ZTogIiArIHJlc3VsdCArICIuIik7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9KTsKfSk7Cgo=",
"commentary":"",
"description":"Tests that the options numeric, normalization, and caseFirst can be\n set through either the locale or the options.",
"description":"Tests that the options numeric and caseFirst can be\n set through either the locale or the options.",
"path":"TestCases/intl402/ch10/10.1/10.1.1_19_c.js"
},
{
@ -271,6 +271,13 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGZvciBub24tb2JqZWN0IHZhbHVlcyBwYXNzZWQgYXMgdGhpcyB0byBDb2xsYXRvciBhCiAqIHdyYXBwZXIgb2JqZWN0IHdpbGwgYmUgaW5pdGlhbGl6ZWQgYW5kIHJldHVybmVkLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCnZhciB0aGlzVmFsdWVzID0gW3RydWUsIDQyLCAi5Zu96Zqb5YyWIl07Cgp0aGlzVmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHZhbHVlKSB7CiAgICB2YXIgY29sbGF0b3IgPSBJbnRsLkNvbGxhdG9yLmNhbGwodmFsdWUpOwogICAgLy8gY2hlY2sgdGhhdCB0aGUgcmV0dXJuZWQgb2JqZWN0IGZ1bmN0aW9ucyBhcyBhIGNvbGxhdG9yCiAgICB2YXIgcmVmZXJlbmNlQ29sbGF0b3IgPSBuZXcgSW50bC5Db2xsYXRvcigpOwogICAgaWYgKEludGwuQ29sbGF0b3IucHJvdG90eXBlLmNvbXBhcmUuY2FsbChjb2xsYXRvciwgImEiLCAiYiIpICE9PSByZWZlcmVuY2VDb2xsYXRvci5jb21wYXJlKCJhIiwgImIiKSkgewogICAgICAgICRFUlJPUigiQ29sbGF0b3IgaW5pdGlhbGl6ZWQgZnJvbSAiICsgdmFsdWUgKyAiIGRvZXNuJ3QgYmVoYXZlIGxpa2Ugbm9ybWFsIGNvbGxhdG9yLiIpOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn0pOwoK",
"commentary":"",
"description":"Tests that for non-object values passed as this to Collator a\nwrapper object will be initialized and returned.",
"path":"TestCases/intl402/ch10/10.1/10.1.2.1_4.js"
},
{
"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2NhbGVzKTsKYS5zb3J0KGNvbGxhdG9yLmNvbXBhcmUpOwp0ZXN0QXJyYXlzQXJlU2FtZShyZWZlcmVuY2VTb3J0ZWQsIGEpOwoK",
"commentary":"",
"description":"Tests that Intl.Collator can be subclassed.",
@ -312,7 +319,7 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IEludGwuQ29sbGF0b3IgZG9lcyBub3QgYWNjZXB0IFVuaWNvZGUgbG9jYWxlCiAqICAgICBleHRlbnNpb24ga2V5cyBhbmQgdmFsdWVzIHRoYXQgYXJlIG5vdCBhbGxvd2VkLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCiRJTkNMVURFKCJ0ZXN0SW50bC5qcyIpOwoKdmFyIGRlZmF1bHRDb2xsYXRvciA9IG5ldyBJbnRsLkNvbGxhdG9yKCk7CnZhciBkZWZhdWx0T3B0aW9ucyA9IGRlZmF1bHRDb2xsYXRvci5yZXNvbHZlZE9wdGlvbnMoKTsKdmFyIGRlZmF1bHRPcHRpb25zSlNPTiA9IEpTT04uc3RyaW5naWZ5KGRlZmF1bHRPcHRpb25zKTsKdmFyIGRlZmF1bHRMb2NhbGUgPSBkZWZhdWx0T3B0aW9ucy5sb2NhbGU7CnZhciBkZWZhdWx0U29ydGVkQXJyYXkgPSBbImhlbGxvIiwgIuS9oOWlvSIsICLjgZPjgpPjgavjgaHjga8iLCAicMOqY2hlIiwgInBlY2jDqSIsICI5IiwgIjEwIl0uc29ydChkZWZhdWx0Q29sbGF0b3IuY29tcGFyZSk7CgoKdmFyIGtleVZhbHVlcyA9IHsKICAgICJjbyI6IFsic3RhbmRhcmQiLCAic2VhcmNoIiwgImludmFsaWQiXSwKICAgICJrYSI6IFsibm9pZ25vcmUiLCAic2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k7CiAgICAgICAgdmFyIG9wdGlvbnMgPSBjb2xsYXRvci5yZXNvbHZlZE9wdGlvbnMoKTsKICAgICAgICBpZiAob3B0aW9ucy5sb2NhbGUgIT09IGRlZmF1bHRMb2NhbGUpIHsKICAgICAgICAgICAgJEVSUk9SKCJMb2NhbGUgIiArIG9wdGlvbnMubG9jYWxlICsgIiBpcyBhZmZlY3RlZCBieSBrZXkgIiArCiAgICAgICAgICAgICAgICBrZXkgKyAiOyB2YWx1ZSAiICsgdmFsdWUgKyAiLiIpOwogICAgICAgIH0KICAgICAgICBpZiAoSlNPTi5zdHJpbmdpZnkob3B0aW9ucykgIT09IGRlZmF1bHRPcHRpb25zSlNPTikgewogICAgICAgICAgICAkRVJST1IoIlJlc29sdmVkIG9wdGlvbnMgIiArIEpTT04uc3RyaW5naWZ5KG9wdGlvbnMpICsgIiBhcmUgYWZmZWN0ZWQgYnkga2V5ICIgKwogICAgICAgICAgICAgICAga2V5ICsgIjsgdmFsdWUgIiArIHZhbHVlICsgIi4iKTsKICAgICAgICB9CiAgICAgICAgdGVzdEFycmF5c0FyZVNhbWUoZGVmYXVsdFNvcnRlZEFycmF5LCB0ZXN0QXJyYXkuc29ydChjb2xsYXRvci5jb21wYXJlKSk7CiAgICB9KTsKfSk7Cgo=",
"commentary":"",
"description":"Tests that Intl.Collator does not accept Unicode locale\n extension keys and values that are not allowed.",
"path":"TestCases/intl402/ch10/10.2/10.2.3_b.js"
@ -374,7 +381,7 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBvYmplY3QgcmV0dXJuZWQgYnkgSW50bC5Db2xsYXRvci5wcm90b3R5cGUucmVzb2x2ZWRPcHRpb25zCiAqICAgICBoYXMgdGhlIHJpZ2h0IHByb3BlcnRpZXMu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CAibG93ZXIiLCAiZmFsc2UiXSk7Cgo=",
"commentary":"",
"description":"Tests that the object returned by Intl.Collator.prototype.resolvedOptions\n has the right properties.",
"path":"TestCases/intl402/ch10/10.3/10.3.3.js"
@ -478,6 +485,13 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGZvciBub24tb2JqZWN0IHZhbHVlcyBwYXNzZWQgYXMgdGhpcyB0byBOdW1iZXJGb3JtYXQgYQogKiB3cmFwcGVyIG9iamVjdCB3aWxsIGJlIGluaXRpYWxpemVkIGFuZCByZXR1cm5lZC4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgp2YXIgdGhpc1ZhbHVlcyA9IFt0cnVlLCA0MiwgIuWbvemam+WMliJdOwoKdGhpc1ZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2YWx1ZSkgewogICAgdmFyIGZvcm1hdCA9IEludGwuTnVtYmVyRm9ybWF0LmNhbGwodmFsdWUpOwogICAgLy8gY2hlY2sgdGhhdCB0aGUgcmV0dXJuZWQgb2JqZWN0IGZ1bmN0aW9ucyBhcyBhIG51bWJlciBmb3JtYXQKICAgIHZhciByZWZlcmVuY2VGb3JtYXQgPSBuZXcgSW50bC5OdW1iZXJGb3JtYXQoKTsKICAgIGlmIChJbnRsLk51bWJlckZvcm1hdC5wcm90b3R5cGUuZm9ybWF0LmNhbGwoZm9ybWF0LCAxMi4zNDU2KSAhPT0gcmVmZXJlbmNlRm9ybWF0LmZvcm1hdCgxMi4zNDU2KSkgewogICAgICAgICRFUlJPUigiTnVtYmVyRm9ybWF0IGluaXRpYWxpemVkIGZyb20gIiArIHZhbHVlICsgIiBkb2Vzbid0IGJlaGF2ZSBsaWtlIG5vcm1hbCBudW1iZXIgZm9ybWF0LiIpOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn0pOwoK",
"commentary":"",
"description":"Tests that for non-object values passed as this to NumberFormat a\nwrapper object will be initialized and returned.",
"path":"TestCases/intl402/ch11/11.1/11.1.2.1_4.js"
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTEtMjAxMiBOb3JiZXJ0IExpbmRlbmJlcmcuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAZGVzY3JpcHRpb24gVGVzdHMgdGhhdCBJbnRsLk51bWJlckZvcm1hdCBjYW4gYmUgc3ViY2xhc3NlZC4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCi8vIGdldCBhIG51bWJlciBmb3JtYXQgYW5kIGhhdmUgaXQgZm9ybWF0IGFuIGFycmF5IG9mIG51bWJlcnMgZm9yIGNvbXBhcmlzb24gd2l0aCB0aGUgc3ViY2xhc3MKdmFyIGxvY2FsZXMgPSBbInRsaCIsICJpZCIsICJlbiJdOwp2YXIgYSA9IFswLCAxLCAtMSwgLTEyMzQ1Ni43ODksIC1JbmZpbml0eSwgTmFOXTsKdmFyIHJlZmVyZW5jZU51bWJlckZvcm1hdCA9IG5ldyBJbnRsLk51bWJlckZvcm1hdChsb2NhbGVzKTsKdmFyIHJlZmVyZW5jZUZvcm1hdHRlZCA9IGEubWFwKHJlZmVyZW5jZU51bWJlckZvcm1hdC5mb3JtYXQpOwoKZnVuY3Rpb24gTXlOdW1iZXJGb3JtYXQobG9jYWxlcywgb3B0aW9ucykgewogICAgSW50bC5OdW1iZXJGb3JtYXQuY2FsbCh0aGlzLCBsb2NhbGVzLCBvcHRpb25zKTsKICAgIC8vIGNvdWxkIGluaXRpYWxpemUgTXlOdW1iZXJGb3JtYXQgcHJvcGVydGllcwp9CgpNeU51bWJlckZvcm1hdC5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKEludGwuTnVtYmVyRm9ybWF0LnByb3RvdHlwZSk7Ck15TnVtYmVyRm9ybWF0LnByb3RvdHlwZS5jb25zdHJ1Y3RvciA9IE15TnVtYmVyRm9ybWF0OwovLyBjb3VsZCBhZGQgbWV0aG9kcyB0byBNeU51bWJlckZvcm1hdC5wcm90b3R5cGUKCnZhciBmb3JtYXQgPSBuZXcgTXlOdW1iZXJGb3JtYXQobG9jYWxlcyk7CnZhciBhY3R1YWwgPSBhLm1hcChmb3JtYXQuZm9ybWF0KTsKdGVzdEFycmF5c0FyZVNhbWUocmVmZXJlbmNlRm9ybWF0dGVkLCBhY3R1YWwpOwoK",
"commentary":"",
"description":"Tests that Intl.NumberFormat can be subclassed.",
@ -702,6 +716,13 @@
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGZvciBub24tb2JqZWN0IHZhbHVlcyBwYXNzZWQgYXMgdGhpcyB0byBEYXRlVGltZUZvcm1hdCBhCiAqIHdyYXBwZXIgb2JqZWN0IHdpbGwgYmUgaW5pdGlhbGl6ZWQgYW5kIHJldHVybmVkLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCnZhciB0aGlzVmFsdWVzID0gW3RydWUsIDQyLCAi5Zu96Zqb5YyWIl07Cgp0aGlzVmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHZhbHVlKSB7CiAgICB2YXIgZm9ybWF0ID0gSW50bC5EYXRlVGltZUZvcm1hdC5jYWxsKHZhbHVlKTsKICAgIC8vIGNoZWNrIHRoYXQgdGhlIHJldHVybmVkIG9iamVjdCBmdW5jdGlvbnMgYXMgYSBkYXRlLXRpbWUgZm9ybWF0CiAgICB2YXIgcmVmZXJlbmNlRm9ybWF0ID0gbmV3IEludGwuRGF0ZVRpbWVGb3JtYXQoKTsKICAgIGlmIChJbnRsLkRhdGVUaW1lRm9ybWF0LnByb3RvdHlwZS5mb3JtYXQuY2FsbChmb3JtYXQsIG5ldyBEYXRlKDExMTExMTExMSkpICE9PSByZWZlcmVuY2VGb3JtYXQuZm9ybWF0KG5ldyBEYXRlKDExMTExMTExMSkpKSB7CiAgICAgICAgJEVSUk9SKCJEYXRlVGltZUZvcm1hdCBpbml0aWFsaXplZCBmcm9tICIgKyB2YWx1ZSArICIgZG9lc24ndCBiZWhhdmUgbGlrZSBub3JtYWwgZGF0ZS10aW1lIGZvcm1hdC4iKTsKICAgIH0KICAgIHJldHVybiB0cnVlOwp9KTsKCg==",
"commentary":"",
"description":"Tests that for non-object values passed as this to DateTimeFormat a\nwrapper object will be initialized and returned.",
"path":"TestCases/intl402/ch12/12.1/12.1.2.1_4.js"
},
{
"author":"Norbert Lindenberg",
"code":"Ly8gQ29weXJpZ2h0IDIwMTEtMjAxMiBOb3JiZXJ0IExpbmRlbmJlcmcuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAZGVzY3JpcHRpb24gVGVzdHMgdGhhdCBJbnRsLkRhdGVUaW1lRm9ybWF0IGNhbiBiZSBzdWJjbGFzc2VkLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCiRJTkNMVURFKCJ0ZXN0SW50bC5qcyIpOwoKLy8gZ2V0IGEgZGF0ZS10aW1lIGZvcm1hdCBhbmQgaGF2ZSBpdCBmb3JtYXQgYW4gYXJyYXkgb2YgZGF0ZXMgZm9yIGNvbXBhcmlzb24gd2l0aCB0aGUgc3ViY2xhc3MKdmFyIGxvY2FsZXMgPSBbInRsaCIsICJpZCIsICJlbiJdOwp2YXIgYSA9IFtuZXcgRGF0ZSgwKSwgRGF0ZS5ub3coKSwgbmV3IERhdGUoRGF0ZS5wYXJzZSgiMTk4OS0xMS0wOVQxNzo1NzowMFoiKSldOwp2YXIgcmVmZXJlbmNlRGF0ZVRpbWVGb3JtYXQgPSBuZXcgSW50bC5EYXRlVGltZUZvcm1hdChsb2NhbGVzKTsKdmFyIHJlZmVyZW5jZUZvcm1hdHRlZCA9IGEubWFwKHJlZmVyZW5jZURhdGVUaW1lRm9ybWF0LmZvcm1hdCk7CgpmdW5jdGlvbiBNeURhdGVUaW1lRm9ybWF0KGxvY2FsZXMsIG9wdGlvbnMpIHsKICAgIEludGwuRGF0ZVRpbWVGb3JtYXQuY2FsbCh0aGlzLCBsb2NhbGVzLCBvcHRpb25zKTsKICAgIC8vIGNvdWxkIGluaXRpYWxpemUgTXlEYXRlVGltZUZvcm1hdCBwcm9wZXJ0aWVzCn0KCk15RGF0ZVRpbWVGb3JtYXQucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShJbnRsLkRhdGVUaW1lRm9ybWF0LnByb3RvdHlwZSk7Ck15RGF0ZVRpbWVGb3JtYXQucHJvdG90eXBlLmNvbnN0cnVjdG9yID0gTXlEYXRlVGltZUZvcm1hdDsKLy8gY291bGQgYWRkIG1ldGhvZHMgdG8gTXlEYXRlVGltZUZvcm1hdC5wcm90b3R5cGUKCnZhciBmb3JtYXQgPSBuZXcgTXlEYXRlVGltZUZvcm1hdChsb2NhbGVzKTsKdmFyIGFjdHVhbCA9IGEubWFwKGZvcm1hdC5mb3JtYXQpOwp0ZXN0QXJyYXlzQXJlU2FtZShyZWZlcmVuY2VGb3JtYXR0ZWQsIGFjdHVhbCk7Cgo=",
"commentary":"",
"description":"Tests that Intl.DateTimeFormat can be subclassed.",

View File

@ -1 +1 @@
{"date":"2012-10-04","version":"ES5.1"}
{"date":"2012-11-05","version":"ES5.1"}

View File

@ -1,5 +1,5 @@
{
"numTests":138,
"numTests":141,
"testSuite":[
"json/intl402.json"
]