class TutorialModDialogsBlocks { constructor (runtime) { /** * The runtime instantiating this block package. * @type {Runtime} */ this.runtime = runtime; } /** * Retrieve the block primitives implemented by this package. * @return {object.} Mapping of opcode to Function. */ getPrimitives () { return { dialogs_alert: this.alertBlock, dialogs_prompt: this.promptBlock, dialogs_confirm: this.confirmBlock }; } alertBlock (args, util) { // eslint-disable-next-line alert(args.MESSAGE); } promptBlock (args, util) { // eslint-disable-next-line return prompt(args.MESSAGE); } confirmBlock (args, util) { // eslint-disable-next-line return confirm(args.MESSAGE); } } module.exports = TutorialModDialogsBlocks;