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
3868f8f7
Commit
3868f8f7
authored
8 years ago
by
Leonardo Balter
Committed by
Mike Pennisi
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update test for distinct NaN replacement on DefineOwnProperty
Fixes gh-683 Ref gh-648 Ref tc39/ecma262#353
parent
3a5a09eb
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/Object/internals/DefineOwnProperty/nan-equivalence.js
+23
-8
23 additions, 8 deletions
...ins/Object/internals/DefineOwnProperty/nan-equivalence.js
with
23 additions
and
8 deletions
test/built-ins/Object/internals/DefineOwnProperty/nan-equivalence.js
+
23
−
8
View file @
3868f8f7
...
@@ -4,9 +4,16 @@
...
@@ -4,9 +4,16 @@
esid: sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc
esid: sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc
es6id: 9.1.6
es6id: 9.1.6
description: >
description: >
Compar
es
"
value
"
field
using SameValue algorithm (thereby ignoring distinct
Replac
es value field
even if they pass in the SameValue algorithm, including
NaN values
)
distinct
NaN values
info: |
info: |
Previously, this method compared the "value" field using the SameValue
algorithm (thereby ignoring distinct NaN values)
---
[[DefineOwnProperty]] (P, Desc)
1. Return ? OrdinaryDefineOwnProperty(O, P, Desc).
1. Return ? OrdinaryDefineOwnProperty(O, P, Desc).
9.1.6.1 OrdinaryDefineOwnProperty
9.1.6.1 OrdinaryDefineOwnProperty
...
@@ -19,9 +26,17 @@ info: |
...
@@ -19,9 +26,17 @@ info: |
9.1.6.3 ValidateAndApplyPropertyDescriptor
9.1.6.3 ValidateAndApplyPropertyDescriptor
[...]
[...]
4. Return true, if every field in Desc also occurs in current and the value
7. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true,
of every field in Desc is the same value as the corresponding field in
then
current when compared using the SameValue algorithm.
a. If the [[Configurable]] field of current is false, then
[...]
b. Else the [[Configurable]] field of current is true, so any change is
acceptable.
[...]
9. If O is not undefined, then
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.
10. Return true.
features: [Float64Array, Uint8Array]
features: [Float64Array, Uint8Array]
includes: [nans.js]
includes: [nans.js]
---*/
---*/
...
@@ -39,7 +54,7 @@ function byteValue(value) {
...
@@ -39,7 +54,7 @@ function byteValue(value) {
/**
/**
* Iterate over each pair of distinct NaN values (with replacement). If two or
* Iterate over each pair of distinct NaN values (with replacement). If two or
* more suitable NaN values cannot be identified, the semantics under test
* more suitable NaN values cannot be identified, the semantics under test
* cannot be verfied and this test is expected to pass without evaluating any
* cannot be ver
i
fied and this test is expected to pass without evaluating any
* assertions.
* assertions.
*/
*/
for
(
idx
=
0
;
idx
<
length
;
++
idx
)
{
for
(
idx
=
0
;
idx
<
length
;
++
idx
)
{
...
@@ -54,10 +69,10 @@ for (idx = 0; idx < length; ++idx) {
...
@@ -54,10 +69,10 @@ for (idx = 0; idx < length; ++idx) {
subject
.
prop
=
first
;
subject
.
prop
=
first
;
subject
.
prop
=
second
;
subject
.
prop
=
second
;
assert
.
notS
ameValue
(
assert
.
s
ameValue
(
byteValue
(
subject
.
prop
),
byteValue
(
subject
.
prop
),
byteValue
(
second
),
byteValue
(
second
),
'
Property value was
not
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