Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
438b87b5
Commit
438b87b5
authored
9 years ago
by
André Bargull
Browse files
Options
Downloads
Patches
Plain Diff
Intl sub-classing is now restricted to class syntax.
parent
888524ff
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/intl402/10.1.2_a.js
+5
-6
5 additions, 6 deletions
test/intl402/10.1.2_a.js
test/intl402/11.1.2.js
+5
-6
5 additions, 6 deletions
test/intl402/11.1.2.js
test/intl402/12.1.2.js
+5
-6
5 additions, 6 deletions
test/intl402/12.1.2.js
with
15 additions
and
18 deletions
test/intl402/10.1.2_a.js
+
5
−
6
View file @
438b87b5
...
@@ -15,15 +15,14 @@ var a = ["A", "C", "E", "B", "D", "F"];
...
@@ -15,15 +15,14 @@ var a = ["A", "C", "E", "B", "D", "F"];
var
referenceCollator
=
new
Intl
.
Collator
(
locales
);
var
referenceCollator
=
new
Intl
.
Collator
(
locales
);
var
referenceSorted
=
a
.
slice
().
sort
(
referenceCollator
.
compare
);
var
referenceSorted
=
a
.
slice
().
sort
(
referenceCollator
.
compare
);
function
MyCollator
(
locales
,
options
)
{
class
MyCollator
extends
Intl
.
Collator
{
Intl
.
Collator
.
call
(
this
,
locales
,
options
);
constructor
(
locales
,
options
)
{
super
(
locales
,
options
);
// could initialize MyCollator properties
// 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
);
var
collator
=
new
MyCollator
(
locales
);
a
.
sort
(
collator
.
compare
);
a
.
sort
(
collator
.
compare
);
testArraysAreSame
(
referenceSorted
,
a
);
testArraysAreSame
(
referenceSorted
,
a
);
This diff is collapsed.
Click to expand it.
test/intl402/11.1.2.js
+
5
−
6
View file @
438b87b5
...
@@ -15,15 +15,14 @@ var a = [0, 1, -1, -123456.789, -Infinity, NaN];
...
@@ -15,15 +15,14 @@ var a = [0, 1, -1, -123456.789, -Infinity, NaN];
var
referenceNumberFormat
=
new
Intl
.
NumberFormat
(
locales
);
var
referenceNumberFormat
=
new
Intl
.
NumberFormat
(
locales
);
var
referenceFormatted
=
a
.
map
(
referenceNumberFormat
.
format
);
var
referenceFormatted
=
a
.
map
(
referenceNumberFormat
.
format
);
function
MyNumberFormat
(
locales
,
options
)
{
class
MyNumberFormat
extends
Intl
.
NumberFormat
{
Intl
.
NumberFormat
.
call
(
this
,
locales
,
options
);
constructor
(
locales
,
options
)
{
super
(
locales
,
options
);
// could initialize MyNumberFormat properties
// 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
format
=
new
MyNumberFormat
(
locales
);
var
actual
=
a
.
map
(
format
.
format
);
var
actual
=
a
.
map
(
format
.
format
);
testArraysAreSame
(
referenceFormatted
,
actual
);
testArraysAreSame
(
referenceFormatted
,
actual
);
This diff is collapsed.
Click to expand it.
test/intl402/12.1.2.js
+
5
−
6
View file @
438b87b5
...
@@ -15,15 +15,14 @@ var a = [new Date(0), Date.now(), new Date(Date.parse("1989-11-09T17:57:00Z"))];
...
@@ -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
referenceDateTimeFormat
=
new
Intl
.
DateTimeFormat
(
locales
);
var
referenceFormatted
=
a
.
map
(
referenceDateTimeFormat
.
format
);
var
referenceFormatted
=
a
.
map
(
referenceDateTimeFormat
.
format
);
function
MyDateTimeFormat
(
locales
,
options
)
{
class
MyDateTimeFormat
extends
Intl
.
DateTimeFormat
{
Intl
.
DateTimeFormat
.
call
(
this
,
locales
,
options
);
constructor
(
locales
,
options
)
{
super
(
locales
,
options
);
// could initialize MyDateTimeFormat properties
// 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
format
=
new
MyDateTimeFormat
(
locales
);
var
actual
=
a
.
map
(
format
.
format
);
var
actual
=
a
.
map
(
format
.
format
);
testArraysAreSame
(
referenceFormatted
,
actual
);
testArraysAreSame
(
referenceFormatted
,
actual
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment