Addressing PR review comments.

This commit is contained in:
Karishma Chadha 2017-11-15 09:17:20 -05:00
parent 386045f033
commit fe86e38210
3 changed files with 20 additions and 16 deletions
src

View file

@ -36,6 +36,8 @@ class Variable {
/** /**
* Type representation for scalar variables. * Type representation for scalar variables.
* This is currently represented as ''
* for compatibility with blockly.
* @const {string} * @const {string}
*/ */
static get SCALAR_TYPE () { static get SCALAR_TYPE () {

View file

@ -255,7 +255,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel) {
getVariableId(list.listName), getVariableId(list.listName),
list.listName, list.listName,
Variable.LIST_TYPE, Variable.LIST_TYPE,
list.isPersistent false
); );
newVariable.value = list.contents; newVariable.value = list.contents;
target.variables[newVariable.id] = newVariable; target.variables[newVariable.id] = newVariable;

View file

@ -22,6 +22,8 @@
* Finally, I filled in the expected arguments as below. * Finally, I filled in the expected arguments as below.
*/ */
const Variable = require('../engine/variable');
/** /**
* @typedef {object} SB2SpecMap_blockInfo * @typedef {object} SB2SpecMap_blockInfo
* @property {string} opcode - the Scratch 3.0 block opcode. Use 'extensionID.opcode' for extension opcodes. * @property {string} opcode - the Scratch 3.0 block opcode. Use 'extensionID.opcode' for extension opcodes.
@ -1202,7 +1204,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'VARIABLE', fieldName: 'VARIABLE',
variableType: '' variableType: Variable.SCALAR_TYPE
} }
] ]
}, },
@ -1212,7 +1214,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'VARIABLE', fieldName: 'VARIABLE',
variableType: '' variableType: Variable.SCALAR_TYPE
}, },
{ {
type: 'input', type: 'input',
@ -1227,7 +1229,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'VARIABLE', fieldName: 'VARIABLE',
variableType: '' variableType: Variable.SCALAR_TYPE
}, },
{ {
type: 'input', type: 'input',
@ -1242,7 +1244,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'VARIABLE', fieldName: 'VARIABLE',
variableType: '' variableType: Variable.SCALAR_TYPE
} }
] ]
}, },
@ -1252,7 +1254,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'VARIABLE', fieldName: 'VARIABLE',
variableType: '' variableType: Variable.SCALAR_TYPE
} }
] ]
}, },
@ -1262,7 +1264,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1277,7 +1279,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1292,7 +1294,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1312,7 +1314,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1327,7 +1329,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
}, },
{ {
type: 'input', type: 'input',
@ -1347,7 +1349,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1357,7 +1359,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1367,7 +1369,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
}, },
{ {
type: 'input', type: 'input',
@ -1382,7 +1384,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },
@ -1392,7 +1394,7 @@ const specMap = {
{ {
type: 'field', type: 'field',
fieldName: 'LIST', fieldName: 'LIST',
variableType: 'list' variableType: Variable.LIST_TYPE
} }
] ]
}, },