Merge pull request from kchadha/broadcast-message-typed-variable

Broadcast message functionality
This commit is contained in:
Paul Kaplan 2017-12-01 11:51:38 -05:00 committed by GitHub
commit a9e95f3b01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 164 additions and 39 deletions
src/engine

View file

@ -175,8 +175,12 @@ const execute = function (sequencer, thread) {
// Add all fields on this block to the argValues.
for (const fieldName in fields) {
if (!fields.hasOwnProperty(fieldName)) continue;
if (fieldName === 'VARIABLE' || fieldName === 'LIST') {
argValues[fieldName] = fields[fieldName].id;
if (fieldName === 'VARIABLE' || fieldName === 'LIST' ||
fieldName === 'BROADCAST_OPTION') {
argValues[fieldName] = {
id: fields[fieldName].id,
name: fields[fieldName].value
};
} else {
argValues[fieldName] = fields[fieldName].value;
}