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
bb26beec
Commit
bb26beec
authored
9 years ago
by
Mike Pennisi
Browse files
Options
Downloads
Patches
Plain Diff
Extend coverage for PerformPromiseAll
parent
1c1a75ee
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
test/built-ins/Promise/all/invoke-resolve-return.js
+47
-0
47 additions, 0 deletions
test/built-ins/Promise/all/invoke-resolve-return.js
test/built-ins/Promise/all/iter-step-err.js
+54
-0
54 additions, 0 deletions
test/built-ins/Promise/all/iter-step-err.js
with
101 additions
and
0 deletions
test/built-ins/Promise/all/invoke-resolve-return.js
0 → 100644
+
47
−
0
View file @
bb26beec
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Use of the value returned by the constructor's `resolve` method.
es6id: 25.4.4.1
info: >
[...]
6. Let promiseCapability be NewPromiseCapability(C).
[...]
11. Let result be PerformPromiseAll(iteratorRecord, promiseCapability, C).
[...]
25.4.4.1.1 Runtime Semantics: PerformPromiseAll
[...]
6. Repeat
[...]
i. Let nextPromise be Invoke(constructor, "resolve", «nextValue»).
[...]
r. Let result be Invoke(nextPromise, "then", resolveElement,
promiseCapability.[[Reject]]»).
[...]
---*/
var
originalCallCount
=
0
;
var
newCallCount
=
0
;
var
P
=
function
(
executor
)
{
executor
(
function
()
{},
function
()
{});
};
P
.
resolve
=
function
()
{
return
newThenable
;
};
var
originalThenable
=
{
then
:
function
()
{
originalCallCount
+=
1
;
}
};
var
newThenable
=
{
then
:
function
()
{
newCallCount
+=
1
;
}
};
Promise
.
all
.
call
(
P
,
[
originalThenable
]);
assert
.
sameValue
(
originalCallCount
,
0
,
'
original `then` method not invoked
'
);
assert
.
sameValue
(
newCallCount
,
1
,
'
new `then` method invoked exactly once
'
);
This diff is collapsed.
Click to expand it.
test/built-ins/Promise/all/iter-step-err.js
0 → 100644
+
54
−
0
View file @
bb26beec
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Error when advancing the provided iterable
es6id: 25.4.4.1
info: >
11. Let result be PerformPromiseAll(iteratorRecord, C, promiseCapability).
12. If result is an abrupt completion,
a. If iteratorRecord.[[done]] is false, let result be
IteratorClose(iterator, result).
b. IfAbruptRejectPromise(result, promiseCapability).
[...]
25.4.4.1.1 Runtime Semantics: PerformPromiseAll
[...]
6. Repeat
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
b. If next is an abrupt completion, set iteratorRecord.[[done]] to
true.
c. ReturnIfAbrupt(next).
features: [Symbol.iterator]
---*/
var
iterStepThrows
=
{};
var
poisonedDone
=
{};
var
error
=
new
Test262Error
();
Object
.
defineProperty
(
poisonedDone
,
'
done
'
,
{
get
:
function
()
{
throw
error
;
}
});
Object
.
defineProperty
(
poisonedDone
,
'
value
'
,
{
get
:
function
()
{
$ERROR
(
'
The `value` property should not be accessed.
'
);
}
});
iterStepThrows
[
Symbol
.
iterator
]
=
function
()
{
return
{
next
:
function
()
{
return
poisonedDone
;
}
};
};
Promise
.
all
(
iterStepThrows
).
then
(
function
()
{
$ERROR
(
'
The promise should be rejected.
'
);
},
function
(
reason
)
{
assert
.
sameValue
(
reason
,
error
);
}).
then
(
$DONE
,
$DONE
);
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