mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
13 lines
283 B
JavaScript
13 lines
283 B
JavaScript
function test() {
|
|
(new Promise(function(resolve,reject){
|
|
reject("Oh No!");
|
|
})).then(function(x) {
|
|
console.log("Ok");
|
|
}).catch(function() {
|
|
console.log("Fail (expected)");
|
|
result=1;
|
|
throw "This used to leak memory!";
|
|
});
|
|
}
|
|
test(); // it used to fail here
|