diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 1c8df4df9..92a8d9794 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -314,9 +314,10 @@ class VirtualMachine extends EventEmitter { * @property {number} rotationCenterX - the X component of the costume's origin. * @property {number} rotationCenterY - the Y component of the costume's origin. * @property {number} [bitmapResolution] - the resolution scale for a bitmap costume. + * @returns {?Promise} - a promise that resolves when the costume has been added */ addCostume (md5ext, costumeObject) { - loadCostume(md5ext, costumeObject, this.runtime).then(() => { + return loadCostume(md5ext, costumeObject, this.runtime).then(() => { this.editingTarget.addCostume(costumeObject); this.editingTarget.setCostume( this.editingTarget.sprite.costumes.length - 1