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
a94b3bf4
Commit
a94b3bf4
authored
6 years ago
by
Rick Waldron
Browse files
Options
Downloads
Patches
Plain Diff
Reflect.ownKeys: order with large integer "index" keys
parent
a8f70125
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js
+72
-0
72 additions, 0 deletions
...lect/ownKeys/return-on-corresponding-order-large-index.js
with
72 additions
and
0 deletions
test/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js
0 → 100644
+
72
−
0
View file @
a94b3bf4
// Copyright (C) 2018 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-ordinaryownpropertykeys
description: >
Returns keys in their corresponding order.
info: |
26.1.11 Reflect.ownKeys ( target )
...
2. Let keys be target.[[OwnPropertyKeys]]().
3. ReturnIfAbrupt(keys).
4. Return CreateArrayFromList(keys).
9.1.12 [[OwnPropertyKeys]] ( )
1. Let keys be a new empty List.
2. For each own property key P of O that is an integer index, in ascending
numeric index order
a. Add P as the last element of keys.
3. For each own property key P of O that is a String but is not an integer
index, in property creation order
a. Add P as the last element of keys.
4. For each own property key P of O that is a Symbol, in property creation
order
a. Add P as the last element of keys.
5. Return keys.
features: [Reflect,Symbol]
---*/
var
o1
=
{
12345678900
:
true
,
b
:
true
,
1
:
true
,
a
:
true
,
[
Number
.
MAX_SAFE_INTEGER
]:
true
,
[
Symbol
.
for
(
'
z
'
)]:
true
,
12345678901
:
true
,
};
var
result
=
Reflect
.
ownKeys
(
o1
);
assert
.
sameValue
(
result
.
length
,
7
);
assert
.
sameValue
(
result
[
0
],
'
1
'
);
assert
.
sameValue
(
result
[
1
],
'
12345678900
'
);
assert
.
sameValue
(
result
[
2
],
'
12345678901
'
);
assert
.
sameValue
(
result
[
3
],
String
(
Number
.
MAX_SAFE_INTEGER
));
assert
.
sameValue
(
result
[
4
],
'
b
'
);
assert
.
sameValue
(
result
[
5
],
'
a
'
);
assert
.
sameValue
(
result
[
6
],
Symbol
.
for
(
'
z
'
));
var
o2
=
{};
o2
[
12345678900
]
=
true
;
o2
.
b
=
true
;
o2
[
1
]
=
true
;
o2
.
a
=
true
;
o2
[
Number
.
MAX_SAFE_INTEGER
]
=
true
;
o2
[
Symbol
.
for
(
'
z
'
)]
=
true
;
o2
[
12345678901
]
=
true
;
result
=
Reflect
.
ownKeys
(
o2
);
assert
.
sameValue
(
result
.
length
,
7
);
assert
.
sameValue
(
result
[
0
],
'
1
'
);
assert
.
sameValue
(
result
[
1
],
'
12345678900
'
);
assert
.
sameValue
(
result
[
2
],
'
12345678901
'
);
assert
.
sameValue
(
result
[
3
],
String
(
Number
.
MAX_SAFE_INTEGER
));
assert
.
sameValue
(
result
[
4
],
'
b
'
);
assert
.
sameValue
(
result
[
5
],
'
a
'
);
assert
.
sameValue
(
result
[
6
],
Symbol
.
for
(
'
z
'
));
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