mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
7 years ago
2 changed files with 68 additions and 0 deletions
@ -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'); |
@ -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…
Reference in new issue