Browse Source

Testcases for resolve/reject constructability

pull/1904/head
Sami Vaarala 7 years ago
parent
commit
06d94f56ec
  1. 34
      tests/ecmascript/test-bi-promise-reject-constructable.js
  2. 34
      tests/ecmascript/test-bi-promise-resolve-constructable.js

34
tests/ecmascript/test-bi-promise-reject-constructable.js

@ -0,0 +1,34 @@
/*---
{
"skip": true
}
---*/
/*@include util-base.js@*/
/*===
function
TypeError
done
===*/
var rejectFn;
var P = new Promise(function (resolve_unused, reject) {
print(typeof reject);
rejectFn = reject;
});
P.then(function (val) {
print('fulfill:', val);
}, function (err) {
print('reject:', err);
});
try {
var tmp = new rejectFn(123);
print('constructor result:', typeof tmp);
} catch (e) {
print(e.name);
}
print('done');

34
tests/ecmascript/test-bi-promise-resolve-constructable.js

@ -0,0 +1,34 @@
/*---
{
"skip": true
}
---*/
/*@include util-base.js@*/
/*===
function
TypeError
done
===*/
var resolveFn;
var P = new Promise(function (resolve, reject_unused) {
print(typeof resolve);
resolveFn = resolve;
});
P.then(function (val) {
print('fulfill:', val);
}, function (err) {
print('reject:', err);
});
try {
var tmp = new resolveFn(123);
print('constructor result:', typeof tmp);
} catch (e) {
print(e.name);
}
print('done');
Loading…
Cancel
Save