_prepareBlockInfo (serviceName, blockInfo) {
        blockInfo = Object.assign({}, {
            blockType: BlockType.COMMAND,
            terminal: false,
            blockAllThreads: false,
            arguments: {}
        }, blockInfo);
        blockInfo.opcode = this._sanitizeID(blockInfo.opcode);
        blockInfo.func = blockInfo.func ? this._sanitizeID(blockInfo.func) : blockInfo.opcode;
        blockInfo.text = blockInfo.text || blockInfo.opcode;

        /**
         * This is only here because the VM performs poorly when blocks return promises.
         * @TODO make it possible for the VM to resolve a promise and continue during the same frame.
         */
        if (dispatch._isRemoteService(serviceName)) {
            blockInfo.func = dispatch.call.bind(dispatch, serviceName, blockInfo.func);
        } else {
            const serviceObject = dispatch.services[serviceName];
            blockInfo.func = serviceObject[blockInfo.func].bind(serviceObject);
        }
        return blockInfo;
    }
/**
     * Apply defaults for optional block fields.
     * @param {string} serviceName - the name of the service hosting this extension block
     * @param {BlockInfo} blockInfo - the block info from the extension
     * @returns {BlockInfo} - a new block info object which has values for all relevant optional fields.
     * @private
     */
Apply defaults for optional block fields.
@param {string} serviceName - the name of the service hosting this extension block
@param {BlockInfo} blockInfo - the block info from the extension
@returns {BlockInfo} - a new block info object which has values for all relevant optional fields.
@private
Apply defaults for optional block fields . @param { string } serviceName - the name of the service hosting this extension block @param { BlockInfo } blockInfo - the block info from the extension @returns { BlockInfo } - a new block info object which has values for all relevant optional fields . @private
_prepareBlockInfo (serviceName, blockInfo) {
        blockInfo = Object.assign({}, {
            blockType: BlockType.COMMAND,
            terminal: false,
            blockAllThreads: false,
            arguments: {}
        }, blockInfo);
        blockInfo.opcode = this._sanitizeID(blockInfo.opcode);
        blockInfo.func = blockInfo.func ? this._sanitizeID(blockInfo.func) : blockInfo.opcode;
        blockInfo.text = blockInfo.text || blockInfo.opcode;
        if (dispatch._isRemoteService(serviceName)) {
            blockInfo.func = dispatch.call.bind(dispatch, serviceName, blockInfo.func);
        } else {
            const serviceObject = dispatch.services[serviceName];
            blockInfo.func = serviceObject[blockInfo.func].bind(serviceObject);
        }
        return blockInfo;
    }
_prepareBlockInfo ( serviceName , blockInfo ) { blockInfo = Object . assign ( { } , { blockType : BlockType . COMMAND , terminal : false , blockAllThreads : false , arguments : { } } , blockInfo ) ; blockInfo . opcode = this . _sanitizeID ( blockInfo . opcode ) ; blockInfo . func = blockInfo . func ? this . _sanitizeID ( blockInfo . func ) : blockInfo . opcode ; blockInfo . text = blockInfo . text || blockInfo . opcode ; if ( dispatch . _isRemoteService ( serviceName ) ) { blockInfo . func = dispatch . call . bind ( dispatch , serviceName , blockInfo . func ) ; } else { const serviceObject = dispatch . services [ serviceName ] ; blockInfo . func = serviceObject [ blockInfo . func ] . bind ( serviceObject ) ; } return blockInfo ; }
Apply defaults for optional block fields.
Apply defaults for optional block fields .
/**
         * This is only here because the VM performs poorly when blocks return promises.
         * @TODO make it possible for the VM to resolve a promise and continue during the same frame.
         */