mirror of
https://github.com/scratchfoundation/scratch-html5.git
synced 2024-12-04 12:51:03 -05:00
27 lines
580 B
JavaScript
27 lines
580 B
JavaScript
|
'use strict';
|
||
|
|
||
|
var interpreterMock = function() {
|
||
|
var args = createArgs(arguments);
|
||
|
|
||
|
function getArgs(argKey) {
|
||
|
return ((argKey in args) ? args[argKey] : null);
|
||
|
}
|
||
|
|
||
|
function createArgs(methodArgs) {
|
||
|
var args = {};
|
||
|
if (methodArgs.length) {
|
||
|
_.each(methodArgs, function(newObject) {
|
||
|
_.each(newObject, function(value, key) {
|
||
|
args[key] = value;
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
return args;
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
'targetSprite' : function() { return getArgs('targetSprite'); },
|
||
|
'arg': function(block, index) { return getArgs('arg');}
|
||
|
}
|
||
|
};
|