mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 06:25:30 +02:00
Add tests for proposal to make Intl prototypes not instances (#1079)
This proposal was started in https://github.com/tc39/ecma402/issues/122, and specified in https://github.com/tc39/ecma402/pull/148
This commit is contained in:
parent
443b15e43e
commit
8e5ffb66bf
9
test/intl402/Collator/prototype/10.3_a.js
vendored
9
test/intl402/Collator/prototype/10.3_a.js
vendored
@ -2,12 +2,13 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 10.3_a
|
esid: sec-properties-of-the-intl-collator-prototype-object
|
||||||
description: >
|
description: >
|
||||||
Tests that Intl.Collator.prototype is an object that has been
|
Tests that Intl.Collator.prototype is not an object that has been
|
||||||
initialized as an Intl.Collator.
|
initialized as an Intl.Collator.
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
// test by calling a function that would fail if "this" were not an object
|
// test by calling a function that should fail as "this" is not an object
|
||||||
// initialized as an Intl.Collator
|
// initialized as an Intl.Collator
|
||||||
assert.sameValue(Intl.Collator.prototype.compare("aаあ아", "aаあ아"), 0, "Intl.Collator.prototype is not an object that has been initialized as an Intl.Collator.");
|
assert.throws(TypeError, () => Intl.Collator.prototype.compare("aаあ아", "aаあ아"),
|
||||||
|
"Intl.Collator.prototype is not an object that has been initialized as an Intl.Collator.");
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.3_a
|
esid: sec-properties-of-intl-datetimeformat-prototype-object
|
||||||
description: >
|
description: >
|
||||||
Tests that Intl.DateTimeFormat.prototype is an object that has
|
Tests that Intl.DateTimeFormat.prototype is not an object that has
|
||||||
been initialized as an Intl.DateTimeFormat.
|
been initialized as an Intl.DateTimeFormat.
|
||||||
author: Roozbeh Pournader
|
author: Roozbeh Pournader
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
// test by calling a function that would fail if "this" were not an object
|
// test by calling a function that should fail as "this" is not an object
|
||||||
// initialized as an Intl.DateTimeFormat
|
// initialized as an Intl.DateTimeFormat
|
||||||
assert.sameValue(typeof Intl.DateTimeFormat.prototype.format(0), "string", "Intl.DateTimeFormat's prototype is not an object that has been initialized as an Intl.DateTimeFormat");
|
assert.throws(TypeError, () => Intl.DateTimeFormat.prototype.format(0),
|
||||||
|
"Intl.DateTimeFormat's prototype is not an object that has been initialized as an Intl.DateTimeFormat");
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 11.3_a
|
esid: sec-properties-of-intl-numberformat-prototype-object
|
||||||
description: >
|
description: >
|
||||||
Tests that Intl.NumberFormat.prototype is an object that has been
|
Tests that Intl.NumberFormat.prototype is not an object that has been
|
||||||
initialized as an Intl.NumberFormat.
|
initialized as an Intl.NumberFormat.
|
||||||
author: Roozbeh Pournader
|
author: Roozbeh Pournader
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
// test by calling a function that would fail if "this" were not an object
|
// test by calling a function that should fail as "this" is not an object
|
||||||
// initialized as an Intl.NumberFormat
|
// initialized as an Intl.NumberFormat
|
||||||
assert.sameValue(typeof Intl.NumberFormat.prototype.format(0), "string", "Intl.NumberFormat's prototype is not an object that has been initialized as an Intl.NumberFormat");
|
assert.throws(TypeError, () => Intl.NumberFormat.prototype.format(0),
|
||||||
|
"Intl.NumberFormat's prototype is not an object that has been initialized as an Intl.NumberFormat");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user