Do sheet workers support ES6 Promises? I'm trying to use Promises in a character sheet I'm developing, but even something as simple as the below doesn't seem to work: /**
* Promise-wrapped setAttrs.
*/
function _setAttrs(values) {
return new Promise((resolve, reject) => {
setAttrs(values, undefined, () => {
resolve();
});
});
}
on('sheet:opened', () => {
Promise.resolve(42)
.then(value => {
return _setAttrs({
debug: value
});
})
.then(() => {
setAttrs({
debug: 11
});
});
});
The expected behavior is that debug is set to 11 after the sheet is opened. Instead, it gets set to 42, as if it is completely skipping calling the Promise's resolve function in _setAttrs().