diff --git a/tests/ecmascript/test-bi-promise-reject-constructable.js b/tests/ecmascript/test-bi-promise-reject-constructable.js new file mode 100644 index 00000000..7403128a --- /dev/null +++ b/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'); diff --git a/tests/ecmascript/test-bi-promise-resolve-constructable.js b/tests/ecmascript/test-bi-promise-resolve-constructable.js new file mode 100644 index 00000000..dcae1225 --- /dev/null +++ b/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');