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
32b19842
Commit
32b19842
authored
7 years ago
by
André Bargull
Browse files
Options
Downloads
Patches
Plain Diff
Fix multiple issues in nan-equivalence.js test case
parent
6c8698ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
features.txt
+1
-0
1 addition, 0 deletions
features.txt
test/built-ins/Object/internals/DefineOwnProperty/nan-equivalence.js
+26
-17
26 additions, 17 deletions
...ins/Object/internals/DefineOwnProperty/nan-equivalence.js
with
27 additions
and
17 deletions
features.txt
+
1
−
0
View file @
32b19842
...
@@ -115,6 +115,7 @@ template
...
@@ -115,6 +115,7 @@ template
TypedArray
TypedArray
u180e
u180e
Uint8Array
Uint8Array
Uint16Array
WeakMap
WeakMap
WeakSet
WeakSet
...
...
This diff is collapsed.
Click to expand it.
test/built-ins/Object/internals/DefineOwnProperty/nan-equivalence.js
+
26
−
17
View file @
32b19842
...
@@ -19,7 +19,7 @@ info: |
...
@@ -19,7 +19,7 @@ info: |
9.1.6.1 OrdinaryDefineOwnProperty
9.1.6.1 OrdinaryDefineOwnProperty
1. Let current be ? O.[[GetOwnProperty]](P).
1. Let current be ? O.[[GetOwnProperty]](P).
2. Let extensible be
the value of the [[Extensible]] internal slot of O
.
2. Let extensible be
O.[[Extensible]]
.
3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc,
3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc,
current).
current).
...
@@ -28,27 +28,34 @@ info: |
...
@@ -28,27 +28,34 @@ info: |
[...]
[...]
7. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true,
7. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true,
then
then
a. If the [[Configurable]] field of current is false, then
a. If current.[[Configurable]] is false and current.[[Writable]] is false,
then
[...]
[...]
b. Else the [[Configurable]] field of current is true, so any change is
acceptable.
[...]
[...]
9. If O is not undefined, then
9. If O is not undefined, then
a. For each field of Desc that is present, set the corresponding attribute
a. For each field of Desc that is present, set the corresponding attribute
of the property named P of object O to the value of the field.
of the property named P of object O to the value of the field.
10. Return true.
10. Return true.
features: [Float64Array, Uint8Array]
features: [Float64Array, Uint8Array
, Uint16Array
]
includes: [nans.js]
includes: [nans.js]
---*/
---*/
var
isLittleEndian
=
new
Uint8Array
(
new
Uint16Array
([
1
]).
buffer
)[
0
]
!==
0
;
var
float
=
new
Float64Array
(
1
);
var
float
=
new
Float64Array
(
1
);
var
ints
=
new
Uint8Array
(
float
.
buffer
);
var
ints
=
new
Uint8Array
(
float
.
buffer
);
var
len
=
distinctNaNs
.
length
;
var
len
=
distinctNaNs
.
length
;
var
idx
,
jdx
,
subject
,
first
,
second
;
function
byteValue
(
value
)
{
function
byteValue
(
value
)
{
float
[
0
]
=
value
;
float
[
0
]
=
value
;
return
ints
[
0
]
+
(
ints
[
1
]
<<
8
)
+
(
ints
[
2
]
<<
16
)
+
(
ints
[
3
]
<<
32
)
+
(
ints
[
4
]
<<
64
)
+
(
ints
[
5
]
<<
64
)
+
(
ints
[
6
]
<<
128
)
+
(
ints
[
7
]
<<
256
);
var
hex
=
"
0123456789ABCDEF
"
;
var
s
=
""
;
for
(
var
i
=
0
;
i
<
8
;
++
i
)
{
var
v
=
ints
[
isLittleEndian
?
7
-
i
:
i
];
s
+=
hex
[(
v
>>
4
)
&
0xf
]
+
hex
[
v
&
0xf
];
}
return
s
;
}
}
/**
/**
...
@@ -57,21 +64,23 @@ function byteValue(value) {
...
@@ -57,21 +64,23 @@ function byteValue(value) {
* cannot be verified and this test is expected to pass without evaluating any
* cannot be verified and this test is expected to pass without evaluating any
* assertions.
* assertions.
*/
*/
for
(
idx
=
0
;
idx
<
len
;
++
idx
)
{
for
(
var
idx
=
0
;
idx
<
len
;
++
idx
)
{
for
(
jdx
=
0
;
jdx
<
len
;
++
jdx
)
{
for
(
var
jdx
=
0
;
jdx
<
len
;
++
jdx
)
{
first
=
distinctNaNs
[
idx
];
// NB: Don't store the distinct NaN values as global variables, because
second
=
distinctNaNs
[
jdx
];
// global variables are properties of the global object. And in this test
if
(
byteValue
(
first
)
===
byteValue
(
second
))
{
// we want to ensure NaN-valued properties in objects are properly handled,
// so storing NaN values in the (global) object defeats the purpose.
if
(
byteValue
(
distinctNaNs
[
idx
])
===
byteValue
(
distinctNaNs
[
jdx
]))
{
continue
;
continue
;
}
}
subject
=
{};
var
subject
=
{};
subject
.
prop
=
first
;
subject
.
prop
=
distinctNaNs
[
idx
]
;
subject
.
prop
=
second
;
subject
.
prop
=
distinctNaNs
[
jdx
]
;
assert
.
sameValue
(
assert
.
sameValue
(
byteValue
(
subject
.
prop
),
byteValue
(
subject
.
prop
),
byteValue
(
second
),
byteValue
(
distinctNaNs
[
jdx
]
),
'
Property value was re-set
'
'
Property value was re-set
'
);
);
}
}
...
...
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